From 08ae2a5ba6b69b574c891a7fb3f88cab5d55b66f Mon Sep 17 00:00:00 2001 From: Craig Meyer Date: Sat, 30 Jul 2011 22:34:22 -0400 Subject: Extend OPML preferences pane, to provide more control of Export OPML User is prompted for filename, and also whether to include settings. Default filename is: TinyTinyRSS.opml modules/pref-feeds.php Prompt for output OPML filename (Default: TinyTinyRSS.opml ) opml.php Modify to support passing in name=&settings=[0|1] functions.js Modify to support passing in name=&settings=[0|1] --- opml.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'opml.php') diff --git a/opml.php b/opml.php index 2e1eb84c6..991f93e0c 100644 --- a/opml.php +++ b/opml.php @@ -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 ""; print ""; @@ -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 "User not found"; } -- cgit v1.2.3