/
_config.php
39 lines (34 loc) · 1.62 KB
/
_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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
// Define path constant
$path = str_replace('\\', '/', __DIR__);
$path_fragments = explode('/', $path);
$dir_name = $path_fragments[count($path_fragments) - 1];
define('ABC_SOCIAL_DIR', $dir_name);
// attach the social extensions to the config and page classes
SiteConfig::add_extension('SocialMediaConfig');
Page::add_extension('SocialMediaPageExtension');
// attach common behaviours to the social updates
FBUpdate::add_extension('SocialUpdatePageExtension');
Tweet::add_extension('SocialUpdatePageExtension');
InstagramUpdate::add_extension('SocialUpdatePageExtension');
// add the embed functionality
if (!Config::inst()->get('SocialGlobalConf', 'disable_wysiwyg_embed')) {
ShortcodeParser::get('default')->register('social_embed', array('SocialMediaPageExtension', 'SocialEmbedParser'));
HtmlEditorConfig::get('cms')->enablePlugins(array(
'social_embed' => '../../../' . ABC_SOCIAL_DIR . '/js/editor-plugin.js'
));
HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'social_embed');
}
// allow script tags
// maybe we could try using requirements and stripping the script tags
// HtmlEditorConfig::get('cms')
// ->setOption(
// 'extended_valid_elements',
// 'img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap|data*],' .
// 'iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],' .
// 'object[width|height|data|type],' .
// 'param[name|value],' .
// 'map[class|name|id],' .
// 'area[shape|coords|href|target|alt],ol[class|start],' .
// 'script[type|src|lang|async|charset]'
// );