summaryrefslogtreecommitdiffstats
path: root/handlers
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-01-09 20:49:02 +0100
committerneoraider <devnull@localhost>2006-01-09 20:49:02 +0100
commit73d5e907a797e976e59f328d4f2fd0b8bfcebde6 (patch)
tree98108e9738db75d2688de5f7a68c72253c54c450 /handlers
parent61f7b4cc39a399a16298453acbe5a8f49ad0513d (diff)
downloadneon-73d5e907a797e976e59f328d4f2fd0b8bfcebde6.tar
neon-73d5e907a797e976e59f328d4f2fd0b8bfcebde6.zip
Allgemein ist jetzt alles etwas weiter. Vieles ist jetzt durch Klassen gel?st, und einige andere Teile von Neon sind jetzt besser strukturiert.
Diffstat (limited to 'handlers')
-rw-r--r--handlers/default22
1 files changed, 19 insertions, 3 deletions
diff --git a/handlers/default b/handlers/default
index b9ea3e9..cb9396f 100644
--- a/handlers/default
+++ b/handlers/default
@@ -1,7 +1,23 @@
<?PHP
- function default_handler($data) {
- return strtr($data['content'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;', "\n" => '<br />', "\r" => ''));
+ include('code/message.inc.php');
+
+ class default_handler {
+ function HandleContentData($data) {
+ $tr = array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;', "\n" => '<br />', "\r" => '');
+
+ if($data['title'])
+ $title = strtr($data['title'], $tr);
+ else
+ $title = strtr($data['_page'], array(':' => ' - '));
+ $content = strtr($data['content'], $tr);
+
+ return array('title' => $title, 'content' => $content);
+ }
+
+ function HandleErrorMessage($type, $data = array()) {
+ return '<span class="error">' . Message($type, $data) . '</span>';
+ }
}
- $handlers['default'] = 'default_handler';
+ $handlers['default'] = new default_handler;
?>