aboutsummaryrefslogtreecommitdiffstats
path: root/include/ItemObject.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-10 21:21:18 -0800
committerfriendica <info@friendica.com>2015-02-10 21:21:18 -0800
commite8bdf2b8d741354fd479bd5fc31f704e2c6f6c88 (patch)
treecac7756131e8337a03f2f37612ae1fdddbb09654 /include/ItemObject.php
parent583af02f71f17039202a2e4009a3ab8586774663 (diff)
downloadvolse-hubzilla-e8bdf2b8d741354fd479bd5fc31f704e2c6f6c88.tar.gz
volse-hubzilla-e8bdf2b8d741354fd479bd5fc31f704e2c6f6c88.tar.bz2
volse-hubzilla-e8bdf2b8d741354fd479bd5fc31f704e2c6f6c88.zip
more permissions tweaking
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r--include/ItemObject.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index ff7da2418..c429a0131 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -136,30 +136,40 @@ class Item extends BaseObject {
$location = format_location($item);
$isevent = false;
$attend = null;
+ $canvote = false;
// process action responses - e.g. like/dislike/attend/agree/whatever
$response_verbs = array('like');
if(feature_enabled($conv->get_profile_owner(),'dislike'))
$response_verbs[] = 'dislike';
- if($item['obj_type'] === ACTIVITY_OBJ_EVENT && $this->is_commentable()) {
+ if($item['obj_type'] === ACTIVITY_OBJ_EVENT) {
$response_verbs[] = 'attendyes';
$response_verbs[] = 'attendno';
$response_verbs[] = 'attendmaybe';
- $isevent = true;
- $attend = array( t('I will attend'), t('I will not attend'), t('I might attend'));
+ if($this->is_commentable()) {
+ $isevent = true;
+ $attend = array( t('I will attend'), t('I will not attend'), t('I might attend'));
+ }
}
- $consensus = ((($item['item_flags'] & ITEM_CONSENSUS) && $this->is_commentable()) ? true : false);
+ $consensus = (($item['item_flags'] & ITEM_CONSENSUS) ? true : false);
if($consensus) {
$response_verbs[] = 'agree';
$response_verbs[] = 'disagree';
$response_verbs[] = 'abstain';
- $conlabels = array( t('I agree'), t('I disagree'), t('I abstain'));
+ if($this->is_commentable()) {
+ $conlabels = array( t('I agree'), t('I disagree'), t('I abstain'));
+ $canvote = true;
+ }
}
+ if(! feature_enabled($conv->get_profile_owner(),'dislike'))
+ unset($conv_responses['dislike']);
+
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
+
$like_button_label = tt('Like','Likes',$like_count,'noun');
$like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
@@ -284,6 +294,7 @@ class Item extends BaseObject {
'attend' => $attend,
'consensus' => $consensus,
'conlabels' => $conlabels,
+ 'canvote' => $canvote,
'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']),
'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']),
'llink' => $item['llink'],