mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 15:19:57 +09:00
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:
parent
c0532578dc
commit
fd933bb885
2 changed files with 10 additions and 11 deletions
|
|
@ -50,7 +50,7 @@ class code_highlighter extends EditorHandler {
|
||||||
if($option_collapse == 'true') $option = $option.':collapse';
|
if($option_collapse == 'true') $option = $option.':collapse';
|
||||||
if($option_nogutter == 'true') $option = $option.':nogutter';
|
if($option_nogutter == 'true') $option = $option.':nogutter';
|
||||||
if($option_nocontrols == 'true' && $option_collapse != 'true') $option = $option.':nocontrols';
|
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;
|
$body = $xml_obj->body;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,8 +58,8 @@ class code_highlighter extends EditorHandler {
|
||||||
$body = preg_replace('@(<br\\s*/?>)(\n)?@i' , "\n", $body);
|
$body = preg_replace('@(<br\\s*/?>)(\n)?@i' , "\n", $body);
|
||||||
$body = strip_tags($body);
|
$body = strip_tags($body);
|
||||||
|
|
||||||
if(!$GLOBALS['_called_code_highlighter_']) {
|
if(!$GLOBALS['_called_editor_component_code_highlighter_']) {
|
||||||
$GLOBALS['_called_code_highlighter_'] = true;
|
$GLOBALS['_called_editor_component_code_highlighter_'] = true;
|
||||||
$js_code = <<<dpScript
|
$js_code = <<<dpScript
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
dp.SyntaxHighlighter.ClipboardSwf = '{$this->component_path}script/clipboard.swf';
|
dp.SyntaxHighlighter.ClipboardSwf = '{$this->component_path}script/clipboard.swf';
|
||||||
|
|
@ -68,18 +68,17 @@ dp.SyntaxHighlighter.HighlightAll('code');
|
||||||
dpScript;
|
dpScript;
|
||||||
|
|
||||||
Context::addHtmlFooter($js_code);
|
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');
|
Context::addJsFile($this->component_path.'script/shBrush'.$code_type.'.js');
|
||||||
|
|
||||||
$output = null;
|
$output = null;
|
||||||
if(isset($option_file_path) || isset($option_description)) {
|
if($option_file_path != null || $option_description != null) {
|
||||||
$output .= '<div class="ch_infobox">';
|
$output .= '<div class="ch_infobox">';
|
||||||
if(isset($option_file_path)) $output .= '<span class="file_path">'.$option_file_path.'</span>';
|
if($option_file_path != null) $output .= '<span class="file_path">'.$option_file_path.'</span>';
|
||||||
if(isset($option_description)) $output .= '<span class="description">'.$option_description.'</span>';
|
if($option_description != null) $output .= '<span class="description">'.$option_description.'</span>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
}
|
}
|
||||||
$output .= sprintf('<pre name="code" class="%s">%s</pre>', $code_type.$option, $body);
|
$output .= sprintf('<pre name="code" class="%s">%s</pre>', $code_type.$option, $body);
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
<th scope="row">{$lang->code_type}</th>
|
<th scope="row">{$lang->code_type}</th>
|
||||||
<td>
|
<td>
|
||||||
<select id="code_type" name="code_type">
|
<select id="code_type" name="code_type">
|
||||||
<option value="Xml">HTML/XML</option>
|
|
||||||
<option value="Php">PHP</option>
|
<option value="Php">PHP</option>
|
||||||
|
<option value="Xml">HTML/XML</option>
|
||||||
<option value="Css">CSS</option>
|
<option value="Css">CSS</option>
|
||||||
<option value="JScript">Javascript</option>
|
<option value="JScript">Javascript</option>
|
||||||
<option value="Cpp">C++</option>
|
<option value="Cpp">C++</option>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue