From f2e87a204d0a257edb501dfedaad867700c58842 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Wed, 17 Aug 2016 21:25:50 -0400 Subject: Progress implementing zip file export --- Zotlabs/Module/Webpages.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Webpages.php') diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 0a48d43c6..439d60a89 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -62,6 +62,16 @@ class Webpages extends \Zotlabs\Web\Controller { case 'importselected': $_SESSION['action'] = null; break; + case 'export_select_list': + $_SESSION['action'] = null; + $o .= replace_macros(get_markup_template('webpage_export_list.tpl'), array( + '$title' => t('Export Webpage Elements'), + '$exportbtn' => t('Export selected'), + '$action' => $_SESSION['export'], // value should be 'zipfile' or 'cloud' + )); + $_SESSION['export'] = null; + return $o; + default : $_SESSION['action'] = null; break; @@ -233,7 +243,7 @@ class Webpages extends \Zotlabs\Web\Controller { } function post() { - + logger(json_encode($_REQUEST), LOGGER_DEBUG); $action = $_REQUEST['action']; if( $action ){ switch ($action) { @@ -382,7 +392,19 @@ class Webpages extends \Zotlabs\Web\Controller { info( t('Import complete.') . EOL); } break; - + + case 'exportzipfile': + + if(isset($_POST['w_download'])) { + logger($_POST['w_download'], LOGGER_DEBUG); + $_SESSION['action'] = 'export_select_list'; + $_SESSION['export'] = 'zipfile'; + if(isset($_POST['filename'])) { + $filename = filter_var($_POST['filename'], 'FILTER_SANITIZE_ENCODED'); + } else { + $filename = 'website.zip'; + } + } default : break; } -- cgit v1.2.3