mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-27 03:11:28 +00:00
rpc/updateFeedBrowser: use JSON
This commit is contained in:
@@ -551,25 +551,18 @@
|
||||
}
|
||||
|
||||
if ($subop == "updateFeedBrowser") {
|
||||
header("Content-Type: text/plain");
|
||||
|
||||
$search = db_escape_string($_REQUEST["search"]);
|
||||
$limit = db_escape_string($_REQUEST["limit"]);
|
||||
$mode = db_escape_string($_REQUEST["mode"]);
|
||||
|
||||
print "<rpc-reply>";
|
||||
print "<content>";
|
||||
print "<![CDATA[";
|
||||
$ctr = print_feed_browser($link, $search, $limit, $mode);
|
||||
print "]]>";
|
||||
print "</content>";
|
||||
print "<num-results value=\"$ctr\"/>";
|
||||
print "<mode value=\"$mode\"/>";
|
||||
print "</rpc-reply>";
|
||||
$mode = (int) db_escape_string($_REQUEST["mode"]);
|
||||
|
||||
print json_encode(array("content" =>
|
||||
make_feed_browser($link, $search, $limit, $mode),
|
||||
"mode" => $mode));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($subop == "massSubscribe") {
|
||||
|
||||
$ids = split(",", db_escape_string($_REQUEST["ids"]));
|
||||
@@ -611,12 +604,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
$num_feeds = count($subscribed);
|
||||
|
||||
print "<rpc-reply>";
|
||||
print "<num-feeds value='$num_feeds'/>";
|
||||
print "</rpc-reply>";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
$owner_uid = $_SESSION["uid"];
|
||||
|
||||
print "<ul class='browseFeedList' id='browseFeedList'>";
|
||||
print_feed_browser($link, $search, 25);
|
||||
print make_feed_browser($link, $search, 25);
|
||||
print "</ul>";
|
||||
|
||||
print "<div align='center'>
|
||||
|
||||
@@ -1362,9 +1362,10 @@
|
||||
|
||||
}
|
||||
|
||||
function print_feed_browser($link, $search, $limit, $mode = 1) {
|
||||
function make_feed_browser($link, $search, $limit, $mode = 1) {
|
||||
|
||||
$owner_uid = $_SESSION["uid"];
|
||||
$owner_uid = $_SESSION["uid"];
|
||||
$rv = '';
|
||||
|
||||
if ($search) {
|
||||
$search_qpart = "AND (UPPER(feed_url) LIKE UPPER('%$search%') OR
|
||||
@@ -1436,7 +1437,7 @@
|
||||
style='border-width : 0px; vertical-align : middle'
|
||||
src='images/feed-icon-12x12.png'></a>";
|
||||
|
||||
print "<li title=\"".htmlspecialchars($details["site_url"])."\"
|
||||
$rv .= "<li title=\"".htmlspecialchars($details["site_url"])."\"
|
||||
id=\"FBROW-".$details["id"]."\">$check_box".
|
||||
"$feed_icon $feed_url " . htmlspecialchars($details["title"]) .
|
||||
" <span class='subscribers'>($subscribers)</span>
|
||||
@@ -1479,7 +1480,7 @@
|
||||
style='border-width : 0px; vertical-align : middle'
|
||||
src='images/feed-icon-12x12.png'></a>";
|
||||
|
||||
print "<li title='".$line['site_url']."' class='$class'
|
||||
$rv .= "<li title='".$line['site_url']."' class='$class'
|
||||
id=\"FBROW-".$line["id"]."\">".
|
||||
$check_box . "$feed_icon $feed_url " . $title .
|
||||
$archived . $site_url . "</li>";
|
||||
@@ -1491,10 +1492,10 @@
|
||||
}
|
||||
|
||||
if ($feedctr == 0) {
|
||||
print "<li style=\"text-align : center\"><p>".__('No feeds found.')."</p></li>";
|
||||
$rv .= "<li style=\"text-align : center\"><p>".__('No feeds found.')."</p></li>";
|
||||
}
|
||||
|
||||
return $feedctr;
|
||||
return $rv;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user