2007-07-19 10:40:05 +00:00
|
|
|
<?php
|
2008-11-18 01:48:50 +00:00
|
|
|
|
2016-08-11 13:18:02 +12:00
|
|
|
use SilverStripe\Admin\CMSMenu;
|
2017-02-28 15:46:07 +13:00
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
2016-08-23 14:36:06 +12:00
|
|
|
use SilverStripe\View\Parsers\ShortcodeParser;
|
2016-08-11 13:18:02 +12:00
|
|
|
|
2012-03-24 11:57:49 +13:00
|
|
|
/**
|
|
|
|
* - CMS_DIR: Path relative to webroot, e.g. "cms"
|
|
|
|
* - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms"
|
|
|
|
*/
|
2016-10-25 11:57:05 +13:00
|
|
|
define('CMS_PATH', realpath(__DIR__));
|
2017-02-28 15:46:07 +13:00
|
|
|
if (strpos(CMS_PATH, BASE_PATH) === 0) {
|
|
|
|
define('CMS_DIR', trim(substr(CMS_PATH, strlen(BASE_PATH)), DIRECTORY_SEPARATOR));
|
2016-10-25 11:57:05 +13:00
|
|
|
} else {
|
2017-02-28 15:46:07 +13:00
|
|
|
throw new Exception("Path error: CMS_PATH " . CMS_PATH . " not within BASE_PATH " . BASE_PATH);
|
2016-10-25 11:57:05 +13:00
|
|
|
}
|
2012-03-24 11:57:49 +13:00
|
|
|
|
2011-03-18 17:04:50 +13:00
|
|
|
/**
|
|
|
|
* Register the default internal shortcodes.
|
|
|
|
*/
|
2016-08-10 16:08:39 +12:00
|
|
|
ShortcodeParser::get('default')->register(
|
2017-02-28 15:46:07 +13:00
|
|
|
'sitetree_link',
|
|
|
|
array(SiteTree::class, 'link_shortcode_handler')
|
2016-08-10 16:08:39 +12:00
|
|
|
);
|
2011-03-23 10:40:09 +13:00
|
|
|
|
2011-04-16 17:54:52 +12:00
|
|
|
// TODO Remove once we can configure CMSMenu through static, nested configuration files
|
2016-08-10 16:08:39 +12:00
|
|
|
CMSMenu::remove_menu_class('SilverStripe\\CMS\\Controllers\\CMSMain');
|
|
|
|
CMSMenu::remove_menu_class('SilverStripe\\CMS\\Controllers\\CMSPageEditController');
|
|
|
|
CMSMenu::remove_menu_class('SilverStripe\\CMS\\Controllers\\CMSPageSettingsController');
|
|
|
|
CMSMenu::remove_menu_class('SilverStripe\\CMS\\Controllers\\CMSPageHistoryController');
|
|
|
|
CMSMenu::remove_menu_class('SilverStripe\\CMS\\Controllers\\CMSPageAddController');
|