aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-01 18:36:14 -0700
committerfriendica <info@friendica.com>2013-09-01 18:36:14 -0700
commita1906482dc3323f747744a1447aace78b494ddbd (patch)
tree4107ae9d3ef0f99ea2a0b3dc3a54e3c9ae2d672a
parentcbab62c95efdd3ab306736a430698313b6b2a320 (diff)
downloadvolse-hubzilla-a1906482dc3323f747744a1447aace78b494ddbd.tar.gz
volse-hubzilla-a1906482dc3323f747744a1447aace78b494ddbd.tar.bz2
volse-hubzilla-a1906482dc3323f747744a1447aace78b494ddbd.zip
rework the pdl_selector a bit since we've slightly changed the way layouts are stored.
-rw-r--r--include/comanche.php12
-rw-r--r--mod/page.php13
2 files changed, 16 insertions, 9 deletions
diff --git a/include/comanche.php b/include/comanche.php
index cf7ecd7c5..bdce0c5e2 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -17,16 +17,10 @@ function pdl_selector($uid,$current="") {
$o = '';
- // You can use anybody's Comanche layouts on this site that haven't been protected in some way
-
$sql_extra = item_permissions_sql($uid);
- // By default order by title (therefore at this time pdl's need a unique title across this system),
- // though future work may allow categorisation
- // based on taxonomy terms
-
- $r = q("select title, mid from item where (item_restrict & %d) $sql_extra order by title",
- intval(ITEM_PDL)
+ $r = q("select item_id.*, mid from item_id left join item on iid = item.id where item_id.uid = %d and item_id.uid = item.uid and service = 'PDL' order by sid asc",
+ intval($owner)
);
$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);
@@ -39,7 +33,7 @@ function pdl_selector($uid,$current="") {
$entries[] = array('title' => t('Default'), 'mid' => '');
foreach($entries as $selection) {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
- $o .= "<option value=\"{$selection['mid']}\" $selected >{$selection['title']}</option>";
+ $o .= "<option value=\"{$selection['mid']}\" $selected >{$selection['sid']}</option>";
}
$o .= '</select>';
diff --git a/mod/page.php b/mod/page.php
index c63932b5e..b227227bb 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -61,6 +61,19 @@ function page_content(&$a) {
return;
}
+ if($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'])
+ );
+
+ if($l) {
+ require_once('include/comanche.php');
+ comanche_parser(get_app(),$l[0]['body']);
+ }
+ }
+
+
// Use of widgets should be determined by Comanche, but we don't have it yet, so...
if ($perms['write_pages']) {