aboutsummaryrefslogtreecommitdiffstats
path: root/include/ItemObject.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-18 21:32:55 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-18 21:32:55 -0700
commite521da05da8c1d02d72edb76e66de2ff6308c466 (patch)
tree1f2a2dd58e4da3f463fc7a22df265db9638039ed /include/ItemObject.php
parentb7ae85e89ac81cd667e512138f605ed0a637709b (diff)
downloadvolse-hubzilla-e521da05da8c1d02d72edb76e66de2ff6308c466.tar.gz
volse-hubzilla-e521da05da8c1d02d72edb76e66de2ff6308c466.tar.bz2
volse-hubzilla-e521da05da8c1d02d72edb76e66de2ff6308c466.zip
consensus items not working correctly and make the collections widget abide by the corresponding feature setting. This needs to be backported as it is borken in redmatrix. Also provide the ability to change the number of most recent expanded comments to conversations on a site-wide basis, increase it to 3 by default. We may also want this as a personal setting.
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r--include/ItemObject.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 1cb7bf25c..d23c1c658 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -152,7 +152,7 @@ class Item extends BaseObject {
}
}
- $consensus = (($item['item_flags'] & ITEM_CONSENSUS) ? true : false);
+ $consensus = (intval($item['item_consensus']) ? true : false);
if($consensus) {
$response_verbs[] = 'agree';
$response_verbs[] = 'disagree';
@@ -373,12 +373,16 @@ class Item extends BaseObject {
$result['children'] = array();
$nb_children = count($children);
+ $visible_comments = get_config('system','expanded_comments');
+ if($visible_comments === false)
+ $visible_comments = 3;
+
if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
foreach($children as $child) {
$result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1);
}
// Collapse
- if(($nb_children > 2) || ($thread_level > 1)) {
+ if(($nb_children > $visible_comments) || ($thread_level > 1)) {
$result['children'][0]['comment_firstcollapsed'] = true;
$result['children'][0]['num_comments'] = $comment_count_txt;
$result['children'][0]['hide_text'] = t('[+] show all');
@@ -386,7 +390,7 @@ class Item extends BaseObject {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
}
else {
- $result['children'][$nb_children - 3]['comment_lastcollapsed'] = true;
+ $result['children'][$nb_children - ($visible_comments + 1)]['comment_lastcollapsed'] = true;
}
}
}