2007-07-19 12:40:05 +02:00
|
|
|
<?php
|
2008-11-18 02:48:50 +01:00
|
|
|
|
2016-08-11 03:18:02 +02:00
|
|
|
use SilverStripe\Admin\CMSMenu;
|
2017-05-25 07:29:32 +02:00
|
|
|
use SilverStripe\CMS\Controllers\CMSMain;
|
|
|
|
use SilverStripe\CMS\Controllers\CMSPageAddController;
|
|
|
|
use SilverStripe\CMS\Controllers\CMSPageEditController;
|
|
|
|
use SilverStripe\CMS\Controllers\CMSPageHistoryController;
|
|
|
|
use SilverStripe\CMS\Controllers\CMSPageSettingsController;
|
2017-02-28 03:46:07 +01:00
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
2017-10-01 11:12:37 +02:00
|
|
|
use SilverStripe\Core\Manifest\ModuleLoader;
|
2017-05-25 07:29:32 +02:00
|
|
|
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
|
2016-08-23 04:36:06 +02:00
|
|
|
use SilverStripe\View\Parsers\ShortcodeParser;
|
2016-08-11 03:18:02 +02:00
|
|
|
|
2017-05-25 07:29:32 +02:00
|
|
|
call_user_func(function () {
|
2017-10-01 11:12:37 +02:00
|
|
|
$module = ModuleLoader::inst()->getManifest()->getModule('silverstripe/cms');
|
2017-05-25 07:29:32 +02:00
|
|
|
|
|
|
|
// Enable insert-link to internal pages
|
|
|
|
TinyMCEConfig::get('cms')
|
2017-10-03 06:04:05 +02:00
|
|
|
->enablePlugins([
|
|
|
|
'sslinkinternal' => $module
|
|
|
|
->getResource('client/dist/js/TinyMCE_sslink-internal.js'),
|
|
|
|
'sslinkanchor' => $module
|
|
|
|
->getResource('client/dist/js/TinyMCE_sslink-anchor.js'),
|
|
|
|
]);
|
2017-05-25 07:29:32 +02:00
|
|
|
});
|
|
|
|
|
2012-03-23 23:57:49 +01:00
|
|
|
|
2011-03-18 05:04:50 +01:00
|
|
|
/**
|
|
|
|
* Register the default internal shortcodes.
|
|
|
|
*/
|
2016-08-10 06:08:39 +02:00
|
|
|
ShortcodeParser::get('default')->register(
|
2017-02-28 03:46:07 +01:00
|
|
|
'sitetree_link',
|
2020-04-19 06:18:01 +02:00
|
|
|
[SiteTree::class, 'link_shortcode_handler']
|
2016-08-10 06:08:39 +02:00
|
|
|
);
|
2011-03-22 22:40:09 +01:00
|
|
|
|
2011-04-16 07:54:52 +02:00
|
|
|
// TODO Remove once we can configure CMSMenu through static, nested configuration files
|
2017-05-25 07:29:32 +02:00
|
|
|
CMSMenu::remove_menu_class(CMSMain::class);
|
|
|
|
CMSMenu::remove_menu_class(CMSPageEditController::class);
|
|
|
|
CMSMenu::remove_menu_class(CMSPageSettingsController::class);
|
2022-11-16 03:39:13 +01:00
|
|
|
if (class_exists(CMSPageHistoryController::class)) {
|
|
|
|
// this class will be removed in CMS 5
|
|
|
|
CMSMenu::remove_menu_class(CMSPageHistoryController::class);
|
|
|
|
}
|
2017-05-25 07:29:32 +02:00
|
|
|
CMSMenu::remove_menu_class(CMSPageAddController::class);
|