Hi all,
I have overwritten the url_segment of CMSMain so that it points to 'cms' rather than ''. For the most part this seems to work, but I am having loads of issues with the AJAX.
I have overwritten the below using my own custom javascript:
// Overwrite main Ajax scripts for site tree
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
SiteTreeHandlers.parentChanged_url = 'admin/cms/ajaxupdateparent';
SiteTreeHandlers.orderChanged_url = 'admin/cms/ajaxupdatesort';
SiteTreeHandlers.loadPage_url = 'admin/cms/getitem';
SiteTreeHandlers.loadTree_url = 'admin/cms/getsubtree';
But I have also had to copy large chunks of Prototype code so that I can alter some of the URL's that are hard coded into it, for example SideReports.prototype in cms/javascript/sidereports/
Is this the only way I can change these url's?
Also, for some reason, my custom javascript file is also being loaded into SecurityAdmin.php as well as just CMSMain.php. Anyone got an idea why?
I am embedding my javascript using:
class DsCMSMain extends Extension {
public function __construct(){
Requirements::customScript(file_get_contents(Director::baseFolder() . '/dashboard/javascript/DsCMSMain_left.js'));
}
}
Which I use to extend CMSMain using Object::add_extension();
Any help would be brilliant!!
Cheers,
Mo