From: Andrew Dolgov Date: Thu, 30 Aug 2012 09:06:58 +0000 (+0400) Subject: hide more obscure preferences under "show more" checkbox in pref-prefs, X-Git-Tag: 1.6.0~100 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f9ebb32ca0a84ec5553d0494cdfc628753fcb36a;p=tt-rss.git hide more obscure preferences under "show more" checkbox in pref-prefs, bump schema --- diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 576dd2f0..705b709f 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 7eeafd64..ddd166f3 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@