Alexander Nicolaysen Sørnes : Allow users to disable the Xinha HTML editor
Chris Morgan
cmorgan at winehq.org
Tue Apr 29 19:44:18 CDT 2008
Module: appdb
Branch: master
Commit: caf65e386963c13707107a3b6566653eda3b56f1
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=caf65e386963c13707107a3b6566653eda3b56f1
Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date: Tue Apr 22 21:03:08 2008 +0200
Allow users to disable the Xinha HTML editor
---
include/util.php | 16 ++++++++++++++++
tables/prefs_list.sql | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
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 '
<script type="text/javascript">';
// You must set _editor_url to the URL (including trailing slash) where
diff --git a/tables/prefs_list.sql b/tables/prefs_list.sql
index 4246912..1952a03 100644
--- a/tables/prefs_list.sql
+++ b/tables/prefs_list.sql
@@ -22,3 +22,4 @@ INSERT INTO prefs_list VALUES (0, 'query:mode', 'view', 'view|edit', 'Default AP
INSERT INTO prefs_list VALUES (0, 'query:hide_header', 'no', 'yes|no', 'Hide apidb header in query results');
INSERT INTO prefs_list VALUES (0, 'query:hide_sidebar', 'no', 'yes|no', 'Hide apidb sidebar in query results');
INSERT INTO prefs_list VALUES (0, 'send_email', 'yes', 'yes|no', 'Send email notifications');
+INSERT INTO prefs_list VALUES (0, 'htmleditor', 'for supported browsers', 'always|for supported browsers|never', 'Display a graphical HTML editor in certain text fields');
More information about the wine-cvs
mailing list