Replace $parameters argument per method with static::$parameters

This commit is contained in:
Philipp 2021-11-14 20:46:25 +01:00
parent 018275919c
commit 714f0febc4
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
249 changed files with 710 additions and 775 deletions

View file

@ -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 '';

View file

@ -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 '';

View file

@ -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();