improve editing ability of webpages - acls, photos, location, page link title, etc.
This commit is contained in:
parent
f2d8127012
commit
48c650c715
@ -20,6 +20,8 @@ function editwebpage_content(&$a) {
|
|||||||
//logger('owner: ' . print_r($owner,true));
|
//logger('owner: ' . print_r($owner,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$is_owner = ((local_user() && local_user() == $owner) ? true : false);
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
// Figure out which post we're editing
|
// Figure out which post we're editing
|
||||||
@ -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;
|
$plaintext = true;
|
||||||
|
|
||||||
if(feature_enabled($itm[0]['uid'],'richtext'))
|
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.
|
//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;
|
$rp = '/webpages/' . $which;
|
||||||
|
$lockstate =
|
||||||
|
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'$return_path' => $rp,
|
'$return_path' => $rp,
|
||||||
|
'$webpage' => true,
|
||||||
|
'$placeholdpagetitle' => t('Page link title'),
|
||||||
|
'$pagetitle' => $page_title,
|
||||||
|
|
||||||
'$action' => 'item',
|
'$action' => 'item',
|
||||||
'$share' => t('Edit'),
|
'$share' => t('Edit'),
|
||||||
'$upload' => t('Upload photo'),
|
'$upload' => t('Upload photo'),
|
||||||
@ -131,9 +155,11 @@ function editwebpage_content(&$a) {
|
|||||||
'$content' => undo_post_tagging($itm[0]['body']),
|
'$content' => undo_post_tagging($itm[0]['body']),
|
||||||
'$post_id' => $post_id,
|
'$post_id' => $post_id,
|
||||||
'$baseurl' => $a->get_baseurl(),
|
'$baseurl' => $a->get_baseurl(),
|
||||||
'$defloc' => $channel['channel_location'],
|
'$defloc' => $itm[0]['location'],
|
||||||
'$visitor' => 'none',
|
'$visitor' => ($is_owner) ? 'block' : 'none',
|
||||||
'$pvisit' => 'none',
|
'$acl' => populate_acl($itm[0]),
|
||||||
|
'$showacl' => true,
|
||||||
|
'$pvisit' => ($is_owner) ? 'block' : 'none',
|
||||||
'$public' => t('Public post'),
|
'$public' => t('Public post'),
|
||||||
'$jotnets' => $jotnets,
|
'$jotnets' => $jotnets,
|
||||||
'$mimeselect' => $mimeselect,
|
'$mimeselect' => $mimeselect,
|
||||||
@ -143,8 +169,8 @@ function editwebpage_content(&$a) {
|
|||||||
'$category' => '',
|
'$category' => '',
|
||||||
'$placeholdercategory' => t('Categories (comma-separated list)'),
|
'$placeholdercategory' => t('Categories (comma-separated list)'),
|
||||||
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
|
||||||
'$lockstate' => $lockstate,
|
'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'),
|
||||||
'$acl' => '',
|
'$acl' => populate_acl($itm[0]),
|
||||||
'$bang' => '',
|
'$bang' => '',
|
||||||
'$profile_uid' => (intval($owner)),
|
'$profile_uid' => (intval($owner)),
|
||||||
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),
|
'$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''),
|
||||||
|
@ -60,13 +60,30 @@ function webpages_content(&$a) {
|
|||||||
require_once ('include/conversation.php');
|
require_once ('include/conversation.php');
|
||||||
require_once('include/acl_selectors.php');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
|
|
||||||
|
if(local_user() && local_user() == $a->profile_uid) {
|
||||||
|
$channel = $a->get_channel();
|
||||||
|
$channel_acl = array(
|
||||||
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
|
'deny_gid' => $channel['channel_deny_gid']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$channel_acl = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$x = array(
|
$x = array(
|
||||||
'webpage' => ITEM_WEBPAGE,
|
'webpage' => ITEM_WEBPAGE,
|
||||||
'is_owner' => true,
|
'is_owner' => true,
|
||||||
'nickname' => $a->profile['channel_address'],
|
'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'),
|
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||||
'bang' => (($group || $cid) ? '!' : ''),
|
'bang' => (($group || $cid) ? '!' : ''),
|
||||||
'acl' => ((local_user() && local_user() == $owner) ? populate_acl($a->get_channel()) : ''),
|
'acl' => ((local_user() && local_user() == $owner) ? populate_acl($channel_acl) : ''),
|
||||||
'visitor' => 'block',
|
'visitor' => 'block',
|
||||||
'profile_uid' => intval($owner),
|
'profile_uid' => intval($owner),
|
||||||
'mimetype' => $mimetype,
|
'mimetype' => $mimetype,
|
||||||
|
Reference in New Issue
Block a user