diff options
author | redmatrix <git@macgirvin.com> | 2016-05-04 17:36:13 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-04 17:36:13 -0700 |
commit | 1b6bc5394b7cf8435928eaa2ace4e321f517ecb6 (patch) | |
tree | 0d1e8c70de7961b9332d4e624e134691c40fc84c /Zotlabs | |
parent | 50fb525b280069e4a95f9ae133b15460e8b02318 (diff) | |
parent | 8c9a773a90fc331f0b4d6ce44119abe1278fd8ea (diff) | |
download | volse-hubzilla-1b6bc5394b7cf8435928eaa2ace4e321f517ecb6.tar.gz volse-hubzilla-1b6bc5394b7cf8435928eaa2ace4e321f517ecb6.tar.bz2 volse-hubzilla-1b6bc5394b7cf8435928eaa2ace4e321f517ecb6.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Channel.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/Editblock.php | 74 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 12 |
3 files changed, 53 insertions, 43 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 36f13e775..d0c6d83d8 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -126,13 +126,21 @@ function get($update = 0, $load = false) { if($perms['post_wall']) { + // I'm trying to make two points in this description text - warn about finality of wall + // post permissions, and try to clear up confusion that these permissions set who is + // *shown* the post, istead of who is able to see the post, i.e. make it clear that clicking + // the "Show" button on a group does not post it to the feed of people in that group, it + // mearly allows those people to view the post if they are viewing/following this channel. + $aclDesc = t('Post permissions <b>cannot be changed</b> after a post is sent.</br />These permissions set who is allowed to view the post.'); + $aclContextHelpCmd = 'acl_dialog_post'; + $x = array( 'is_owner' => $is_owner, 'allow_location' => ((($is_owner || $observer) && (intval(get_pconfig(\App::$profile['profile_uid'],'system','use_browser_location')))) ? true : false), 'default_location' => (($is_owner) ? \App::$profile['channel_location'] : ''), 'nickname' => \App::$profile['channel_address'], 'lockstate' => (((strlen(\App::$profile['channel_allow_cid'])) || (strlen(\App::$profile['channel_allow_gid'])) || (strlen(\App::$profile['channel_deny_cid'])) || (strlen(\App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl,true,((\App::$profile['channel_r_stream'] & PERMS_PUBLIC) ? t('Public') : '')) : ''), + 'acl' => (($is_owner) ? populate_acl($channel_acl,true,((\App::$profile['channel_r_stream'] & PERMS_PUBLIC) ? t('Public') : ''), $aclDesc, $aclContextHelpCmd) : ''), 'showacl' => (($is_owner) ? 'yes' : ''), 'bang' => '', 'visitor' => (($is_owner || $observer) ? true : false), diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php index 2821b3fe0..0204d0994 100644 --- a/Zotlabs/Module/Editblock.php +++ b/Zotlabs/Module/Editblock.php @@ -4,46 +4,43 @@ namespace Zotlabs\Module; require_once('include/identity.php'); require_once('include/acl_selectors.php'); - class Editblock extends \Zotlabs\Web\Controller { function init() { - + if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) { $sys = get_sys_channel(); if($sys && intval($sys['channel_id'])) { \App::$is_sys = true; } } - + if(argc() > 1) $which = argv(1); else return; - + profile_load($a,$which); - + } - - - - function get() { - + + function get() { + if(! \App::$profile) { notice( t('Requested profile is not available.') . EOL ); \App::$error = 404; return; } - + $which = argv(1); - + $uid = local_channel(); $owner = 0; $channel = null; $observer = \App::get_observer(); - + $channel = \App::get_channel(); - + if(\App::$is_sys && is_site_admin()) { $sys = get_sys_channel(); if($sys && intval($sys['channel_id'])) { @@ -52,7 +49,7 @@ class Editblock extends \Zotlabs\Web\Controller { $observer = $sys; } } - + if(! $owner) { // Figure out who the page owner is. $r = q("select channel_id from channel where channel_address = '%s'", @@ -62,27 +59,26 @@ class Editblock extends \Zotlabs\Web\Controller { $owner = intval($r[0]['channel_id']); } } - + $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); - + if(! perm_is_allowed($owner,$ob_hash,'write_pages')) { notice( t('Permission denied.') . EOL); return; } - + $is_owner = (($uid && $uid == $owner) ? true : false); - + $o = ''; - + // Figure out which post we're editing $post_id = ((argc() > 2) ? intval(argv(2)) : 0); - - + if(! ($post_id && $owner)) { notice( t('Item not found') . EOL); return; } - + $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1", intval($post_id), intval($owner) @@ -98,20 +94,20 @@ class Editblock extends \Zotlabs\Web\Controller { notice( t('Item not found') . EOL); return; } - + $plaintext = true; - + $mimeselect = ''; $mimetype = $itm[0]['mimetype']; - + if($mimetype != 'text/bbcode') $plaintext = true; - + if(get_config('system','page_mimetype')) - $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />'; + $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />'; else $mimeselect = mimetype_select($itm[0]['uid'],$mimetype); - + \App::$page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), @@ -122,17 +118,17 @@ class Editblock extends \Zotlabs\Web\Controller { '$confirmdelete' => t('Delete block?'), '$bbco_autocomplete'=> (($mimetype == 'text/bbcode') ? 'bbcode' : 'comanche-block') )); - + $tpl = get_markup_template("jot.tpl"); - + $jotplugins = ''; $jotnets = ''; - + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); - + $rp = 'blocks/' . $channel['channel_address']; - + $editor = replace_macros($tpl,array( '$return_path' => $rp, '$action' => 'item', @@ -174,18 +170,16 @@ class Editblock extends \Zotlabs\Web\Controller { '$defexpire' => '', '$bbcode' => (($mimetype == 'text/bbcode') ? true : false) )); - + $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Block'), '$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false), '$id' => $itm[0]['id'], '$editor' => $editor )); - + return $o; - + } - - - + } diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 77353da05..e4b936dc2 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -154,6 +154,14 @@ class Network extends \Zotlabs\Web\Controller { } nav_set_selected('network'); + + // I'm trying to make two points in this description text - warn about finality of wall + // post permissions, and try to clear up confusion that these permissions set who is + // *shown* the post, istead of who is able to see the post, i.e. make it clear that clicking + // the "Show" button on a group does not post it to the feed of people in that group, it + // mearly allows those people to view the post if they are viewing/following this channel. + $aclDesc = t('Post permissions <b>cannot be changed</b> after a post is sent.</br />These permissions set who is allowed to view the post.'); + $aclContextHelpCmd = 'acl_dialog_post'; $channel_acl = array( 'allow_cid' => $channel['channel_allow_cid'], @@ -161,7 +169,7 @@ class Network extends \Zotlabs\Web\Controller { 'deny_cid' => $channel['channel_deny_cid'], 'deny_gid' => $channel['channel_deny_gid'] ); - + $private_editing = ((($group || $cid) && (! intval($_GET['pf']))) ? true : false); $x = array( @@ -170,7 +178,7 @@ class Network extends \Zotlabs\Web\Controller { 'default_location' => $channel['channel_location'], 'nickname' => $channel['channel_address'], 'lockstate' => (($private_editing || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => populate_acl((($private_editing) ? $def_acl : $channel_acl), true, (($channel['channel_r_stream'] & PERMS_PUBLIC) ? t('Public') : '')), + 'acl' => populate_acl((($private_editing) ? $def_acl : $channel_acl), true, (($channel['channel_r_stream'] & PERMS_PUBLIC) ? t('Public') : ''), $aclDesc, $aclContextHelpCmd), 'bang' => (($private_editing) ? '!' : ''), 'visitor' => true, 'profile_uid' => local_channel(), |