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\Model\User;
23 use Friendica\Util\Crypto;
24 use Friendica\Util\DateTimeFormat;
25 use Friendica\Util\Proxy as ProxyUtils;
26 use Friendica\Util\Strings;
27 use Friendica\Util\Temporal;
32 class Post extends BaseObject
35 private $template = null;
36 private $available_templates = [
37 'wall' => 'wall_thread.tpl',
38 'wall2wall' => 'wallwall_thread.tpl'
40 private $comment_box_template = 'comment_item.tpl';
41 private $toplevel = false;
42 private $writable = false;
46 private $children = [];
47 private $parent = null;
52 private $thread = null;
53 private $redirect_url = null;
54 private $owner_url = '';
55 private $owner_photo = '';
56 private $owner_name = '';
57 private $wall_to_wall = false;
58 private $threaded = false;
59 private $visiting = false;
64 * @param array $data data array
67 public function __construct(array $data)
70 $this->setTemplate('wall');
71 $this->toplevel = $this->getId() == $this->getDataValue('parent');
73 if (!empty($_SESSION['remote']) && is_array($_SESSION['remote'])) {
74 foreach ($_SESSION['remote'] as $visitor) {
75 if ($visitor['cid'] == $this->getDataValue('contact-id')) {
76 $this->visiting = true;
82 $this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
83 $author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
84 'network' => $this->getDataValue('author-network'),
85 'url' => $this->getDataValue('author-link')];
86 $this->redirect_url = Contact::magicLinkByContact($author);
87 if (!$this->isToplevel()) {
88 $this->threaded = true;
91 // Prepare the children
92 if (!empty($data['children'])) {
93 foreach ($data['children'] as $item) {
94 // Only add will be displayed
95 if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) {
97 } elseif (!visible_activity($item)) {
101 // You can always comment on Diaspora and OStatus items
102 if (in_array($item['network'], [Protocol::OSTATUS, Protocol::DIASPORA]) && (local_user() == $item['uid'])) {
103 $item['writable'] = true;
106 $item['pagedrop'] = $data['pagedrop'];
107 $child = new Post($item);
108 $this->addChild($child);
114 * Get data in a form usable by a conversation template
116 * @param array $conv_responses conversation responses
117 * @param integer $thread_level default = 1
119 * @return mixed The data requested on success
121 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
122 * @throws \ImagickException
124 public function getTemplateData(array $conv_responses, $thread_level = 1)
128 $item = $this->getData();
130 // If the time between "created" and "edited" differs we add
131 // a notice that the post was edited.
132 // Note: In some networks reshared items seem to have (sometimes) a difference
133 // between creation time and edit time of a second. Thats why we add the notice
134 // only if the difference is more than 1 second.
135 if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
137 'label' => L10n::t('This entry was edited'),
138 'date' => DateTimeFormat::local($item['edited'], 'r'),
139 'relative' => Temporal::getRelativeDate($item['edited'])
147 $isstarred = "unstarred";
151 $total_children = $this->countDescendants();
153 $conv = $this->getThread();
155 $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
156 || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
157 ? L10n::t('Private Message')
160 $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
165 if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
166 if ($item["event-id"] != 0) {
167 $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
169 $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
172 $dropping = in_array($item['uid'], [0, local_user()]);
175 // Editing on items of not subscribed users isn't currently possible
176 // There are some issues on editing that prevent this.
177 // But also it is an issue of the supported protocols that doesn't allow editing at all.
178 if ($item['uid'] == 0) {
182 if (($this->getDataValue('uid') == local_user()) || $this->isVisiting()) {
186 $origin = $item['origin'];
189 /// @todo This shouldn't be done as query here, but better during the data creation.
190 // it is now done here, since during the RC phase we shouldn't make to intense changes.
191 $parent = Item::selectFirst(['origin'], ['id' => $item['parent']]);
192 if (DBA::isResult($parent)) {
193 $origin = $parent['origin'];
197 if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
198 // ActivityPub doesn't allow removal of remote comments
199 $delete = L10n::t('Delete locally');
201 // Showing the one or the other text, depending upon if we can only hide it or really delete it.
202 $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
206 'dropping' => $dropping,
207 'pagedrop' => $item['pagedrop'],
208 'select' => L10n::t('Select'),
216 $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
218 $profile_name = $item['author-name'];
219 if (!empty($item['author-link']) && empty($item['author-name'])) {
220 $profile_name = $item['author-link'];
223 $author = ['uid' => 0, 'id' => $item['author-id'],
224 'network' => $item['author-network'], 'url' => $item['author-link']];
226 if (local_user() || remote_user()) {
227 $profile_link = Contact::magicLinkByContact($author);
229 $profile_link = $item['author-link'];
232 if (strpos($profile_link, 'redir/') === 0) {
233 $sparkle = ' sparkle';
236 $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
237 Hook::callAll('render_location', $locate);
238 $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
240 // process action responses - e.g. like/dislike/attend/agree/whatever
241 $response_verbs = ['like', 'dislike', 'announce'];
245 if ($item['object-type'] === ACTIVITY_OBJ_EVENT) {
246 $response_verbs[] = 'attendyes';
247 $response_verbs[] = 'attendno';
248 $response_verbs[] = 'attendmaybe';
249 if ($conv->isWritable()) {
251 $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
255 $responses = get_responses($conv_responses, $response_verbs, $item, $this);
257 foreach ($response_verbs as $value => $verbs) {
258 $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']) : '';
262 * We should avoid doing this all the time, but it depends on the conversation mode
263 * And the conv mode may change when we change the conv, or it changes its mode
264 * Maybe we should establish a way to be notified about conversation changes
266 $this->checkWallToWall();
268 if ($this->isWallToWall() && ($this->getOwnerUrl() == $this->getRedirectUrl())) {
269 $osparkle = ' sparkle';
274 if ($this->isToplevel()) {
276 $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
277 if (DBA::isResult($thread)) {
279 'do' => L10n::t("ignore thread"),
280 'undo' => L10n::t("unignore thread"),
281 'toggle' => L10n::t("toggle ignore status"),
282 'classdo' => $thread['ignored'] ? "hidden" : "",
283 'classundo' => $thread['ignored'] ? "" : "hidden",
284 'ignored' => L10n::t('ignored'),
288 if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
289 $isstarred = (($item['starred']) ? "starred" : "unstarred");
292 'do' => L10n::t("add star"),
293 'undo' => L10n::t("remove star"),
294 'toggle' => L10n::t("toggle star status"),
295 'classdo' => $item['starred'] ? "hidden" : "",
296 'classundo' => $item['starred'] ? "" : "hidden",
297 'starred' => L10n::t('starred'),
301 'add' => L10n::t("add tag"),
310 if ($conv->isWritable()) {
312 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
313 'dislike' => [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")],
316 $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
320 $comment = $this->getCommentBox($indent);
322 if (strcmp(DateTimeFormat::utc($item['created']), DateTimeFormat::utc('now - 12 hours')) > 0) {
326 localize_item($item);
328 $body = Item::prepareBody($item, true);
330 list($categories, $folders) = get_cats_and_terms($item);
333 $text_e = strip_tags($body);
334 $name_e = $profile_name;
336 if (!empty($item['content-warning']) && PConfig::get(local_user(), 'system', 'disable_cw', false)) {
337 $title_e = ucfirst($item['content-warning']);
339 $title_e = $item['title'];
342 $location_e = $location;
343 $owner_name_e = $this->getOwnerName();
345 // Disable features that aren't available in several networks
346 if (!in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA]) && isset($buttons["dislike"])) {
347 unset($buttons["dislike"]);
352 if (($item["network"] == Protocol::FEED) && isset($buttons["like"])) {
353 unset($buttons["like"]);
356 if (($item["network"] == Protocol::MAIL) && isset($buttons["like"])) {
357 unset($buttons["like"]);
360 $tags = Term::populateTagsFromItem($item);
363 'template' => $this->getTemplate(),
364 'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
365 'suppress_tags' => Config::get('system', 'suppress_tags'),
366 'tags' => $tags['tags'],
367 'hashtags' => $tags['hashtags'],
368 'mentions' => $tags['mentions'],
369 'implicit_mentions' => $tags['implicit_mentions'],
370 'txt_cats' => L10n::t('Categories:'),
371 'txt_folders' => L10n::t('Filed under:'),
372 'has_cats' => ((count($categories)) ? 'true' : ''),
373 'has_folders' => ((count($folders)) ? 'true' : ''),
374 'categories' => $categories,
375 'folders' => $folders,
378 'id' => $this->getId(),
379 'guid' => urlencode($item['guid']),
380 'isevent' => $isevent,
382 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
383 'olinktitle' => L10n::t('View %s\'s profile @ %s', $this->getOwnerName(), $item['owner-link']),
384 'to' => L10n::t('to'),
385 'via' => L10n::t('via'),
386 'wall' => L10n::t('Wall-to-Wall'),
387 'vwall' => L10n::t('via Wall-To-Wall:'),
388 'profile_url' => $profile_link,
389 'item_photo_menu' => item_photo_menu($item),
391 'thumb' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
392 'osparkle' => $osparkle,
393 'sparkle' => $sparkle,
395 'localtime' => DateTimeFormat::local($item['created'], 'r'),
396 'ago' => $item['app'] ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']), $item['app']) : Temporal::getRelativeDate($item['created']),
397 'app' => $item['app'],
398 'created' => Temporal::getRelativeDate($item['created']),
400 'location' => $location_e,
403 'owner_self' => $item['author-link'] == defaults($_SESSION, 'my_url', null),
404 'owner_url' => $this->getOwnerUrl(),
405 'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
406 'owner_name' => $owner_name_e,
407 'plink' => Item::getPlink($item),
409 'isstarred' => $isstarred,
416 'like' => $responses['like']['output'],
417 'dislike' => $responses['dislike']['output'],
418 'responses' => $responses,
419 'switchcomment' => L10n::t('Comment'),
420 'reply_label' => L10n::t('Reply to %s', $name_e),
421 'comment' => $comment,
422 'previewing' => $conv->isPreview() ? ' preview ' : '',
423 'wait' => L10n::t('Please wait'),
424 'thread_level' => $thread_level,
426 'network' => $item["network"],
427 'network_name' => ContactSelector::networkToName($item['network'], $item['author-link']),
428 'received' => $item['received'],
429 'commented' => $item['commented'],
430 'created_date' => $item['created'],
431 'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
433 'queue_count' => $item['delivery_queue_count'],
434 'queue_done' => $item['delivery_queue_done'],
435 'notifier_pending' => L10n::t('Notifier task is pending'),
436 'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
437 'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
438 'delivery_almost' => L10n::t('Delivery to remote servers is mostly done'),
439 'delivery_done' => L10n::t('Delivery to remote servers is done'),
443 $arr = ['item' => $item, 'output' => $tmp_item];
444 Hook::callAll('display_item', $arr);
446 $result = $arr['output'];
448 $result['children'] = [];
449 $children = $this->getChildren();
450 $nb_children = count($children);
451 if ($nb_children > 0) {
452 foreach ($children as $child) {
453 $result['children'][] = $child->getTemplateData($conv_responses, $thread_level + 1);
457 if (($nb_children > 2) || ($thread_level > 1)) {
458 $result['children'][0]['comment_firstcollapsed'] = true;
459 $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
460 $result['children'][0]['show_text'] = L10n::t('Show more');
461 $result['children'][0]['hide_text'] = L10n::t('Show fewer');
462 if ($thread_level > 1) {
463 $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
465 $result['children'][$nb_children - 3]['comment_lastcollapsed'] = true;
470 if ($this->isToplevel()) {
471 $result['total_comments_num'] = "$total_children";
472 $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
475 $result['private'] = $item['private'];
476 $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
478 if ($this->isThreaded()) {
479 $result['flatten'] = false;
480 $result['threaded'] = true;
482 $result['flatten'] = true;
483 $result['threaded'] = false;
492 public function getId()
494 return $this->getDataValue('id');
500 public function isThreaded()
502 return $this->threaded;
508 * @param Post $item The child item to add
513 public function addChild(Post $item)
515 $item_id = $item->getId();
517 Logger::log('[ERROR] Post::addChild : Item has no ID!!', Logger::DEBUG);
519 } elseif ($this->getChild($item->getId())) {
520 Logger::log('[WARN] Post::addChild : Item already exists (' . $item->getId() . ').', Logger::DEBUG);
524 * Only add what will be displayed
526 if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) {
528 } elseif (activity_match($item->getDataValue('verb'), ACTIVITY_LIKE) || activity_match($item->getDataValue('verb'), ACTIVITY_DISLIKE)) {
532 $item->setParent($this);
533 $this->children[] = $item;
535 return end($this->children);
539 * Get a child by its ID
541 * @param integer $id The child id
545 public function getChild($id)
547 foreach ($this->getChildren() as $child) {
548 if ($child->getId() == $id) {
557 * Get all our children
561 public function getChildren()
563 return $this->children;
569 * @param Post $item The item to set as parent
573 protected function setParent(Post $item)
575 $parent = $this->getParent();
577 $parent->removeChild($this);
580 $this->parent = $item;
581 $this->setThread($item->getThread());
589 protected function removeParent()
591 $this->parent = null;
592 $this->thread = null;
598 * @param Post $item The child to be removed
600 * @return boolean Success or failure
603 public function removeChild(Post $item)
605 $id = $item->getId();
606 foreach ($this->getChildren() as $key => $child) {
607 if ($child->getId() == $id) {
608 $child->removeParent();
609 unset($this->children[$key]);
610 // Reindex the array, in order to make sure there won't be any trouble on loops using count()
611 $this->children = array_values($this->children);
615 Logger::log('[WARN] Item::removeChild : Item is not a child (' . $id . ').', Logger::DEBUG);
624 protected function getParent()
626 return $this->parent;
630 * Set conversation thread
632 * @param Thread $thread
636 public function setThread(Thread $thread = null)
638 $this->thread = $thread;
640 // Set it on our children too
641 foreach ($this->getChildren() as $child) {
642 $child->setThread($thread);
651 public function getThread()
653 return $this->thread;
659 * We shouldn't need this
663 public function getData()
671 * @param string $name key
673 * @return mixed value on success
676 public function getDataValue($name)
678 if (!isset($this->data[$name])) {
679 // Logger::log('[ERROR] Item::getDataValue : Item has no value name "'. $name .'".', Logger::DEBUG);
683 return $this->data[$name];
689 * @param string $name template name
693 private function setTemplate($name)
695 if (empty($this->available_templates[$name])) {
696 Logger::log('[ERROR] Item::setTemplate : Template not available ("' . $name . '").', Logger::DEBUG);
700 $this->template = $this->available_templates[$name];
710 private function getTemplate()
712 return $this->template;
716 * Check if this is a toplevel post
720 private function isToplevel()
722 return $this->toplevel;
726 * Check if this is writable
730 private function isWritable()
732 $conv = $this->getThread();
735 // This will allow us to comment on wall-to-wall items owned by our friends
736 // and community forums even if somebody else wrote the post.
737 // bug #517 - this fixes for conversation owner
738 if ($conv->getMode() == 'profile' && $conv->getProfileOwner() == local_user()) {
742 // this fixes for visitors
743 return ($this->writable || ($this->isVisiting() && $conv->getMode() == 'profile'));
745 return $this->writable;
749 * Count the total of our descendants
753 private function countDescendants()
755 $children = $this->getChildren();
756 $total = count($children);
758 foreach ($children as $child) {
759 $total += $child->countDescendants();
767 * Get the template for the comment box
771 private function getCommentBoxTemplate()
773 return $this->comment_box_template;
777 * Get default text for the comment box
780 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
782 private function getDefaultText()
790 $owner = User::getOwnerDataById($a->user['uid']);
792 if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
796 $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);
797 if (!DBA::isResult($item) || empty($item['author-addr'])) {
802 if ($item['author-addr'] != $owner['addr']) {
803 $text = '@' . $item['author-addr'] . ' ';
808 $terms = Term::tagArrayFromItemId($this->getId(), [Term::MENTION, Term::IMPLICIT_MENTION]);
809 foreach ($terms as $term) {
810 $profile = Contact::getDetailsByURL($term['url']);
811 if (!empty($profile['addr']) && (defaults($profile, 'contact-type', Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
812 ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
813 $text .= '@' . $profile['addr'] . ' ';
821 * Get the comment box
823 * @param string $indent Indent value
825 * @return mixed The comment box string (empty if no comment box)
829 private function getCommentBox($indent)
834 $conv = $this->getThread();
836 if (($conv->getMode() === 'network') && $this->isWallToWall()) {
840 if ($conv->isWritable() && $this->isWritable()) {
844 * Hmmm, code depending on the presence of a particular addon?
845 * This should be better if done by a hook
847 if (Addon::isEnabled('qcomment')) {
848 $qc = ((local_user()) ? PConfig::get(local_user(), 'qcomment', 'words') : null);
849 $qcomment = (($qc) ? explode("\n", $qc) : null);
852 // Fetch the user id from the parent when the owner user is empty
853 $uid = $conv->getProfileOwner();
854 $parent_uid = $this->getDataValue('uid');
856 $default_text = $this->getDefaultText();
858 if (!is_null($parent_uid) && ($uid != $parent_uid)) {
862 $template = Renderer::getMarkupTemplate($this->getCommentBoxTemplate());
863 $comment_box = Renderer::replaceMacros($template, [
864 '$return_path' => $a->query_string,
865 '$threaded' => $this->isThreaded(),
867 '$wall' => ($conv->getMode() === 'profile'),
868 '$id' => $this->getId(),
869 '$parent' => $this->getId(),
870 '$qcomment' => $qcomment,
871 '$default' => $default_text,
872 '$profile_uid' => $uid,
873 '$mylink' => $a->removeBaseURL($a->contact['url']),
874 '$mytitle' => L10n::t('This is you'),
875 '$myphoto' => $a->removeBaseURL($a->contact['thumb']),
876 '$comment' => L10n::t('Comment'),
877 '$submit' => L10n::t('Submit'),
878 '$edbold' => L10n::t('Bold'),
879 '$editalic' => L10n::t('Italic'),
880 '$eduline' => L10n::t('Underline'),
881 '$edquote' => L10n::t('Quote'),
882 '$edcode' => L10n::t('Code'),
883 '$edimg' => L10n::t('Image'),
884 '$edurl' => L10n::t('Link'),
885 '$edattach' => L10n::t('Link or Media'),
886 '$prompttext' => L10n::t('Please enter a image/video/audio/webpage URL:'),
887 '$preview' => L10n::t('Preview'),
888 '$indent' => $indent,
889 '$sourceapp' => L10n::t($a->sourcename),
890 '$ww' => $conv->getMode() === 'network' ? $ww : '',
891 '$rand_num' => Crypto::randomDigits(12)
901 private function getRedirectUrl()
903 return $this->redirect_url;
907 * Check if we are a wall to wall item and set the relevant properties
912 protected function checkWallToWall()
915 $conv = $this->getThread();
916 $this->wall_to_wall = false;
918 if ($this->isToplevel()) {
919 if ($conv->getMode() !== 'profile') {
920 if ($this->getDataValue('wall') && !$this->getDataValue('self')) {
921 // On the network page, I am the owner. On the display page it will be the profile owner.
922 // This will have been stored in $a->page_contact by our calling page.
923 // Put this person as the wall owner of the wall-to-wall notice.
925 $this->owner_url = Contact::magicLink($a->page_contact['url']);
926 $this->owner_photo = $a->page_contact['thumb'];
927 $this->owner_name = $a->page_contact['name'];
928 $this->wall_to_wall = true;
929 } elseif ($this->getDataValue('owner-link')) {
930 $owner_linkmatch = (($this->getDataValue('owner-link')) && Strings::compareLink($this->getDataValue('owner-link'), $this->getDataValue('author-link')));
931 $alias_linkmatch = (($this->getDataValue('alias')) && Strings::compareLink($this->getDataValue('alias'), $this->getDataValue('author-link')));
932 $owner_namematch = (($this->getDataValue('owner-name')) && $this->getDataValue('owner-name') == $this->getDataValue('author-name'));
934 if (!$owner_linkmatch && !$alias_linkmatch && !$owner_namematch) {
935 // The author url doesn't match the owner (typically the contact)
936 // and also doesn't match the contact alias.
937 // The name match is a hack to catch several weird cases where URLs are
938 // all over the park. It can be tricked, but this prevents you from
939 // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
940 // well that it's the same Bob Smith.
941 // But it could be somebody else with the same name. It just isn't highly likely.
944 $this->owner_photo = $this->getDataValue('owner-avatar');
945 $this->owner_name = $this->getDataValue('owner-name');
946 $this->wall_to_wall = true;
948 $owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
949 'network' => $this->getDataValue('owner-network'),
950 'url' => $this->getDataValue('owner-link')];
951 $this->owner_url = Contact::magicLinkByContact($owner);
957 if (!$this->wall_to_wall) {
958 $this->setTemplate('wall');
959 $this->owner_url = '';
960 $this->owner_photo = '';
961 $this->owner_name = '';
968 private function isWallToWall()
970 return $this->wall_to_wall;
976 private function getOwnerUrl()
978 return $this->owner_url;
984 private function getOwnerName()
986 return $this->owner_name;
992 private function isVisiting()
994 return $this->visiting;