]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Debug/Localtime.php
Merge pull request #10613 from annando/improved-payload
[friendica.git] / src / Module / Debug / Localtime.php
index 751fb82399a02de8abb5d6ecc478626f948c41d1..ff1466408e922152f0dfb481aa092c88938153d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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" >';