{{indexmenu_n>100}}
====== Code ======
View of source code with the CP code and the JavaScript [[http://alexgorbatchev.com/SyntaxHighlighter/|SyntaxHighlighter]] in the FE.
**Syntax Highlighting** since version V1.5 r461
{{:deutsch:phpwcms-system:artikel:contentparts:syntaxhighlighter_php01_1.gif|}}
The main Highlighter:
* Css
* Delphi
* Java
* JScript
* Perl
* Php
* Python
* Ruby
* Sql
* Vb
* Xml
Forum: [[http://forum.phpwcms.org/viewtopic.php?f=16&t=22821|CP Code - Syntax Highlighting PHP]] \\
----
\\
===== Template =====
Template: template/inc_cntpart/code/JavaScript-SyntaxHighLighter.tmpl
E.g.: View of PHP-Code.
[TITLE]{TITLE}
[/TITLE]
[SUBTITLE]{SUBTITLE}
[/SUBTITLE]
[CODE]
{CODE}
[/CODE]
\\
The different highlighter can be set on the JS.
E.g. for JavaScript:
.
.
The different highlighter can be viewed in the template directory ##template/lib/syntaxhighlighter/*.js##.
\\
===== PHP =====
The CP code set for each line break automatically a
. The JS also takes up this html TAG and interprets it.
To avoid this, the
must be removed for the output in the FE. For this purpose, the following CP-Trigger //(PHP-Script)// triggers are used.
File: template/inc_script/frontend_init/cp_trigg_code_no_br.php
from source text in CP code
*
* File: CP trigger in template/inc_Script/frontend_init/cp_trigg_code_no_br.php
* TAG in template for processing: [%NoBR%]
*********************************************************************************************
*/
function TRIGG_CP_CODE_NO_BR_V1($text, & $data) {
// Der richtige CP: code (11)
// and Tag available?
if ( ($data['acontent_type'] == 11) AND // cp code
( strpos($text, '[%NoBR%]') !== FALSE) ) // TAG is set ? // TAG vorhanden?
{
// dumpVar($text);
$text = str_replace('
', '', $text);
$text = str_replace('[%NoBR%]', '', $text);
}
return $text;
}
register_cp_trigger('TRIGG_CP_CODE_NO_BR_V1');
?>
Somewhere in the template between %%....
%% the TAG ##[%NOBR%]## is registered for the trigger to know that he is meant.
\\