diff --git a/src/Manage.php b/src/Manage.php index a2fdb81..afc02a5 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -31,9 +31,9 @@ use Dotclear\Helper\Html\Form\{ Submit, Text }; +use Dotclear\Helper\Date; use Dotclear\Helper\Html\Html; use Exception; -use dt; class Manage extends dcNsProcess { @@ -204,7 +204,7 @@ class Manage extends dcNsProcess $res = ''; $modules = $current->translater->getModules($current->type); - ksort($modules); + uasort($modules, fn ($a, $b) => strtolower($a->name) <=> strtolower($b->name)); foreach ($modules as $module) { if ($current->translater->hide_default && in_array($module->id, My::defaultDistribModules($current->type))) { continue; @@ -310,7 +310,7 @@ class Manage extends dcNsProcess echo '' . count($backups[$code_id]) . '' . ' ' . - dt::str('%Y-%m-%d %H:%M', (int) $time[$code_id], (string) dcCore::app()->blog?->settings->get('system')->get('blog_timezone')) . + Date::str('%Y-%m-%d %H:%M', (int) $time[$code_id], (string) dcCore::app()->blog?->settings->get('system')->get('blog_timezone')) . ''; } else { echo '' . __('no backups') . '-'; @@ -332,7 +332,7 @@ class Manage extends dcNsProcess (new Submit('do-action'))->value(__('ok')), dcCore::app()->formNonce(false), ], - dcCore::app()->adminurl?->hiddenFormFields( + is_null(dcCore::app()->adminurl) ? [] : dcCore::app()->adminurl->hiddenFormFields( My::id(), ['type' => $current->module->type, 'module' => $current->module->id] ) @@ -376,7 +376,7 @@ class Manage extends dcNsProcess $form_id, $backup_code['name'], $backup_code['code'], - dt::str( + Date::str( dcCore::app()->blog?->settings->get('system')->get('date_format') . ' ' . dcCore::app()->blog?->settings->get('system')->get('time_format'), (int) $backup_code['time'], dcCore::app()->blog?->settings->get('system')->get('blog_timezone') @@ -401,7 +401,7 @@ class Manage extends dcNsProcess (new Submit('do-action'))->value(__('ok')), dcCore::app()->formNonce(false), ], - dcCore::app()->adminurl?->hiddenFormFields( + is_null(dcCore::app()->adminurl) ? [] : dcCore::app()->adminurl->hiddenFormFields( My::id(), ['type' => $current->module->type, 'module' => $current->module->id] ) @@ -437,7 +437,7 @@ class Manage extends dcNsProcess (new Submit(['save']))->value(__('Create')), dcCore::app()->formNonce(false), ], - dcCore::app()->adminurl?->hiddenFormFields( + is_null(dcCore::app()->adminurl) ? [] : dcCore::app()->adminurl->hiddenFormFields( My::id(), ['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_add_code'] ) @@ -458,7 +458,7 @@ class Manage extends dcNsProcess (new Submit(['save']))->value(__('Import')), dcCore::app()->formNonce(false), ], - dcCore::app()->adminurl?->hiddenFormFields( + is_null(dcCore::app()->adminurl) ? [] : dcCore::app()->adminurl->hiddenFormFields( My::id(), ['type' => $current->module->type, 'module' => $current->module->id, 'action' => 'module_import_pack'] ) @@ -604,7 +604,7 @@ class Manage extends dcNsProcess dcCore::app()->formNonce(false), (new Hidden(['code'], $current->lang->code)), ], - dcCore::app()->adminurl?->hiddenFormFields( + is_null(dcCore::app()->adminurl) ? [] : dcCore::app()->adminurl->hiddenFormFields( My::id(), ['type' => $current->module?->type, 'module' => $current->module?->id, 'lang' => $current->lang->code, 'action' => 'module_update_code'] ) diff --git a/src/TranslaterModule.php b/src/TranslaterModule.php index 455ac42..87ac3d5 100644 --- a/src/TranslaterModule.php +++ b/src/TranslaterModule.php @@ -16,6 +16,7 @@ namespace Dotclear\Plugin\translater; use dcCore; use dcModuleDefine; +use Dotclear\Helper\Date; use Dotclear\Helper\File\Files; use Dotclear\Helper\File\Path; use Dotclear\Helper\File\Zip\Unzip; @@ -23,7 +24,6 @@ use Dotclear\Helper\File\Zip\Zip; use Dotclear\Helper\Html\Html; use Dotclear\Helper\L10n; use Exception; -use dt; /** * Translater tools. @@ -400,7 +400,7 @@ class TranslaterModule $zip->addFile($from, $to); } - $filename = Files::tidyFileName(dt::str(str_replace( + $filename = Files::tidyFileName(Date::str(str_replace( ['timestamp', 'module', 'type', 'version'], [time(), $this->id, $this->type, $this->version], $this->translater->export_filename @@ -683,7 +683,7 @@ class TranslaterModule if ($this->translater->parse_comment) { $content .= '# Language: ' . $lang->name . "\n" . '# Module: ' . $this->id . ' - ' . $this->version . "\n" . - '# Date: ' . dt::str('%Y-%m-%d %H:%M:%S') . "\n"; + '# Date: ' . Date::str('%Y-%m-%d %H:%M:%S') . "\n"; if ($this->translater->parse_user && $this->translater->parse_userinfo != '') { $search = My::defaultUserInformations(); @@ -775,7 +775,7 @@ class TranslaterModule if ($this->translater->parse_comment) { $content .= '// Language: ' . $lang->name . "\n" . '// Module: ' . $this->id . ' - ' . $this->version . "\n" . - '// Date: ' . dt::str('%Y-%m-%d %H:%M:%S') . "\n"; + '// Date: ' . Date::str('%Y-%m-%d %H:%M:%S') . "\n"; if ($this->translater->parse_user && !empty($this->translater->parse_userinfo)) { $search = My::defaultUserInformations();