aboutsummaryrefslogtreecommitdiffstats
path: root/include/ItemObject.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r--include/ItemObject.php38
1 files changed, 26 insertions, 12 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index dea2f75bf..34500efb9 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';
@@ -212,9 +212,9 @@ class Item extends BaseObject {
'do' => t("Add Star"),
'undo' => t("Remove Star"),
'toggle' => t("Toggle Star Status"),
- 'classdo' => (($item['item_flags'] & ITEM_STARRED) ? "hidden" : ""),
- 'classundo' => (($item['item_flags'] & ITEM_STARRED) ? "" : "hidden"),
- 'isstarred' => (($item['item_flags'] & ITEM_STARRED) ? "starred icon-star" : "unstarred icon-star-empty"),
+ 'classdo' => (intval($item['item_starred']) ? "hidden" : ""),
+ 'classundo' => (intval($item['item_starred']) ? "" : "hidden"),
+ 'isstarred' => (intval($item['item_starred']) ? "starred icon-star" : "unstarred icon-star-empty"),
'starred' => t('starred'),
);
@@ -224,9 +224,9 @@ class Item extends BaseObject {
}
- $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message signature validated') : '');
- $forged = ((($item['sig']) && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message signature incorrect') : '');
- $unverified = '' ; // (($this->is_wall_to_wall() && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message cannot be verified') : '');
+ $verified = (intval($item['item_verified']) ? t('Message signature validated') : '');
+ $forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : '');
+ $unverified = '' ; // (($this->is_wall_to_wall() && (! intval($item['item_verified']))) ? t('Message cannot be verified') : '');
@@ -279,14 +279,21 @@ class Item extends BaseObject {
$children = $this->get_children();
+ $has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
+
$tmp_item = array(
'template' => $this->get_template(),
'mode' => $mode,
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
- 'tags' => array(),
- 'body' => $body,
- 'text' => strip_tags($body),
+ 'body' => $body['html'],
+ 'tags' => $body['tags'],
+ 'categories' => $body['categories'],
+ 'mentions' => $body['mentions'],
+ 'attachments' => $body['attachments'],
+ 'folders' => $body['folders'],
+ 'text' => strip_tags($body['html']),
'id' => $this->get_id(),
+ 'mid' => $item['mid'],
'isevent' => $isevent,
'attend' => $attend,
'consensus' => $consensus,
@@ -302,6 +309,7 @@ class Item extends BaseObject {
'vwall' => t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
+ 'dreport' => t('Delivery Report'),
'name' => $profile_name,
'thumb' => $profile_avatar,
'osparkle' => $osparkle,
@@ -324,6 +332,8 @@ class Item extends BaseObject {
'owner_url' => $this->get_owner_url(),
'owner_photo' => $this->get_owner_photo(),
'owner_name' => $this->get_owner_name(),
+ 'photo' => $body['photo'],
+ 'has_tags' => $has_tags,
// Item toolbar buttons
'like' => $like,
@@ -374,12 +384,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');
@@ -387,7 +401,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;
}
}
}