]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
move stylesheets to css/, reference default tt-rss stylesheets from
[tt-rss.git] / classes / pref / prefs.php
index 35065ea7b262d2314f591d5cc4912830c10a4742..32071e3b31680ff00a89b215650babb7467d6cd8 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,9 +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_CSS_THEME" => array(__("Select theme"), __("Select one of the available CSS themes"))
+                       "USER_LANGUAGE" => array(__("Language")),
+                       "USER_CSS_THEME" => array(__("Theme"), __("Select one of the available CSS themes"))
                );
        }
 
@@ -111,18 +112,13 @@ class Pref_Prefs extends Handler_Protected {
                                }
                        }
 
-                       if ($pref_name == "language") {
+                       if ($pref_name == "USER_LANGUAGE") {
                                if ($_SESSION["language"] != $value) {
-                                       setcookie("ttrss_lang", $value,
-                                               time() + COOKIE_LIFETIME_LONG);
-                                       $_SESSION["language"] = $value;
-
                                        $need_reload = true;
                                }
-                       } else {
-                               set_pref($pref_name, $value);
                        }
 
+                       set_pref($pref_name, $value);
                }
 
                if ($need_reload) {
@@ -370,7 +366,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>";
 
@@ -543,22 +539,6 @@ class Pref_Prefs extends Handler_Protected {
                                print "<tr><td colspan=\"3\"><h3>".$section_name."</h3></td></tr>";
 
                                $lnum = 0;
-
-                               if ($active_section == 2) {
-                                       print "<tr>";
-
-                                       print "<td width=\"40%\" class=\"prefName\">";
-                                       print "<label>";
-                                       print __("Language:");
-                                       print "</label>";
-
-                                       print "<td>";
-                                       print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
-                                               "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
-                                       print "</td>";
-                                       print "</tr>";
-                               }
-
                        }
 
                        print "<tr>";
@@ -574,7 +554,11 @@ class Pref_Prefs extends Handler_Protected {
 
                        print "<td class=\"prefValue\">";
 
-                       if ($pref_name == "USER_TIMEZONE") {
+                       if ($pref_name == "USER_LANGUAGE") {
+                               print_select_hash($pref_name, $value, get_translations(),
+                                       "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
+
+                       } else if ($pref_name == "USER_TIMEZONE") {
 
                                $timezones = explode("\n", file_get_contents("lib/timezones.txt"));
 
@@ -721,8 +705,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>."));
@@ -763,7 +745,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);
 
@@ -980,7 +962,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\">";
@@ -1057,8 +1039,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\"";