summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-03 15:28:37 +0300
committerAndrew Dolgov <[email protected]>2009-02-03 15:28:37 +0300
commit87b16a0a6156e90f549f13f59e657ff03a33a7e4 (patch)
tree3a6cef1229645b9a24b6a4e72ba2b63f7934581a /modules
parentd92d7f02ada5a6f7fbc39ae0de6811624724da29 (diff)
add dialog to download articles for offline reading; start implementation
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php28
-rw-r--r--modules/popup-dialog.php39
2 files changed, 67 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 04e2858ca..55ab73a20 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -514,6 +514,34 @@
return;
}
+ if ($subop == "download") {
+ $stage = (int) $_REQUEST["stage"];
+
+ print "<rpc-reply>";
+
+ if ($stage == 0) {
+ print "<feeds>";
+
+ $reply = array();
+
+ $result = db_query($link, "SELECT id, title FROM
+ ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]);
+
+ while ($line = db_fetch_assoc($result)) {
+ print "<feed id=\"".$line["id"]."\"><![CDATA[";
+ print $line["title"];
+ print "]]></feed>";
+ }
+
+ print "</feeds>";
+
+ }
+
+ print "</rpc-reply>";
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php
index 465d3bcd9..d89547fe9 100644
--- a/modules/popup-dialog.php
+++ b/modules/popup-dialog.php
@@ -461,6 +461,45 @@
return;
}
+ if ($id == "offlineDownload") {
+ print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>";
+ print "<div class=\"infoBoxContents\">";
+
+ print "<form name='download_ops_form' id='download_ops_form'>";
+
+ print "<div class=\"dlgSec\">".__("Download")."</div>";
+
+ print "<div class=\"dlgSecCont\">";
+
+ $amount = array(
+ 50 => 50,
+ 100 => 100,
+ 0 => "All unread");
+
+ print_select_hash("amount", 50, $amount);
+
+ print " " . __("newest articles for offline reading.");
+
+ print "</div>";
+
+ print "</form>";
+
+ print "<div class=\"dlgButtons\">
+ <div id=\"d_progress_o\" style=\"display : none\">
+ <div id=\"d_progress_i\"></div>
+ </div>
+ <input class=\"button\"
+ type=\"submit\" onclick=\"return initiate_offline_download()\" value=\"".__('Download')."\">
+ <input class=\"button\"
+ type=\"submit\" onclick=\"return closeInfoBox()\"
+ value=\"".__('Cancel')."\"></div>";
+
+ print "</div>";
+
+ return;
+ }
+
+
print "<div id='infoBoxTitle'>Internal Error</div>
<div id='infoBoxContents'>
<p>Unknown dialog <b>$id</b></p>