]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Debug/Localtime.php
Rework Feed::import parameters
[friendica.git] / src / Module / Debug / Localtime.php
index 197149837ae5f161f2e4d6caaf1b271b669b3921..d9e2489790d77751cd9750d18078494af11c2f58 100644 (file)
@@ -5,25 +5,26 @@ namespace Friendica\Module\Debug;
 use Friendica\BaseModule;
 use Friendica\Core\Installer;
 use Friendica\Core\L10n;
+use Friendica\DI;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Temporal;
 
 class Localtime extends BaseModule
 {
-       public static function post()
+       public static function post(array $parameters = [])
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
                $bd_format = L10n::t('l F d, Y \@ g:i A');
 
                if (!empty($_POST['timezone'])) {
-                       self::getApp()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
+                       DI::app()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
                }
        }
 
-       public static function content()
+       public static function content(array $parameters = [])
        {
-               $app = self::getApp();
+               $app = DI::app();
 
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
@@ -39,7 +40,7 @@ class Localtime extends BaseModule
                        $output .= '<p>' . L10n::t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
                }
 
-               $output .= '<form action ="' . $app->getBaseURL() . '/localtime?time=' . $time . '" method="post" >';
+               $output .= '<form action ="' . DI::baseUrl()->get() . '/localtime?time=' . $time . '" method="post" >';
                $output .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
                $output .= Temporal::getTimezoneSelect(($_REQUEST['timezone'] ?? '') ?: Installer::DEFAULT_TZ);
                $output .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';