From f5d9cd983ccc08bed63776f244f1520c1547048e Mon Sep 17 00:00:00 2001 From: ArrayIterator Date: Sun, 22 Oct 2023 02:43:06 +0700 Subject: [PATCH] add bulk update --- .../AbstractAdministrationController.php | 1 - Controllers/MainPage.php | 11 +++++-- Controllers/User/Auth.php | 5 +--- Controllers/User/Main.php | 1 - Core.php | 6 ++-- Languages/core-module.pot | 29 ++++++++++++++----- .../Controllers/Attributes/Dashboard.php | 1 - .../Middlewares/TemplateMiddleware.php | 1 - SubModules/Templates/Templates.php | 1 + 9 files changed, 35 insertions(+), 21 deletions(-) diff --git a/Controllers/Abstracts/AbstractAdministrationController.php b/Controllers/Abstracts/AbstractAdministrationController.php index 933f5a6..fba47e5 100644 --- a/Controllers/Abstracts/AbstractAdministrationController.php +++ b/Controllers/Abstracts/AbstractAdministrationController.php @@ -6,7 +6,6 @@ use ArrayAccess\TrayDigita\Traits\Service\TranslatorTrait; use ArrayAccess\TrayDigita\Util\Filter\DataNormalizer; use Psr\Http\Message\ServerRequestInterface; -use function var_dump; abstract class AbstractAdministrationController extends AbstractAuthenticationBasedController { diff --git a/Controllers/MainPage.php b/Controllers/MainPage.php index 6f330e8..be9142e 100644 --- a/Controllers/MainPage.php +++ b/Controllers/MainPage.php @@ -16,10 +16,15 @@ class MainPage extends AbstractController { #[Any('')] - public function main() : ResponseInterface - { + public function main( + ResponseInterface $response + ) : ResponseInterface { return $this - ->render('templates/home'); + ->render( + 'templates/home', + [], + $response + ); } // handle favicon diff --git a/Controllers/User/Auth.php b/Controllers/User/Auth.php index 988e74a..33feea3 100644 --- a/Controllers/User/Auth.php +++ b/Controllers/User/Auth.php @@ -22,9 +22,7 @@ class Auth extends AbstractUserController priority: PHP_INT_MIN )] public function login( - ServerRequestInterface $request, - ResponseInterface $response, - array $params + ResponseInterface $response ): ResponseInterface { return $this->render( 'user/login', @@ -36,6 +34,5 @@ public function login( ], $response ); - // return new \ArrayAccess\TrayDigita\Responder\FileResponder\FileResponder(__FILE__); } } diff --git a/Controllers/User/Main.php b/Controllers/User/Main.php index 9e0ab20..cdff912 100644 --- a/Controllers/User/Main.php +++ b/Controllers/User/Main.php @@ -18,7 +18,6 @@ class Main extends AbstractUserController priority: PHP_INT_MAX - 1000 )] public function dashboard( - ServerRequestInterface $request, ResponseInterface $response ) : ResponseInterface { return $this->render( diff --git a/Core.php b/Core.php index 6b3ba70..ab6d2c5 100644 --- a/Core.php +++ b/Core.php @@ -239,10 +239,10 @@ private function doOverrideController(): void } $factoryControllerNamespace = $core->getKernel()->getControllerNameSpace(); $controllerNamespace = __NAMESPACE__ .'\\Controller\\'; - $controllerDir = __DIR__ . DIRECTORY_SEPARATOR . 'Controllers'; - Consolidation::registerAutoloader($controllerNamespace, $controllerDir); + $controllerDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'Controllers'; + Consolidation::registerAutoloader($controllerNamespace, $controllerDirectory); $this->{'controllerNameSpace'} = $controllerNamespace; - $this->{'registeredDirectories'}[$controllerNamespace] = $controllerDir; + $this->{'registeredDirectories'}[$controllerNamespace] = $controllerDirectory; })->call($kernel, $this); if (!$factoryControllerNamespace) { return; diff --git a/Languages/core-module.pot b/Languages/core-module.pot index a0c3fc0..a1dcf2f 100644 --- a/Languages/core-module.pot +++ b/Languages/core-module.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: TrayDigita Core Module 1.0.0\n" -"POT-Creation-Date: 2023-10-19 03:54+0700\n" +"POT-Creation-Date: 2023-10-22 02:40+0700\n" "PO-Revision-Date: 2023-09-24 19:00+0700\n" "Last-Translator: ArrayAccess\n" "Language-Team: ArrayAccess\n" @@ -33,12 +33,16 @@ msgctxt "benchmark" msgid "Event" msgstr "" -#: Core.php:115 +#: Controllers/User/Auth.php:31 +msgid "Login to member area" +msgstr "" + +#: Core.php:184 msgctxt "module-info" msgid "Core" msgstr "" -#: Core.php:132 +#: Core.php:201 msgctxt "module-info" msgid "Main core module" msgstr "" @@ -148,12 +152,12 @@ msgid "" "record for scheduler" msgstr "" -#: SubModules/ServiceInitializer/ServiceInitializer.php:37 +#: SubModules/ServiceInitializer/ServiceInitializer.php:39 msgctxt "module-info" msgid "Service Initializer" msgstr "" -#: SubModules/ServiceInitializer/ServiceInitializer.php:46 +#: SubModules/ServiceInitializer/ServiceInitializer.php:48 msgctxt "module-info" msgid "Core module to make application run properly" msgstr "" @@ -168,12 +172,12 @@ msgctxt "module-info" msgid "Core module for site" msgstr "" -#: SubModules/Templates/Templates.php:27 +#: SubModules/Templates/Templates.php:26 msgctxt "module-info" msgid "Templates Helper" msgstr "" -#: SubModules/Templates/Templates.php:36 +#: SubModules/Templates/Templates.php:35 msgctxt "module-info" msgid "Core module to support templating" msgstr "" @@ -188,6 +192,7 @@ msgctxt "module-info" msgid "Core module to support translation" msgstr "" +#: SubModules/ServiceInitializer/Controllers/Views/contents/config-install.phtml:22 #: SubModules/ServiceInitializer/Controllers/Views/contents/config-unavailable.phtml:22 #: SubModules/ServiceInitializer/Controllers/Views/install.phtml:30 msgctxt "installation" @@ -205,3 +210,13 @@ msgid "Required Module Not Found" msgid_plural "Required Modules Not Found" msgstr[0] "" msgstr[1] "" + +#: SubModules/ServiceInitializer/Controllers/Views/repair.phtml:31 +msgctxt "module-not-found" +msgid "Incomplete Database Schema" +msgstr "" + +#: SubModules/ServiceInitializer/Controllers/Views/repair.phtml:40 +msgctxt "incomplete-schema" +msgid "Database schema are incomplete" +msgstr "" diff --git a/SubModules/Controllers/Attributes/Dashboard.php b/SubModules/Controllers/Attributes/Dashboard.php index a73d4a7..7673d6d 100644 --- a/SubModules/Controllers/Attributes/Dashboard.php +++ b/SubModules/Controllers/Attributes/Dashboard.php @@ -10,7 +10,6 @@ use function in_array; use function str_starts_with; use function substr; -use function var_dump; #[Attribute(Attribute::TARGET_CLASS)] class Dashboard extends Group diff --git a/SubModules/Templates/Middlewares/TemplateMiddleware.php b/SubModules/Templates/Middlewares/TemplateMiddleware.php index 188e595..2249ff3 100644 --- a/SubModules/Templates/Middlewares/TemplateMiddleware.php +++ b/SubModules/Templates/Middlewares/TemplateMiddleware.php @@ -36,7 +36,6 @@ protected function doProcess(ServerRequestInterface $request): ServerRequestInte if (is_string($active)) { $this->templates->getTemplateRule()->setActive($active); } - $template = $this->templates->getTemplateRule()->getActive(); if ($template) { if ($template->getBasePath() !== $active && $option) { diff --git a/SubModules/Templates/Templates.php b/SubModules/Templates/Templates.php index 3fc3c23..05a414e 100644 --- a/SubModules/Templates/Templates.php +++ b/SubModules/Templates/Templates.php @@ -86,6 +86,7 @@ private function initSetTemplate($module, KernelInterface $kernel) $view->getContainer()??$this->getContainer() ) ); + return $module; } }