From 0f185543bb9851fddc137f81a1e2a1d21589bc83 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 5 Oct 2011 14:36:01 +0200 Subject: Backend, frontend and 404 handlers partially implemented. * Backend layout done. * Frontend theoretically done (untested). * 404 handler done * Added textprocessors.php --- ratatoeskr/sys/default_settings.php | 3 +- ratatoeskr/sys/textprocessors.php | 78 +++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 ratatoeskr/sys/textprocessors.php (limited to 'ratatoeskr/sys') diff --git a/ratatoeskr/sys/default_settings.php b/ratatoeskr/sys/default_settings.php index 7b42028..cb755cb 100644 --- a/ratatoeskr/sys/default_settings.php +++ b/ratatoeskr/sys/default_settings.php @@ -4,7 +4,8 @@ $default_settings = array( "comment_visible_default" => False, "default_language" => "en", "default_section" => 0/* Must be created */ - "allow_comments_default" => True + "allow_comments_default" => True, + "comment_textprocessor" => "Markdown" ); ?> diff --git a/ratatoeskr/sys/textprocessors.php b/ratatoeskr/sys/textprocessors.php new file mode 100644 index 0000000..3e67b01 --- /dev/null +++ b/ratatoeskr/sys/textprocessors.php @@ -0,0 +1,78 @@ + object. The used textprocessor is determined by the $texttype property. + * + * Parameters: + * $translationobj - The object. + * + * Returns: + * HTML + */ +function textprocessor_apply_translation($translationobj) +{ + return textprocessor_apply($translationobj->text, $translationobj->texttype); +} + +if(!isset($textprocessors)) +{ + $textprocessors = array( + "Markdown" => array("Markdown", True), + "Plain Text" => array(function($text) { return str_replace(array("\r\n", "\n"), array("
", "
"), htmlesc($text)); }, True), + "HTML" => array(function($text) { return $text; }, True) + ); +} + +?> -- cgit v1.2.3-70-g09d2