Pages populate the available-to-export list. New checkbox class for smaller boxes.
This commit is contained in:
parent
f2e87a204d
commit
40a7d38210
@ -41,7 +41,6 @@ class Webpages extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
$owner = 0;
|
$owner = 0;
|
||||||
$channel = null;
|
|
||||||
$observer = \App::get_observer();
|
$observer = \App::get_observer();
|
||||||
|
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
@ -64,10 +63,19 @@ class Webpages extends \Zotlabs\Web\Controller {
|
|||||||
break;
|
break;
|
||||||
case 'export_select_list':
|
case 'export_select_list':
|
||||||
$_SESSION['action'] = null;
|
$_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(
|
$o .= replace_macros(get_markup_template('webpage_export_list.tpl'), array(
|
||||||
'$title' => t('Export Webpage Elements'),
|
'$title' => t('Export Webpage Elements'),
|
||||||
'$exportbtn' => t('Export selected'),
|
'$exportbtn' => t('Export selected'),
|
||||||
'$action' => $_SESSION['export'], // value should be 'zipfile' or 'cloud'
|
'$action' => $_SESSION['export'], // value should be 'zipfile' or 'cloud'
|
||||||
|
'$pages' => $elements['pages'],
|
||||||
));
|
));
|
||||||
$_SESSION['export'] = null;
|
$_SESSION['export'] = null;
|
||||||
return $o;
|
return $o;
|
||||||
@ -243,7 +251,6 @@ class Webpages extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
logger(json_encode($_REQUEST), LOGGER_DEBUG);
|
|
||||||
$action = $_REQUEST['action'];
|
$action = $_REQUEST['action'];
|
||||||
if( $action ){
|
if( $action ){
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
@ -396,11 +403,10 @@ class Webpages extends \Zotlabs\Web\Controller {
|
|||||||
case 'exportzipfile':
|
case 'exportzipfile':
|
||||||
|
|
||||||
if(isset($_POST['w_download'])) {
|
if(isset($_POST['w_download'])) {
|
||||||
logger($_POST['w_download'], LOGGER_DEBUG);
|
|
||||||
$_SESSION['action'] = 'export_select_list';
|
$_SESSION['action'] = 'export_select_list';
|
||||||
$_SESSION['export'] = 'zipfile';
|
$_SESSION['export'] = 'zipfile';
|
||||||
if(isset($_POST['filename'])) {
|
if(isset($_POST['filename'])) {
|
||||||
$filename = filter_var($_POST['filename'], 'FILTER_SANITIZE_ENCODED');
|
$filename = filter_var($_POST['filename'], FILTER_SANITIZE_ENCODED);
|
||||||
} else {
|
} else {
|
||||||
$filename = 'website.zip';
|
$filename = 'website.zip';
|
||||||
}
|
}
|
||||||
|
@ -1472,3 +1472,65 @@ function scan_webpage_elements($path, $type, $cloud = false) {
|
|||||||
return $element;
|
return $element;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_webpage_elements($channel, $type = 'all') {
|
||||||
|
$elements = array();
|
||||||
|
if(!$channel['channel_id']) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
switch ($type) {
|
||||||
|
case 'pages':
|
||||||
|
$elements['pages'] = null;
|
||||||
|
$owner = $channel['channel_id'];
|
||||||
|
|
||||||
|
$sql_extra = item_permissions_sql($owner);
|
||||||
|
|
||||||
|
|
||||||
|
$r = q("select * from iconfig left join item on iconfig.iid = item.id
|
||||||
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d
|
||||||
|
$sql_extra order by item.created desc",
|
||||||
|
intval($owner),
|
||||||
|
intval(ITEM_TYPE_WEBPAGE)
|
||||||
|
);
|
||||||
|
|
||||||
|
$pages = null;
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$elements['pages'] = array();
|
||||||
|
$pages = array();
|
||||||
|
foreach($r as $rr) {
|
||||||
|
unobscure($rr);
|
||||||
|
|
||||||
|
//$lockstate = (($rr['allow_cid'] || $rr['allow_gid'] || $rr['deny_cid'] || $rr['deny_gid']) ? 'lock' : 'unlock');
|
||||||
|
|
||||||
|
$element_arr = array(
|
||||||
|
'type' => 'webpage',
|
||||||
|
'title' => $rr['title'],
|
||||||
|
'body' => $rr['body'],
|
||||||
|
'created' => $rr['created'],
|
||||||
|
'edited' => $rr['edited'],
|
||||||
|
'mimetype' => $rr['mimetype'],
|
||||||
|
'pagetitle' => $rr['v'],
|
||||||
|
'mid' => $rr['mid'],
|
||||||
|
'layout_mid' => $rr['layout_mid']
|
||||||
|
);
|
||||||
|
$pages[$rr['iid']][] = array(
|
||||||
|
'url' => $rr['iid'],
|
||||||
|
'pagetitle' => $rr['v'],
|
||||||
|
'title' => $rr['title'],
|
||||||
|
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
|
||||||
|
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
|
||||||
|
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]',
|
||||||
|
//'lockstate' => $lockstate
|
||||||
|
);
|
||||||
|
$elements['pages'][] = $element_arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $elements;
|
||||||
|
}
|
@ -119,3 +119,77 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* SQUARED THREE */
|
||||||
|
.squaredThree {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
background: #fcfff4;
|
||||||
|
|
||||||
|
background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
|
||||||
|
background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
|
||||||
|
background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
|
||||||
|
background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
|
||||||
|
background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 );
|
||||||
|
margin: 5px auto;
|
||||||
|
|
||||||
|
-webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
|
||||||
|
-moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
|
||||||
|
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.squaredThree label {
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
left: 2px;
|
||||||
|
top: 2px;
|
||||||
|
|
||||||
|
-webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
|
||||||
|
-moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
|
||||||
|
box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
|
||||||
|
|
||||||
|
background: -webkit-linear-gradient(top, #222 0%, #45484d 100%);
|
||||||
|
background: -moz-linear-gradient(top, #222 0%, #45484d 100%);
|
||||||
|
background: -o-linear-gradient(top, #222 0%, #45484d 100%);
|
||||||
|
background: -ms-linear-gradient(top, #222 0%, #45484d 100%);
|
||||||
|
background: linear-gradient(top, #222 0%, #45484d 100%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d',GradientType=0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
.squaredThree label:after {
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
opacity: 0;
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 9px;
|
||||||
|
height: 5px;
|
||||||
|
background: transparent;
|
||||||
|
top: 2px;
|
||||||
|
left: 2px;
|
||||||
|
border: 3px solid #fcfff4;
|
||||||
|
border-top: none;
|
||||||
|
border-right: none;
|
||||||
|
|
||||||
|
-webkit-transform: rotate(-45deg);
|
||||||
|
-moz-transform: rotate(-45deg);
|
||||||
|
-o-transform: rotate(-45deg);
|
||||||
|
-ms-transform: rotate(-45deg);
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.squaredThree label:hover::after {
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
|
||||||
|
filter: alpha(opacity=30);
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.squaredThree input[type=checkbox]:checked + label:after {
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||||
|
filter: alpha(opacity=100);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
@ -9,13 +9,43 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="import-website-content-wrapper" class="section-content-wrapper">
|
<div id="import-website-content-wrapper" class="section-content-wrapper">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<button id="toggle-select-all" class="btn btn-xs btn-primary" onclick="checkedAll(window.isChecked); return false;"><i class="fa fa-check"></i> Toggle Select All</button>
|
<button id="toggle-select-all" class="btn btn-xs btn-primary" onclick="checkedAll(window.isChecked); return false;"><i class="fa fa-check"></i> Toggle Select All</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
<h4>Pages</h4>
|
||||||
|
<div>
|
||||||
|
<table class="table-striped table-responsive table-hover" style="width: 100%;">
|
||||||
|
<tr><td>Export?</td><td>Page Title</td><td>Page Link</td><td>Type</td></tr>
|
||||||
|
{{foreach $pages as $page}}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class='squaredThree'>
|
||||||
|
<input type="checkbox" id="page_{{$page.mid}}" name="page[]" value="{{$page.mid}}">
|
||||||
|
<label for="page_{{$page.mid}}"></label>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class='desc'>
|
||||||
|
{{$page.title}}<br>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class='desc'>
|
||||||
|
{{$page.pagetitle}}<br>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class='desc'>
|
||||||
|
{{$page.mimetype}}<br>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/foreach}}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user