3 * @file src/Object/Post.php
5 namespace Friendica\Object;
7 use Friendica\BaseObject;
8 use Friendica\Content\ContactSelector;
9 use Friendica\Content\Feature;
10 use Friendica\Core\Addon;
11 use Friendica\Core\Config;
12 use Friendica\Core\Hook;
13 use Friendica\Core\L10n;
14 use Friendica\Core\Logger;
15 use Friendica\Core\PConfig;
16 use Friendica\Core\Protocol;
17 use Friendica\Core\Renderer;
18 use Friendica\Database\DBA;
19 use Friendica\Model\Contact;
20 use Friendica\Model\Item;
21 use Friendica\Model\Term;
22 use Friendica\Util\Crypto;
23 use Friendica\Util\DateTimeFormat;
24 use Friendica\Util\Proxy as ProxyUtils;
25 use Friendica\Util\Strings;
26 use Friendica\Util\Temporal;
31 class Post extends BaseObject
34 private $template = null;
35 private $available_templates = [
36 'wall' => 'wall_thread.tpl',
37 'wall2wall' => 'wallwall_thread.tpl'
39 private $comment_box_template = 'comment_item.tpl';
40 private $toplevel = false;
41 private $writable = false;
45 private $children = [];
46 private $parent = null;
51 private $thread = null;
52 private $redirect_url = null;
53 private $owner_url = '';
54 private $owner_photo = '';
55 private $owner_name = '';
56 private $wall_to_wall = false;
57 private $threaded = false;
58 private $visiting = false;
63 * @param array $data data array
66 public function __construct(array $data)
69 $this->setTemplate('wall');
70 $this->toplevel = $this->getId() == $this->getDataValue('parent');
72 if (!empty($_SESSION['remote']) && is_array($_SESSION['remote'])) {
73 foreach ($_SESSION['remote'] as $visitor) {
74 if ($visitor['cid'] == $this->getDataValue('contact-id')) {
75 $this->visiting = true;
81 $this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
82 $author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
83 'network' => $this->getDataValue('author-network'),
84 'url' => $this->getDataValue('author-link')];
85 $this->redirect_url = Contact::magicLinkbyContact($author);
86 if (!$this->isToplevel()) {
87 $this->threaded = true;
90 // Prepare the children
91 if (!empty($data['children'])) {
92 foreach ($data['children'] as $item) {
93 // Only add will be displayed
94 if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) {
96 } elseif (!visible_activity($item)) {
100 // You can always comment on Diaspora and OStatus items
101 if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (local_user() == $item['uid'])) {
102 $item['writable'] = true;
105 $item['pagedrop'] = $data['pagedrop'];
106 $child = new Post($item);
107 $this->addChild($child);
113 * Get data in a form usable by a conversation template
115 * @param array $conv_responses conversation responses
116 * @param integer $thread_level default = 1
118 * @return mixed The data requested on success
120 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
121 * @throws \ImagickException
123 public function getTemplateData(array $conv_responses, $thread_level = 1)
127 $item = $this->getData();
129 // If the time between "created" and "edited" differs we add
130 // a notice that the post was edited.
131 // Note: In some networks reshared items seem to have (sometimes) a difference
132 // between creation time and edit time of a second. Thats why we add the notice
133 // only if the difference is more than 1 second.
134 if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
136 'label' => L10n::t('This entry was edited'),
137 'date' => DateTimeFormat::local($item['edited'], 'r'),
138 'relative' => Temporal::getRelativeDate($item['edited'])
146 $isstarred = "unstarred";
150 $total_children = $this->countDescendants();
152 $conv = $this->getThread();
154 $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
155 || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
156 ? L10n::t('Private Message')
159 $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
164 if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
165 if ($item["event-id"] != 0) {
166 $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
168 $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
171 $dropping = in_array($item['uid'], [0, local_user()]);
174 // Editing on items of not subscribed users isn't currently possible
175 // There are some issues on editing that prevent this.
176 // But also it is an issue of the supported protocols that doesn't allow editing at all.
177 if ($item['uid'] == 0) {
181 if (($this->getDataValue('uid') == local_user()) || $this->isVisiting()) {
185 $origin = $item['origin'];
188 /// @todo This shouldn't be done as query here, but better during the data creation.
189 // it is now done here, since during the RC phase we shouldn't make to intense changes.
190 $parent = Item::selectFirst(['origin'], ['id' => $item['parent']]);
191 if (DBA::isResult($parent)) {
192 $origin = $parent['origin'];
196 if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
197 // ActivityPub doesn't allow removal of remote comments
198 $delete = L10n::t('Delete locally');
200 // Showing the one or the other text, depending upon if we can only hide it or really delete it.
201 $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
205 'dropping' => $dropping,
206 'pagedrop' => $item['pagedrop'],
207 'select' => L10n::t('Select'),
215 $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
217 $profile_name = $item['author-name'];
218 if (!empty($item['author-link']) && empty($item['author-name'])) {
219 $profile_name = $item['author-link'];
222 $author = ['uid' => 0, 'id' => $item['author-id'],
223 'network' => $item['author-network'], 'url' => $item['author-link']];
225 if (local_user() || remote_user()) {
226 $profile_link = Contact::magicLinkbyContact($author);
228 $profile_link = $item['author-link'];
231 if (strpos($profile_link, 'redir/') === 0) {
232 $sparkle = ' sparkle';
235 $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
236 Hook::callAll('render_location', $locate);
237 $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
239 // process action responses - e.g. like/dislike/attend/agree/whatever
240 $response_verbs = ['like', 'dislike'];
244 if ($item['object-type'] === ACTIVITY_OBJ_EVENT) {
245 $response_verbs[] = 'attendyes';
246 $response_verbs[] = 'attendno';
247 $response_verbs[] = 'attendmaybe';
248 if ($conv->isWritable()) {
250 $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
254 $responses = get_responses($conv_responses, $response_verbs, $item, $this);
256 foreach ($response_verbs as $value => $verbs) {
257 $responses[$verbs]['output'] = !empty($conv_responses[$verbs][$item['uri']]) ? format_like($conv_responses[$verbs][$item['uri']], $conv_responses[$verbs][$item['uri'] . '-l'], $verbs, $item['uri']) : '';
261 * We should avoid doing this all the time, but it depends on the conversation mode
262 * And the conv mode may change when we change the conv, or it changes its mode
263 * Maybe we should establish a way to be notified about conversation changes
265 $this->checkWallToWall();
267 if ($this->isWallToWall() && ($this->getOwnerUrl() == $this->getRedirectUrl())) {
268 $osparkle = ' sparkle';
273 if ($this->isToplevel()) {
275 $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
276 if (DBA::isResult($thread)) {
278 'do' => L10n::t("ignore thread"),
279 'undo' => L10n::t("unignore thread"),
280 'toggle' => L10n::t("toggle ignore status"),
281 'classdo' => $thread['ignored'] ? "hidden" : "",
282 'classundo' => $thread['ignored'] ? "" : "hidden",
283 'ignored' => L10n::t('ignored'),
287 if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
288 $isstarred = (($item['starred']) ? "starred" : "unstarred");
291 'do' => L10n::t("add star"),
292 'undo' => L10n::t("remove star"),
293 'toggle' => L10n::t("toggle star status"),
294 'classdo' => $item['starred'] ? "hidden" : "",
295 'classundo' => $item['starred'] ? "" : "hidden",
296 'starred' => L10n::t('starred'),
300 'add' => L10n::t("add tag"),
309 if ($conv->isWritable()) {
311 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
312 'dislike' => [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")],
315 $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
319 $comment = $this->getCommentBox($indent);
321 if (strcmp(DateTimeFormat::utc($item['created']), DateTimeFormat::utc('now - 12 hours')) > 0) {
325 localize_item($item);
327 $body = Item::prepareBody($item, true);
329 list($categories, $folders) = get_cats_and_terms($item);
332 $text_e = strip_tags($body);
333 $name_e = $profile_name;
335 if (!empty($item['content-warning']) && PConfig::get(local_user(), 'system', 'disable_cw', false)) {
336 $title_e = ucfirst($item['content-warning']);
338 $title_e = $item['title'];
341 $location_e = $location;
342 $owner_name_e = $this->getOwnerName();
344 // Disable features that aren't available in several networks
345 if (!in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA]) && isset($buttons["dislike"])) {
346 unset($buttons["dislike"]);
351 if (($item["network"] == Protocol::FEED) && isset($buttons["like"])) {
352 unset($buttons["like"]);
355 if (($item["network"] == Protocol::MAIL) && isset($buttons["like"])) {
356 unset($buttons["like"]);
359 $tags = Term::populateTagsFromItem($item);
362 'template' => $this->getTemplate(),
363 'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
364 'suppress_tags' => Config::get('system', 'suppress_tags'),
365 'tags' => $tags['tags'],
366 'hashtags' => $tags['hashtags'],
367 'mentions' => $tags['mentions'],
368 'txt_cats' => L10n::t('Categories:'),
369 'txt_folders' => L10n::t('Filed under:'),
370 'has_cats' => ((count($categories)) ? 'true' : ''),
371 'has_folders' => ((count($folders)) ? 'true' : ''),
372 'categories' => $categories,
373 'folders' => $folders,
376 'id' => $this->getId(),
377 'guid' => urlencode($item['guid']),
378 'isevent' => $isevent,
380 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
381 'olinktitle' => L10n::t('View %s\'s profile @ %s', $this->getOwnerName(), $item['owner-link']),
382 'to' => L10n::t('to'),
383 'via' => L10n::t('via'),
384 'wall' => L10n::t('Wall-to-Wall'),
385 'vwall' => L10n::t('via Wall-To-Wall:'),
386 'profile_url' => $profile_link,
387 'item_photo_menu' => item_photo_menu($item),
389 'thumb' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
390 'osparkle' => $osparkle,
391 'sparkle' => $sparkle,
393 'localtime' => DateTimeFormat::local($item['created'], 'r'),
394 'ago' => $item['app'] ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']), $item['app']) : Temporal::getRelativeDate($item['created']),
395 'app' => $item['app'],
396 'created' => Temporal::getRelativeDate($item['created']),
398 'location' => $location_e,
401 'owner_self' => $item['author-link'] == defaults($_SESSION, 'my_url', null),
402 'owner_url' => $this->getOwnerUrl(),
403 'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
404 'owner_name' => $owner_name_e,
405 'plink' => Item::getPlink($item),
407 'isstarred' => $isstarred,
414 'like' => $responses['like']['output'],
415 'dislike' => $responses['dislike']['output'],
416 'responses' => $responses,
417 'switchcomment' => L10n::t('Comment'),
418 'reply_label' => L10n::t('Reply to %s', $name_e),
419 'comment' => $comment,
420 'previewing' => $conv->isPreview() ? ' preview ' : '',
421 'wait' => L10n::t('Please wait'),
422 'thread_level' => $thread_level,
424 'network' => $item["network"],
425 'network_name' => ContactSelector::networkToName($item['network'], $item['author-link']),
426 'received' => $item['received'],
427 'commented' => $item['commented'],
428 'created_date' => $item['created'],
429 'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
431 'queue_count' => $item['delivery_queue_count'],
432 'queue_done' => $item['delivery_queue_done'],
433 'notifier_pending' => L10n::t('Notifier task is pending'),
434 'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
435 'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
436 'delivery_almost' => L10n::t('Delivery to remote servers is mostly done'),
437 'delivery_done' => L10n::t('Delivery to remote servers is done'),
441 $arr = ['item' => $item, 'output' => $tmp_item];
442 Hook::callAll('display_item', $arr);
444 $result = $arr['output'];
446 $result['children'] = [];
447 $children = $this->getChildren();
448 $nb_children = count($children);
449 if ($nb_children > 0) {
450 foreach ($children as $child) {
451 $result['children'][] = $child->getTemplateData($conv_responses, $thread_level + 1);
455 if (($nb_children > 2) || ($thread_level > 1)) {
456 $result['children'][0]['comment_firstcollapsed'] = true;
457 $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
458 $result['children'][0]['show_text'] = L10n::t('Show more');
459 $result['children'][0]['hide_text'] = L10n::t('Show fewer');
460 if ($thread_level > 1) {
461 $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
463 $result['children'][$nb_children - 3]['comment_lastcollapsed'] = true;
468 if ($this->isToplevel()) {
469 $result['total_comments_num'] = "$total_children";
470 $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
473 $result['private'] = $item['private'];
474 $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
476 if ($this->isThreaded()) {
477 $result['flatten'] = false;
478 $result['threaded'] = true;
480 $result['flatten'] = true;
481 $result['threaded'] = false;
490 public function getId()
492 return $this->getDataValue('id');
498 public function isThreaded()
500 return $this->threaded;
506 * @param Post $item The child item to add
511 public function addChild(Post $item)
513 $item_id = $item->getId();
515 Logger::log('[ERROR] Post::addChild : Item has no ID!!', Logger::DEBUG);
517 } elseif ($this->getChild($item->getId())) {
518 Logger::log('[WARN] Post::addChild : Item already exists (' . $item->getId() . ').', Logger::DEBUG);
522 * Only add what will be displayed
524 if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) {
526 } elseif (activity_match($item->getDataValue('verb'), ACTIVITY_LIKE) || activity_match($item->getDataValue('verb'), ACTIVITY_DISLIKE)) {
530 $item->setParent($this);
531 $this->children[] = $item;
533 return end($this->children);
537 * Get a child by its ID
539 * @param integer $id The child id
543 public function getChild($id)
545 foreach ($this->getChildren() as $child) {
546 if ($child->getId() == $id) {
555 * Get all our children
559 public function getChildren()
561 return $this->children;
567 * @param Post $item The item to set as parent
571 protected function setParent(Post $item)
573 $parent = $this->getParent();
575 $parent->removeChild($this);
578 $this->parent = $item;
579 $this->setThread($item->getThread());
587 protected function removeParent()
589 $this->parent = null;
590 $this->thread = null;
596 * @param Post $item The child to be removed
598 * @return boolean Success or failure
601 public function removeChild(Post $item)
603 $id = $item->getId();
604 foreach ($this->getChildren() as $key => $child) {
605 if ($child->getId() == $id) {
606 $child->removeParent();
607 unset($this->children[$key]);
608 // Reindex the array, in order to make sure there won't be any trouble on loops using count()
609 $this->children = array_values($this->children);
613 Logger::log('[WARN] Item::removeChild : Item is not a child (' . $id . ').', Logger::DEBUG);
622 protected function getParent()
624 return $this->parent;
628 * Set conversation thread
630 * @param Thread $thread
634 public function setThread(Thread $thread = null)
636 $this->thread = $thread;
638 // Set it on our children too
639 foreach ($this->getChildren() as $child) {
640 $child->setThread($thread);
649 public function getThread()
651 return $this->thread;
657 * We shouldn't need this
661 public function getData()
669 * @param string $name key
671 * @return mixed value on success
674 public function getDataValue($name)
676 if (!isset($this->data[$name])) {
677 // Logger::log('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".', Logger::DEBUG);
681 return $this->data[$name];
687 * @param string $name template name
691 private function setTemplate($name)
693 if (empty($this->available_templates[$name])) {
694 Logger::log('[ERROR] Item::setTemplate : Template not available ("' . $name . '").', Logger::DEBUG);
698 $this->template = $this->available_templates[$name];
708 private function getTemplate()
710 return $this->template;
714 * Check if this is a toplevel post
718 private function isToplevel()
720 return $this->toplevel;
724 * Check if this is writable
728 private function isWritable()
730 $conv = $this->getThread();
733 // This will allow us to comment on wall-to-wall items owned by our friends
734 // and community forums even if somebody else wrote the post.
735 // bug #517 - this fixes for conversation owner
736 if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == local_user()) {
740 // this fixes for visitors
741 return ($this->writable || ($this->isVisiting() && $conv->getMode() == 'profile'));
743 return $this->writable;
747 * Count the total of our descendants
751 private function countDescendants()
753 $children = $this->getChildren();
754 $total = count($children);
756 foreach ($children as $child) {
757 $total += $child->countDescendants();
765 * Get the template for the comment box
769 private function getCommentBoxTemplate()
771 return $this->comment_box_template;
775 * Get default text for the comment box
778 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
780 private function getDefaultText()
784 if (!local_user() || empty($a->profile['addr'])) {
788 if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
792 $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);
793 if (!DBA::isResult($item) || empty($item['author-addr'])) {
798 if ($item['author-addr'] != $a->profile['addr']) {
799 $text = '@' . $item['author-addr'] . ' ';
804 $terms = Term::tagArrayFromItemId($this->getId(), TERM_MENTION);
806 foreach ($terms as $term) {
807 $profile = Contact::getDetailsByURL($term['url']);
808 if (!empty($profile['addr']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) &&
809 ($profile['addr'] != $a->profile['addr']) && !strstr($text, $profile['addr'])) {
810 $text .= '@' . $profile['addr'] . ' ';
818 * Get the comment box
820 * @param string $indent Indent value
822 * @return mixed The comment box string (empty if no comment box)
826 private function getCommentBox($indent)
831 $conv = $this->getThread();
833 if (($conv->getMode() === 'network') && $this->isWallToWall()) {
837 if ($conv->isWritable() && $this->isWritable()) {
841 * Hmmm, code depending on the presence of a particular addon?
842 * This should be better if done by a hook
844 if (Addon::isEnabled('qcomment')) {
845 $qc = ((local_user()) ? PConfig::get(local_user(), 'qcomment', 'words') : null);
846 $qcomment = (($qc) ? explode("\n", $qc) : null);
849 // Fetch the user id from the parent when the owner user is empty
850 $uid = $conv->getProfileOwner();
851 $parent_uid = $this->getDataValue('uid');
853 $default_text = $this->getDefaultText();
855 if (!is_null($parent_uid) && ($uid != $parent_uid)) {
859 $template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
860 $comment_box = Renderer::replaceMacros($template, [
861 '$return_path' => $a->query_string,
862 '$threaded' => $this->isThreaded(),
864 '$wall' => ($conv->getMode() === 'profile'),
865 '$id' => $this->getId(),
866 '$parent' => $this->getId(),
867 '$qcomment' => $qcomment,
868 '$default' => $default_text,
869 '$profile_uid' => $uid,
870 '$mylink' => $a->removeBaseURL($a->contact['url']),
871 '$mytitle' => L10n::t('This is you'),
872 '$myphoto' => $a->removeBaseURL($a->contact['thumb']),
873 '$comment' => L10n::t('Comment'),
874 '$submit' => L10n::t('Submit'),
875 '$edbold' => L10n::t('Bold'),
876 '$editalic' => L10n::t('Italic'),
877 '$eduline' => L10n::t('Underline'),
878 '$edquote' => L10n::t('Quote'),
879 '$edcode' => L10n::t('Code'),
880 '$edimg' => L10n::t('Image'),
881 '$edurl' => L10n::t('Link'),
882 '$edattach' => L10n::t('Link or Media'),
883 '$prompttext' => L10n::t('Please enter a image/video/audio/webpage URL:'),
884 '$preview' => L10n::t('Preview'),
885 '$indent' => $indent,
886 '$sourceapp' => L10n::t($a->sourcename),
887 '$ww' => $conv->getMode() === 'network' ? $ww : '',
888 '$rand_num' => Crypto::randomDigits(12)
898 private function getRedirectUrl()
900 return $this->redirect_url;
904 * Check if we are a wall to wall item and set the relevant properties
909 protected function checkWallToWall()
912 $conv = $this->getThread();
913 $this->wall_to_wall = false;
915 if ($this->isToplevel()) {
916 if ($conv->getMode() !== 'profile') {
917 if ($this->getDataValue('wall') && !$this->getDataValue('self')) {
918 // On the network page, I am the owner. On the display page it will be the profile owner.
919 // This will have been stored in $a->page_contact by our calling page.
920 // Put this person as the wall owner of the wall-to-wall notice.
922 $this->owner_url = Contact::magicLink($a->page_contact['url']);
923 $this->owner_photo = $a->page_contact['thumb'];
924 $this->owner_name = $a->page_contact['name'];
925 $this->wall_to_wall = true;
926 } elseif ($this->getDataValue('owner-link')) {
927 $owner_linkmatch = (($this->getDataValue('owner-link')) && Strings::compareLink($this->getDataValue('owner-link'), $this->getDataValue('author-link')));
928 $alias_linkmatch = (($this->getDataValue('alias')) && Strings::compareLink($this->getDataValue('alias'), $this->getDataValue('author-link')));
929 $owner_namematch = (($this->getDataValue('owner-name')) && $this->getDataValue('owner-name') == $this->getDataValue('author-name'));
931 if (!$owner_linkmatch && !$alias_linkmatch && !$owner_namematch) {
932 // The author url doesn't match the owner (typically the contact)
933 // and also doesn't match the contact alias.
934 // The name match is a hack to catch several weird cases where URLs are
935 // all over the park. It can be tricked, but this prevents you from
936 // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
937 // well that it's the same Bob Smith.
938 // But it could be somebody else with the same name. It just isn't highly likely.
941 $this->owner_photo = $this->getDataValue('owner-avatar');
942 $this->owner_name = $this->getDataValue('owner-name');
943 $this->wall_to_wall = true;
945 $owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
946 'network' => $this->getDataValue('owner-network'),
947 'url' => $this->getDataValue('owner-link')];
948 $this->owner_url = Contact::magicLinkbyContact($owner);
954 if (!$this->wall_to_wall) {
955 $this->setTemplate('wall');
956 $this->owner_url = '';
957 $this->owner_photo = '';
958 $this->owner_name = '';
965 private function isWallToWall()
967 return $this->wall_to_wall;
973 private function getOwnerUrl()
975 return $this->owner_url;
981 private function getOwnerName()
983 return $this->owner_name;
989 private function isVisiting()
991 return $this->visiting;