define ( 'ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like' );
define ( 'ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike' );
-define ( 'ACTIVITY_AGREE', NAMESPACE_ZOT . '/activity/agree' );
-define ( 'ACTIVITY_DISAGREE', NAMESPACE_ZOT . '/activity/disagree' );
-define ( 'ACTIVITY_ABSTAIN', NAMESPACE_ZOT . '/activity/abstain' );
define ( 'ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes' );
define ( 'ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno' );
define ( 'ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe' );
// likes (etc.) can apply to other things besides posts. Check if they are post children,
// in which case we handle them specially
- $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE);
+ $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE);
foreach($hidden_activities as $act) {
if(activity_match($item['verb'],$act)) {
return false;
$hide_comments_tpl = get_markup_template('hide_comments.tpl');
$conv_responses = array(
- 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')),
- 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')),
+ 'like' => array('title' => t('Likes','title')), 'dislike' => array('title' => t('Dislikes','title')),
'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title'))
);
case 'dislike':
$verb = ACTIVITY_DISLIKE;
break;
- case 'agree':
- $verb = ACTIVITY_AGREE;
- break;
- case 'disagree':
- $verb = ACTIVITY_DISAGREE;
- break;
- case 'abstain':
- $verb = ACTIVITY_ABSTAIN;
- break;
case 'attendyes':
$verb = ACTIVITY_ATTEND;
break;
// Format the vote text for a profile item
// $cnt = number of people who vote the item
// $arr = array of pre-linked names of likers/dislikers
-// $type = one of 'like, 'dislike', 'attendyes', 'attendno', 'attendmaybe', 'agree', 'disagree', 'abstain'
+// $type = one of 'like, 'dislike', 'attendyes', 'attendno', 'attendmaybe'
// $id = item id
// returns formatted text
case 'attendmaybe' :
$phrase = sprintf( t('%s attends maybe.'), $likers);
break;
- case 'agree' :
- $phrase = sprintf( t('%s agrees.'), $likers);
- break;
- case 'disagree' :
- $phrase = sprintf( t('%s doesn\'t agree.'), $likers);
- break;
- case 'abstain' :
- $phrase = sprintf( t('%s abstains.'), $likers);
- break;
}
if($cnt > 1) {
if( local_user() && feature_enabled(local_user(),'richtext') )
$plaintext = false;
- $voting = feature_enabled(local_user(),'consensus_tools');
-
$tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true',
'$shortsetloc' => t('set location'),
'$noloc' => t('Clear browser location'),
'$shortnoloc' => t('clear location'),
- '$voting' => t('Toggle voting'),
- '$feature_voting' => $voting,
- '$consensus' => 0,
'$title' => $x['title'],
'$placeholdertitle' => t('Set title'),
'$category' => $x['category'],
case 'attendmaybe':
return tt('Undecided','Undecided',$count,'noun');
break;
- case 'agree':
- return tt('Agree','Agrees',$count,'noun');
- break;
- case 'disagree':
- return tt('Disagree','Disagrees',$count,'noun');
- break;
- case 'abstain':
- return tt('Abstain','Abstains',$count,'noun');
- break;
- default:
- return '';
- break;
}
}
array('richtext', t('Richtext Editor'), t('Enable richtext editor')),
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them')),
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a fourm page is selected/deselected in ACL window.')),
- array('consensus_tools', t('Enable voting tools'), t('Provide a class of post which others can vote on'),false),
),
// Network sidebar widgets
'$noloc' => t('Clear browser location'),
'$shortnoloc' => t('clear location'),
'$voting' => t('Toggle voting'),
- '$feature_voting' => $voting,
-
- // we need a solution for the red flags to make consensus work
- '$consensus' => (($itm[0]['item_flags'] & ITEM_CONSENSUS) ? 1 : 0),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$ptyp' => $itm[0]['type'],
$message_id = ((x($_REQUEST,'message_id') && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
- $consensus = intval($_REQUEST['consensus']);
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
if(!$thr_parent)
$thr_parent = $uri;
-
- /* *
- * to make consensus work, red requests the consensus flag from boot.php
- * this have to be inserted into the lower $datarray
- *
- * if($consensus)
- * $item_flags |= ITEM_CONSENSUS;
- */
-
$datarray = array();
$datarray['uid'] = $profile_uid;
$datarray['type'] = $post_type;
case 'undislike':
$activity = ACTIVITY_DISLIKE;
break;
- case 'agree':
- case 'unagree':
- $activity = ACTIVITY_AGREE;
- break;
- case 'disagree':
- case 'undisagree':
- $activity = ACTIVITY_DISAGREE;
- break;
- case 'abstain':
- case 'unabstain':
- $activity = ACTIVITY_ABSTAIN;
- break;
case 'attendyes':
case 'unattendyes':
$activity = ACTIVITY_ATTEND;
$verbs = " '".dbesc($activity)."' ";
- // event participation and consensus items are essentially radio toggles. If you make a subsequent choice,
+ // event participation are essentially radio toggles. If you make a subsequent choice,
// we need to eradicate your first choice.
if($activity === ACTIVITY_ATTEND || $activity === ACTIVITY_ATTENDNO || $activity === ACTIVITY_ATTENDMAYBE) {
$verbs = " '" . dbesc(ACTIVITY_ATTEND) . "','" . dbesc(ACTIVITY_ATTENDNO) . "','" . dbesc(ACTIVITY_ATTENDMAYBE) . "' ";
}
- if($activity === ACTIVITY_AGREE || $activity === ACTIVITY_DISAGREE || $activity === ACTIVITY_ABSTAIN) {
- $verbs = " '" . dbesc(ACTIVITY_AGREE) . "','" . dbesc(ACTIVITY_DISAGREE) . "','" . dbesc(ACTIVITY_ABSTAIN) . "' ";
- }
$r = q("SELECT `id`, `guid` FROM `item` WHERE `verb` IN ( $verbs ) AND `deleted` = 0
AND `contact-id` = %d AND `uid` = %d
$bodyverb = t('%1$s likes %2$s\'s %3$s');
if($verb === 'dislike')
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
- if($verb === 'agree')
- $bodyverb = t('%1$s agrees with %2$s\'s %3$s');
- if($verb === 'disagree')
- $bodyverb = t('%1$s doesn\'t agree with %2$s\'s %3$s');
- if($verb === 'abstain')
- $bodyverb = t('%1$s abstains from a decision on %2$s\'s %3$s');
if($verb === 'attendyes')
$bodyverb = t('%1$s is attending %2$s\'s %3$s');
if($verb === 'attendno')
$conv_responses = array(
'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')),
- 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')),
'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title'))
);
}
}
- // red part for consensus
- // we need a solution in friendica for missing item_flags
- // to test $consensus with friendica set $consensus = true
- // $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false);
- $consensus = false;
-
- if($consensus) {
- $response_verbs[] = 'agree';
- $response_verbs[] = 'disagree';
- $response_verbs[] = 'abstain';
- if($conv->is_writable()) {
- $conlabels = array( t('I agree'), t('I disagree'), t('I abstain'));
- $canvote = true;
- }
- }
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
foreach ($response_verbs as $value=>$verbs) {
// Disable features that aren't available in several networks
if (($item["item_network"] != NETWORK_DFRN) AND isset($buttons["dislike"])) {
- unset($buttons["dislike"],$isevent,$consensus);
+ unset($buttons["dislike"],$isevent);
$tagger = '';
}
'guid' => urlencode($item['guid']),
'isevent' => $isevent,
'attend' => $attend,
- 'consensus' => $consensus,
- 'conlabels' => $conlabels,
- 'canvote' => $canvote,
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $this->get_owner_name(), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
'to' => t('to'),
}
- function toggleVoting() {
- if($('#jot-consensus').val() > 0) {
- $('#jot-consensus').val(0);
- $('#profile-voting').removeClass('icon-check').addClass('icon-check-empty');
- }
- else {
- $('#jot-consensus').val(1);
- $('#profile-voting').removeClass('icon-check-empty').addClass('icon-check');
- }
- }
-
function jotClearLocation() {
$('#jot-coord').val('');
$('#profile-nolocation-wrapper').hide();
<a id="profile-nolocation" class="icon noglobe" title="{{$noloc|escape:'html'}}" onclick="jotClearLocation();return false;"></a>
</div>
- {{if $feature_voting}}
- <div id="profile-voting-wrapper" style="display: {{$visitor}};" >
- <a id="profile-voting" class="icon icon-check-empty" title="{{$voting|escape:'html'}}" onclick="toggleVoting();return false;"></a>
- </div>
- {{/if}}
-
<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};" >
<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}}" title="{{$permset|escape:'html'}}" ></a>{{$bang}}
</div>
margin-bottom: 0.3em;
}
.wall-item-container .wall-item-actions-social,
-.wall-item-container .wall-item-actions-isevent,
-.wall-item-container .wall-item-actions-canvote {
+.wall-item-container .wall-item-actions-isevent {
float: left;
margin-bottom: 1px;
}
.wall-item-container .wall-item-actions-social a,
-.wall-item-container .wall-item-actions-isevent a,
-.wall-item-container .wall-item-actions-canvote a{
+.wall-item-container .wall-item-actions-isevent a {
float: left;
margin-right: 1em;
cursor: pointer;
margin-left: 15px;
cursor: pointer;
}
-#profile-voting-wrapper {
- float: left;
- margin-left: 15px;
- cursor: pointer;
-}
#profile-smiley-wrapper {
float: left;
margin-left: 15px;
</div>
{{/if}}
- {{if $item.canvote}}<!--Consensus isn't implemented at this time. It's just for testing. -->
- <div class="clear"></div>
- <div class="wall-item-actions-canvote">
- <a href="#" id="attendyes-{{$item.id}}" title="{{$item.conlabels.0}}" onclick="dolike({{$item.id}},'agree'); return false;"><i class="icon-ok icon-large"></i></a>
- <a href="#" id="attendno-{{$item.id}}" title="{{$item.conlabels.1}}" onclick="dolike({{$item.id}},'disagree'); return false;"><i class="icon-remove icon-large"></i></a>
- <a href="#" id="attendmaybe-{{$item.id}}" title="{{$item.conlabels.2}}" onclick="dolike({{$item.id}},'abstain'); return false;"><i class="icon-question icon-large"></i></a>
- </div>
- {{/if}}
<div class="wall-item-actions-tools">
{{if $item.drop.pagedrop}}