mirror of
https://github.com/friendica/friendica
synced 2025-04-19 12:30:12 +00:00
Replace $parameters
argument per method with static::$parameters
This commit is contained in:
parent
018275919c
commit
714f0febc4
249 changed files with 710 additions and 775 deletions
|
@ -30,11 +30,11 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Details extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
$addon = Strings::sanitizeFilePathItem($parameters['addon']);
|
||||
$addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
|
||||
|
||||
$redirect = 'admin/addons/' . $addon;
|
||||
|
||||
|
@ -52,15 +52,15 @@ class Details extends BaseAdmin
|
|||
DI::baseUrl()->redirect($redirect);
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$a = DI::app();
|
||||
|
||||
$addons_admin = Addon::getAdminList();
|
||||
|
||||
$addon = Strings::sanitizeFilePathItem($parameters['addon']);
|
||||
$addon = Strings::sanitizeFilePathItem(static::$parameters['addon']);
|
||||
if (!is_file("addon/$addon/$addon.php")) {
|
||||
notice(DI::l10n()->t('Addon not found.'));
|
||||
Addon::uninstall($addon);
|
||||
|
|
|
@ -28,9 +28,9 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class Index extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
// reload active themes
|
||||
if (!empty($_GET['action'])) {
|
||||
|
|
|
@ -32,7 +32,7 @@ use Friendica\Util\Network;
|
|||
|
||||
class Contact extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -76,9 +76,9 @@ class Contact extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/blocklist/contact');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$condition = ['uid' => 0, 'blocked' => true];
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ use GuzzleHttp\Psr7\Uri;
|
|||
|
||||
class Add extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -66,9 +66,9 @@ class Add extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/blocklist/server');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$gservers = [];
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class Index extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -56,9 +56,9 @@ class Index extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/blocklist/server');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$blocklist = DI::config()->get('system', 'blocklist');
|
||||
$blocklistform = [];
|
||||
|
|
|
@ -30,14 +30,14 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class DBSync extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$a = DI::app();
|
||||
|
||||
$action = $parameters['action'] ?? '';
|
||||
$update = $parameters['update'] ?? 0;
|
||||
$action = static::$parameters['action'] ?? '';
|
||||
$update = static::$parameters['update'] ?? 0;
|
||||
|
||||
switch ($action) {
|
||||
case 'mark':
|
||||
|
|
|
@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class Features extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -60,9 +60,9 @@ class Features extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/features');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$features = [];
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class Federation extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
// get counts on active federation systems this node is knowing
|
||||
// We list the more common systems by name. The rest is counted as "other"
|
||||
|
|
|
@ -29,7 +29,7 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Delete extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -55,9 +55,9 @@ class Delete extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/item/delete');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$t = Renderer::getMarkupTemplate('admin/item/delete.tpl');
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@ use Friendica\Module\BaseAdmin;
|
|||
class Source extends BaseAdmin
|
||||
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$guid = basename($_REQUEST['guid'] ?? $parameters['guid'] ?? '');
|
||||
$guid = basename($_REQUEST['guid'] ?? static::$parameters['guid'] ?? '');
|
||||
|
||||
$source = '';
|
||||
$item_uri = '';
|
||||
|
|
|
@ -29,7 +29,7 @@ use Psr\Log\LogLevel;
|
|||
|
||||
class Settings extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -56,9 +56,9 @@ class Settings extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/logs');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$log_choices = [
|
||||
LogLevel::ERROR => 'Error',
|
||||
|
|
|
@ -31,9 +31,9 @@ class View extends BaseAdmin
|
|||
{
|
||||
const LIMIT = 500;
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$t = Renderer::getMarkupTemplate('admin/logs/view.tpl');
|
||||
DI::page()->registerFooterScript(Theme::getPathForFile('js/module/admin/logs/view.js'));
|
||||
|
@ -75,7 +75,7 @@ class View extends BaseAdmin
|
|||
->withLimit(self::LIMIT)
|
||||
->withFilters($filters)
|
||||
->withSearch($search);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.<br/>Check to see if file %1$s is readable.', $f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class PhpInfo extends BaseAdmin
|
||||
{
|
||||
public static function rawContent(array $parameters = [])
|
||||
public static function rawContent()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
|
|
@ -38,11 +38,11 @@ use Friendica\Util\DateTimeFormat;
|
|||
*/
|
||||
class Queue extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$status = $parameters['status'] ?? '';
|
||||
$status = static::$parameters['status'] ?? '';
|
||||
|
||||
// get jobs from the workerqueue table
|
||||
if ($status == 'deferred') {
|
||||
|
|
|
@ -43,7 +43,7 @@ require_once __DIR__ . '/../../../boot.php';
|
|||
|
||||
class Site extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -384,9 +384,9 @@ class Site extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
/* Installed langs */
|
||||
$lang_choices = DI::l10n()->getAvailableLanguages();
|
||||
|
|
|
@ -31,13 +31,13 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Storage extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
|
||||
|
||||
$storagebackend = trim($parameters['name'] ?? '');
|
||||
$storagebackend = trim(static::$parameters['name'] ?? '');
|
||||
|
||||
try {
|
||||
/** @var ICanConfigureStorage|false $newStorageConfig */
|
||||
|
@ -91,9 +91,9 @@ class Storage extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/storage');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$current_storage_backend = DI::storage();
|
||||
$available_storage_forms = [];
|
||||
|
|
|
@ -37,9 +37,9 @@ use Friendica\Util\DateTimeFormat;
|
|||
|
||||
class Summary extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$a = DI::app();
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Details extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$theme = Strings::sanitizeFilePathItem($parameters['theme']);
|
||||
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
||||
if (!is_dir("view/theme/$theme")) {
|
||||
notice(DI::l10n()->t("Item not found."));
|
||||
return '';
|
||||
|
|
|
@ -28,19 +28,19 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Embed extends BaseAdmin
|
||||
{
|
||||
public static function init(array $parameters = [])
|
||||
public static function init()
|
||||
{
|
||||
$theme = Strings::sanitizeFilePathItem($parameters['theme']);
|
||||
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
||||
if (is_file("view/theme/$theme/config.php")) {
|
||||
DI::app()->setCurrentTheme($theme);
|
||||
}
|
||||
}
|
||||
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
$theme = Strings::sanitizeFilePathItem($parameters['theme']);
|
||||
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
||||
if (is_file("view/theme/$theme/config.php")) {
|
||||
require_once "view/theme/$theme/config.php";
|
||||
if (function_exists('theme_admin_post')) {
|
||||
|
@ -56,11 +56,11 @@ class Embed extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$theme = Strings::sanitizeFilePathItem($parameters['theme']);
|
||||
$theme = Strings::sanitizeFilePathItem(static::$parameters['theme']);
|
||||
if (!is_dir("view/theme/$theme")) {
|
||||
notice(DI::l10n()->t('Unknown theme.'));
|
||||
return '';
|
||||
|
|
|
@ -29,9 +29,9 @@ use Friendica\Util\Strings;
|
|||
|
||||
class Index extends BaseAdmin
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$allowed_themes = Theme::getAllowedList();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
|
|||
|
||||
class Tos extends BaseAdmin
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -48,11 +48,11 @@ class Tos extends BaseAdmin
|
|||
DI::baseUrl()->redirect('admin/tos');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$tos = new \Friendica\Module\Tos();
|
||||
$tos = new \Friendica\Module\Tos(static::$parameters);
|
||||
$t = Renderer::getMarkupTemplate('admin/tos.tpl');
|
||||
return Renderer::replaceMacros($t, [
|
||||
'$title' => DI::l10n()->t('Administration'),
|
||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
|
|||
|
||||
class Active extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -60,12 +60,12 @@ class Active extends BaseUsers
|
|||
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$action = $parameters['action'] ?? '';
|
||||
$uid = $parameters['uid'] ?? 0;
|
||||
$action = static::$parameters['action'] ?? '';
|
||||
$uid = static::$parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
|
|
|
@ -31,7 +31,7 @@ use Friendica\Util\Temporal;
|
|||
|
||||
class Blocked extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -61,12 +61,12 @@ class Blocked extends BaseUsers
|
|||
DI::baseUrl()->redirect('admin/users/blocked');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$action = $parameters['action'] ?? '';
|
||||
$uid = $parameters['uid'] ?? 0;
|
||||
$action = static::$parameters['action'] ?? '';
|
||||
$uid = static::$parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
|
|
|
@ -28,7 +28,7 @@ use Friendica\Module\Admin\BaseUsers;
|
|||
|
||||
class Create extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -51,9 +51,9 @@ class Create extends BaseUsers
|
|||
DI::baseUrl()->redirect('admin/users/create');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$t = Renderer::getMarkupTemplate('admin/users/create.tpl');
|
||||
return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
|
||||
|
|
|
@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
|
|||
|
||||
class Deleted extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -44,9 +44,9 @@ class Deleted extends BaseUsers
|
|||
DI::baseUrl()->redirect('admin/users/deleted');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
|
|||
|
||||
class Index extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -67,12 +67,12 @@ class Index extends BaseUsers
|
|||
DI::baseUrl()->redirect(DI::args()->getQueryString());
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$action = $parameters['action'] ?? '';
|
||||
$uid = $parameters['uid'] ?? 0;
|
||||
$action = static::$parameters['action'] ?? '';
|
||||
$uid = static::$parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
|
|
|
@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
|
|||
|
||||
class Pending extends BaseUsers
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
self::checkAdminAccess();
|
||||
|
||||
|
@ -58,12 +58,12 @@ class Pending extends BaseUsers
|
|||
DI::baseUrl()->redirect('admin/users/pending');
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
parent::content($parameters);
|
||||
parent::content();
|
||||
|
||||
$action = $parameters['action'] ?? '';
|
||||
$uid = $parameters['uid'] ?? 0;
|
||||
$action = static::$parameters['action'] ?? '';
|
||||
$uid = static::$parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue