From f9ebb32ca0a84ec5553d0494cdfc628753fcb36a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 30 Aug 2012 13:06:58 +0400 Subject: [PATCH] hide more obscure preferences under "show more" checkbox in pref-prefs, bump schema --- classes/pref/prefs.php | 24 ++++++++++++++++++- include/functions.php | 2 +- js/prefs.js | 14 +++++++++++ schema/ttrss_schema_mysql.sql | 38 ++++++++++++++++++----------- schema/ttrss_schema_pgsql.sql | 45 +++++++++++++++++++++-------------- schema/versions/mysql/95.sql | 39 ++++++++++++++++++++++++++++++ schema/versions/pgsql/95.sql | 39 ++++++++++++++++++++++++++++++ 7 files changed, 167 insertions(+), 34 deletions(-) create mode 100644 schema/versions/mysql/95.sql create mode 100644 schema/versions/pgsql/95.sql diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 576dd2f03..705b709fa 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -291,17 +291,24 @@ class Pref_Prefs extends Handler_Protected { $profile_qpart = "profile IS NULL"; } + if ($_SESSION["prefs_show_advanced"]) + $access_query = "true"; + else + $access_query = "(access_level = 0 AND section_id != 3)"; + $result = db_query($this->link, "SELECT DISTINCT ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name, + ttrss_prefs_sections.order_id, section_name,def_value,section_id FROM ttrss_prefs,ttrss_prefs_types,ttrss_prefs_sections,ttrss_user_prefs WHERE type_id = ttrss_prefs_types.id AND $profile_qpart AND section_id = ttrss_prefs_sections.id AND ttrss_user_prefs.pref_name = ttrss_prefs.pref_name AND + $access_query AND short_desc != '' AND owner_uid = ".$_SESSION["uid"]." - ORDER BY section_id,short_desc"); + ORDER BY ttrss_prefs_sections.order_id,short_desc"); $lnum = 0; @@ -487,6 +494,18 @@ class Pref_Prefs extends Handler_Protected { print ""; + print " "; + + $checked = $_SESSION["prefs_show_advanced"] ? "checked='1'" : ""; + + print " + "; + print ''; # inner pane print ''; # border container print ""; @@ -549,5 +568,8 @@ class Pref_Prefs extends Handler_Protected { } } + function toggleAdvanced() { + $_SESSION["prefs_show_advanced"] = !$_SESSION["prefs_show_advanced"]; + } } ?> diff --git a/include/functions.php b/include/functions.php index 7eeafd645..ddd166f3a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@