summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/article.php1
-rwxr-xr-xclasses/feeds.php53
-rwxr-xr-xclasses/handler/public.php6
-rw-r--r--classes/labels.php4
-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
-rwxr-xr-xclasses/rpc.php2
10 files changed, 75 insertions, 81 deletions
diff --git a/classes/article.php b/classes/article.php
index e5c98b2c5..59830027b 100755
--- a/classes/article.php
+++ b/classes/article.php
@@ -253,6 +253,7 @@ class Article extends Handler_Protected {
print json_encode(array("id" => $ids,
"score" => (int)$score,
+ "score_class" => get_score_class($score),
"score_pic" => get_score_pic($score)));
}
diff --git a/classes/feeds.php b/classes/feeds.php
index d9c772c9c..6e0f5ace3 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -28,8 +28,6 @@ class Feeds extends Handler_Protected {
$rss_link = htmlspecialchars(get_self_url_prefix() .
"/public.php?op=rss&id=$feed_id$cat_q$search_q");
- $error_class = $error ? "error" : "";
-
$reply .= "<span class='left'>";
$reply .= "<a href=\"#\"
@@ -37,25 +35,20 @@ class Feeds extends Handler_Protected {
onclick=\"App.displayDlg('".__("Show as feed")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
<i class='icon-syndicate material-icons'>rss_feed</i></a>";
- $reply .= "<span id='feed_title' class='$error_class'>";
+ $reply .= "<span id='feed_title'>";
if ($feed_site_url) {
- $last_updated = T_sprintf("Last updated: %s",
- $feed_last_updated);
+ $last_updated = T_sprintf("Last updated: %s", $feed_last_updated);
- $target = "target=\"_blank\"";
- $reply .= "<a title=\"$last_updated\" $target href=\"$feed_site_url\">".
+ $reply .= "<a title=\"$last_updated\" target='_blank' href=\"$feed_site_url\">".
truncate_string(strip_tags($feed_title), 30)."</a>";
-
- if ($error) {
- $error = htmlspecialchars($error);
- $reply .= "&nbsp;<img title=\"$error\" src='images/error.png' alt='error' class=\"noborder\">";
- }
-
} else {
$reply .= strip_tags($feed_title);
}
+ if ($error)
+ $reply .= " <i title=\"" . htmlspecialchars($error) . "\" class='material-icons icon-error'>error</i>";
+
$reply .= "</span></span>";
$reply .= "<span class=\"right\">";
@@ -308,18 +301,10 @@ class Feeds extends Handler_Protected {
$score = $line["score"];
- $score_pic = "images/" . get_score_pic($score);
-
- $score_pic = "<img class='score-pic' score='$score' onclick='Article.setScore($id, this)' src=\"$score_pic\"
- title=\"$score\">";
-
- if ($score > 500) {
- $hlc_suffix = "high";
- } else if ($score < -100) {
- $hlc_suffix = "low";
- } else {
- $hlc_suffix = "";
- }
+ $score_pic = "<i class='material-icons icon-score' title='$score'
+ data-score='$score' onclick='Article.setScore($id, this)'>" .
+ get_score_pic($score) . "</i>";
+ $score_class = get_score_class($score);
$entry_author = $line["author"];
@@ -365,7 +350,7 @@ class Feeds extends Handler_Protected {
}
}
- $reply['content'] .= "<div class='hl $class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
+ $reply['content'] .= "<div class='hl $class $score_class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
$reply['content'] .= "<div class='left'>";
@@ -379,8 +364,8 @@ class Feeds extends Handler_Protected {
$reply['content'] .= "</div>";
$reply['content'] .= "<div onclick='return Headlines.click(event, $id)'
- class=\"title\"><span data-article-id=\"$id\" class='hl-content hlMenuAttach $hlc_suffix'>";
- $reply['content'] .= "<a class=\"title $hlc_suffix\"
+ class=\"title\"><span data-article-id=\"$id\" class='hl-content hlMenuAttach'>";
+ $reply['content'] .= "<a class=\"title\"
href=\"" . htmlspecialchars($line["link"]) . "\"
onclick=\"\">" .
truncate_string($line["title"], 200);
@@ -462,7 +447,7 @@ class Feeds extends Handler_Protected {
$content_encoded = htmlspecialchars($line["content"]);
$expanded_class = get_pref("CDM_EXPANDED") ? "expanded" : "expandable";
- $tmp_content = "<div class=\"cdm $expanded_class $hlc_suffix $class\"
+ $tmp_content = "<div class=\"cdm $expanded_class $score_class $class\"
id=\"RROW-$id\" data-content=\"$content_encoded\" data-article-id='$id' data-orig-feed-id='$feed_id' $mouseover_attrs>";
$tmp_content .= "<div class=\"header\">";
@@ -502,8 +487,8 @@ class Feeds extends Handler_Protected {
if (!get_pref("CDM_EXPANDED")) {
$tmp_content .= "<span class='collapse'>
- <img src=\"images/collapse.png\" onclick=\"return Article.cdmUnsetActive(event)\"
- title=\"" . __("Collapse article") . "\"/></span>";
+ <i class=\"material-icons\" onclick=\"return Article.cdmUnsetActive(event)\"
+ title=\"" . __("Collapse article") . "\">remove_circle</i></span>";
if (get_pref('SHOW_CONTENT_PREVIEW')) {
$tmp_content .= "<span class='excerpt'>" . $line["content_preview"] . "</span>";
@@ -1501,17 +1486,17 @@ class Feeds extends Handler_Protected {
return "rss_feed";
break;
case -3:
- return "new_releases";
+ return "whatshot";
break;
case -4:
return "inbox";
break;
case -6:
- return "cached";
+ return "restore";
break;
default:
if ($id < LABEL_BASE_INDEX) {
- return "images/label.png";
+ return "label";
} else {
$icon = self::getIconFile($id);
diff --git a/classes/handler/public.php b/classes/handler/public.php
index e216d7a36..2ad18fa1f 100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -509,7 +509,7 @@ class Handler_Public extends Handler {
if (clean($_POST["profile"])) {
- $profile = clean($_POST["profile"]);
+ $profile = (int) clean($_POST["profile"]);
$sth = $this->pdo->prepare("SELECT id FROM ttrss_settings_profiles
WHERE id = ? AND owner_uid = ?");
@@ -517,7 +517,9 @@ class Handler_Public extends Handler {
if ($sth->fetch()) {
$_SESSION["profile"] = $profile;
- }
+ } else {
+ $_SESSION["profile"] = null;
+ }
}
} else {
diff --git a/classes/labels.php b/classes/labels.php
index fd9e454bb..19d060617 100644
--- a/classes/labels.php
+++ b/classes/labels.php
@@ -163,8 +163,8 @@ class Labels
/* Remove cached data */
$sth = $pdo->prepare("UPDATE ttrss_user_entries SET label_cache = ''
- WHERE label_cache LIKE ? AND owner_uid = ?");
- $sth->execute(["%$caption%", $owner_uid]);
+ WHERE owner_uid = ?");
+ $sth->execute([$owner_uid]);
}
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") {
diff --git a/classes/rpc.php b/classes/rpc.php
index bd4337fbe..41325d62a 100755
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -8,7 +8,7 @@ class RPC extends Handler_Protected {
}
function setprofile() {
- $_SESSION["profile"] = clean($_REQUEST["id"]);
+ $_SESSION["profile"] = (int) clean($_REQUEST["id"]);
// default value
if (!$_SESSION["profile"]) $_SESSION["profile"] = null;