code_highlighter addon - 파일경로/설명 입력이 없음에도 태그를 출력하던 문제 수정 & PHP를 최상단으로 다시 이동

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3418 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2007-12-26 09:55:55 +00:00
parent c0532578dc
commit fd933bb885
2 changed files with 10 additions and 11 deletions

View file

@ -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('@(<br\\s*/?>)(\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 = <<<dpScript
<script type="text/javascript">
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 .= '<div class="ch_infobox">';
if(isset($option_file_path)) $output .= '<span class="file_path">'.$option_file_path.'</span>';
if(isset($option_description)) $output .= '<span class="description">'.$option_description.'</span>';
if($option_file_path != null) $output .= '<span class="file_path">'.$option_file_path.'</span>';
if($option_description != null) $output .= '<span class="description">'.$option_description.'</span>';
$output .= '</div>';
}
$output .= sprintf('<pre name="code" class="%s">%s</pre>', $code_type.$option, $body);

View file

@ -15,8 +15,8 @@
<th scope="row">{$lang->code_type}</th>
<td>
<select id="code_type" name="code_type">
<option value="Xml">HTML/XML</option>
<option value="Php">PHP</option>
<option value="Xml">HTML/XML</option>
<option value="Css">CSS</option>
<option value="JScript">Javascript</option>
<option value="Cpp">C++</option>
@ -71,4 +71,4 @@
<a href="#" onclick="winopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
</div>
</form>
</form>