From fd933bb885906f7f460a0beab3e1da357ebbdb12 Mon Sep 17 00:00:00 2001 From: bnu Date: Wed, 26 Dec 2007 09:55:55 +0000 Subject: [PATCH] =?UTF-8?q?code=5Fhighlighter=20addon=20-=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EA=B2=BD=EB=A1=9C/=EC=84=A4=EB=AA=85=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=9D=B4=20=EC=97=86=EC=9D=8C=EC=97=90=EB=8F=84=20?= =?UTF-8?q?=ED=83=9C=EA=B7=B8=EB=A5=BC=20=EC=B6=9C=EB=A0=A5=ED=95=98?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95=20&=20PHP?= =?UTF-8?q?=EB=A5=BC=20=EC=B5=9C=EC=83=81=EB=8B=A8=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3418 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../code_highlighter/code_highlighter.class.php | 17 ++++++++--------- .../components/code_highlighter/tpl/popup.html | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) 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}