add date suffixes to opml & import_export generated files
This commit is contained in:
parent
73963a21b2
commit
77e8100669
2 changed files with 7 additions and 3 deletions
|
@ -1461,8 +1461,10 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<hr>";
|
print "<hr>";
|
||||||
|
|
||||||
|
$opml_export_filename = "TinyTinyRSS_".date("Y-m-d").".opml";
|
||||||
|
|
||||||
print "<p>" . __('Filename:') .
|
print "<p>" . __('Filename:') .
|
||||||
" <input type=\"text\" id=\"filename\" value=\"TinyTinyRSS.opml\" /> " .
|
" <input type=\"text\" id=\"filename\" value=\"$opml_export_filename\" /> " .
|
||||||
__('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>";
|
__('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>";
|
||||||
|
|
||||||
print "</p><button dojoType=\"dijit.form.Button\"
|
print "</p><button dojoType=\"dijit.form.Button\"
|
||||||
|
|
|
@ -106,11 +106,13 @@ class Import_Export extends Plugin implements IHandler {
|
||||||
if (file_exists($exportname)) {
|
if (file_exists($exportname)) {
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
|
|
||||||
|
$timestamp_suffix = date("Y-m-d", filemtime($exportname));
|
||||||
|
|
||||||
if (function_exists('gzencode')) {
|
if (function_exists('gzencode')) {
|
||||||
header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz");
|
header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml.gz");
|
||||||
echo gzencode(file_get_contents($exportname));
|
echo gzencode(file_get_contents($exportname));
|
||||||
} else {
|
} else {
|
||||||
header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml");
|
header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml");
|
||||||
echo file_get_contents($exportname);
|
echo file_get_contents($exportname);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue