aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Webpages.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Webpages.php')
-rw-r--r--Zotlabs/Module/Webpages.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php
index 439d60a89..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();
@@ -64,10 +63,19 @@ class Webpages extends \Zotlabs\Web\Controller {
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;
@@ -243,7 +251,6 @@ class Webpages extends \Zotlabs\Web\Controller {
}
function post() {
- logger(json_encode($_REQUEST), LOGGER_DEBUG);
$action = $_REQUEST['action'];
if( $action ){
switch ($action) {
@@ -396,11 +403,10 @@ class Webpages extends \Zotlabs\Web\Controller {
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');
+ $filename = filter_var($_POST['filename'], FILTER_SANITIZE_ENCODED);
} else {
$filename = 'website.zip';
}