diff options
author | neoraider <devnull@localhost> | 2006-04-11 20:34:03 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2006-04-11 20:34:03 +0200 |
commit | 3634676b7fab1da7ffb5f3d32bc4608a6f339305 (patch) | |
tree | f9a8e5cf5f78c2a76cda3152ee8b58cf286a4292 /templates | |
parent | 2fe04a4707412ff2f4f8df5f5524bb1b2dcbb3d7 (diff) | |
download | neon-3634676b7fab1da7ffb5f3d32bc4608a6f339305.tar neon-3634676b7fab1da7ffb5f3d32bc4608a6f339305.zip |
Handler hei?en jetzt Templates.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/default.inc.php | 18 | ||||
-rw-r--r-- | templates/phpexec.inc.php | 21 |
2 files changed, 39 insertions, 0 deletions
diff --git a/templates/default.inc.php b/templates/default.inc.php new file mode 100644 index 0000000..9669671 --- /dev/null +++ b/templates/default.inc.php @@ -0,0 +1,18 @@ +<?PHP + require_once('code/message.inc.php'); + + class default_template { + function Get($data) { + if($data['title']) + $title = strtr($data['title'], array('<' => '<', '>' => '>', '&' => '&', '"' => '"')); + else + $title = strtr($data['_page'], array(':' => ' - ')); + $content = '<h2>' . $title . '</h2>' . strtr($data['content'], array('<' => '<', '>' => '>', '&' => '&', + '"' => '"', "\n" => '<br />', "\r" => '')); + + return array('title' => $title, 'content' => $content); + } + } + + $GLOBALS['templates']['default'] = new default_template; +?> diff --git a/templates/phpexec.inc.php b/templates/phpexec.inc.php new file mode 100644 index 0000000..0d0404d --- /dev/null +++ b/templates/phpexec.inc.php @@ -0,0 +1,21 @@ +<?PHP + require_once('code/message.inc.php'); + require_once('code/links.inc.php'); + + class phpexec_template { + function Get($data) { + $title = strtr($data['_page'], array(':' => ' - ')); + + ob_start(); + + eval('?>' . $data['code']); + + $content = ob_get_contents(); + ob_end_clean(); + + return array('title' => $title, 'content' => $content); + } + } + + $GLOBALS['templates']['phpexec'] = new phpexec_template; +?> |