From 67df2db26547466acf78d21c3ff60f8cdf51998a Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 27 Jan 2017 14:18:12 -0800 Subject: [PATCH] Load TinyMce editor CSS from library. --- e107_handlers/e_parse_class.php | 11 +++++++++ e107_plugins/tinymce4/wysiwyg.php | 41 +++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 8e4f56bd5..ca5a1980f 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2764,6 +2764,17 @@ class e_parse extends e_parser */ public function replaceConstants($text, $mode = '', $all = FALSE) { + if(is_array($text)) + { + $new = array(); + foreach($text as $k=>$v) + { + $new[$k] = $this->replaceConstants($v,$mode,$all); + } + + return $new; + } + if($mode != "") { diff --git a/e107_plugins/tinymce4/wysiwyg.php b/e107_plugins/tinymce4/wysiwyg.php index 5e86e1d60..e137dae9c 100644 --- a/e107_plugins/tinymce4/wysiwyg.php +++ b/e107_plugins/tinymce4/wysiwyg.php @@ -724,24 +724,29 @@ class wysiwyg // $ret['skin'] = 'e107admin'; // $ret['skin_url'] = SITEURLBASE.e_PLUGIN_ABS.'tinymce4/skins/e107admin'; - - $ret['convert_fonts_to_spans'] = false; +/* $editorCSS = array( 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', 'http://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', e_PLUGIN_ABS.'tinymce4/editor.css', ); +*/ + $editorCSS = array( + 0 => e107::getLibrary()->getProperty('bootstrap','library_path').'dist/css/bootstrap.min.css', + 1 => e107::getLibrary()->getProperty('fontawesome','library_path').'css/font-awesome.min.css', + 2 => e_PLUGIN_ABS.'tinymce4/editor.css' + ); + + $editorCSS = $tp->replaceConstants($editorCSS, 'abs'); + $ret['content_css'] = json_encode($editorCSS); $ret['content_style'] = "div.clearfix { border-top:1px solid red } "; - - // $ret['content_css'] = e_WEB_ABS."js/bootstrap/css/bootstrap.min.css"; - - $ret['relative_urls'] = false; //Media Manager prefers it like this. + $ret['relative_urls'] = false; //Media Manager prefers it like this. $ret['preformatted'] = true; $ret['document_base_url'] = SITEURL; $ret['schema'] = "html5"; @@ -787,23 +792,7 @@ class wysiwyg // ------------------------------------------------------------------------------------- - - $cssFiles = $fl->get_files(THEME,"\.css",'',2); - - - foreach($cssFiles as $val) - { - $css[] = str_replace(THEME,THEME_ABS,$val['path'].$val['fname']); - } - - - - // @todo e107::library('info','bootstrap','library_path'); or similar ? - - $css[] = "{e_WEB_ABS}js/bootstrap/css/bootstrap.min.css"; - $content_css = vartrue($config['content_css'], implode(",",$css)); - - $content_styles = array('Bootstrap Button' => 'btn btn-primary', 'Bootstrap Table' => 'table'); +/* @@ -833,7 +822,7 @@ class wysiwyg // 'end_container_on_empty_block' => true, // HTML5 formats - /* + 'style_formats' => "[ {title : 'h1', block : 'h1'}, {title : 'h2', block : 'h2'}, @@ -851,7 +840,7 @@ class wysiwyg {title : 'aside', block : 'aside', wrapper: true}, {title : 'figure', block : 'figure', wrapper: true} ]", - */ + // -------------------------------- @@ -921,7 +910,7 @@ class wysiwyg if(ADMIN) { // $this->config['external_link_list_url'] = e_PLUGIN_ABS."tiny_mce/filelist.php"; - } + }*/ }