aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-08-19 19:32:52 -0400
committerAndrew Manning <tamanning@zoho.com>2016-08-19 19:32:52 -0400
commit40a7d3821098c095a01e2a30b2b49c53bb38e2cf (patch)
treed5b9ba8b822752911b5a325a68b9fb8f1edf3dae /include/import.php
parentf2e87a204d0a257edb501dfedaad867700c58842 (diff)
downloadvolse-hubzilla-40a7d3821098c095a01e2a30b2b49c53bb38e2cf.tar.gz
volse-hubzilla-40a7d3821098c095a01e2a30b2b49c53bb38e2cf.tar.bz2
volse-hubzilla-40a7d3821098c095a01e2a30b2b49c53bb38e2cf.zip
Pages populate the available-to-export list. New checkbox class for smaller boxes.
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/import.php b/include/import.php
index 84881a420..f7df636f3 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1472,3 +1472,65 @@ function scan_webpage_elements($path, $type, $cloud = false) {
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;
+} \ No newline at end of file