summaryrefslogtreecommitdiff
path: root/classes/pref
diff options
context:
space:
mode:
Diffstat (limited to 'classes/pref')
-rwxr-xr-xclasses/pref/feeds.php14
-rwxr-xr-xclasses/pref/filters.php12
-rw-r--r--classes/pref/labels.php29
-rw-r--r--classes/pref/prefs.php32
-rw-r--r--classes/pref/system.php3
5 files changed, 48 insertions, 42 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index d29cf70f5..b834d0de1 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -542,9 +542,8 @@ class Pref_Feeds extends Handler_Protected {
$last_error = $row["last_error"];
if ($last_error) {
- print "&nbsp;<img src=\"images/error.png\" alt=\"(error)\"
- style=\"vertical-align : middle\"
- title=\"".htmlspecialchars($last_error)."\">";
+ print "&nbsp;<i class=\"material-icons\"
+ title=\"".htmlspecialchars($last_error)."\">error</i>";
}
@@ -1134,7 +1133,8 @@ class Pref_Feeds extends Handler_Protected {
function index() {
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
- print "<div id=\"pref-feeds-feeds\" dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Feeds')."\">";
+ print "<div id=\"pref-feeds-feeds\" dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>rss_feed</i> ".__('Feeds')."\">";
$sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?");
@@ -1268,7 +1268,8 @@ class Pref_Feeds extends Handler_Protected {
print "</div>"; # feeds pane
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('OPML')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>import_export</i> ".__('OPML')."\">";
print __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") .
__("Only main settings profile can be migrated using OPML.");
@@ -1323,7 +1324,8 @@ class Pref_Feeds extends Handler_Protected {
print "</div>"; # pane
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Published & shared articles / Generated feeds')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>share</i> ".__('Published & shared articles / Generated feeds')."\">";
print __('Published articles can be subscribed by anyone who knows the following URL:');
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index 0bb1493e5..54fc99bdc 100755
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -320,10 +320,10 @@ class Pref_Filters extends Handler_Protected {
$label_sth->execute([$line['action_param'], $_SESSION['uid']]);
if ($label_row = $label_sth->fetch()) {
- $fg_color = $label_row["fg_color"];
+ //$fg_color = $label_row["fg_color"];
$bg_color = $label_row["bg_color"];
- $name[1] = "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color; margin-right : 4px'>&alpha;</span>" . $name[1];
+ $name[1] = "<i class=\"material-icons\" style='color : $bg_color; margin-right : 4px'>label</i>" . $name[1];
}
}
@@ -518,7 +518,7 @@ class Pref_Filters extends Handler_Protected {
__('Remove')."</button>";
print "</div>";
- print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
+ print "<button dojoType=\"dijit.form.Button\" class=\"alt-info\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
__('Test')."</button> ";
print "<button dojoType=\"dijit.form.Button\" type=\"submit\" class=\"alt-primary\" onclick=\"return dijit.byId('filterEditDlg').execute()\">".
@@ -857,7 +857,7 @@ class Pref_Filters extends Handler_Protected {
function newfilter() {
- print "<form name='filter_new_form' id='filter_new_form'>";
+ print "<form name='filter_new_form' id='filter_new_form' onsubmit='return false'>";
print_hidden("op", "pref-filters");
print_hidden("method", "add");
@@ -935,10 +935,10 @@ class Pref_Filters extends Handler_Protected {
print "<div class=\"dlgButtons\">";
- print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
+ print "<button dojoType=\"dijit.form.Button\" class=\"alt-info\" onclick=\"return dijit.byId('filterEditDlg').test()\">".
__('Test')."</button> ";
- print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').execute()\">".
+ print "<button dojoType=\"dijit.form.Button\" type=\"submit\" class=\"alt-primary\" onclick=\"return dijit.byId('filterEditDlg').execute()\">".
__('Create')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterEditDlg').hide()\">".
diff --git a/classes/pref/labels.php b/classes/pref/labels.php
index 1e297818c..0414a7f8e 100644
--- a/classes/pref/labels.php
+++ b/classes/pref/labels.php
@@ -29,12 +29,9 @@ class Pref_Labels extends Handler_Protected {
$fg_color = $line['fg_color'];
$bg_color = $line['bg_color'];
- print "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color; margin-bottom : 4px; margin-right : 4px'>&alpha;</span>";
-
- print "<input style=\"font-size : 16px\" name=\"caption\"
- dojoType=\"dijit.form.ValidationTextBox\"
- required=\"true\"
- value=\"".htmlspecialchars($line['caption'])."\">";
+ print "<input style='font-size : 16px; color : $fg_color; background : $bg_color; transition : background 0.1s linear'
+ id='labelEdit_caption' name='caption' dojoType='dijit.form.ValidationTextBox'
+ required='true' value=\"".htmlspecialchars($line['caption'])."\">";
print "</div>";
print "<div class=\"dlgSec\">" . __("Colors") . "</div>";
@@ -56,8 +53,8 @@ class Pref_Labels extends Handler_Protected {
print "<div dojoType=\"dijit.ColorPalette\">
<script type=\"dojo/method\" event=\"onChange\" args=\"fg_color\">
- dijit.byId(\"labelEdit_fgColor\").attr('value', fg_color);
- $('label-editor-indicator').setStyle({color: fg_color});
+ dijit.byId('labelEdit_fgColor').attr('value', fg_color);
+ dijit.byId('labelEdit_caption').domNode.setStyle({color: fg_color});
</script>
</div>";
print "</div>";
@@ -66,8 +63,8 @@ class Pref_Labels extends Handler_Protected {
print "<div dojoType=\"dijit.ColorPalette\">
<script type=\"dojo/method\" event=\"onChange\" args=\"bg_color\">
- dijit.byId(\"labelEdit_bgColor\").attr('value', bg_color);
- $('label-editor-indicator').setStyle({backgroundColor: bg_color});
+ dijit.byId('labelEdit_bgColor').attr('value', bg_color);
+ dijit.byId('labelEdit_caption').domNode.setStyle({backgroundColor: bg_color});
</script>
</div>";
print "</div>";
@@ -147,13 +144,11 @@ class Pref_Labels extends Handler_Protected {
$sth->execute([$fg, $bg, $id, $_SESSION['uid']]);
}
- $caption = Labels::find_caption($id, $_SESSION["uid"]);
-
/* Remove cached data */
$sth = $this->pdo->prepare("UPDATE ttrss_user_entries SET label_cache = ''
- WHERE label_cache LIKE ? AND owner_uid = ?");
- $sth->execute(["%$caption%", $_SESSION['uid']]);
+ WHERE owner_uid = ?");
+ $sth->execute([$_SESSION['uid']]);
}
}
@@ -166,13 +161,11 @@ class Pref_Labels extends Handler_Protected {
AND owner_uid = ?");
$sth->execute([$id, $_SESSION['uid']]);
- $caption = Labels::find_caption($id, $_SESSION["uid"]);
-
/* Remove cached data */
$sth = $this->pdo->prepare("UPDATE ttrss_user_entries SET label_cache = ''
- WHERE label_cache LIKE ? AND owner_uid = ?");
- $sth->execute(["%$caption%", $_SESSION['uid']]);
+ WHERE owner_uid = ?");
+ $sth->execute([$_SESSION['uid']]);
}
}
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index af827af58..e717db938 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -176,7 +176,8 @@ class Pref_Prefs extends Handler_Protected {
$_SESSION["prefs_op_result"] = "";
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data / Authentication')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>person</i> ".__('Personal data / Authentication')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
@@ -422,7 +423,8 @@ class Pref_Prefs extends Handler_Protected {
print "</div>"; #pane
- print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"".__('Preferences')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\"
+ title=\"<i class='material-icons'>settings</i> ".__('Preferences')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">";
@@ -454,13 +456,9 @@ class Pref_Prefs extends Handler_Protected {
$profile = $_SESSION["profile"];
- if (!is_numeric($profile) || !$profile || get_schema_version() < 63) $profile = null;
-
if ($profile) {
print_notice(__("Some preferences are only available in default profile."));
- }
- if ($_SESSION["profile"]) {
initialize_user_prefs($_SESSION["uid"], $profile);
} else {
initialize_user_prefs($_SESSION["uid"]);
@@ -544,7 +542,7 @@ class Pref_Prefs extends Handler_Protected {
print_select($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"');
} else if ($pref_name == "USER_STYLESHEET") {
- print "<button dojoType=\"dijit.form.Button\"
+ print "<button dojoType=\"dijit.form.Button\" class='alt-info'
onclick=\"Helpers.customizeCSS()\">" . __('Customize') . "</button>";
} else if ($pref_name == "USER_CSS_THEME") {
@@ -556,8 +554,17 @@ class Pref_Prefs extends Handler_Protected {
if (!theme_valid($value)) $value = "default.php";
- print_select($pref_name, $value, $themes,
- 'dojoType="dijit.form.Select"');
+ print "<select name='$pref_name' id='$pref_name' dojoType='dijit.form.Select'>";
+
+ $issel = $value == "default.php" ? "selected='selected'" : "";
+ print "<option $issel value='default.php'>".__("default")."</option>";
+
+ foreach ($themes as $theme) {
+ $issel = $value == $theme ? "selected='selected'" : "";
+ print "<option $issel value='$theme'>$theme</option>";
+ }
+
+ print "</select>";
} else if ($pref_name == "DEFAULT_UPDATE_INTERVAL") {
@@ -679,7 +686,8 @@ class Pref_Prefs extends Handler_Protected {
print "</div>"; #pane
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Plugins')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>extension</i> ".__('Plugins')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changePluginsForm\">";
@@ -843,14 +851,16 @@ class Pref_Prefs extends Handler_Protected {
print "</div>"; #pane
print "</div>"; #pane
- print "</doiv>"; #border-container
+ print "</div>"; #border-container
print "</form>";
+
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB,
"hook_prefs_tab", "prefPrefs");
print "</div>"; #container
+
}
function toggleAdvanced() {
diff --git a/classes/pref/system.php b/classes/pref/system.php
index ef2ca98b0..f44b499c8 100644
--- a/classes/pref/system.php
+++ b/classes/pref/system.php
@@ -26,7 +26,8 @@ class Pref_System extends Handler_Protected {
function index() {
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Event Log')."\">";
+ print "<div dojoType=\"dijit.layout.AccordionPane\"
+ title=\"<i class='material-icons'>report</i> ".__('Event Log')."\">";
if (LOG_DESTINATION == "sql") {