aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php4
-rw-r--r--include/conversation.php5
-rw-r--r--include/features.php1
-rwxr-xr-xinclude/items.php4
4 files changed, 12 insertions, 2 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 3638b2ffb..7f5ee83a3 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -148,11 +148,13 @@ class Item extends BaseObject {
$isevent = true;
$attend = array( t('I will attend'), t('I will not attend'), t('I might attend'));
}
+
$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'));
}
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
@@ -280,6 +282,8 @@ class Item extends BaseObject {
'id' => $this->get_id(),
'isevent' => $isevent,
'attend' => $attend,
+ 'consensus' => $consensus,
+ 'conlabels' => $conlabels,
'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'],
diff --git a/include/conversation.php b/include/conversation.php
index 4da6636fa..2c89249cb 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1085,6 +1085,8 @@ function status_editor($a,$x,$popup=false) {
// if(feature_enabled(local_channel(),'richtext'))
// $plaintext = false;
+ $voting = feature_enabled(local_channel(),'consensus_tools');
+
$mimeselect = '';
if(array_key_exists('mimetype',$x) && $x['mimetype']) {
if($x['mimetype'] != 'text/bbcode')
@@ -1176,6 +1178,9 @@ function status_editor($a,$x,$popup=false) {
'$shortaudio' => t('audio link'),
'$setloc' => t('Set your location'),
'$shortsetloc' => t('set location'),
+ '$voting' => t('Toggle voting'),
+ '$feature_voting' => $voting,
+ '$consensus' => 0,
'$noloc' => ((get_pconfig($x['profile_uid'],'system','use_browser_location')) ? t('Clear browser location') : ''),
'$shortnoloc' => t('clear location'),
'$title' => ((x($x,'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
diff --git a/include/features.php b/include/features.php
index 6b4bc34c6..fc14858a8 100644
--- a/include/features.php
+++ b/include/features.php
@@ -60,6 +60,7 @@ function get_features() {
array('large_photos', t('Large Photos'), t('Include large (640px) photo thumbnails in posts. If not enabled, use small (320px) photo thumbnails'),false),
array('channel_sources', t('Channel Sources'), t('Automatically import channel content from other channels or feeds'),false),
array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'),false),
+ array('consensus_tools', t('Enable voting tools'), t('Provide a class of post which others can vote on'),false),
array('adult_photo_flagging', t('Flag Adult Photos'), t('Provide photo edit option to hide adult photos from default album view'),false),
),
diff --git a/include/items.php b/include/items.php
index 0b2106572..2207635b6 100755
--- a/include/items.php
+++ b/include/items.php
@@ -843,9 +843,9 @@ function get_item_elements($x) {
if(array_key_exists('flags',$x) && in_array('deleted',$x['flags']))
- $arr['item_restrict'] = ITEM_DELETED;
+ $arr['item_restrict'] |= ITEM_DELETED;
if(array_key_exists('flags',$x) && in_array('hidden',$x['flags']))
- $arr['item_restrict'] = ITEM_HIDDEN;
+ $arr['item_restrict'] |= ITEM_HIDDEN;
// Here's the deal - the site might be down or whatever but if there's a new person you've never
// seen before sending stuff to your stream, we MUST be able to look them up and import their data from their