forked from sheadawson/silverstripe-shortcodable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.php
23 lines (20 loc) · 949 Bytes
/
_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
if (!defined('SHORTCODABLE_DIR')) {
define('SHORTCODABLE_DIR', rtrim(basename(dirname(__FILE__))));
}
if (SHORTCODABLE_DIR != 'shortcodable') {
throw new Exception('The edit shortcodable module is not installed in correct directory. The directory should be named "shortcodable"');
}
// enable shortcodable buttons and add to HtmlEditorConfig
$htmlEditorNames = Config::inst()->get('Shortcodable', 'htmleditor_names');
if (is_array($htmlEditorNames)) {
foreach ($htmlEditorNames as $htmlEditorName) {
HtmlEditorConfig::get($htmlEditorName)->enablePlugins(array(
'shortcodable' => sprintf('../../../%s/javascript/editor_plugin.js', SHORTCODABLE_DIR)
));
HtmlEditorConfig::get($htmlEditorName)->addButtonsToLine(1, 'shortcodable');
}
}
// register classes added via yml config
$classes = Config::inst()->get('Shortcodable', 'shortcodable_classes');
Shortcodable::register_classes($classes);