Browse Source

Move Item and Conversation from Core to Object

- Move BaseObject from Core\ to Friendica\
pull/3921/head
Hypolite Petovan 4 years ago
parent
commit
f43aaf5227
  1. 4
      include/conversation.php
  2. 2
      index.php
  3. 8
      src/BaseObject.php
  4. 12
      src/Object/Conversation.php
  5. 20
      src/Object/Item.php

4
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";

2
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;

8
src/Core/BaseObject.php → src/BaseObject.php

@ -1,8 +1,8 @@
<?php
/**
* @file src/Core/BaseObject.php
* @file src/BaseObject.php
*/
namespace Friendica\Core;
namespace Friendica;
require_once 'boot.php';
@ -22,13 +22,13 @@ class BaseObject
*
* @return object
*/
public function getApp()
public static function getApp()
{
if (self::$app) {
return self::$app;
}
self::$app = boot::get_app();
self::$app = get_app();
return self::$app;
}

12
src/Core/Conversation.php → src/Object/Conversation.php

@ -1,11 +1,11 @@
<?php
/**
* @file src/Core/Conversation.php
* @file src/Object/Conversation.php
*/
namespace Friendica\Core;
namespace Friendica\Object;
use Friendica\Core\BaseObject;
use Friendica\Core\Item;
use Friendica\BaseObject;
use Friendica\Object\Item;
require_once 'boot.php';
require_once 'include/text.php';
@ -48,7 +48,7 @@ class Conversation extends BaseObject
return;
}
$a = $this->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;

20
src/Core/Item.php → src/Object/Item.php

@ -1,14 +1,14 @@
<?php
/**
* @file src/Core/Item.php
* @file src/Object/Item.php
*/
namespace Friendica\Core;
namespace Friendica\Object;
use Friendica\Core\BaseObject;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use Friendica\Object\Contact;
use dba;
require_once 'include/text.php';
@ -46,7 +46,7 @@ class Item extends BaseObject
*/
public function __construct($data)
{
$a = $this->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;
Loading…
Cancel
Save