<?
/* Delta Playground, (c) Maciej Łebkowski 2005 */
/* zrodla, podświetlanie składni HTML i PHP */
/* http://delta.lebkowski.info/zrodla */
/* &delta:info; zrodla 1.0 SRC:1 CSS:mod PHP:yes SQL:no JS:no AJAX:no */
include( 'engine/main.php' );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD><title>[Delta] ¬ródła</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css">
@import url(/delta.css);
DIV#main{ background: white none; }
DIV#zrodlo{
font: 12px Courier new, Lucida Console, monospaced;
padding: 10px;
white-space: pre-wrap;
width: 580px;
}
CODE{ background-color: #F9F9Fa; white-space: normal}
.code span.text{ color:#000; }
.code span.comment{ color:#008000; }
.code span.tag{ color:#00B; }
.code span.attribute{ color:#D00; }
.code span.value{ color:#800080; }
.code span.comment span{ color:#008000; }
</style>
</head><body>
<div id="main"><h1><a href="/zrodla">¬ródła</a></h1>
<div id="zrodlo" class="code">
<?
function php_hl( $str ){
global $php_hls;
$php_hls[] = highlight_string( $str[0], 1 );
return '%php_'.(count($php_hls)).'%';
}
$klucze = array_flip( array( 'zrodla', 'notes', 'delta', 'terminy',
'user', 'autoform', 'php/forms', 'php/rss', 'engine/main',
'engine/karty', 'engine/forms'
) );
$ar_search = array( 'hasło' );
$ar_replace = array( 'hasło' );
include( 'hh/source2' );
$zrodla = new sourcecode;
$file_path = trim($_SERVER['PATH_INFO'], '/' );
if( strpos( $file_path, 'delta2/' ) === false ){
if(!array_key_exists( $file_path, $klucze ) )
$file_path = 'zrodla';
$file_path = str_replace( 'php/','/usr/include/php/',
$file_path );
$source = file_get_contents($file_path.'.php');
} elseif( empty ($_POST) )
$source = $engine->delta( substr( $file_path, 7 ) );
else $source = $_POST['source'];
$source = str_replace( $ar_search, $ar_replace, $source );
$php = preg_replace_callback( '/(<\?.*\?\>)+/sU', 'php_hl', $source );
$php = trim( $zrodla->html( $php ) );
if( $php_hls ) foreach( $php_hls as $rep )
$php = str_replace( '%php_'.(++$i).'%', $rep, $php );
echo $php;
?>
</div>
<div id="copy">
<a href="/">playground</a>
<a href="http://lebkowski.info/kontakt">maciej łebkowski</a></div>
</div></body></html>