Switch static::$parameters to $this->parameters

This commit is contained in:
Philipp 2021-11-14 23:19:25 +01:00
parent 489cd0884a
commit 5879535822
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
116 changed files with 321 additions and 314 deletions

View file

@ -34,7 +34,7 @@ class Details extends BaseAdmin
{
self::checkAdminAccess();
$addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
$addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
$redirect = 'admin/addons/' . $addon;
@ -60,7 +60,7 @@ class Details extends BaseAdmin
$addons_admin = Addon::getAdminList();
$addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
$addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
if (!is_file("addon/$addon/$addon.php")) {
notice(DI::l10n()->t('Addon not found.'));
Addon::uninstall($addon);

View file

@ -36,8 +36,8 @@ class DBSync extends BaseAdmin
$a = DI::app();
$action = static::$parameters['action'] ?? '';
$update = static::$parameters['update'] ?? 0;
$action = $this->parameters['action'] ?? '';
$update = $this->parameters['update'] ?? 0;
switch ($action) {
case 'mark':

View file

@ -33,7 +33,7 @@ class Source extends BaseAdmin
{
parent::content();
$guid = basename($_REQUEST['guid'] ?? static::$parameters['guid'] ?? '');
$guid = basename($_REQUEST['guid'] ?? $this->parameters['guid'] ?? '');
$source = '';
$item_uri = '';

View file

@ -42,7 +42,7 @@ class Queue extends BaseAdmin
{
parent::content();
$status = static::$parameters['status'] ?? '';
$status = $this->parameters['status'] ?? '';
// get jobs from the workerqueue table
if ($status == 'deferred') {

View file

@ -37,7 +37,7 @@ class Storage extends BaseAdmin
self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
$storagebackend = trim(static::$parameters['name'] ?? '');
$storagebackend = trim($this->parameters['name'] ?? '');
try {
/** @var ICanConfigureStorage|false $newStorageConfig */

View file

@ -34,7 +34,7 @@ class Details extends BaseAdmin
{
parent::content();
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (!is_dir("view/theme/$theme")) {
notice(DI::l10n()->t("Item not found."));
return '';

View file

@ -30,7 +30,7 @@ class Embed extends BaseAdmin
{
public function init()
{
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (is_file("view/theme/$theme/config.php")) {
DI::app()->setCurrentTheme($theme);
}
@ -40,7 +40,7 @@ class Embed extends BaseAdmin
{
self::checkAdminAccess();
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (is_file("view/theme/$theme/config.php")) {
require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin_post')) {
@ -60,7 +60,7 @@ class Embed extends BaseAdmin
{
parent::content();
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (!is_dir("view/theme/$theme")) {
notice(DI::l10n()->t('Unknown theme.'));
return '';

View file

@ -52,7 +52,7 @@ class Tos extends BaseAdmin
{
parent::content();
$tos = new \Friendica\Module\Tos(static::$parameters);
$tos = new \Friendica\Module\Tos($this->parameters);
$t = Renderer::getMarkupTemplate('admin/tos.tpl');
return Renderer::replaceMacros($t, [
'$title' => DI::l10n()->t('Administration'),

View file

@ -64,8 +64,8 @@ class Active extends BaseUsers
{
parent::content();
$action = static::$parameters['action'] ?? '';
$uid = static::$parameters['uid'] ?? 0;
$action = $this->parameters['action'] ?? '';
$uid = $this->parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);

View file

@ -65,8 +65,8 @@ class Blocked extends BaseUsers
{
parent::content();
$action = static::$parameters['action'] ?? '';
$uid = static::$parameters['uid'] ?? 0;
$action = $this->parameters['action'] ?? '';
$uid = $this->parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);

View file

@ -71,8 +71,8 @@ class Index extends BaseUsers
{
parent::content();
$action = static::$parameters['action'] ?? '';
$uid = static::$parameters['uid'] ?? 0;
$action = $this->parameters['action'] ?? '';
$uid = $this->parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);

View file

@ -62,8 +62,8 @@ class Pending extends BaseUsers
{
parent::content();
$action = static::$parameters['action'] ?? '';
$uid = static::$parameters['uid'] ?? 0;
$action = $this->parameters['action'] ?? '';
$uid = $this->parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);