mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 05:46:00 +00:00
sortable feed editor
This commit is contained in:
38
backend.php
38
backend.php
@@ -1116,28 +1116,52 @@
|
|||||||
type=\"submit\" class=\"button\"
|
type=\"submit\" class=\"button\"
|
||||||
onclick=\"javascript:addFeed()\" value=\"Add feed\"></div>";
|
onclick=\"javascript:addFeed()\" value=\"Add feed\"></div>";
|
||||||
|
|
||||||
|
$feeds_sort = db_escape_string($_GET["sort"]);
|
||||||
|
|
||||||
|
if (!$feeds_sort || $feeds_sort == "undefined") {
|
||||||
|
$feeds_sort = $_SESSION["pref_sort_feeds"];
|
||||||
|
if (!$feeds_sort) $feeds_sort = "title";
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION["pref_sort_feeds"] = $feeds_sort;
|
||||||
|
|
||||||
$result = db_query($link, "SELECT
|
$result = db_query($link, "SELECT
|
||||||
id,title,feed_url,substring(last_updated,1,16) as last_updated,
|
id,title,feed_url,substring(last_updated,1,16) as last_updated,
|
||||||
update_interval,purge_interval,
|
update_interval,purge_interval,
|
||||||
(SELECT title FROM ttrss_feed_categories
|
(SELECT title FROM ttrss_feed_categories
|
||||||
WHERE id = cat_id) AS category
|
WHERE id = cat_id) AS category
|
||||||
FROM
|
FROM
|
||||||
ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' ORDER by title");
|
ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."'
|
||||||
|
ORDER by $feeds_sort,title");
|
||||||
|
|
||||||
print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
|
||||||
|
|
||||||
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
|
print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
|
||||||
print "<tr class=\"title\">
|
print "<tr class=\"title\">
|
||||||
<td> </td><td>Select</td><td width=\"20%\">Title</td>
|
<td> </td>
|
||||||
<td width=\"20%\">Link</td>";
|
<td>Select</td>
|
||||||
|
<td width=\"20%\">
|
||||||
|
<a href=\"javascript:updateFeedList('title')\">Title</a></td>
|
||||||
|
<td width=\"20%\">
|
||||||
|
<a href=\"javascript:updateFeedList('feed_url')\">Link</a>
|
||||||
|
</td>";
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||||
print "<td width=\"10%\">Category</td>";
|
print "<td width=\"10%\">
|
||||||
|
<a href=\"javascript:updateFeedList('category')\">Category</a></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<td width=\"10%\">Update Interval</td>
|
print "
|
||||||
<td width=\"10%\">Purge Days</td>
|
<td width=\"10%\">
|
||||||
<td>Last updated</td></tr>";
|
<a href=\"javascript:updateFeedList('update_interval')\">Update Interval</a>
|
||||||
|
</td>
|
||||||
|
<td width=\"10%\">
|
||||||
|
<a href=\"javascript:updateFeedList('purge_interval')\">Purge Days</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=\"javascript:updateFeedList('last_updated')\">Last updated</a>
|
||||||
|
</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
$lnum = 0;
|
$lnum = 0;
|
||||||
|
|
||||||
|
|||||||
6
prefs.js
6
prefs.js
@@ -165,8 +165,7 @@ function notify_callback() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateFeedList(sort_key) {
|
||||||
function updateFeedList() {
|
|
||||||
|
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
if (!xmlhttp_ready(xmlhttp)) {
|
||||||
printLockingError();
|
printLockingError();
|
||||||
@@ -177,7 +176,8 @@ function updateFeedList() {
|
|||||||
|
|
||||||
p_notify("Loading, please wait...");
|
p_notify("Loading, please wait...");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
|
xmlhttp.open("GET", "backend.php?op=pref-feeds" +
|
||||||
|
"&sort=" + param_escape(sort_key), true);
|
||||||
xmlhttp.onreadystatechange=feedlist_callback;
|
xmlhttp.onreadystatechange=feedlist_callback;
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user