Replacing a single page (from some other plugin) is a little trickier. There's a plugin hook called "route" that gets called for every (non-action) page. You'll want to register for that hook, analyze the segments of the URL and, if they match what you want, you call your function to echo a page and return true.
I highly recomment setting up an xdebug environment where you can walk through requests, set breakpoints, see values at each step, etc.
What exactly do you want to change in pages/avatar/edit.php?
This page is built up with two views:
views/default(core/avatar/upload
and in case an avatar image has been uploaded also
views/default/core/avatar/crop
The noCrop() function in your initial posting makes me believe that you might want to prevent image cropping. This might work without changing the pages/avatar/edit.php. You can not only overwrite a view by adding a view file with code in your own plugin. If the view file (same name for the view file in the corresponding place within the views directory of your plugin) is present but is only an empty file (more precisely not creating any output) the original view gets overwritten nonetheless. So, if you create a placeholder file mod/SpikeDisplay/views/default/views/default/core/avatar/crop.php it could already solve your issue.
Or it might work by "extending" the views/default/core/avatar/upload and/or views/default/core/avatar/crop views to add some options to the avatar edit page. I've extended this page by extending the upload view for example in my Identicon plugin (http://community.elgg.org/plugins/1155619/1.8.0/elgg-18-identicons). In this case the line elgg_extend_view('core/avatar/upload', 'identicon/editusericon'); in start.php extends the upload view with the editusericon view.
yes, I am just removing the crop functionality,I have not tried the dummy functionality or extentions, so I'll be trying this now, thanks a lot for all your help!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.