Many more app-variables removed

This commit is contained in:
Michael 2021-07-24 10:09:39 +00:00
parent e05c1821c2
commit 2502a9192d
30 changed files with 310 additions and 401 deletions

View file

@ -29,6 +29,8 @@ use Friendica\Util\Temporal;
class Localtime extends BaseModule
{
static $mod_localtime = '';
public static function post(array $parameters = [])
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
@ -36,14 +38,12 @@ class Localtime extends BaseModule
$bd_format = DI::l10n()->t('l F d, Y \@ g:i A');
if (!empty($_POST['timezone'])) {
DI::app()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
self::$mod_localtime = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
}
}
public static function content(array $parameters = [])
{
$app = DI::app();
$time = ($_REQUEST['time'] ?? '') ?: 'now';
$output = '<h3>' . DI::l10n()->t('Time Conversion') . '</h3>';
@ -54,8 +54,8 @@ class Localtime extends BaseModule
$output .= '<p>' . DI::l10n()->t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
}
if (!empty($app->data['mod-localtime'])) {
$output .= '<p>' . DI::l10n()->t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
if (!empty(self::$mod_localtime)) {
$output .= '<p>' . DI::l10n()->t('Converted localtime: %s', self::$mod_localtime) . '</p>';
}
$output .= '<form action ="' . DI::baseUrl()->get() . '/localtime?time=' . $time . '" method="post" >';