<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
class Details extends BaseAdmin
{
- public static function post(array $parameters = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
- $addon = Strings::sanitizeFilePathItem($parameters['addon']);
+ $addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
$redirect = 'admin/addons/' . $addon;
DI::baseUrl()->redirect($redirect);
}
- public static function content(array $parameters = [])
+ protected function content(array $request = []): string
{
- parent::content($parameters);
+ parent::content();
$a = DI::app();
$addons_admin = Addon::getAdminList();
- $addon = Strings::sanitizeFilePathItem($parameters['addon']);
+ $addon = Strings::sanitizeFilePathItem($this->parameters['addon']);
if (!is_file("addon/$addon/$addon.php")) {
- notice(DI::l10n()->t('Addon not found.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Addon not found.'));
Addon::uninstall($addon);
DI::baseUrl()->redirect('admin/addons');
}
// Toggle addon status
if (Addon::isEnabled($addon)) {
Addon::uninstall($addon);
- info(DI::l10n()->t('Addon %s disabled.', $addon));
+ DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon));
} else {
Addon::install($addon);
- info(DI::l10n()->t('Addon %s enabled.', $addon));
+ DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s enabled.', $addon));
}
DI::baseUrl()->redirect('admin/addons/' . $addon);