silverstripe-cms/_config.php

29 lines
812 B
PHP
Raw Permalink Normal View History

<?php
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;
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')
->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
});
/**
* Register the default internal shortcodes.
*/
2016-08-10 06:08:39 +02:00
ShortcodeParser::get('default')->register(
'sitetree_link',
[SiteTree::class, 'link_shortcode_handler']
2016-08-10 06:08:39 +02:00
);