Fix various documentation issues/unused variables
This commit is contained in:
parent
8a0e4e12e1
commit
dea1a98a5d
|
@ -129,7 +129,6 @@ function group_content(App $a) {
|
||||||
|
|
||||||
$members = [];
|
$members = [];
|
||||||
$preselected = [];
|
$preselected = [];
|
||||||
$entry = [];
|
|
||||||
|
|
||||||
$context = $context + [
|
$context = $context + [
|
||||||
'$title' => $group['name'],
|
'$title' => $group['name'],
|
||||||
|
@ -191,8 +190,6 @@ function group_content(App $a) {
|
||||||
$group = $r[0];
|
$group = $r[0];
|
||||||
$members = Model\Contact::getByGroupId($group['id']);
|
$members = Model\Contact::getByGroupId($group['id']);
|
||||||
$preselected = [];
|
$preselected = [];
|
||||||
$entry = [];
|
|
||||||
$id = 0;
|
|
||||||
|
|
||||||
if (count($members)) {
|
if (count($members)) {
|
||||||
foreach ($members as $member) {
|
foreach ($members as $member) {
|
||||||
|
|
|
@ -912,7 +912,7 @@ function item_content(App $a)
|
||||||
* the appropiate link.
|
* the appropiate link.
|
||||||
*
|
*
|
||||||
* @param App $a Application instance @TODO is unused in this function's scope (excluding included files)
|
* @param App $a Application instance @TODO is unused in this function's scope (excluding included files)
|
||||||
* @param unknown_type $body the text to replace the tag in
|
* @param string $body the text to replace the tag in
|
||||||
* @param string $inform a comma-seperated string containing everybody to inform
|
* @param string $inform a comma-seperated string containing everybody to inform
|
||||||
* @param string $str_tags string to add the tag to
|
* @param string $str_tags string to add the tag to
|
||||||
* @param integer $profile_uid
|
* @param integer $profile_uid
|
||||||
|
|
|
@ -351,8 +351,6 @@ class Group extends BaseObject
|
||||||
*/
|
*/
|
||||||
public static function sidebarWidget($every = 'contact', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0)
|
public static function sidebarWidget($every = 'contact', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0)
|
||||||
{
|
{
|
||||||
$o = '';
|
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1238,8 +1238,6 @@ class Item extends BaseObject
|
||||||
|
|
||||||
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
|
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
|
||||||
{
|
{
|
||||||
$a = \get_app();
|
|
||||||
|
|
||||||
// If it is a posting where users should get notifications, then define it as wall posting
|
// If it is a posting where users should get notifications, then define it as wall posting
|
||||||
if ($notify) {
|
if ($notify) {
|
||||||
$item['wall'] = 1;
|
$item['wall'] = 1;
|
||||||
|
@ -1883,6 +1881,7 @@ class Item extends BaseObject
|
||||||
* @brief Insert a new item content entry
|
* @brief Insert a new item content entry
|
||||||
*
|
*
|
||||||
* @param array $item The item fields that are to be inserted
|
* @param array $item The item fields that are to be inserted
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private static function insertActivity(&$item)
|
private static function insertActivity(&$item)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace Friendica\Object;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Content\ContactSelector;
|
use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Content\Feature;
|
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
@ -16,6 +15,7 @@ use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
use Friendica\Model\Conversation;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Term;
|
use Friendica\Model\Term;
|
||||||
use Friendica\Util\Crypto;
|
use Friendica\Util\Crypto;
|
||||||
|
@ -38,8 +38,15 @@ class Post extends BaseObject
|
||||||
private $comment_box_template = 'comment_item.tpl';
|
private $comment_box_template = 'comment_item.tpl';
|
||||||
private $toplevel = false;
|
private $toplevel = false;
|
||||||
private $writable = false;
|
private $writable = false;
|
||||||
|
/**
|
||||||
|
* @var Post[]
|
||||||
|
*/
|
||||||
private $children = [];
|
private $children = [];
|
||||||
private $parent = null;
|
private $parent = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Thread
|
||||||
|
*/
|
||||||
private $thread = null;
|
private $thread = null;
|
||||||
private $redirect_url = null;
|
private $redirect_url = null;
|
||||||
private $owner_url = '';
|
private $owner_url = '';
|
||||||
|
@ -56,8 +63,6 @@ class Post extends BaseObject
|
||||||
*/
|
*/
|
||||||
public function __construct(array $data)
|
public function __construct(array $data)
|
||||||
{
|
{
|
||||||
$a = self::getApp();
|
|
||||||
|
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
$this->setTemplate('wall');
|
$this->setTemplate('wall');
|
||||||
$this->toplevel = $this->getId() == $this->getDataValue('parent');
|
$this->toplevel = $this->getId() == $this->getDataValue('parent');
|
||||||
|
@ -105,16 +110,14 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Get data in a form usable by a conversation template
|
* Get data in a form usable by a conversation template
|
||||||
*
|
*
|
||||||
* @param object $conv_responses conversation responses
|
* @param array $conv_responses conversation responses
|
||||||
* @param integer $thread_level default = 1
|
* @param integer $thread_level default = 1
|
||||||
*
|
*
|
||||||
* @return mixed The data requested on success
|
* @return mixed The data requested on success
|
||||||
* false on failure
|
* false on failure
|
||||||
*/
|
*/
|
||||||
public function getTemplateData($conv_responses, $thread_level = 1)
|
public function getTemplateData(array $conv_responses, $thread_level = 1)
|
||||||
{
|
{
|
||||||
$result = [];
|
|
||||||
|
|
||||||
$a = self::getApp();
|
$a = self::getApp();
|
||||||
|
|
||||||
$item = $this->getData();
|
$item = $this->getData();
|
||||||
|
@ -131,7 +134,6 @@ class Post extends BaseObject
|
||||||
'relative' => Temporal::getRelativeDate($item['edited'])
|
'relative' => Temporal::getRelativeDate($item['edited'])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$commentww = '';
|
|
||||||
$sparkle = '';
|
$sparkle = '';
|
||||||
$buttons = '';
|
$buttons = '';
|
||||||
$dropping = false;
|
$dropping = false;
|
||||||
|
@ -486,7 +488,7 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Add a child item
|
* Add a child item
|
||||||
*
|
*
|
||||||
* @param object $item The child item to add
|
* @param Post $item The child item to add
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
@ -536,7 +538,7 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Get all our children
|
* Get all our children
|
||||||
*
|
*
|
||||||
* @return object
|
* @return Post[]
|
||||||
*/
|
*/
|
||||||
public function getChildren()
|
public function getChildren()
|
||||||
{
|
{
|
||||||
|
@ -546,11 +548,11 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Set our parent
|
* Set our parent
|
||||||
*
|
*
|
||||||
* @param object $item The item to set as parent
|
* @param Post $item The item to set as parent
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function setParent($item)
|
protected function setParent(Post $item)
|
||||||
{
|
{
|
||||||
$parent = $this->getParent();
|
$parent = $this->getParent();
|
||||||
if ($parent) {
|
if ($parent) {
|
||||||
|
@ -575,11 +577,11 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Remove a child
|
* Remove a child
|
||||||
*
|
*
|
||||||
* @param object $item The child to be removed
|
* @param Post $item The child to be removed
|
||||||
*
|
*
|
||||||
* @return boolean Success or failure
|
* @return boolean Success or failure
|
||||||
*/
|
*/
|
||||||
public function removeChild($item)
|
public function removeChild(Post $item)
|
||||||
{
|
{
|
||||||
$id = $item->getId();
|
$id = $item->getId();
|
||||||
foreach ($this->getChildren() as $key => $child) {
|
foreach ($this->getChildren() as $key => $child) {
|
||||||
|
@ -606,28 +608,26 @@ class Post extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set conversation
|
* Set conversation thread
|
||||||
*
|
*
|
||||||
* @param object $conv The conversation
|
* @param Thread $thread
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setThread($conv)
|
public function setThread(Thread $thread = null)
|
||||||
{
|
{
|
||||||
$previous_mode = ($this->thread ? $this->thread->getMode() : '');
|
$this->thread = $thread;
|
||||||
|
|
||||||
$this->thread = $conv;
|
|
||||||
|
|
||||||
// Set it on our children too
|
// Set it on our children too
|
||||||
foreach ($this->getChildren() as $child) {
|
foreach ($this->getChildren() as $child) {
|
||||||
$child->setThread($conv);
|
$child->setThread($thread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get conversation
|
* Get conversation
|
||||||
*
|
*
|
||||||
* @return object
|
* @return Thread
|
||||||
*/
|
*/
|
||||||
public function getThread()
|
public function getThread()
|
||||||
{
|
{
|
||||||
|
@ -649,7 +649,7 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Get a data value
|
* Get a data value
|
||||||
*
|
*
|
||||||
* @param object $name key
|
* @param string $name key
|
||||||
*
|
*
|
||||||
* @return mixed value on success
|
* @return mixed value on success
|
||||||
* false on failure
|
* false on failure
|
||||||
|
@ -667,9 +667,8 @@ class Post extends BaseObject
|
||||||
/**
|
/**
|
||||||
* Set template
|
* Set template
|
||||||
*
|
*
|
||||||
* @param object $name template name
|
* @param string $name template name
|
||||||
*
|
* @return bool
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
private function setTemplate($name)
|
private function setTemplate($name)
|
||||||
{
|
{
|
||||||
|
@ -679,6 +678,8 @@ class Post extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->template = $this->available_templates[$name];
|
$this->template = $this->available_templates[$name];
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user