From f43aaf5227af34b870bae3715f2cb1de293aa272 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 19 Nov 2017 16:50:49 -0500 Subject: [PATCH] Move Item and Conversation from Core to Object - Move BaseObject from Core\ to Friendica\ --- include/conversation.php | 4 ++-- index.php | 2 +- src/{Core => }/BaseObject.php | 8 ++++---- src/{Core => Object}/Conversation.php | 12 ++++++------ src/{Core => Object}/Item.php | 20 ++++++++++---------- 5 files changed, 23 insertions(+), 23 deletions(-) rename src/{Core => }/BaseObject.php (79%) rename src/{Core => Object}/Conversation.php (96%) rename src/{Core => Object}/Item.php (98%) diff --git a/include/conversation.php b/include/conversation.php index 218d7405b5..3eae184a82 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -4,11 +4,11 @@ */ use Friendica\App; use Friendica\Core\Config; -use Friendica\Core\Conversation; -use Friendica\Core\Item; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBM; +use Friendica\Object\Conversation; +use Friendica\Object\Item; require_once "include/bbcode.php"; require_once "include/acl_selectors.php"; diff --git a/index.php b/index.php index 5e8860afd3..0290a38be7 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,7 @@ */ use Friendica\App; -use Friendica\Core\BaseObject; +use Friendica\BaseObject; use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Core\Worker; diff --git a/src/Core/BaseObject.php b/src/BaseObject.php similarity index 79% rename from src/Core/BaseObject.php rename to src/BaseObject.php index d6ea17f708..01957164c1 100644 --- a/src/Core/BaseObject.php +++ b/src/BaseObject.php @@ -1,8 +1,8 @@ getApp(); + $a = self::getApp(); switch ($mode) { case 'network': @@ -165,7 +165,7 @@ class Conversation extends BaseObject */ public function getTemplateData($conv_responses) { - $a = get_app(); + $a = self::getApp(); $result = array(); $i = 0; diff --git a/src/Core/Item.php b/src/Object/Item.php similarity index 98% rename from src/Core/Item.php rename to src/Object/Item.php index 24e524d2ea..082ecae03a 100644 --- a/src/Core/Item.php +++ b/src/Object/Item.php @@ -1,14 +1,14 @@ getApp(); + $a = self::getApp(); $this->data = $data; $this->setTemplate('wall'); @@ -109,7 +109,7 @@ class Item extends BaseObject $result = array(); - $a = $this->getApp(); + $a = self::getApp(); $item = $this->getData(); $edited = false; @@ -186,7 +186,7 @@ class Item extends BaseObject } if (!isset($item['author-thumb']) || ($item['author-thumb'] == "")) { - $author_contact = get_contact_details_by_url($item['author-link'], $conv->getProfileOwner()); + $author_contact = Contact::getDetailsByURL($item['author-link'], $conv->getProfileOwner()); if ($author_contact["thumb"]) { $item['author-thumb'] = $author_contact["thumb"]; } else { @@ -195,7 +195,7 @@ class Item extends BaseObject } if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) { - $owner_contact = get_contact_details_by_url($item['owner-link'], $conv->getProfileOwner()); + $owner_contact = Contact::getDetailsByURL($item['owner-link'], $conv->getProfileOwner()); if ($owner_contact["thumb"]) { $item['owner-thumb'] = $owner_contact["thumb"]; } else { @@ -752,7 +752,7 @@ class Item extends BaseObject */ private function getCommentBox($indent) { - $a = $this->getApp(); + $a = self::getApp(); if (!$this->isToplevel() && !(Config::get('system', 'thread_allow') && $a->theme_thread_allow)) { return ''; } @@ -828,7 +828,7 @@ class Item extends BaseObject */ protected function checkWallToWall() { - $a = $this->getApp(); + $a = self::getApp(); $conv = $this->getConversation(); $this->wall_to_wall = false;