function csrf_ignore($method) {
$csrf_ignored = array("index", "getfeedtree", "add", "editcats", "editfeed",
- "savefeedorder");
+ "savefeedorder", "uploadicon");
return array_search($method, $csrf_ignored) !== false;
}
$root['type'] = 'category';
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
+ $show_empty_cats = get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
$result = db_query($this->link, "SELECT id, title FROM ttrss_feed_categories
WHERE owner_uid = " . $_SESSION["uid"] . " ORDER BY order_id, title");
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
- if (count($cat['items']) > 0)
+ if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
- if (count($cat['items']) > 0)
+ if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
return;
}
+ function togglehiddenfeedcats() {
+ set_pref($this->link, '_PREFS_SHOW_EMPTY_CATS',
+ (get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS') ? 'false' : 'true'));
+ }
+
function savefeedorder() {
$data = json_decode($_POST['payload'], true);
break;
case "private":
- $qpart = "private = '$private'";
+ $qpart = "private = $private";
break;
case "include_in_digest":
- $qpart = "include_in_digest = '$include_in_digest'";
+ $qpart = "include_in_digest = $include_in_digest";
break;
case "always_display_enclosures":
- $qpart = "always_display_enclosures = '$always_display_enclosures'";
+ $qpart = "always_display_enclosures = $always_display_enclosures";
break;
case "mark_unread_on_update":
- $qpart = "mark_unread_on_update = '$mark_unread_on_update'";
+ $qpart = "mark_unread_on_update = $mark_unread_on_update";
break;
case "update_on_checksum_change":
- $qpart = "update_on_checksum_change = '$update_on_checksum_change'";
+ $qpart = "update_on_checksum_change = $update_on_checksum_change";
break;
case "cache_images":
- $qpart = "cache_images = '$cache_images'";
+ $qpart = "cache_images = $cache_images";
break;
case "rtl_content":
- $qpart = "rtl_content = '$rtl_content'";
+ $qpart = "rtl_content = $rtl_content";
break;
case "update_method":
$auth_pass = db_escape_string(trim($_POST["auth_pass"]));
if ($p_from != 'tt-rss') {
- header("Content-Type: text/html");
+ header('Content-Type: text/html; charset=utf-8');
print "<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
+ <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
</head>
<body>
<img class=\"floatingLogo\" src=\"images/ttrss_logo.png\"
print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
break;
case 4:
- print_notice("Multiple feed URLs found.");
+ print_notice(__("Multiple feed URLs found."));
$feed_urls = get_feeds_from_html($feed_url);
break;
}
}
- print "<div dojoType=\"dijit.Toolbar\">
- <input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"newcat\">
+ print "<div dojoType=\"dijit.Toolbar\">";
+
+ print "<div dojoType=\"dijit.form.DropDownButton\">".
+ "<span>" . __('Select')."</span>";
+ print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
+ print "<div onclick=\"selectTableRows('prefFeedCatList', 'all')\"
+ dojoType=\"dijit.MenuItem\">".__('All')."</div>";
+ print "<div onclick=\"selectTableRows('prefFeedCatList', 'none')\"
+ dojoType=\"dijit.MenuItem\">".__('None')."</div>";
+ print "</div></div>";
+
+ print "<div style='float : right'>";
+
+ print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"newcat\">
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedCatEditDlg').addCategory()\">".
__('Create category')."</button></div>";
+ print "</div>";
+
$result = db_query($this->link, "SELECT title,id FROM ttrss_feed_categories
WHERE owner_uid = ".$_SESSION["uid"]."
ORDER BY title");
$cat_id = $line["id"];
$this_row_id = "id=\"FCATR-$cat_id\"";
- print "<tr class=\"\" $this_row_id>";
+ print "<tr class=\"placeholder\" $this_row_id>";
$edit_title = htmlspecialchars($line["title"]);
- print "<td width='5%' align='center'><input
+ print "<td width='5%' align='center'><input id=\"FCATC-$cat_id\"
onclick='toggleSelectRow2(this);' dojoType=\"dijit.form.CheckBox\"
type=\"checkbox\"></td>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"editFeedCats()\"
dojoType=\"dijit.MenuItem\">".__('Edit categories')."</div>";
+ print "<div onclick=\"toggleHiddenFeedCats()\"
+ dojoType=\"dijit.MenuItem\">".__('(Un)hide empty categories')."</div>";
print "<div onclick=\"resetCatOrder()\"
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "</div></div>";
$bm_subscribe_url = str_replace('%s', '', add_feed_url());
- $confirm_str = __('Subscribe to %s in Tiny Tiny RSS?');
+ $confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?'));
$bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}");