From 0db8d3f6c6dcf72aa90a9cbf45708882c90e0402 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 4 May 2016 11:49:29 +0200 Subject: whitespace --- Zotlabs/Module/Editblock.php | 74 ++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 40 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php index 2821b3fe0..b13ab22f3 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 = ''; 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; - + } - - - -} + +} \ No newline at end of file -- cgit v1.2.3 From 9fe33bb67df2f9cea25e3815ddfe503dfabb3fd6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 4 May 2016 11:53:38 +0200 Subject: whitespace --- Zotlabs/Module/Editblock.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php index b13ab22f3..0204d0994 100644 --- a/Zotlabs/Module/Editblock.php +++ b/Zotlabs/Module/Editblock.php @@ -24,7 +24,7 @@ class Editblock extends \Zotlabs\Web\Controller { } - function get() { + function get() { if(! \App::$profile) { notice( t('Requested profile is not available.') . EOL ); @@ -104,7 +104,7 @@ class Editblock extends \Zotlabs\Web\Controller { $plaintext = true; if(get_config('system','page_mimetype')) - $mimeselect = ''; + $mimeselect = ''; else $mimeselect = mimetype_select($itm[0]['uid'],$mimetype); @@ -182,4 +182,4 @@ class Editblock extends \Zotlabs\Web\Controller { } -} \ No newline at end of file +} -- cgit v1.2.3 From 33a8d845c12a9a6394a5fb8fa8edd851126e19e2 Mon Sep 17 00:00:00 2001 From: Treer Date: Wed, 4 May 2016 23:55:32 +1000 Subject: Refine permissions dialog UI --- Zotlabs/Module/Channel.php | 10 +++++++++- Zotlabs/Module/Network.php | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 36f13e775..ee7140475 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 cannot be changed after a post is sent.
These permissions set who is allowed to view the post.'); + $aclContextHelpCmd = ''; + $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/Network.php b/Zotlabs/Module/Network.php index 77353da05..a6b36ad3c 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 cannot be changed after a post is sent.
These permissions set who is allowed to view the post.'); + $aclContextHelpCmd = ''; $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(), -- cgit v1.2.3 From e1e56936c971bee54f58664df3aa58796a71ead4 Mon Sep 17 00:00:00 2001 From: Treer Date: Thu, 5 May 2016 02:09:47 +1000 Subject: add help to some permissions dialogs --- Zotlabs/Module/Channel.php | 2 +- Zotlabs/Module/Network.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index ee7140475..d0c6d83d8 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -132,7 +132,7 @@ function get($update = 0, $load = false) { // 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 cannot be changed after a post is sent.
These permissions set who is allowed to view the post.'); - $aclContextHelpCmd = ''; + $aclContextHelpCmd = 'acl_dialog_post'; $x = array( 'is_owner' => $is_owner, diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index a6b36ad3c..e4b936dc2 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -161,7 +161,7 @@ class Network extends \Zotlabs\Web\Controller { // 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 cannot be changed after a post is sent.
These permissions set who is allowed to view the post.'); - $aclContextHelpCmd = ''; + $aclContextHelpCmd = 'acl_dialog_post'; $channel_acl = array( 'allow_cid' => $channel['channel_allow_cid'], -- cgit v1.2.3