aboutsummaryrefslogtreecommitdiffstats
path: root/mod/editwebpage.php
diff options
context:
space:
mode:
authorThomas Willingham <founder@kakste.com>2013-12-18 18:21:47 +0000
committerThomas Willingham <founder@kakste.com>2013-12-18 18:21:47 +0000
commit7ac00d02d110ec2f2d33779d8316e17c13cda149 (patch)
tree03b41e86e0790895fe56488beea2b5f554fbaeae /mod/editwebpage.php
parent733cb37ef14eb4dd5408e1a8c453f13cd41952eb (diff)
parentdf34aaba4733b1c38ac2b8b9c19c5a945d5a841b (diff)
downloadvolse-hubzilla-7ac00d02d110ec2f2d33779d8316e17c13cda149.tar.gz
volse-hubzilla-7ac00d02d110ec2f2d33779d8316e17c13cda149.tar.bz2
volse-hubzilla-7ac00d02d110ec2f2d33779d8316e17c13cda149.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: mod/page.php
Diffstat (limited to 'mod/editwebpage.php')
-rw-r--r--mod/editwebpage.php38
1 files changed, 32 insertions, 6 deletions
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index 5a21aa78d..85bd9e918 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -19,6 +19,8 @@ function editwebpage_content(&$a) {
$owner = intval($r[0]['channel_id']);
//logger('owner: ' . print_r($owner,true));
}
+
+ $is_owner = ((local_user() && local_user() == $owner) ? true : false);
$o = '';
@@ -52,6 +54,23 @@ function editwebpage_content(&$a) {
);
+ if($itm[0]['item_flags'] & ITEM_OBSCURED) {
+ $key = get_config('system','prvkey');
+ if($itm[0]['title'])
+ $itm[0]['title'] = crypto_unencapsulate(json_decode_plus($itm[0]['title']),$key);
+ if($itm[0]['body'])
+ $itm[0]['body'] = crypto_unencapsulate(json_decode_plus($itm[0]['body']),$key);
+ }
+
+ $item_id = q("select * from item_id where service = 'WEBPAGE' and iid = %d limit 1",
+ $itm[0]['id']
+ );
+ if($item_id)
+ $page_title = $item_id[0]['sid'];
+
+
+
+
$plaintext = true;
if(feature_enabled($itm[0]['uid'],'richtext'))
@@ -112,9 +131,14 @@ function editwebpage_content(&$a) {
//FIXME A return path with $_SESSION doesn't always work for observer - it may WSoD instead of loading a sensible page. So, send folk to the webpage list.
$rp = '/webpages/' . $which;
+ $lockstate =
$o .= replace_macros($tpl,array(
'$return_path' => $rp,
+ '$webpage' => true,
+ '$placeholdpagetitle' => t('Page link title'),
+ '$pagetitle' => $page_title,
+
'$action' => 'item',
'$share' => t('Edit'),
'$upload' => t('Upload photo'),
@@ -131,20 +155,22 @@ function editwebpage_content(&$a) {
'$content' => undo_post_tagging($itm[0]['body']),
'$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(),
- '$defloc' => $channel['channel_location'],
- '$visitor' => 'none',
- '$pvisit' => 'none',
+ '$defloc' => $itm[0]['location'],
+ '$visitor' => ($is_owner) ? 'block' : 'none',
+ '$acl' => populate_acl($itm[0]),
+ '$showacl' => true,
+ '$pvisit' => ($is_owner) ? 'block' : 'none',
'$public' => t('Public post'),
'$jotnets' => $jotnets,
'$mimeselect' => $mimeselect,
'$layoutselect' => $layoutselect,
- '$title' => htmlspecialchars($itm[0]['title']),
+ '$title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
'$placeholdertitle' => t('Set title'),
'$category' => '',
'$placeholdercategory' => t('Categories (comma-separated list)'),
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
- '$lockstate' => $lockstate,
- '$acl' => '',
+ 'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'),
+ '$acl' => populate_acl($itm[0]),
'$bang' => '',
'$profile_uid' => (intval($owner)),
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),