diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-08-20 16:05:27 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-08-20 16:05:27 -0400 |
commit | 2d42d587388aeaedf8b53b2b56b3b4ccda37af03 (patch) | |
tree | 9e2e142ecb142078587cab8d5c1b70b672cbd1f7 /include/import.php | |
parent | 80ed05d45d0e9f7f23848919a3a8af388988fdd9 (diff) | |
download | volse-hubzilla-2d42d587388aeaedf8b53b2b56b3b4ccda37af03.tar.gz volse-hubzilla-2d42d587388aeaedf8b53b2b56b3b4ccda37af03.tar.bz2 volse-hubzilla-2d42d587388aeaedf8b53b2b56b3b4ccda37af03.zip |
Layouts list and are selectable for export to the zip file
Diffstat (limited to 'include/import.php')
-rw-r--r-- | include/import.php | 48 |
1 files changed, 46 insertions, 2 deletions
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; } |