From 5d40efc9b00fae24ab71d38c9508285a61743a8f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 28 Mar 2013 21:04:29 +0400 Subject: [PATCH] add ability to select CSS files in themes/ --- classes/pref/prefs.php | 16 +++++++++------- include/functions.php | 2 +- index.php | 8 ++++++++ prefs.php | 8 ++++++++ schema/ttrss_schema_mysql.sql | 4 +++- schema/ttrss_schema_pgsql.sql | 4 +++- schema/versions/mysql/110.sql | 7 +++++++ schema/versions/pgsql/110.sql | 7 +++++++ utility.css | 1 + 9 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 schema/versions/mysql/110.sql create mode 100644 schema/versions/pgsql/110.sql diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index ad5dff4a..2190dc0e 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -113,8 +113,6 @@ class Pref_Prefs extends Handler_Protected { WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]); initialize_user_prefs($this->link, $_SESSION["uid"], $_SESSION["profile"]); - - print "PREFS_THEME_CHANGED"; } function index() { @@ -389,11 +387,7 @@ class Pref_Prefs extends Handler_Protected { parameters: dojo.objectToQuery(this.getValues()), onComplete: function(transport) { var msg = transport.responseText; - if (msg.match('PREFS_THEME_CHANGED')) { - window.location.reload(); - } else { - notify_info(msg); - } + notify_info(msg); } }); } "; @@ -496,6 +490,14 @@ class Pref_Prefs extends Handler_Protected { print ""; + } else if ($pref_name == "USER_CSS_THEME") { + + $themes = array_map("basename", glob("themes/*.css")); + + print_select($pref_name, $value, $themes, + 'dojoType="dijit.form.Select"'); + + } else if ($pref_name == "DEFAULT_ARTICLE_LIMIT") { $limits = array(15, 30, 45, 60); diff --git a/include/functions.php b/include/functions.php index 4f8eb057..a9f3b31a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ + +