mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
db3dcf7331
Remove hardcoded references to pages and SiteTree Remove assumption that records are versioned Remove or validate assumptions about methods on the model class Improve general architecture of CMSMain
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
use SilverStripe\Admin\CMSMenu;
|
|
use SilverStripe\CMS\Controllers\CMSPageEditController;
|
|
use SilverStripe\CMS\Controllers\CMSPageSettingsController;
|
|
use SilverStripe\CMS\Model\SiteTree;
|
|
use SilverStripe\Core\Manifest\ModuleLoader;
|
|
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
|
|
use SilverStripe\View\Parsers\ShortcodeParser;
|
|
|
|
call_user_func(function () {
|
|
$module = ModuleLoader::inst()->getManifest()->getModule('silverstripe/cms');
|
|
|
|
// Enable insert-link to internal pages
|
|
TinyMCEConfig::get('cms')
|
|
->enablePlugins([
|
|
'sslinkinternal' => $module
|
|
->getResource('client/dist/js/TinyMCE_sslink-internal.js'),
|
|
'sslinkanchor' => $module
|
|
->getResource('client/dist/js/TinyMCE_sslink-anchor.js'),
|
|
]);
|
|
});
|
|
|
|
|
|
/**
|
|
* Register the default internal shortcodes.
|
|
*/
|
|
ShortcodeParser::get('default')->register(
|
|
'sitetree_link',
|
|
[SiteTree::class, 'link_shortcode_handler']
|
|
);
|
|
|
|
CMSMenu::remove_menu_class(CMSPageEditController::class);
|
|
CMSMenu::remove_menu_class(CMSPageSettingsController::class);
|