Pages populate the available-to-export list. New checkbox class for smaller boxes.

This commit is contained in:
Andrew Manning
2016-08-19 19:32:52 -04:00
parent f2e87a204d
commit 40a7d38210
4 changed files with 182 additions and 10 deletions

View File

@@ -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';
}