<?php
require_once("dependencies/PHP_Highlight.php");
class php_code_plugin
{
function setup($s=null)
{
return array('refresh_object'=>false);
}
function parse($contents,&$object)
{
$code=null;
$tags=$object->get_tags('php','code');
while (($code=x64Template::get_statement($tags,$contents))!==false)
{
$_code=html_entity_decode($code);
$code_highlighter=new PHP_Highlight();
$code_highlighter->loadString($_code);
$_code=$code_highlighter->toList(true,false);
$contents=str_replace($tags['b'].$code.$tags['e'],$_code,$contents);
}
return $contents;
}
function version($of_what)
{
switch ($of_what)
{
case "protocol":
return "1.0";
break;
case "plugin":
return "0.1.1";
break;
}
}
}
?>
|