aboutsummaryrefslogtreecommitdiffstats
path: root/include/ItemObject.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-14 22:14:19 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-14 22:14:19 +0200
commitb4e83b65375e62259671749c089d9cd7a2a2967a (patch)
tree3c4b8e18b2dc439530f9515147af4424e1726be1 /include/ItemObject.php
parentd616099de6984ad8d45e3b8908367bf5a0b8ab31 (diff)
downloadvolse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.tar.gz
volse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.tar.bz2
volse-hubzilla-b4e83b65375e62259671749c089d9cd7a2a2967a.zip
allow photo-items to appear full width if large photos feature is enabled. in prepare_body() split off mentions, tags, categories folders and attachments from body for easier theming. some other little fixes.
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r--include/ItemObject.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 5296a1cf0..46bb78ecd 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -278,13 +278,21 @@ class Item extends BaseObject {
$children = $this->get_children();
+ $is_photo = (($item['resource_type'] == 'photo') ? true : false) && feature_enabled($conv->get_profile_owner(),'large_photos');
+
+ $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,
@@ -325,6 +333,8 @@ class Item extends BaseObject {
'owner_url' => $this->get_owner_url(),
'owner_photo' => $this->get_owner_photo(),
'owner_name' => $this->get_owner_name(),
+ 'is_photo' => $is_photo,
+ 'has_tags' => $has_tags,
// Item toolbar buttons
'like' => $like,