From 4db13b8a171740798f1fb036b8ad7e45b8f9f090 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Feb 2019 12:35:40 +0300 Subject: simplify preference layout, remove some unnecessary css classes --- classes/pref/prefs.php | 104 +++++++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 63 deletions(-) (limited to 'classes/pref/prefs.php') diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 86c02beed..aeaf5285b 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -24,24 +24,24 @@ class Pref_Prefs extends Handler_Protected { $this->pref_help = array( "ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate articles"), ""), "BLACKLISTED_TAGS" => array(__("Blacklisted tags"), __("When auto-detecting tags in articles these tags will not be applied (comma-separated list).")), - "CDM_AUTO_CATCHUP" => array(__("Automatically mark articles as read"), __("This option enables marking articles as read automatically while you scroll article list.")), + "CDM_AUTO_CATCHUP" => array(__("Automatically mark articles as read"), __("Mark articles as read while you scroll")), "CDM_EXPANDED" => array(__("Automatically expand articles in combined mode"), ""), - "COMBINED_DISPLAY_MODE" => array(__("Combined feed display"), __("Display expanded list of feed articles, instead of separate displays for headlines and article content")), + "COMBINED_DISPLAY_MODE" => array(__("Combined feed display"), __("Show combined list of articles, instead of separate panels")), "CONFIRM_FEED_CATCHUP" => array(__("Confirm marking feed as read"), ""), "DEFAULT_ARTICLE_LIMIT" => array(__("Amount of articles to display at once"), ""), - "DEFAULT_UPDATE_INTERVAL" => array(__("Default feed update interval"), __("Shortest interval at which a feed will be checked for updates regardless of update method")), + "DEFAULT_UPDATE_INTERVAL" => array(__("Default feed update interval")), "DIGEST_CATCHUP" => array(__("Mark articles in e-mail digest as read"), ""), - "DIGEST_ENABLE" => array(__("Enable e-mail digest"), __("This option enables sending daily digest of new (and unread) headlines on your configured e-mail address")), - "DIGEST_PREFERRED_TIME" => array(__("Try to send digests around specified time"), __("Uses UTC timezone")), + "DIGEST_ENABLE" => array(__("Enable e-mail digest"), __("Send daily digest of new (and unread) headlines to your e-mail address")), + "DIGEST_PREFERRED_TIME" => array(__("Try to send digests around specified time"), __("Time in UTC")), "ENABLE_API_ACCESS" => array(__("Enable API access"), __("Allows external clients to access this account through the API")), "ENABLE_FEED_CATS" => array(__("Enable feed categories"), ""), "FEEDS_SORT_BY_UNREAD" => array(__("Sort feeds by unread articles count"), ""), "FRESH_ARTICLE_MAX_AGE" => array(__("Maximum age of fresh articles (in hours)"), ""), "HIDE_READ_FEEDS" => array(__("Hide feeds with no unread articles"), ""), "HIDE_READ_SHOWS_SPECIAL" => array(__("Show special feeds when hiding read feeds"), ""), - "LONG_DATE_FORMAT" => array(__("Long date format"), __("The syntax used is identical to the PHP date() function.")), - "ON_CATCHUP_SHOW_NEXT_FEED" => array(__("On catchup show next feed"), __("Automatically open next feed with unread articles after marking one as read")), - "PURGE_OLD_DAYS" => array(__("Purge articles after this number of days (0 - disables)"), ""), + "LONG_DATE_FORMAT" => array(__("Long date format"), __("Syntax is identical to PHP date() function.")), + "ON_CATCHUP_SHOW_NEXT_FEED" => array(__("On catchup show next feed"), __("Automatically opens next unread feed after marking one as read")), + "PURGE_OLD_DAYS" => array(__("Purge articles older than"), "days (0 disables purging)"), "PURGE_UNREAD_ARTICLES" => array(__("Purge unread articles"), ""), "REVERSE_HEADLINES" => array(__("Reverse headline order (oldest first)"), ""), "SHORT_DATE_FORMAT" => array(__("Short date format"), ""), @@ -50,11 +50,11 @@ class Pref_Prefs extends Handler_Protected { "SSL_CERT_SERIAL" => array(__("Login with an SSL certificate"), __("Click to register your SSL client certificate with tt-rss")), "STRIP_IMAGES" => array(__("Do not embed media in articles"), ""), "STRIP_UNSAFE_TAGS" => array(__("Strip unsafe tags from articles"), __("Strip all but most common HTML tags when reading articles.")), - "USER_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")), + "USER_STYLESHEET" => array(__("Customize stylesheet")), "USER_TIMEZONE" => array(__("Time zone"), ""), "VFEED_GROUP_BY_FEED" => array(__("Group headlines in virtual feeds"), __("Special feeds, labels, and categories are grouped by originating feeds")), "USER_LANGUAGE" => array(__("Language")), - "USER_CSS_THEME" => array(__("Theme"), __("Select one of the available CSS themes")) + "USER_CSS_THEME" => array(__("Theme")) ); } @@ -478,8 +478,6 @@ class Pref_Prefs extends Handler_Protected { ORDER BY ttrss_prefs_sections.order_id,pref_name"); $sth->execute([":uid" => $_SESSION['uid'], ":profile" => $profile]); - $lnum = 0; - $active_section = ""; $listed_boolean_prefs = array(); @@ -506,32 +504,17 @@ class Pref_Prefs extends Handler_Protected { if ($active_section != $line["section_id"]) { - if ($active_section != "") { - print ""; - } - - print ""; - $active_section = $line["section_id"]; - print ""; - - $lnum = 0; + print "

".$section_name."

"; } - print ""; + print "
"; - print "
"; - - print ""; - - print ""; + if ($help_text) print "
"; - $lnum++; + print ""; } - print "

".$section_name."

"; - print ""; - if ($pref_name == "USER_LANGUAGE") { print_select_hash($pref_name, $value, get_translations(), "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'"); @@ -567,7 +550,6 @@ class Pref_Prefs extends Handler_Protected { print ""; - } else if ($pref_name == "DEFAULT_UPDATE_INTERVAL") { global $update_intervals_nodefault; @@ -603,9 +585,14 @@ class Pref_Prefs extends Handler_Protected { $disabled = ""; } - print ""; + if ($type_name == 'integer') + print ""; + else + print ""; } else if ($pref_name == "SSL_CERT_SERIAL") { @@ -616,21 +603,20 @@ class Pref_Prefs extends Handler_Protected { $cert_serial = htmlspecialchars(get_ssl_certificate_id()); $has_serial = ($cert_serial) ? "false" : "true"; - print "
"; - - print " "; - print " "; } else if ($pref_name == 'DIGEST_PREFERRED_TIME') { print "
". - T_sprintf("Current server time: %s (UTC)", date("H:i")) . "
"; + name=\"$pref_name\" value=\"$value\">"; + //
" . T_sprintf("Server time: %s (UTC)", date("H:i")) . "
"; + $help_text .= ". " . T_sprintf("Current server time: %s", date("H:i")); } else { $regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : ''; @@ -639,15 +625,11 @@ class Pref_Prefs extends Handler_Protected { name=\"$pref_name\" value=\"$value\">"; } - print "
"; - $listed_boolean_prefs = htmlspecialchars(join(",", $listed_boolean_prefs)); print_hidden("boolean_prefs", "$listed_boolean_prefs"); @@ -725,12 +707,12 @@ class Pref_Prefs extends Handler_Protected { format_notice(__("System plugins are enabled in config.php for all users.")). ""; - print " -   - ".__('Plugin')." - ".__('Description')." - ".__('Version')." - ".__('Author').""; + print " +   + ".__('Plugin')." + ".__('Description')." + ".__('Version')." + ".__('Author').""; $system_enabled = array_map("trim", explode(",", PLUGINS)); $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS"))); @@ -781,12 +763,12 @@ class Pref_Prefs extends Handler_Protected { print "

".__("User plugins")."

"; - print " -   - ".__('Plugin')." - ".__('Description')." - ".__('Version')." - ".__('Author').""; + print " +   + ".__('Plugin')." + ".__('Description')." + ".__('Version')." + ".__('Author').""; foreach ($tmppluginhost->get_plugins() as $name => $plugin) { @@ -1049,8 +1031,6 @@ class Pref_Prefs extends Handler_Protected { print ""; - $lnum = 1; - while ($line = $sth->fetch()) { $profile_id = $line["id"]; @@ -1085,8 +1065,6 @@ class Pref_Prefs extends Handler_Protected { $is_active"; print ""; - - ++$lnum; } print ""; -- cgit v1.2.3-54-g00ecf