From 2d42d587388aeaedf8b53b2b56b3b4ccda37af03 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 20 Aug 2016 16:05:27 -0400 Subject: Layouts list and are selectable for export to the zip file --- include/import.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/import.php b/include/import.php index b4d342273..a62747d9b 100644 --- a/include/import.php +++ b/include/import.php @@ -1479,6 +1479,8 @@ function get_webpage_elements($channel, $type = 'all') { return null; } switch ($type) { + case 'all': + // If all, execute all the pages, layouts, blocks case statements case 'pages': $elements['pages'] = null; $owner = $channel['channel_id']; @@ -1527,10 +1529,52 @@ function get_webpage_elements($channel, $type = 'all') { } } - break; + if($type !== 'all') { + break; + } + + case 'layouts': + $elements['layouts'] = 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 = 'PDL' and item_type = %d + $sql_extra order by item.created desc", + intval($owner), + intval(ITEM_TYPE_PDL) + ); + + $layouts = null; + + if($r) { + $elements['layouts'] = array(); + $layouts = array(); + foreach($r as $rr) { + unobscure($rr); + $elements['layouts'][] = array( + 'type' => 'layout', + 'description' => $rr['title'], // description of the layout + 'body' => $rr['body'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'name' => $rr['v'], // name of reference for the layout + 'mid' => $rr['mid'], + ); + } + + } + + if($type !== 'all') { + break; + } + default: - return null; + break; } return $elements; } -- cgit v1.2.3