diff options
author | Andrew Dolgov <[email protected]> | 2011-07-30 23:38:03 -0700 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-07-30 23:38:03 -0700 |
commit | 01664ee728bf99bbcddf51939b4914b29d6f47ae (patch) | |
tree | e376cbb0edf08499f7ff62c5f9355d98d9bc0c59 /opml.php | |
parent | e78477b4e213e31cd19f483039f3af182e9f1cef (diff) | |
parent | 08ae2a5ba6b69b574c891a7fb3f88cab5d55b66f (diff) |
Merge pull request #10 from meyercr/master
Extend OPML preferences pane, to provide more control of Export OPML
Diffstat (limited to 'opml.php')
-rw-r--r-- | opml.php | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -10,12 +10,14 @@ init_connection($link); - function opml_export($link, $owner_uid, $hide_private_feeds=false, $include_settings=true) { + function opml_export($link, $name, $owner_uid, $hide_private_feeds=false, $include_settings=true) { if (!$_REQUEST["debug"]) { header("Content-type: application/xml+opml"); } else { header("Content-type: text/xml"); } + header("Content-Disposition: attachment; filename=" . $name ); + print "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; print "<opml version=\"1.0\">"; @@ -119,14 +121,18 @@ // FIXME there are some brackets issues here $op = $_REQUEST["op"]; + if (!$op) $op = "Export"; + + $output_name = $_REQUEST["filename"]; + if (!$output_name) $output_name = "TinyTinyRSS.opml"; - if (!$op) $op = "Export"; + $show_settings = $_REQUEST["settings"]; if ($op == "Export") { login_sequence($link); $owner_uid = $_SESSION["uid"]; - return opml_export($link, $owner_uid); + return opml_export($link, $output_name, $owner_uid, false, ($show_settings == 1)); } if ($op == "publish"){ @@ -138,7 +144,7 @@ if (db_num_rows($result) == 1) { $owner_uid = db_fetch_result($result, 0, "owner_uid"); - return opml_export($link, $owner_uid, true, false); + return opml_export($link, "", $owner_uid, true, false); } else { print "<error>User not found</error>"; } |