diff --git a/modules/editor/components/code_highlighter/code_highlighter.class.php b/modules/editor/components/code_highlighter/code_highlighter.class.php index 2fdb88607..cfa6ed5ab 100755 --- a/modules/editor/components/code_highlighter/code_highlighter.class.php +++ b/modules/editor/components/code_highlighter/code_highlighter.class.php @@ -50,7 +50,7 @@ class code_highlighter extends EditorHandler { if($option_collapse == 'true') $option = $option.':collapse'; if($option_nogutter == 'true') $option = $option.':nogutter'; if($option_nocontrols == 'true' && $option_collapse != 'true') $option = $option.':nocontrols'; - if($option_first_line) $option = $option.":firstline[$option_first_line]"; + if($option_first_line > 1) $option = $option.":firstline[$option_first_line]"; $body = $xml_obj->body; @@ -58,8 +58,8 @@ class code_highlighter extends EditorHandler { $body = preg_replace('@()(\n)?@i' , "\n", $body); $body = strip_tags($body); - if(!$GLOBALS['_called_code_highlighter_']) { - $GLOBALS['_called_code_highlighter_'] = true; + if(!$GLOBALS['_called_editor_component_code_highlighter_']) { + $GLOBALS['_called_editor_component_code_highlighter_'] = true; $js_code = << dp.SyntaxHighlighter.ClipboardSwf = '{$this->component_path}script/clipboard.swf'; @@ -68,18 +68,17 @@ dp.SyntaxHighlighter.HighlightAll('code'); dpScript; Context::addHtmlFooter($js_code); + Context::addCSSFile($this->component_path.'css/SyntaxHighlighter.css'); + Context::addJsFile($this->component_path.'script/shCore.js'); } - Context::addCSSFile($this->component_path.'css/SyntaxHighlighter.css'); - - Context::addJsFile($this->component_path.'script/shCore.js'); Context::addJsFile($this->component_path.'script/shBrush'.$code_type.'.js'); $output = null; - if(isset($option_file_path) || isset($option_description)) { + if($option_file_path != null || $option_description != null) { $output .= '
'; - if(isset($option_file_path)) $output .= ''.$option_file_path.''; - if(isset($option_description)) $output .= ''.$option_description.''; + if($option_file_path != null) $output .= ''.$option_file_path.''; + if($option_description != null) $output .= ''.$option_description.''; $output .= '
'; } $output .= sprintf('
%s
', $code_type.$option, $body); diff --git a/modules/editor/components/code_highlighter/tpl/popup.html b/modules/editor/components/code_highlighter/tpl/popup.html index a38736285..a519c88c1 100755 --- a/modules/editor/components/code_highlighter/tpl/popup.html +++ b/modules/editor/components/code_highlighter/tpl/popup.html @@ -15,8 +15,8 @@ {$lang->code_type}