diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Webpages.php | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 0a48d43c6..b927f95df 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -41,7 +41,6 @@ class Webpages extends \Zotlabs\Web\Controller { $uid = local_channel(); $owner = 0; - $channel = null; $observer = \App::get_observer(); $channel = \App::get_channel(); @@ -62,6 +61,25 @@ class Webpages extends \Zotlabs\Web\Controller { case 'importselected': $_SESSION['action'] = null; break; + case 'export_select_list': + $_SESSION['action'] = null; + if(!$uid) { + $_SESSION['export'] = null; + break; + } + require_once('include/import.php'); + + $elements = get_webpage_elements($channel, 'pages'); + logger(json_encode($elements), LOGGER_DEBUG); + $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' + '$pages' => $elements['pages'], + )); + $_SESSION['export'] = null; + return $o; + default : $_SESSION['action'] = null; break; @@ -233,7 +251,6 @@ class Webpages extends \Zotlabs\Web\Controller { } function post() { - $action = $_REQUEST['action']; if( $action ){ switch ($action) { @@ -382,7 +399,18 @@ class Webpages extends \Zotlabs\Web\Controller { info( t('Import complete.') . EOL); } break; - + + case 'exportzipfile': + + if(isset($_POST['w_download'])) { + $_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; } |