aboutsummaryrefslogtreecommitdiffstats
path: root/mod/page.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2015-04-15 11:19:25 +0200
committermrjive <mrjive@mrjive.it>2015-04-15 11:19:25 +0200
commit7b467d6ca7a27bd83388627f16df96b47963c42f (patch)
tree76c7ba2286bb8cb3c031137f394cc3bd02b84c73 /mod/page.php
parent865b602cf8b4eff5e7da00362df95e52e2fe4f77 (diff)
parent834044b15bf4cd3f436f065449cbc0ed76b4de93 (diff)
downloadvolse-hubzilla-7b467d6ca7a27bd83388627f16df96b47963c42f.tar.gz
volse-hubzilla-7b467d6ca7a27bd83388627f16df96b47963c42f.tar.bz2
volse-hubzilla-7b467d6ca7a27bd83388627f16df96b47963c42f.zip
Merge pull request #1 from redmatrix/master
2015-04-15_1
Diffstat (limited to 'mod/page.php')
-rw-r--r--mod/page.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/mod/page.php b/mod/page.php
index 05d88aa52..ad1862a7a 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -55,11 +55,12 @@ function page_init(&$a) {
$sql_options = item_permissions_sql($u[0]['channel_id']);
$r = q("select item.* from item left join item_id on item.id = item_id.iid
- where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and
- item_restrict = %d $sql_options $revision limit 1",
+ where item.uid = %d and sid = '%s' and (( service = 'WEBPAGE' and
+ item_restrict = %d ) or ( service = 'PDL' and item_restrict = %d )) $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_WEBPAGE)
+ intval(ITEM_WEBPAGE),
+ intval(ITEM_PDL)
);
if(! $r) {
@@ -83,7 +84,12 @@ function page_init(&$a) {
return;
}
- if($r[0]['layout_mid']) {
+ if($r[0]['item_restrict'] == ITEM_PDL) {
+ require_once('include/comanche.php');
+ comanche_parser(get_app(),$r[0]['body']);
+ get_app()->pdl = $r[0]['body'];
+ }
+ elseif($r[0]['layout_mid']) {
$l = q("select body from item where mid = '%s' and uid = %d limit 1",
dbesc($r[0]['layout_mid']),
intval($u[0]['channel_id'])
@@ -98,8 +104,6 @@ function page_init(&$a) {
$a->data['webpage'] = $r;
-
-
}
@@ -111,17 +115,11 @@ function page_content(&$a) {
if(! $r)
return;
- // logger('layout: ' . print_r($a->layout,true));
-
- // Use of widgets should be determined by Comanche, but we don't have it on system pages yet, so...
-
- // I recommend we now get rid of this bit - it's quite a hack to work around... - mike
-
- if ($perms['write_pages']) {
- $chan = $a->channel['channel_id'];
- $who = $channel_address;
- $which = $r[0]['id'];
- $o .= writepages_widget($who,$which);
+ if($r[0]['item_restrict'] == ITEM_PDL) {
+ $r[0]['body'] = t('Ipsum Lorem');
+ $r[0]['mimetype'] = 'text/plain';
+ $r[0]['title'] = '';
+
}
xchan_query($r);