mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 10:04:26 +02:00
Switch static::$parameters
to $this->parameters
This commit is contained in:
parent
489cd0884a
commit
5879535822
116 changed files with 321 additions and 314 deletions
|
@ -44,12 +44,12 @@ class Activity extends BaseModule
|
|||
throw new HTTPException\ForbiddenException();
|
||||
}
|
||||
|
||||
if (empty(static::$parameters['id']) || empty(static::$parameters['verb'])) {
|
||||
if (empty($this->parameters['id']) || empty($this->parameters['verb'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$verb = static::$parameters['verb'];
|
||||
$itemId = static::$parameters['id'];
|
||||
$verb = $this->parameters['verb'];
|
||||
$itemId = $this->parameters['id'];
|
||||
|
||||
if (in_array($verb, ['announce', 'unannounce'])) {
|
||||
$item = Post::selectFirst(['network'], ['id' => $itemId]);
|
||||
|
|
|
@ -64,7 +64,7 @@ class Compose extends BaseModule
|
|||
}
|
||||
|
||||
/// @TODO Retrieve parameter from router
|
||||
$posttype = static::$parameters['type'] ?? Item::PT_ARTICLE;
|
||||
$posttype = $this->parameters['type'] ?? Item::PT_ARTICLE;
|
||||
if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) {
|
||||
switch ($posttype) {
|
||||
case 'note':
|
||||
|
|
|
@ -42,11 +42,11 @@ class Follow extends BaseModule
|
|||
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
|
||||
}
|
||||
|
||||
if (empty(static::$parameters['id'])) {
|
||||
if (empty($this->parameters['id'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$itemId = intval(static::$parameters['id']);
|
||||
$itemId = intval($this->parameters['id']);
|
||||
|
||||
if (!Item::performActivity($itemId, 'follow', local_user())) {
|
||||
throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
|
||||
|
|
|
@ -41,11 +41,11 @@ class Ignore extends BaseModule
|
|||
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
|
||||
}
|
||||
|
||||
if (empty(static::$parameters['id'])) {
|
||||
if (empty($this->parameters['id'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$itemId = intval(static::$parameters['id']);
|
||||
$itemId = intval($this->parameters['id']);
|
||||
|
||||
$dba = DI::dba();
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ class Pin extends BaseModule
|
|||
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
|
||||
}
|
||||
|
||||
if (empty(static::$parameters['id'])) {
|
||||
if (empty($this->parameters['id'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$itemId = intval(static::$parameters['id']);
|
||||
$itemId = intval($this->parameters['id']);
|
||||
|
||||
$item = Post::selectFirst(['uri-id', 'uid'], ['id' => $itemId]);
|
||||
if (!DBA::isResult($item)) {
|
||||
|
|
|
@ -43,11 +43,11 @@ class Star extends BaseModule
|
|||
throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
|
||||
}
|
||||
|
||||
if (empty(static::$parameters['id'])) {
|
||||
if (empty($this->parameters['id'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$itemId = intval(static::$parameters['id']);
|
||||
$itemId = intval($this->parameters['id']);
|
||||
|
||||
|
||||
$item = Post::selectFirstForUser(local_user(), ['uid', 'uri-id', 'starred'], ['uid' => [0, local_user()], 'id' => $itemId]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue