]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
require version information in all additional themes
[tt-rss.git] / classes / pref / prefs.php
index 157abb8bc55b3e082ac232e95c6fab84d42908bd..da11f55e1bed81f454a5af0a334808caa89fed8c 100644 (file)
@@ -40,7 +40,7 @@ class Pref_Prefs extends Handler_Protected {
                        "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"), ""),
+                       "LONG_DATE_FORMAT" => array(__("Long date format"), __("The syntax used is identical to the PHP <a href='http://php.net/manual/function.date.php'>date()</a> 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)"), ""),
                        "PURGE_UNREAD_ARTICLES" => array(__("Purge unread articles"), ""),
@@ -52,10 +52,10 @@ class Pref_Prefs extends Handler_Protected {
                        "STRIP_IMAGES" => array(__("Do not embed images 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_TIMEZONE" => array(__("User timezone"), ""),
+                       "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(__("Select theme"), __("Select one of the available CSS themes"))
+                       "USER_CSS_THEME" => array(__("Theme"), __("Select one of the available CSS themes"))
                );
        }
 
@@ -181,7 +181,8 @@ class Pref_Prefs extends Handler_Protected {
                global $access_level_names;
 
                $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES",
-                       "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT");
+                       "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT",
+                       "FEEDS_SORT_BY_UNREAD");
 
                /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */
 
@@ -366,7 +367,7 @@ class Pref_Prefs extends Handler_Protected {
 
                                } else if (function_exists("imagecreatefromstring")) {
 
-                                       print "<p>".__("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP.") . "</p>";
+                                       print_warning(__("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP."));
 
                                        print "<p>".__("Scan the following code by the Authenticator application:")."</p>";
 
@@ -570,7 +571,8 @@ class Pref_Prefs extends Handler_Protected {
 
                        } else if ($pref_name == "USER_CSS_THEME") {
 
-                               $themes = array_map("basename", glob("themes/*.css"));
+                               $themes = array_filter(array_map("basename", glob("themes/*.css")),
+                                       "theme_valid");
 
                                print_select($pref_name, $value, $themes,
                                        'dojoType="dijit.form.Select"');
@@ -705,8 +707,6 @@ class Pref_Prefs extends Handler_Protected {
 
                print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Plugins')."\">";
 
-               print "<h2>".__("Plugins")."</h2>";
-
                print "<p>" . __("You will need to reload Tiny Tiny RSS for plugin changes to take effect.") . "</p>";
 
                print_notice(__("Download more plugins at tt-rss.org <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/forum/viewforum.php?f=22\">forums</a> or <a target=\"_blank\" class=\"visibleLink\" href=\"http://tt-rss.org/wiki/Plugins\">wiki</a>."));
@@ -747,7 +747,7 @@ class Pref_Prefs extends Handler_Protected {
                $system_enabled = array_map("trim", explode(",", PLUGINS));
                $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
 
-               $tmppluginhost = new PluginHost(Db::get());
+               $tmppluginhost = new PluginHost();
                $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"]);
                $tmppluginhost->load_data(true);
 
@@ -767,7 +767,9 @@ class Pref_Prefs extends Handler_Protected {
                                                dojoType=\"dijit.form.CheckBox\" $checked
                                                type=\"checkbox\"></td>";
 
-                               print "<td>$name</td>";
+                               $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
+
+                               print "<td><label><img src='images/$plugin_icon' alt=''> $name</label></td>";
                                print "<td>" . htmlspecialchars($about[1]);
                                if (@$about[4]) {
                                        print " &mdash; <a target=\"_blank\" class=\"visibleLink\"
@@ -820,11 +822,13 @@ class Pref_Prefs extends Handler_Protected {
 
                                print "<tr class='$rowclass'>";
 
+                               $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
+
                                print "<td align='center'><input id='FPCHK-$name' name='plugins[]' value='$name' onclick='toggleSelectRow2(this);'
                                        dojoType=\"dijit.form.CheckBox\" $checked $disabled
                                        type=\"checkbox\"></td>";
 
-                               print "<td><label for='FPCHK-$name'>$name</label></td>";
+                               print "<td><label for='FPCHK-$name'><img src='images/$plugin_icon' alt=''> $name</label></td>";
                                print "<td><label for='FPCHK-$name'>" . htmlspecialchars($about[1]) . "</label>";
                                if (@$about[4]) {
                                        print " &mdash; <a target=\"_blank\" class=\"visibleLink\"
@@ -885,8 +889,9 @@ class Pref_Prefs extends Handler_Protected {
 
                if (!$otp_enabled) {
                        $secret = $base32->encode(sha1($this->dbh->fetch_result($result, 0, "salt")));
-                       $topt = new \OTPHP\TOTP($secret);
-                       print QRcode::png($topt->provisioning_uri($login));
+             print QRcode::png("otpauth://totp/".urlencode($login).
+                               "?secret=$secret&issuer=".urlencode("Tiny Tiny RSS"));
+
                }
        }
 
@@ -964,7 +969,7 @@ class Pref_Prefs extends Handler_Protected {
 
                $value = str_replace("<br/>", "\n", $value);
 
-               print_notice(T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css"));
+               print_notice(T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "css/tt-rss.css"));
 
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setpref\">";
@@ -1041,8 +1046,6 @@ class Pref_Prefs extends Handler_Protected {
 
                while ($line = $this->dbh->fetch_assoc($result)) {
 
-                       $class = ($lnum % 2) ? "even" : "odd";
-
                        $profile_id = $line["id"];
                        $this_row_id = "id=\"FCATR-$profile_id\"";