aboutsummaryrefslogtreecommitdiffstats
path: root/mod/layouts.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-03-04 14:52:12 +0100
committermarijus <mario@mariovavti.com>2014-03-04 14:52:12 +0100
commitffb791968e48b5699dc99fffccc562f198f86c5d (patch)
tree4b53eeae5f9236f76f6ba4baee00b0a08adafe50 /mod/layouts.php
parent636a52d001be9bce66f5b2fd7313ffa6540a97e4 (diff)
parent5b33d98f0814a2fcb23ad78d2442ebecc85d4fb5 (diff)
downloadvolse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.tar.gz
volse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.tar.bz2
volse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod/layouts.php')
-rw-r--r--mod/layouts.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/mod/layouts.php b/mod/layouts.php
index cbbef4fea..0dcaba361 100644
--- a/mod/layouts.php
+++ b/mod/layouts.php
@@ -40,6 +40,20 @@ function layouts_content(&$a) {
return;
}
+ if((argc() > 3) && (argv(2) === 'share') && (argv(3))) {
+ $r = q("select sid, service, mimetype, title, body from item_id left join item on item.id = item_id.iid where item_id.uid = %d and item.mid = '%s' and service = 'PDL' order by sid asc",
+ intval($owner),
+ dbesc(argv(3))
+ );
+ if($r) {
+ header('Content-type: application/x-redmatrix-layout');
+ header('Content-disposition: attachment; filename="' . $r[0]['sid'] . '.pdl"');
+ echo json_encode($r);
+ killme();
+
+ }
+ }
+
$tabs = array(
array(
'label' => t('Layout Help'),
@@ -75,7 +89,7 @@ function layouts_content(&$a) {
// Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link.
// TODO - this should be replaced with pagelist_widget
- $r = q("select * from item_id where uid = %d and service = 'PDL' order by sid asc",
+ $r = q("select iid, sid, mid from item_id left join item on item.id = item_id.iid where item_id.uid = %d and service = 'PDL' order by sid asc",
intval($owner)
);
@@ -84,7 +98,7 @@ function layouts_content(&$a) {
if($r) {
$pages = array();
foreach($r as $rr) {
- $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']);
+ $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid'], 'mid' => $rr['mid']);
}
}
@@ -92,9 +106,10 @@ function layouts_content(&$a) {
//Build the base URL for edit links
$url = z_root() . "/editlayout/" . $which;
- return $o . replace_macros(get_markup_template("webpagelist.tpl"), array(
+ return $o . replace_macros(get_markup_template("layoutlist.tpl"), array(
'$baseurl' => $url,
'$edit' => t('Edit'),
+ '$share' => t('Share'),
'$pages' => $pages,
'$channel' => $which,
'$view' => t('View'),