From caf65e386963c13707107a3b6566653eda3b56f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Tue, 22 Apr 2008 21:03:08 +0200 Subject: [PATCH] Allow users to disable the Xinha HTML editor --- include/util.php | 16 ++++++++++++++++ tables/prefs_list.sql | 1 + 2 files changed, 17 insertions(+) diff --git a/include/util.php b/include/util.php index ba13386..5f4ce4d 100644 --- a/include/util.php +++ b/include/util.php @@ -628,6 +628,22 @@ function HtmlAreaLoaderScript($aTextareas) { static $outputIndex = 0; + /* Check if the user wants to display the HTML editor (always, for supported browsers or never) */ + switch($_SESSION['current']->getPref('htmleditor', 'for supported browsers')) + { + case 'never': + return; + case 'for supported browsers': + if(strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') || + strstr($_SERVER['HTTP_USER_AGENT'], 'Konqueror')) + { + return; + } + break; + case 'always': + break; + } + echo '