Skip to content

Commit

Permalink
Use scripthighter version 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jul 11, 2016
1 parent 2742a25 commit 60b5938
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions framework/Core/lib/Horde/Core/Mime/Viewer/Syntaxhighlighter.php
Expand Up @@ -33,25 +33,13 @@ protected function _renderInline()
$page_output = $GLOBALS['injector']->getInstance('Horde_PageOutput');

if (!self::$_shLoaded) {
$page_output->addScriptFile('syntaxhighlighter/scripts/shCore.js', 'horde');
$page_output->addInlineScript(array(
'SyntaxHighlighter.defaults[\'toolbar\'] = false',
'SyntaxHighlighter.highlight()',
), true);
$page_output->addScriptFile('syntaxhighlighter/scripts/syntaxhighlighter.js', 'horde');
self::$_shLoaded = true;

$sh_js_fs = $this->getConfigParam('registry')->get('jsfs', 'horde') . '/syntaxhighlighter/styles/';
$sh_js_uri = Horde::url($this->getConfigParam('registry')->get('jsuri', 'horde'), false, -1) . '/syntaxhighlighter/styles/';

$page_output->addStylesheet($sh_js_fs . 'shCoreEclipse.css', $sh_js_uri . 'shCoreEclipse.css');
$page_output->addStylesheet($sh_js_fs . 'shThemeEclipse.css', $sh_js_uri . 'shThemeEclipse.css');
}

if (empty(self::$_shBrushes[$brush])) {
$page_output->addScriptFile('syntaxhighlighter/scripts/shBrush' . $brush . '.js', 'horde');
self::$_shBrushes[$brush] = true;
$page_output->addStylesheet($sh_js_fs . 'theme.css', $sh_js_uri . 'theme.css');
}

$results = '<pre class="brush: ' . $language . '; toolbar: false;">' . htmlspecialchars(Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset(), $this->getConfigParam('charset')), ENT_QUOTES, $this->getConfigParam('charset')) . '</pre>';
return $this->_renderReturn(
$results,
Expand Down

0 comments on commit 60b5938

Please sign in to comment.