diff options
author | friendica <info@friendica.com> | 2013-11-14 14:19:20 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-11-14 14:19:20 -0800 |
commit | 49a392942cbea18432c44f227804e3cc8f5d79b0 (patch) | |
tree | b1bbdec9031d2e60fab9d1d129105779b1273e59 /mod/webpages.php | |
parent | ee629534d5245443152797bae81768680b5dda85 (diff) | |
download | volse-hubzilla-49a392942cbea18432c44f227804e3cc8f5d79b0.tar.gz volse-hubzilla-49a392942cbea18432c44f227804e3cc8f5d79b0.tar.bz2 volse-hubzilla-49a392942cbea18432c44f227804e3cc8f5d79b0.zip |
acl in webpages and a couple of other little bits related to webpages - sort the list of pages by last edited and use prepare_body() so we get private stuff (and attachments, categories, etc.) formatted correctly
Diffstat (limited to 'mod/webpages.php')
-rw-r--r-- | mod/webpages.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/mod/webpages.php b/mod/webpages.php index 2c5728531..5257bc91d 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -57,13 +57,16 @@ function webpages_content(&$a) { // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages // Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. -require_once ('include/conversation.php'); + require_once ('include/conversation.php'); + require_once('include/acl_selectors.php'); + $x = array( 'webpage' => ITEM_WEBPAGE, 'is_owner' => true, 'nickname' => $a->profile['channel_address'], 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => (($group || $cid) ? '!' : ''), + 'acl' => ((local_user() && local_user() == $owner) ? populate_acl($a->get_channel()) : ''), 'visitor' => 'block', 'profile_uid' => intval($owner), 'mimetype' => $mimetype, @@ -76,18 +79,18 @@ require_once ('include/conversation.php'); //Get a list of webpages. 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 = 'WEBPAGE' order by sid asc", - intval($owner) -); + $r = q("select item_id.* from item_id left join item on item_id.iid = item.id where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc", + intval($owner) + ); - $pages = null; + $pages = null; - if($r) { - $pages = array(); - foreach($r as $rr) { - $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']); - } - } + if($r) { + $pages = array(); + foreach($r as $rr) { + $pages[$rr['iid']][] = array('url' => $rr['iid'],'title' => $rr['sid']); + } + } //Build the base URL for edit links |