From a943b960ad5e3d3e2b81779703696b27787b3377 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Sun, 19 Jan 2025 20:50:25 +0300 Subject: [PATCH] themes add and some fix --- .../controllers/ThemeShopController.php | 84 +++++++++++++ .../models/forms/CreateThemeShopForm.php | 22 ++++ app/modules/module_shop/views/theme/form.php | 51 ++++++++ bootstrap/db.php | 0 bootstrap/header.php | 0 bootstrap/secure.php | 0 kernel/AdminController.php | 0 kernel/App.php | 0 kernel/CgRouteCollector.php | 0 kernel/CgView.php | 0 kernel/Controller.php | 0 kernel/Database.php | 0 kernel/EntityRelation.php | 0 kernel/FileUpload.php | 8 +- kernel/Flash.php | 0 kernel/FormModel.php | 0 kernel/Header.php | 0 .../action_column/DeleteActionColumn.php | 0 .../action_column/EditActionColumn.php | 0 .../action_column/InstallActionColumn.php | 0 .../action_column/ViewActionColumn.php | 0 kernel/IGTabel/btn/DangerBtn.php | 0 kernel/IGTabel/btn/PrimaryBtn.php | 2 +- kernel/IGTabel/btn/SuccessBtn.php | 0 kernel/Mailing.php | 0 kernel/Middleware.php | 0 kernel/Module.php | 0 kernel/Request.php | 0 kernel/ResponseType.php | 0 kernel/RestController.php | 4 +- kernel/Widget.php | 0 kernel/admin_themes/default/layout/login.php | 0 kernel/admin_themes/default/layout/main.php | 19 +-- kernel/admin_themes/default/manifest.json | 0 kernel/admin_themes/simple/layout/main.php | 0 kernel/admin_themes/simple/manifest.json | 0 kernel/console/CgMigrationCreator.php | 0 kernel/console/ConsoleApp.php | 0 kernel/console/ConsoleController.php | 0 kernel/console/Out.php | 0 .../controllers/AdminConsoleController.php | 0 .../controllers/AdminThemeController.php | 66 +++++------ .../console/controllers/KernelController.php | 0 kernel/console/controllers/MainController.php | 0 .../controllers/MigrationController.php | 0 .../console/controllers/ModuleController.php | 0 .../console/controllers/SecureController.php | 0 kernel/console/migrations/stubs/blank.stub | 0 kernel/console/migrations/stubs/create.stub | 0 .../migrations/stubs/migration.create.stub | 0 .../console/migrations/stubs/migration.stub | 0 .../migrations/stubs/migration.update.stub | 0 kernel/console/migrations/stubs/update.stub | 0 kernel/console/routs/cli.php | 4 + kernel/controllers/ModuleController.php | 0 kernel/filters/BootstrapSelectFilter.php | 23 ++++ kernel/filters/BootstrapTextFilter.php | 21 ++++ kernel/helpers/Debug.php | 0 kernel/helpers/Files.php | 0 kernel/helpers/Html.php | 0 kernel/helpers/Manifest.php | 0 kernel/helpers/RESTClient.php | 0 kernel/helpers/SMTP.php | 0 kernel/helpers/Slug.php | 0 kernel/helpers/Version.php | 0 kernel/manifest.json | 0 kernel/middlewares/AuthMiddleware.php | 0 kernel/models/Menu.php | 0 kernel/models/Option.php | 0 .../admin_themes/AdminThemesModule.php | 0 .../controllers/AdminThemeController.php | 0 kernel/modules/admin_themes/manifest.json | 0 .../admin_themes/routs/adminThemes.php | 0 kernel/modules/admin_themes/views/index.php | 0 kernel/modules/admin_themes/views/view.php | 0 kernel/modules/menu/MenuModule.php | 0 .../menu/controllers/MenuController.php | 0 .../menu/controllers/MenuRestController.php | 0 kernel/modules/menu/manifest.json | 0 .../2024_09_23_125545_create_menu_table.php | 0 kernel/modules/menu/models/Menu.php | 0 .../menu/models/forms/CreateMenuForm.php | 0 kernel/modules/menu/routs/menu.php | 0 kernel/modules/menu/service/MenuService.php | 0 .../table/columns/MenuDeleteActionColumn.php | 0 .../table/columns/MenuEditActionColumn.php | 0 .../table/columns/MenuViewActionColumn.php | 0 kernel/modules/menu/views/form.php | 0 kernel/modules/menu/views/index.php | 7 +- kernel/modules/menu/views/view.php | 0 .../ModuleShopClientController.php | 77 +++++++++--- .../modules/module_shop_client/manifest.json | 0 .../routs/module_shop_client.php | 0 .../services/ModuleShopClientService.php | 22 ++++ .../module_shop_client/views/enter_code.php | 0 .../module_shop_client/views/index.php | 45 ++++--- .../views/kernel_update.php | 0 .../views/login_at_module_shop.php | 0 .../views/module_shop_error_connection.php | 0 .../views/success_login.php | 0 .../modules/module_shop_client/views/view.php | 0 kernel/modules/option/OptionModule.php | 0 .../option/controllers/OptionController.php | 0 kernel/modules/option/manifest.json | 0 .../2024_09_23_125716_create_option_table.php | 0 kernel/modules/option/models/Option.php | 0 .../option/models/forms/CreateOptionForm.php | 0 kernel/modules/option/routs/option.php | 0 .../modules/option/service/OptionService.php | 0 .../columns/OptionDeleteActionColumn.php | 0 .../table/columns/OptionEditActionColumn.php | 0 .../table/columns/OptionViewActionColumn.php | 0 kernel/modules/option/views/form.php | 0 kernel/modules/option/views/index.php | 0 kernel/modules/option/views/view.php | 0 kernel/modules/post/PostModule.php | 0 .../post/controllers/PostController.php | 0 .../post/controllers/PostRestController.php | 0 kernel/modules/post/manifest.json | 0 .../2024_09_23_130017_create_post_table.php | 0 kernel/modules/post/models/Post.php | 0 .../post/models/forms/CreatePostForm.php | 0 kernel/modules/post/routs/post.php | 0 kernel/modules/post/service/PostService.php | 0 kernel/modules/post/views/form.php | 0 kernel/modules/post/views/index.php | 55 ++++++--- kernel/modules/post/views/view.php | 0 .../secure/controllers/SecureController.php | 0 .../controllers/SecureRestController.php | 0 kernel/modules/secure/manifest.json | 0 .../middlewares/BearerAuthMiddleware.php | 0 ..._12_09_081420_create_secret_code_table.php | 0 kernel/modules/secure/models/SecretCode.php | 0 .../secure/models/forms/LoginEmailForm.php | 0 .../modules/secure/models/forms/LoginForm.php | 0 .../secure/models/forms/RegisterForm.php | 0 kernel/modules/secure/routs/secure.php | 0 .../modules/secure/services/SecureService.php | 0 kernel/modules/secure/views/email_login.php | 0 kernel/modules/secure/views/enter_code.php | 0 kernel/modules/secure/views/login.php | 0 kernel/modules/secure/views/register.php | 0 kernel/modules/user/UserModule.php | 0 .../user/controllers/UserController.php | 67 ++++++++++- kernel/modules/user/manifest.json | 0 .../2024_09_23_125827_create_user_table.php | 1 + kernel/modules/user/models/User.php | 4 +- .../user/models/forms/CreateUserForm.php | 7 +- kernel/modules/user/routs/user.php | 5 + kernel/modules/user/service/UserService.php | 24 ++++ .../table/columns/UserDeleteActionColumn.php | 0 .../table/columns/UserEditActionColumn.php | 0 .../table/columns/UserViewActionColumn.php | 0 kernel/modules/user/views/form.php | 10 ++ kernel/modules/user/views/form_profile.php | 74 ++++++++++++ kernel/modules/user/views/index.php | 12 +- kernel/modules/user/views/view.php | 3 + kernel/modules/user/views/view_profile.php | 56 +++++++++ kernel/routs/admin.php | 0 kernel/services/AdminThemeService.php | 111 +++++++++++++++++- kernel/services/ConsoleService.php | 0 kernel/services/KernelService.php | 0 kernel/services/MigrationService.php | 0 kernel/services/ModuleService.php | 8 +- kernel/services/ModuleShopService.php | 0 kernel/services/TokenService.php | 0 .../controllers/app_controller_template | 0 .../controllers/kernel_controller_template | 0 kernel/templates/manifests/manifest_template | 0 .../models/forms/create_form_template | 0 kernel/templates/models/model_template | 0 .../module_files/app_module_file_template | 0 .../module_files/kernel_module_file_template | 0 kernel/templates/routs/app_routs_template | 0 kernel/templates/routs/kernel_routs_template | 0 kernel/templates/services/service_template | 0 kernel/templates/views/form_template | 0 kernel/templates/views/index_template | 10 ++ kernel/templates/views/view_template | 0 kernel/views/mailing/login_by_code.php | 0 kernel/views/mailing/register_by_code.php | 0 kernel/views/module/index.php | 0 kernel/views/module/view.php | 0 kernel/views/widgets/action_button.php | 0 kernel/views/widgets/menu.php | 0 kernel/views/widgets/tabs.php | 0 kernel/widgets/ActionButtonWidget.php | 0 .../widgets/IconBtn/IconBtnActivateWidget.php | 0 .../widgets/IconBtn/IconBtnCreateWidget.php | 0 .../IconBtn/IconBtnDeactivateWidget.php | 0 .../widgets/IconBtn/IconBtnDeleteWidget.php | 0 kernel/widgets/IconBtn/IconBtnEditWidget.php | 0 .../widgets/IconBtn/IconBtnInstallWidget.php | 0 kernel/widgets/IconBtn/IconBtnListWidget.php | 0 .../widgets/IconBtn/IconBtnUpdateWidget.php | 0 kernel/widgets/IconBtn/IconBtnViewWidget.php | 0 kernel/widgets/MenuWidget.php | 0 kernel/widgets/ModuleTabsWidget.php | 0 kernel/widgets/TagTabsWidget.php | 0 resources/default_user_photo/noPhoto.png | Bin 0 -> 4085 bytes 200 files changed, 796 insertions(+), 106 deletions(-) create mode 100644 app/modules/module_shop/controllers/ThemeShopController.php create mode 100644 app/modules/module_shop/models/forms/CreateThemeShopForm.php create mode 100644 app/modules/module_shop/views/theme/form.php mode change 100644 => 100755 bootstrap/db.php mode change 100644 => 100755 bootstrap/header.php mode change 100644 => 100755 bootstrap/secure.php mode change 100644 => 100755 kernel/AdminController.php mode change 100644 => 100755 kernel/App.php mode change 100644 => 100755 kernel/CgRouteCollector.php mode change 100644 => 100755 kernel/CgView.php mode change 100644 => 100755 kernel/Controller.php mode change 100644 => 100755 kernel/Database.php mode change 100644 => 100755 kernel/EntityRelation.php mode change 100644 => 100755 kernel/FileUpload.php mode change 100644 => 100755 kernel/Flash.php mode change 100644 => 100755 kernel/FormModel.php mode change 100644 => 100755 kernel/Header.php mode change 100644 => 100755 kernel/IGTabel/action_column/DeleteActionColumn.php mode change 100644 => 100755 kernel/IGTabel/action_column/EditActionColumn.php mode change 100644 => 100755 kernel/IGTabel/action_column/InstallActionColumn.php mode change 100644 => 100755 kernel/IGTabel/action_column/ViewActionColumn.php mode change 100644 => 100755 kernel/IGTabel/btn/DangerBtn.php mode change 100644 => 100755 kernel/IGTabel/btn/PrimaryBtn.php mode change 100644 => 100755 kernel/IGTabel/btn/SuccessBtn.php mode change 100644 => 100755 kernel/Mailing.php mode change 100644 => 100755 kernel/Middleware.php mode change 100644 => 100755 kernel/Module.php mode change 100644 => 100755 kernel/Request.php mode change 100644 => 100755 kernel/ResponseType.php mode change 100644 => 100755 kernel/RestController.php mode change 100644 => 100755 kernel/Widget.php mode change 100644 => 100755 kernel/admin_themes/default/layout/login.php mode change 100644 => 100755 kernel/admin_themes/default/layout/main.php mode change 100644 => 100755 kernel/admin_themes/default/manifest.json mode change 100644 => 100755 kernel/admin_themes/simple/layout/main.php mode change 100644 => 100755 kernel/admin_themes/simple/manifest.json mode change 100644 => 100755 kernel/console/CgMigrationCreator.php mode change 100644 => 100755 kernel/console/ConsoleApp.php mode change 100644 => 100755 kernel/console/ConsoleController.php mode change 100644 => 100755 kernel/console/Out.php mode change 100644 => 100755 kernel/console/controllers/AdminConsoleController.php mode change 100644 => 100755 kernel/console/controllers/AdminThemeController.php mode change 100644 => 100755 kernel/console/controllers/KernelController.php mode change 100644 => 100755 kernel/console/controllers/MainController.php mode change 100644 => 100755 kernel/console/controllers/MigrationController.php mode change 100644 => 100755 kernel/console/controllers/ModuleController.php mode change 100644 => 100755 kernel/console/controllers/SecureController.php mode change 100644 => 100755 kernel/console/migrations/stubs/blank.stub mode change 100644 => 100755 kernel/console/migrations/stubs/create.stub mode change 100644 => 100755 kernel/console/migrations/stubs/migration.create.stub mode change 100644 => 100755 kernel/console/migrations/stubs/migration.stub mode change 100644 => 100755 kernel/console/migrations/stubs/migration.update.stub mode change 100644 => 100755 kernel/console/migrations/stubs/update.stub mode change 100644 => 100755 kernel/console/routs/cli.php mode change 100644 => 100755 kernel/controllers/ModuleController.php create mode 100755 kernel/filters/BootstrapSelectFilter.php create mode 100755 kernel/filters/BootstrapTextFilter.php mode change 100644 => 100755 kernel/helpers/Debug.php mode change 100644 => 100755 kernel/helpers/Files.php mode change 100644 => 100755 kernel/helpers/Html.php mode change 100644 => 100755 kernel/helpers/Manifest.php mode change 100644 => 100755 kernel/helpers/RESTClient.php mode change 100644 => 100755 kernel/helpers/SMTP.php mode change 100644 => 100755 kernel/helpers/Slug.php mode change 100644 => 100755 kernel/helpers/Version.php mode change 100644 => 100755 kernel/manifest.json mode change 100644 => 100755 kernel/middlewares/AuthMiddleware.php mode change 100644 => 100755 kernel/models/Menu.php mode change 100644 => 100755 kernel/models/Option.php mode change 100644 => 100755 kernel/modules/admin_themes/AdminThemesModule.php mode change 100644 => 100755 kernel/modules/admin_themes/controllers/AdminThemeController.php mode change 100644 => 100755 kernel/modules/admin_themes/manifest.json mode change 100644 => 100755 kernel/modules/admin_themes/routs/adminThemes.php mode change 100644 => 100755 kernel/modules/admin_themes/views/index.php mode change 100644 => 100755 kernel/modules/admin_themes/views/view.php mode change 100644 => 100755 kernel/modules/menu/MenuModule.php mode change 100644 => 100755 kernel/modules/menu/controllers/MenuController.php mode change 100644 => 100755 kernel/modules/menu/controllers/MenuRestController.php mode change 100644 => 100755 kernel/modules/menu/manifest.json mode change 100644 => 100755 kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php mode change 100644 => 100755 kernel/modules/menu/models/Menu.php mode change 100644 => 100755 kernel/modules/menu/models/forms/CreateMenuForm.php mode change 100644 => 100755 kernel/modules/menu/routs/menu.php mode change 100644 => 100755 kernel/modules/menu/service/MenuService.php mode change 100644 => 100755 kernel/modules/menu/table/columns/MenuDeleteActionColumn.php mode change 100644 => 100755 kernel/modules/menu/table/columns/MenuEditActionColumn.php mode change 100644 => 100755 kernel/modules/menu/table/columns/MenuViewActionColumn.php mode change 100644 => 100755 kernel/modules/menu/views/form.php mode change 100644 => 100755 kernel/modules/menu/views/index.php mode change 100644 => 100755 kernel/modules/menu/views/view.php mode change 100644 => 100755 kernel/modules/module_shop_client/controllers/ModuleShopClientController.php mode change 100644 => 100755 kernel/modules/module_shop_client/manifest.json mode change 100644 => 100755 kernel/modules/module_shop_client/routs/module_shop_client.php create mode 100755 kernel/modules/module_shop_client/services/ModuleShopClientService.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/enter_code.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/index.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/kernel_update.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/login_at_module_shop.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/module_shop_error_connection.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/success_login.php mode change 100644 => 100755 kernel/modules/module_shop_client/views/view.php mode change 100644 => 100755 kernel/modules/option/OptionModule.php mode change 100644 => 100755 kernel/modules/option/controllers/OptionController.php mode change 100644 => 100755 kernel/modules/option/manifest.json mode change 100644 => 100755 kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php mode change 100644 => 100755 kernel/modules/option/models/Option.php mode change 100644 => 100755 kernel/modules/option/models/forms/CreateOptionForm.php mode change 100644 => 100755 kernel/modules/option/routs/option.php mode change 100644 => 100755 kernel/modules/option/service/OptionService.php mode change 100644 => 100755 kernel/modules/option/table/columns/OptionDeleteActionColumn.php mode change 100644 => 100755 kernel/modules/option/table/columns/OptionEditActionColumn.php mode change 100644 => 100755 kernel/modules/option/table/columns/OptionViewActionColumn.php mode change 100644 => 100755 kernel/modules/option/views/form.php mode change 100644 => 100755 kernel/modules/option/views/index.php mode change 100644 => 100755 kernel/modules/option/views/view.php mode change 100644 => 100755 kernel/modules/post/PostModule.php mode change 100644 => 100755 kernel/modules/post/controllers/PostController.php mode change 100644 => 100755 kernel/modules/post/controllers/PostRestController.php mode change 100644 => 100755 kernel/modules/post/manifest.json mode change 100644 => 100755 kernel/modules/post/migrations/2024_09_23_130017_create_post_table.php mode change 100644 => 100755 kernel/modules/post/models/Post.php mode change 100644 => 100755 kernel/modules/post/models/forms/CreatePostForm.php mode change 100644 => 100755 kernel/modules/post/routs/post.php mode change 100644 => 100755 kernel/modules/post/service/PostService.php mode change 100644 => 100755 kernel/modules/post/views/form.php mode change 100644 => 100755 kernel/modules/post/views/index.php mode change 100644 => 100755 kernel/modules/post/views/view.php mode change 100644 => 100755 kernel/modules/secure/controllers/SecureController.php mode change 100644 => 100755 kernel/modules/secure/controllers/SecureRestController.php mode change 100644 => 100755 kernel/modules/secure/manifest.json mode change 100644 => 100755 kernel/modules/secure/middlewares/BearerAuthMiddleware.php mode change 100644 => 100755 kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php mode change 100644 => 100755 kernel/modules/secure/models/SecretCode.php mode change 100644 => 100755 kernel/modules/secure/models/forms/LoginEmailForm.php mode change 100644 => 100755 kernel/modules/secure/models/forms/LoginForm.php mode change 100644 => 100755 kernel/modules/secure/models/forms/RegisterForm.php mode change 100644 => 100755 kernel/modules/secure/routs/secure.php mode change 100644 => 100755 kernel/modules/secure/services/SecureService.php mode change 100644 => 100755 kernel/modules/secure/views/email_login.php mode change 100644 => 100755 kernel/modules/secure/views/enter_code.php mode change 100644 => 100755 kernel/modules/secure/views/login.php mode change 100644 => 100755 kernel/modules/secure/views/register.php mode change 100644 => 100755 kernel/modules/user/UserModule.php mode change 100644 => 100755 kernel/modules/user/controllers/UserController.php mode change 100644 => 100755 kernel/modules/user/manifest.json mode change 100644 => 100755 kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php mode change 100644 => 100755 kernel/modules/user/models/User.php mode change 100644 => 100755 kernel/modules/user/models/forms/CreateUserForm.php mode change 100644 => 100755 kernel/modules/user/routs/user.php mode change 100644 => 100755 kernel/modules/user/service/UserService.php mode change 100644 => 100755 kernel/modules/user/table/columns/UserDeleteActionColumn.php mode change 100644 => 100755 kernel/modules/user/table/columns/UserEditActionColumn.php mode change 100644 => 100755 kernel/modules/user/table/columns/UserViewActionColumn.php mode change 100644 => 100755 kernel/modules/user/views/form.php create mode 100755 kernel/modules/user/views/form_profile.php mode change 100644 => 100755 kernel/modules/user/views/index.php mode change 100644 => 100755 kernel/modules/user/views/view.php create mode 100755 kernel/modules/user/views/view_profile.php mode change 100644 => 100755 kernel/routs/admin.php mode change 100644 => 100755 kernel/services/AdminThemeService.php mode change 100644 => 100755 kernel/services/ConsoleService.php mode change 100644 => 100755 kernel/services/KernelService.php mode change 100644 => 100755 kernel/services/MigrationService.php mode change 100644 => 100755 kernel/services/ModuleService.php mode change 100644 => 100755 kernel/services/ModuleShopService.php mode change 100644 => 100755 kernel/services/TokenService.php mode change 100644 => 100755 kernel/templates/controllers/app_controller_template mode change 100644 => 100755 kernel/templates/controllers/kernel_controller_template mode change 100644 => 100755 kernel/templates/manifests/manifest_template mode change 100644 => 100755 kernel/templates/models/forms/create_form_template mode change 100644 => 100755 kernel/templates/models/model_template mode change 100644 => 100755 kernel/templates/module_files/app_module_file_template mode change 100644 => 100755 kernel/templates/module_files/kernel_module_file_template mode change 100644 => 100755 kernel/templates/routs/app_routs_template mode change 100644 => 100755 kernel/templates/routs/kernel_routs_template mode change 100644 => 100755 kernel/templates/services/service_template mode change 100644 => 100755 kernel/templates/views/form_template mode change 100644 => 100755 kernel/templates/views/index_template mode change 100644 => 100755 kernel/templates/views/view_template mode change 100644 => 100755 kernel/views/mailing/login_by_code.php mode change 100644 => 100755 kernel/views/mailing/register_by_code.php mode change 100644 => 100755 kernel/views/module/index.php mode change 100644 => 100755 kernel/views/module/view.php mode change 100644 => 100755 kernel/views/widgets/action_button.php mode change 100644 => 100755 kernel/views/widgets/menu.php mode change 100644 => 100755 kernel/views/widgets/tabs.php mode change 100644 => 100755 kernel/widgets/ActionButtonWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnActivateWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnCreateWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnDeactivateWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnDeleteWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnEditWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnInstallWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnListWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnUpdateWidget.php mode change 100644 => 100755 kernel/widgets/IconBtn/IconBtnViewWidget.php mode change 100644 => 100755 kernel/widgets/MenuWidget.php mode change 100644 => 100755 kernel/widgets/ModuleTabsWidget.php mode change 100644 => 100755 kernel/widgets/TagTabsWidget.php create mode 100644 resources/default_user_photo/noPhoto.png diff --git a/app/modules/module_shop/controllers/ThemeShopController.php b/app/modules/module_shop/controllers/ThemeShopController.php new file mode 100644 index 0000000..4ec7325 --- /dev/null +++ b/app/modules/module_shop/controllers/ThemeShopController.php @@ -0,0 +1,84 @@ +cgView->viewPath = APP_DIR . "/modules/module_shop/views/theme/"; + $this->moduleShopService = new ModuleShopService(); + $this->files = new Files(); + } + + public function actionCreate(): void + { + $this->cgView->render("form.php"); + } + + /** + * @throws \Exception + */ + #[NoReturn] public function actionAdd(): void + { + $themeShopForm = new CreateThemeShopForm(); + $themeShopForm->load($_REQUEST); + + if (isset($_FILES['path_to_archive']) && $_FILES['path_to_archive']['error'] === UPLOAD_ERR_OK) { + $file = new FileUpload($_FILES['path_to_archive'], ['zip', 'rar', 'igt']); + $file->upload(); + $themeShopForm->setItem('path_to_archive', $file->getUploadFile()); + } + + $tmpThemeDir = md5(time()); + $zip = new ZipArchive; + $res = $zip->open(ROOT_DIR . $themeShopForm->getItem('path_to_archive')); + if ($res === TRUE) { + if (!is_dir(RESOURCES_DIR . '/tmp/ms/')) { + $oldMask = umask(0); + mkdir(RESOURCES_DIR . '/tmp/ms/', 0775, true); + umask($oldMask); + } + $tmpModuleShopDirFull = RESOURCES_DIR . '/tmp/ms/' . $tmpThemeDir . "/"; + $zip->extractTo($tmpModuleShopDirFull); + $zip->close(); + + if (file_exists($tmpModuleShopDirFull . "meta/manifest.json")){ + $themeInfo = $this->moduleShopService->getModuleInfo($tmpModuleShopDirFull . "meta"); + $themeShopForm->load($themeInfo); + } + else { + throw new \Exception("Manifest.json file not found"); + } + $this->files->recursiveRemoveDir($tmpModuleShopDirFull); + + } + else { + throw new \Exception("zip not found"); + } + + if ($themeShopForm->validate()) { + $theme = $this->moduleShopService->create($themeShopForm); + if ($theme) { + Flash::setMessage("success", "Тема сайта добавлена."); + $this->redirect("/admin/module_shop/view/" . $theme->id); + } + } + Flash::setMessage("error", "Ошибка добавления темы сайта:
" . $themeShopForm->getErrorsStr()); + $this->redirect("/admin/module_shop/theme/create"); + } +} \ No newline at end of file diff --git a/app/modules/module_shop/models/forms/CreateThemeShopForm.php b/app/modules/module_shop/models/forms/CreateThemeShopForm.php new file mode 100644 index 0000000..1b478e3 --- /dev/null +++ b/app/modules/module_shop/models/forms/CreateThemeShopForm.php @@ -0,0 +1,22 @@ + 'required|min-str-len:3', + 'version' => 'required', + 'description' => '', + 'author' => 'required', + 'status' => 'required', + 'slug' => 'required', + 'type' => 'required', + 'path_to_archive' => 'required', + ]; + } +} \ No newline at end of file diff --git a/app/modules/module_shop/views/theme/form.php b/app/modules/module_shop/views/theme/form.php new file mode 100644 index 0000000..ad51235 --- /dev/null +++ b/app/modules/module_shop/views/theme/form.php @@ -0,0 +1,51 @@ +beginForm("/admin/module_shop/theme", enctype: 'multipart/form-data'); + +$form->field(class: \itguild\forms\inputs\File::class, name: "path_to_archive", params: [ + 'class' => "form-control", + 'placeholder' => 'Путь к файлу темы сайта', + 'value' => $model->path_to_archive ?? '' +]) + ->setLabel("Путь к файлу темы сайта") + ->render(); + +$form->field(class: \itguild\forms\inputs\Select::class, name: "status", params: [ + 'class' => "form-control", + 'value' => $model->status ?? '' +]) + ->setLabel("Статус") + ->setOptions(ModuleShop::getStatus()) + ->render(); + +?> +
+
+ field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [ + 'class' => "btn btn-primary ", + 'value' => 'Отправить', + 'typeInput' => 'submit' + ]) + ->render(); + ?> +
+
+ field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [ + 'class' => "btn btn-warning", + 'value' => 'Сбросить', + 'typeInput' => 'reset' + ]) + ->render(); + ?> +
+
+endForm(); diff --git a/bootstrap/db.php b/bootstrap/db.php old mode 100644 new mode 100755 diff --git a/bootstrap/header.php b/bootstrap/header.php old mode 100644 new mode 100755 diff --git a/bootstrap/secure.php b/bootstrap/secure.php old mode 100644 new mode 100755 diff --git a/kernel/AdminController.php b/kernel/AdminController.php old mode 100644 new mode 100755 diff --git a/kernel/App.php b/kernel/App.php old mode 100644 new mode 100755 diff --git a/kernel/CgRouteCollector.php b/kernel/CgRouteCollector.php old mode 100644 new mode 100755 diff --git a/kernel/CgView.php b/kernel/CgView.php old mode 100644 new mode 100755 diff --git a/kernel/Controller.php b/kernel/Controller.php old mode 100644 new mode 100755 diff --git a/kernel/Database.php b/kernel/Database.php old mode 100644 new mode 100755 diff --git a/kernel/EntityRelation.php b/kernel/EntityRelation.php old mode 100644 new mode 100755 diff --git a/kernel/FileUpload.php b/kernel/FileUpload.php old mode 100644 new mode 100755 index 7a1705b..a61893c --- a/kernel/FileUpload.php +++ b/kernel/FileUpload.php @@ -36,7 +36,9 @@ class FileUpload $newFileName = md5(time() . $this->fileName) . '.' . $this->fileExtension; if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir . mb_substr($newFileName, 0, 2) . '/' . mb_substr($newFileName, 2, 2) . '/'; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $newFileName; $this->uploadFile = $this->uploadDir . $newFileName; @@ -49,7 +51,9 @@ class FileUpload } else { if (in_array($this->fileExtension, $this->allowedFileExtensions)) { $this->uploadDir = $uploadDir; - mkdir(ROOT_DIR . $this->uploadDir, 0777, true); + $oldMask = umask(0); + mkdir(ROOT_DIR . $this->uploadDir, 0775, true); + umask($oldMask); $uploadFileDir = ROOT_DIR . $this->uploadDir; $this->destPath = $uploadFileDir . $this->fileName; $this->uploadFile = $this->uploadDir . $this->fileName; diff --git a/kernel/Flash.php b/kernel/Flash.php old mode 100644 new mode 100755 diff --git a/kernel/FormModel.php b/kernel/FormModel.php old mode 100644 new mode 100755 diff --git a/kernel/Header.php b/kernel/Header.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/action_column/DeleteActionColumn.php b/kernel/IGTabel/action_column/DeleteActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/action_column/EditActionColumn.php b/kernel/IGTabel/action_column/EditActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/action_column/InstallActionColumn.php b/kernel/IGTabel/action_column/InstallActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/action_column/ViewActionColumn.php b/kernel/IGTabel/action_column/ViewActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/btn/DangerBtn.php b/kernel/IGTabel/btn/DangerBtn.php old mode 100644 new mode 100755 diff --git a/kernel/IGTabel/btn/PrimaryBtn.php b/kernel/IGTabel/btn/PrimaryBtn.php old mode 100644 new mode 100755 index 2abe09e..b389401 --- a/kernel/IGTabel/btn/PrimaryBtn.php +++ b/kernel/IGTabel/btn/PrimaryBtn.php @@ -8,7 +8,7 @@ class PrimaryBtn public function __construct(string $title, string $url, $width) { - $this->btn = "$title"; + $this->btn = "$title"; } public function fetch(): string diff --git a/kernel/IGTabel/btn/SuccessBtn.php b/kernel/IGTabel/btn/SuccessBtn.php old mode 100644 new mode 100755 diff --git a/kernel/Mailing.php b/kernel/Mailing.php old mode 100644 new mode 100755 diff --git a/kernel/Middleware.php b/kernel/Middleware.php old mode 100644 new mode 100755 diff --git a/kernel/Module.php b/kernel/Module.php old mode 100644 new mode 100755 diff --git a/kernel/Request.php b/kernel/Request.php old mode 100644 new mode 100755 diff --git a/kernel/ResponseType.php b/kernel/ResponseType.php old mode 100644 new mode 100755 diff --git a/kernel/RestController.php b/kernel/RestController.php old mode 100644 new mode 100755 index 0da92ff..2d7596d --- a/kernel/RestController.php +++ b/kernel/RestController.php @@ -94,7 +94,9 @@ class RestController $model = $this->model->where('id', $id)->first(); foreach ($model->getFillable() as $item){ - $model->{$item} = $data[$item] ?? null; + if (!empty($data[$item])){ + $model->{$item} = $data[$item] ?? null; + } } $model->save(); diff --git a/kernel/Widget.php b/kernel/Widget.php old mode 100644 new mode 100755 diff --git a/kernel/admin_themes/default/layout/login.php b/kernel/admin_themes/default/layout/login.php old mode 100644 new mode 100755 diff --git a/kernel/admin_themes/default/layout/main.php b/kernel/admin_themes/default/layout/main.php old mode 100644 new mode 100755 index db00106..98be7fb --- a/kernel/admin_themes/default/layout/main.php +++ b/kernel/admin_themes/default/layout/main.php @@ -26,10 +26,13 @@
-
- - -
+
+ + +
- +
diff --git a/kernel/admin_themes/default/manifest.json b/kernel/admin_themes/default/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/admin_themes/simple/layout/main.php b/kernel/admin_themes/simple/layout/main.php old mode 100644 new mode 100755 diff --git a/kernel/admin_themes/simple/manifest.json b/kernel/admin_themes/simple/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/console/CgMigrationCreator.php b/kernel/console/CgMigrationCreator.php old mode 100644 new mode 100755 diff --git a/kernel/console/ConsoleApp.php b/kernel/console/ConsoleApp.php old mode 100644 new mode 100755 diff --git a/kernel/console/ConsoleController.php b/kernel/console/ConsoleController.php old mode 100644 new mode 100755 diff --git a/kernel/console/Out.php b/kernel/console/Out.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/AdminConsoleController.php b/kernel/console/controllers/AdminConsoleController.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/AdminThemeController.php b/kernel/console/controllers/AdminThemeController.php old mode 100644 new mode 100755 index 2fc1739..d33d44b --- a/kernel/console/controllers/AdminThemeController.php +++ b/kernel/console/controllers/AdminThemeController.php @@ -18,31 +18,15 @@ class AdminThemeController extends ConsoleController throw new \Exception('Missing admin theme path "--path" specified'); } - $zip = new ZipArchive; - $tmpThemeDir = md5(time()); - $res = $zip->open(ROOT_DIR . $this->argv['path']); - if ($res === TRUE) { - $tmpThemeDirFull = RESOURCES_DIR . '/tmp/ad/' . $tmpThemeDir . "/"; - $zip->extractTo($tmpThemeDirFull); - $zip->close(); - $this->out->r('Архив распакован', 'green'); + if (file_exists(ROOT_DIR . $this->argv['path'])) { + $adminThemeService = new AdminThemeService(); + if ($adminThemeService->install($this->argv['path'])) { + $this->out->r("Тема админ-панели установлена", 'green'); + } else { + $this->out->r("Ошибка установки темы админ-панели", 'red'); + } } else { - $this->out->r('Message: Ошибка чтения архива', 'red'); - } - - if (file_exists($tmpThemeDirFull . "meta/manifest.json")){ - $manifestJson = getConst(file_get_contents($tmpThemeDirFull . "meta/manifest.json")); - $manifest = Manifest::getWithVars($manifestJson); - $this->out->r('manifest.json инициализирован', 'green'); - - $fileHelper = new Files(); - $fileHelper->copy_folder($tmpThemeDirFull . "meta", $manifest['theme_path']); - $fileHelper->copy_folder($tmpThemeDirFull . "resources", $manifest['resource_path']); - - $this->out->r("Удаляем временные файлы", 'green'); - $fileHelper->recursiveRemoveDir($tmpThemeDirFull); - - $this->out->r("Тема " . $manifest['name'] . " установлена", 'green'); + $this->out->r("Тема админ-панели не найдена", 'red'); } } @@ -53,17 +37,11 @@ class AdminThemeController extends ConsoleController } if (file_exists(ROOT_DIR . $this->argv['path'])) { - $themeName = basename($this->argv['path']); - $active_admin_theme = Option::where("key", "active_admin_theme")->first(); - if ($active_admin_theme->value === ROOT_DIR . $this->argv['path']) { - $this->out->r("Меняем тему на базовую", 'green'); - $adminThemeService = new AdminThemeService(); - $adminThemeService->setActiveAdminTheme(KERNEL_ADMIN_THEMES_DIR . '/default'); - $this->out->r("Тема изменена", 'green'); - } - $fileHelper = new Files(); - $fileHelper->recursiveRemoveDir(ROOT_DIR . $this->argv['path']); - $fileHelper->recursiveRemoveDir(RESOURCES_DIR . '/' . $themeName); + $adminThemeService = new AdminThemeService(); + $adminThemeService->uninstall($this->argv['path']); + + + $this->out->r("Тема удалена", 'green'); } else { @@ -71,4 +49,22 @@ class AdminThemeController extends ConsoleController } } + /** + * @throws \Exception + */ + public function actionPackTheme(): void + { + if (!isset($this->argv['path'])) { + throw new \Exception('Missing admin theme path "--path" specified'); + } + + if (file_exists(ROOT_DIR . $this->argv['path'])) { + $adminThemeService = new AdminThemeService(); + $adminThemeService->pack($this->argv['path']); + $this->out->r("Тема админ-панели заархивирована", 'green'); + } else { + $this->out->r("Тема админ-панели не найдена", 'red'); + } + } + } \ No newline at end of file diff --git a/kernel/console/controllers/KernelController.php b/kernel/console/controllers/KernelController.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/MainController.php b/kernel/console/controllers/MainController.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/MigrationController.php b/kernel/console/controllers/MigrationController.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/ModuleController.php b/kernel/console/controllers/ModuleController.php old mode 100644 new mode 100755 diff --git a/kernel/console/controllers/SecureController.php b/kernel/console/controllers/SecureController.php old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/blank.stub b/kernel/console/migrations/stubs/blank.stub old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/create.stub b/kernel/console/migrations/stubs/create.stub old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/migration.create.stub b/kernel/console/migrations/stubs/migration.create.stub old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/migration.stub b/kernel/console/migrations/stubs/migration.stub old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/migration.update.stub b/kernel/console/migrations/stubs/migration.update.stub old mode 100644 new mode 100755 diff --git a/kernel/console/migrations/stubs/update.stub b/kernel/console/migrations/stubs/update.stub old mode 100644 new mode 100755 diff --git a/kernel/console/routs/cli.php b/kernel/console/routs/cli.php old mode 100644 new mode 100755 index d0f1032..4676cc7 --- a/kernel/console/routs/cli.php +++ b/kernel/console/routs/cli.php @@ -35,6 +35,10 @@ App::$collector->group(["prefix" => "admin-theme"], callback: function (RouteCol [\kernel\console\controllers\AdminThemeController::class, 'actionUninstallTheme'], additionalInfo: ['description' => 'Удалить тему админ-панели', 'params' => ['--path' => 'Путь к удаляемой теме']] ); + App::$collector->console('pack', + [\kernel\console\controllers\AdminThemeController::class, 'actionPackTheme'], + additionalInfo: ['description' => 'Заархивировать тему админ-панели', 'params' => ['--path' => 'Путь к теме, которую нужно заархивировать']] + ); }); App::$collector->group(["prefix" => "secure"], callback: function (RouteCollector $router){ diff --git a/kernel/controllers/ModuleController.php b/kernel/controllers/ModuleController.php old mode 100644 new mode 100755 diff --git a/kernel/filters/BootstrapSelectFilter.php b/kernel/filters/BootstrapSelectFilter.php new file mode 100755 index 0000000..86daceb --- /dev/null +++ b/kernel/filters/BootstrapSelectFilter.php @@ -0,0 +1,23 @@ +name, [ + 'class' => 'form-control', + 'options' => $this->params['options'], + 'value' => $this->value, + 'prompt' => $this->params['prompt'] ?? null, + ]); + + return "" . $select->create()->fetch() . ""; + } +} \ No newline at end of file diff --git a/kernel/filters/BootstrapTextFilter.php b/kernel/filters/BootstrapTextFilter.php new file mode 100755 index 0000000..32aec8b --- /dev/null +++ b/kernel/filters/BootstrapTextFilter.php @@ -0,0 +1,21 @@ +name, [ + 'value' => $this->value, + 'class' => "form-control" + ]); + + return "" . $textInput->create()->fetch() . ""; + + } +} \ No newline at end of file diff --git a/kernel/helpers/Debug.php b/kernel/helpers/Debug.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/Files.php b/kernel/helpers/Files.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/Html.php b/kernel/helpers/Html.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/Manifest.php b/kernel/helpers/Manifest.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/RESTClient.php b/kernel/helpers/RESTClient.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/SMTP.php b/kernel/helpers/SMTP.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/Slug.php b/kernel/helpers/Slug.php old mode 100644 new mode 100755 diff --git a/kernel/helpers/Version.php b/kernel/helpers/Version.php old mode 100644 new mode 100755 diff --git a/kernel/manifest.json b/kernel/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/middlewares/AuthMiddleware.php b/kernel/middlewares/AuthMiddleware.php old mode 100644 new mode 100755 diff --git a/kernel/models/Menu.php b/kernel/models/Menu.php old mode 100644 new mode 100755 diff --git a/kernel/models/Option.php b/kernel/models/Option.php old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/AdminThemesModule.php b/kernel/modules/admin_themes/AdminThemesModule.php old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/controllers/AdminThemeController.php b/kernel/modules/admin_themes/controllers/AdminThemeController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/manifest.json b/kernel/modules/admin_themes/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/routs/adminThemes.php b/kernel/modules/admin_themes/routs/adminThemes.php old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/views/index.php b/kernel/modules/admin_themes/views/index.php old mode 100644 new mode 100755 diff --git a/kernel/modules/admin_themes/views/view.php b/kernel/modules/admin_themes/views/view.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/MenuModule.php b/kernel/modules/menu/MenuModule.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/controllers/MenuController.php b/kernel/modules/menu/controllers/MenuController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/controllers/MenuRestController.php b/kernel/modules/menu/controllers/MenuRestController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/manifest.json b/kernel/modules/menu/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php b/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/models/Menu.php b/kernel/modules/menu/models/Menu.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/models/forms/CreateMenuForm.php b/kernel/modules/menu/models/forms/CreateMenuForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/routs/menu.php b/kernel/modules/menu/routs/menu.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/service/MenuService.php b/kernel/modules/menu/service/MenuService.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/table/columns/MenuDeleteActionColumn.php b/kernel/modules/menu/table/columns/MenuDeleteActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/table/columns/MenuEditActionColumn.php b/kernel/modules/menu/table/columns/MenuEditActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/table/columns/MenuViewActionColumn.php b/kernel/modules/menu/table/columns/MenuViewActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/views/form.php b/kernel/modules/menu/views/form.php old mode 100644 new mode 100755 diff --git a/kernel/modules/menu/views/index.php b/kernel/modules/menu/views/index.php old mode 100644 new mode 100755 index 0cad83d..d3bbfcd --- a/kernel/modules/menu/views/index.php +++ b/kernel/modules/menu/views/index.php @@ -19,12 +19,15 @@ $table = new ListEloquentTable(new EloquentDataProvider(Menu::class, [ 'baseUrl' => "/admin/settings/menu", ])); $table->columns([ - 'parent_id' => (function ($data) { + 'parent_id' => function ($data) { if ($data == 0) return null; return Menu::find($data)->label; - }), + }, 'icon_file' => function ($data) { return $data ? "" : ""; + }, + 'status' => function ($data) { + return Menu::getStatus()[$data]; } ]); $table->beforePrint(function () { diff --git a/kernel/modules/menu/views/view.php b/kernel/modules/menu/views/view.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/controllers/ModuleShopClientController.php b/kernel/modules/module_shop_client/controllers/ModuleShopClientController.php old mode 100644 new mode 100755 index d4d4102..13c4e6c --- a/kernel/modules/module_shop_client/controllers/ModuleShopClientController.php +++ b/kernel/modules/module_shop_client/controllers/ModuleShopClientController.php @@ -10,14 +10,12 @@ use kernel\Flash; use kernel\helpers\Debug; use kernel\helpers\Files; use kernel\helpers\RESTClient; -use kernel\helpers\SMTP; -use kernel\Mailing; +use kernel\modules\module_shop_client\services\ModuleShopClientService; use kernel\Request; use kernel\services\AdminThemeService; use kernel\services\KernelService; use kernel\services\ModuleService; use kernel\services\ModuleShopService; -use kernel\services\TokenService; use PHPMailer\PHPMailer\Exception; class ModuleShopClientController extends AdminController @@ -26,6 +24,7 @@ class ModuleShopClientController extends AdminController protected Client $client; protected ModuleService $moduleService; protected KernelService $kernelService; + protected ModuleShopClientService $moduleShopClientService; protected function init(): void { @@ -35,6 +34,7 @@ class ModuleShopClientController extends AdminController $this->client = new Client(); $this->moduleService = new ModuleService(); $this->kernelService = new KernelService(); + $this->moduleShopClientService = new ModuleShopClientService(); } /** @@ -42,7 +42,6 @@ class ModuleShopClientController extends AdminController */ public function actionIndex(int $page_number = 1): void { - if ($this->moduleService->issetModuleShopToken()) { if ($this->moduleService->isServerAvailable()) { @@ -157,24 +156,71 @@ class ModuleShopClientController extends AdminController $this->redirect('/admin/module_shop_client', 302); } +// public function actionSearch(int $page_number = 1): void +// { +// $request = new Request(); +// $filters = $request->get(); +//// Debug::dd($filters); +// if ($this->moduleService->issetModuleShopToken()) { +// if ($this->moduleService->isServerAvailable()) { +// $modules_info = []; +// $per_page = 8; +// $modules = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); +// $modules = json_decode($modules->getBody()->getContents(), true); +// foreach ($modules as $module) { +// foreach ($filters as $key => $value) { +// if ($value === '') continue; +// if ($module[$key] !== $value) { +// break; +// } +// +// $modules_info[] = $module; +// } +// } +// $module_count = count($modules_info); +// $modules_info = array_slice($modules_info, $per_page * ($page_number - 1), $per_page); +// +// $this->cgView->render("index.php", [ +// 'modules_info' => $modules_info, +// 'moduleService' => $this->moduleService, +// 'page_number' => $page_number, +// 'module_count' => $module_count, +// 'per_page' => $per_page, +// 'kernelService' => new KernelService(), +// 'adminThemeService' => new AdminThemeService(), +// 'filterValues' => $filters +// ]); +// } else { +// $this->cgView->render("module_shop_error_connection.php"); +// } +// +// } else { +// $this->cgView->render("login_at_module_shop.php"); +// } +// } + public function actionSearch(int $page_number = 1): void { $request = new Request(); $filters = $request->get(); if ($this->moduleService->issetModuleShopToken()) { if ($this->moduleService->isServerAvailable()) { - $modules_info = []; +// $modules_info = []; $per_page = 8; - $modules = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); - $modules = json_decode($modules->getBody()->getContents(), true); - foreach ($modules as $module) { - foreach ($filters as $key => $value) { + $modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); + $modules_info = json_decode($modules_info->getBody()->getContents(), true); + foreach ($modules_info as $key => $module) { + foreach ($filters as $column => $value) { if ($value === '') continue; - if ($module[$key] !== $value) { - break; + if (is_numeric($value)) { + if ($module[$column] !== $value) { + unset($modules_info[$key]); + } + } elseif (is_string($value)) { + if (!str_contains($module[$column], $value)) { + unset($modules_info[$key]); + } } - - $modules_info[] = $module; } } $module_count = count($modules_info); @@ -188,6 +234,7 @@ class ModuleShopClientController extends AdminController 'per_page' => $per_page, 'kernelService' => new KernelService(), 'adminThemeService' => new AdminThemeService(), + 'filterValues' => $filters ]); } else { $this->cgView->render("module_shop_error_connection.php"); @@ -209,7 +256,7 @@ class ModuleShopClientController extends AdminController $moduleShopService = new ModuleShopService(); $result = $moduleShopService->email_auth($address); - if ($result['status'] == 'success'){ + if ($result['status'] == 'success') { $this->cgView->render('enter_code.php', ['email' => $address]); } @@ -224,7 +271,7 @@ class ModuleShopClientController extends AdminController $moduleShopService = new ModuleShopService(); $result = $moduleShopService->code_check($code); - if (isset($result['access_token'])){ + if (isset($result['access_token'])) { $envFile = \EnvEditor\EnvFile::loadFrom(ROOT_DIR . "/.env"); diff --git a/kernel/modules/module_shop_client/manifest.json b/kernel/modules/module_shop_client/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/routs/module_shop_client.php b/kernel/modules/module_shop_client/routs/module_shop_client.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/services/ModuleShopClientService.php b/kernel/modules/module_shop_client/services/ModuleShopClientService.php new file mode 100755 index 0000000..d86afca --- /dev/null +++ b/kernel/modules/module_shop_client/services/ModuleShopClientService.php @@ -0,0 +1,22 @@ +getBody()->getContents(), true); +// return array_slice($modules_info, $perPage * ($pageNumber - 1), $perPage); +// } +// +// public function getModulesInfoWithFilters(string $url, int $perPage, int $pageNumber): \Psr\Http\Message\ResponseInterface +// { +// $modules_info = RESTClient::request($url); +// $modules_info = json_decode($modules_info->getBody()->getContents(), true); +// return array_slice($modules_info, $perPage * ($pageNumber - 1), $perPage); +// } +} \ No newline at end of file diff --git a/kernel/modules/module_shop_client/views/enter_code.php b/kernel/modules/module_shop_client/views/enter_code.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/views/index.php b/kernel/modules/module_shop_client/views/index.php old mode 100644 new mode 100755 index aa5ae3e..f3474d4 --- a/kernel/modules/module_shop_client/views/index.php +++ b/kernel/modules/module_shop_client/views/index.php @@ -7,6 +7,7 @@ * @var \kernel\services\ModuleService $moduleService * @var \kernel\services\KernelService $kernelService * @var \kernel\services\AdminThemeService $adminThemeService + * @var array $filterValues */ use Itguild\Tables\ListJsonTable; @@ -30,7 +31,6 @@ $meta['total'] = $module_count; $info_to_table['meta'] = $meta; $info_to_table['data'] = $modules_info; -$info_to_table['filters'] = ['type']; $table = new ListJsonTable(json_encode($info_to_table, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); @@ -40,8 +40,24 @@ $table->addAction(function ($row, $url) use ($moduleService) { return \kernel\widgets\IconBtn\IconBtnViewWidget::create(['url' => $url])->run(); }); -$table->addAction(function ($row, $url) use ($moduleService){ - if ($row['slug'] !== 'kernel') { +$table->columns([ + 'type' => [ + 'filter' => [ + 'class' => \kernel\filters\BootstrapSelectFilter::class, + 'params' => [ + 'options' => [ + 'kernel' => 'kernel', + 'entity' => 'entity', + ], + 'prompt' => 'Не выбрано' + ], + 'value' => $filterValues['type'] ?? '' + ], + ] +]); + +$table->addAction(function ($row, $url) use ($moduleService) { + if ($row['type'] === 'entity' || $row['type'] === 'additional_property') { if ($moduleService->isInstall($row['slug'])) { $url = "$url/delete/?slug=" . $row['slug']; @@ -52,16 +68,19 @@ $table->addAction(function ($row, $url) use ($moduleService){ return \kernel\widgets\IconBtn\IconBtnInstallWidget::create(['url' => $url])->run(); } } - return null; + + return false; }); $table->addAction(function ($row, $url) use ($moduleService) { - $slug = $row['slug']; - if ($moduleService->isInstall($slug)) { - if (!$moduleService->isLastVersion($slug)) { - $url = "$url/update/?slug=" . $slug; + if ($row['type'] === 'entity' || $row['type'] === 'additional_property') { + $slug = $row['slug']; + if ($moduleService->isInstall($slug)) { + if (!$moduleService->isLastVersion($slug)) { + $url = "$url/update/?slug=" . $slug; - return \kernel\widgets\IconBtn\IconBtnUpdateWidget::create(['url' => $url])->run(); + return \kernel\widgets\IconBtn\IconBtnUpdateWidget::create(['url' => $url])->run(); + } } } @@ -69,8 +88,7 @@ $table->addAction(function ($row, $url) use ($moduleService) { }); $table->addAction(function ($row, $url) use ($kernelService) { - $slug = $row['slug']; - if ($slug === 'kernel') { + if ($row['type'] === 'kernel') { if (!$kernelService->isLastVersion()) { $url = "$url/kernel/update_form/"; @@ -82,9 +100,8 @@ $table->addAction(function ($row, $url) use ($kernelService) { }); $table->addAction(function ($row, $url) use ($adminThemeService) { - $type = $row['type']; - $slug = $row['slug']; - if ($type === 'admin_theme') { + if ($row['type'] === 'admin_theme') { + $slug = $row['slug']; if ($adminThemeService->isInstall($slug)) { if (!$adminThemeService->isLastVersion($slug)) { $url = "$url/admin_theme/update/"; diff --git a/kernel/modules/module_shop_client/views/kernel_update.php b/kernel/modules/module_shop_client/views/kernel_update.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/views/login_at_module_shop.php b/kernel/modules/module_shop_client/views/login_at_module_shop.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/views/module_shop_error_connection.php b/kernel/modules/module_shop_client/views/module_shop_error_connection.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/views/success_login.php b/kernel/modules/module_shop_client/views/success_login.php old mode 100644 new mode 100755 diff --git a/kernel/modules/module_shop_client/views/view.php b/kernel/modules/module_shop_client/views/view.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/OptionModule.php b/kernel/modules/option/OptionModule.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/controllers/OptionController.php b/kernel/modules/option/controllers/OptionController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/manifest.json b/kernel/modules/option/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php b/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/models/Option.php b/kernel/modules/option/models/Option.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/models/forms/CreateOptionForm.php b/kernel/modules/option/models/forms/CreateOptionForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/routs/option.php b/kernel/modules/option/routs/option.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/service/OptionService.php b/kernel/modules/option/service/OptionService.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/table/columns/OptionDeleteActionColumn.php b/kernel/modules/option/table/columns/OptionDeleteActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/table/columns/OptionEditActionColumn.php b/kernel/modules/option/table/columns/OptionEditActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/table/columns/OptionViewActionColumn.php b/kernel/modules/option/table/columns/OptionViewActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/views/form.php b/kernel/modules/option/views/form.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/views/index.php b/kernel/modules/option/views/index.php old mode 100644 new mode 100755 diff --git a/kernel/modules/option/views/view.php b/kernel/modules/option/views/view.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/PostModule.php b/kernel/modules/post/PostModule.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/controllers/PostController.php b/kernel/modules/post/controllers/PostController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/controllers/PostRestController.php b/kernel/modules/post/controllers/PostRestController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/manifest.json b/kernel/modules/post/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/post/migrations/2024_09_23_130017_create_post_table.php b/kernel/modules/post/migrations/2024_09_23_130017_create_post_table.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/models/Post.php b/kernel/modules/post/models/Post.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/models/forms/CreatePostForm.php b/kernel/modules/post/models/forms/CreatePostForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/routs/post.php b/kernel/modules/post/routs/post.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/service/PostService.php b/kernel/modules/post/service/PostService.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/views/form.php b/kernel/modules/post/views/form.php old mode 100644 new mode 100755 diff --git a/kernel/modules/post/views/index.php b/kernel/modules/post/views/index.php old mode 100644 new mode 100755 index 045feb1..4b47124 --- a/kernel/modules/post/views/index.php +++ b/kernel/modules/post/views/index.php @@ -15,11 +15,15 @@ use kernel\widgets\IconBtn\IconBtnDeleteWidget; use kernel\widgets\IconBtn\IconBtnEditWidget; use kernel\widgets\IconBtn\IconBtnViewWidget; +$get = (new \kernel\Request())->get(); + $table = new ListEloquentTable(new EloquentDataProvider(Post::class, [ 'currentPage' => $page_number, 'perPage' => 3, 'params' => ["class" => "table table-bordered", "border" => "2"], - 'baseUrl' => "/admin/post" + 'baseUrl' => "/admin/post", + 'searchPrefix' => "", + 'searchParams' => $get, ])); $view->setTitle("Список постов"); @@ -36,36 +40,57 @@ foreach ($additionals as $additional) { }); } +//\kernel\helpers\Debug::dd($request); + $table->columns([ - 'created_at' => function ($data) { - if (!$data){ - return null; - } - - return (new DateTimeImmutable($data))->format("d-m-Y"); - }, + 'title' => [ + 'filter' => [ + 'class' => \kernel\filters\BootstrapTextFilter::class, + 'value' => $get['title'] ?? '' + ] + ], + 'content' => [ + 'filter' => [ + 'class' => \kernel\filters\BootstrapTextFilter::class, + 'value' => $get['content'] ?? '' + ] + ], + 'created_at' => [ + 'format' => 'date:d-m-Y', + ], 'updated_at' => function ($data) { - if (!$data){ + if (!$data) { return null; } return (new DateTimeImmutable($data))->format("d-m-Y"); }, - 'user_id' => (function ($data) { - return User::find($data)->username; - }) + 'user_id' => [ + 'value' => function ($data) { + return User::find($data)->username; + }, + 'filter' => [ + 'class' => \kernel\filters\BootstrapSelectFilter::class, + 'params' => [ + 'options' => \kernel\modules\user\service\UserService::createUsernameArr(), + 'prompt' => 'Не выбрано' + ], + 'value' => $get['user_id'] ?? '', + ], + ] ]); + $table->beforePrint(function () { return IconBtnCreateWidget::create(['url' => '/admin/post/create'])->run(); }); -$table->addAction(function($row) { +$table->addAction(function ($row) { return IconBtnViewWidget::create(['url' => '/admin/post/view/' . $row['id']])->run(); }); -$table->addAction(function($row) { +$table->addAction(function ($row) { return IconBtnEditWidget::create(['url' => '/admin/post/update/' . $row['id']])->run(); }); -$table->addAction(function($row) { +$table->addAction(function ($row) { return IconBtnDeleteWidget::create(['url' => '/admin/post/delete/' . $row['id']])->run(); }); $table->create(); diff --git a/kernel/modules/post/views/view.php b/kernel/modules/post/views/view.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/controllers/SecureController.php b/kernel/modules/secure/controllers/SecureController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/controllers/SecureRestController.php b/kernel/modules/secure/controllers/SecureRestController.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/manifest.json b/kernel/modules/secure/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/middlewares/BearerAuthMiddleware.php b/kernel/modules/secure/middlewares/BearerAuthMiddleware.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php b/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/models/SecretCode.php b/kernel/modules/secure/models/SecretCode.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/models/forms/LoginEmailForm.php b/kernel/modules/secure/models/forms/LoginEmailForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/models/forms/LoginForm.php b/kernel/modules/secure/models/forms/LoginForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/models/forms/RegisterForm.php b/kernel/modules/secure/models/forms/RegisterForm.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/routs/secure.php b/kernel/modules/secure/routs/secure.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/services/SecureService.php b/kernel/modules/secure/services/SecureService.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/views/email_login.php b/kernel/modules/secure/views/email_login.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/views/enter_code.php b/kernel/modules/secure/views/enter_code.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/views/login.php b/kernel/modules/secure/views/login.php old mode 100644 new mode 100755 diff --git a/kernel/modules/secure/views/register.php b/kernel/modules/secure/views/register.php old mode 100644 new mode 100755 diff --git a/kernel/modules/user/UserModule.php b/kernel/modules/user/UserModule.php old mode 100644 new mode 100755 diff --git a/kernel/modules/user/controllers/UserController.php b/kernel/modules/user/controllers/UserController.php old mode 100644 new mode 100755 index fdd8534..60a6028 --- a/kernel/modules/user/controllers/UserController.php +++ b/kernel/modules/user/controllers/UserController.php @@ -6,6 +6,8 @@ use Exception; use JetBrains\PhpStorm\NoReturn; use kernel\AdminController; use kernel\EntityRelation; +use kernel\FileUpload; +use kernel\helpers\Debug; use kernel\modules\user\models\forms\CreateUserForm; use kernel\modules\user\models\User; use kernel\modules\user\service\UserService; @@ -35,10 +37,17 @@ class UserController extends AdminController { $userForm = new CreateUserForm(); $userForm->load($_REQUEST); + + + if (isset($_FILES['user_photo']) && $_FILES['user_photo']['error'] === UPLOAD_ERR_OK) { + $file = new FileUpload($_FILES['user_photo'], ['jpg', 'jpeg', 'png']); + $file->upload(); + $userForm->setItem('user_photo', $file->getUploadFile()); + } + if ($userForm->validate()){ $user = $this->userService->create($userForm); - $entityRelation = new EntityRelation(); $entityRelation->saveEntityRelation(entity: "user", model: $user, request: new Request()); @@ -98,6 +107,13 @@ class UserController extends AdminController $userForm = new CreateUserForm(); $userService = new UserService(); $userForm->load($_REQUEST); + + if (isset($_FILES['user_photo']) && $_FILES['user_photo']['error'] === UPLOAD_ERR_OK) { + $file = new FileUpload($_FILES['user_photo'], ['jpg', 'jpeg', 'png']); + $file->upload(); + $userForm->setItem('user_photo', $file->getUploadFile()); + } + if ($userForm->validateForUpdate()){ $user = $userService->update($userForm, $user); @@ -128,4 +144,53 @@ class UserController extends AdminController $this->redirect("/admin/user/"); } + public function actionProfile(): void + { + $user = UserService::getAuthUser(); + if (!$user){ + throw new Exception(message: "The user not found"); + } + $this->cgView->render("view_profile.php", ['user' => $user]); + } + + public function actionProfileUpdate(): void + { + $model = UserService::getAuthUser(); + if (!$model){ + throw new Exception(message: "The user not found"); + } + + $this->cgView->render("form_profile.php", ['model' => $model]); + } + + public function actionProfileEdit(): void + { + $user = UserService::getAuthUser(); + if (!$user){ + throw new Exception(message: "The user not found"); + } + + $userForm = new CreateUserForm(); + $userService = new UserService(); + $userForm->load($_REQUEST); + + if (isset($_FILES['user_photo']) && $_FILES['user_photo']['error'] === UPLOAD_ERR_OK) { + $file = new FileUpload($_FILES['user_photo'], ['jpg', 'jpeg', 'png']); + $file->upload(); + $userForm->setItem('user_photo', $file->getUploadFile()); + } + + if ($userForm->validateForUpdate()){ + $user = $userService->update($userForm, $user); + + $entityRelation = new EntityRelation(); + $entityRelation->saveEntityRelation(entity: "user", model: $user, request: new Request()); + + if ($user){ + $this->redirect("/admin/user/profile"); + } + } + $this->redirect("/admin/user/profile/update"); + } + } \ No newline at end of file diff --git a/kernel/modules/user/manifest.json b/kernel/modules/user/manifest.json old mode 100644 new mode 100755 diff --git a/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php b/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php old mode 100644 new mode 100755 index a762579..2b2ab0f --- a/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php +++ b/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php @@ -20,6 +20,7 @@ return new class extends Migration $table->string('username', 255)->nullable(false); $table->string('email', 255); $table->string('password_hash', 255); + $table->string('user_photo', 255)->nullable(); $table->integer('role')->default(1); $table->string('access_token', 255)->nullable(true); $table->dateTime('access_token_expires_at')->nullable(true); diff --git a/kernel/modules/user/models/User.php b/kernel/modules/user/models/User.php old mode 100644 new mode 100755 index 3dd03c1..78afe96 --- a/kernel/modules/user/models/User.php +++ b/kernel/modules/user/models/User.php @@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model; * @property string $username * @property string $email * @property string $password_hash + * @property string $user_photo * @property string $access_token * @property string $access_token_expires_at * @method static find($id) @@ -17,7 +18,7 @@ class User extends Model { const ADMIN_USER_ROLE = 9; protected $table = 'user'; - protected $fillable = ['username', 'email', 'password_hash', 'role', 'access_token', 'access_token_expires_at']; + protected $fillable = ['username', 'email', 'password_hash', 'user_photo', 'role', 'access_token', 'access_token_expires_at']; protected array $dates = ['deleted at']; public static function labels(): array @@ -25,6 +26,7 @@ class User extends Model { return [ 'username' => 'Логин', 'email' => 'Email', + 'user_photo' => 'Фото профиля', 'created_at' => 'Создан', 'updated_at' => 'Обновлен', ]; diff --git a/kernel/modules/user/models/forms/CreateUserForm.php b/kernel/modules/user/models/forms/CreateUserForm.php old mode 100644 new mode 100755 index 73c5f77..bcf37df --- a/kernel/modules/user/models/forms/CreateUserForm.php +++ b/kernel/modules/user/models/forms/CreateUserForm.php @@ -12,7 +12,8 @@ class CreateUserForm extends FormModel return [ 'username' => 'required|min-str-len:5|max-str-len:30', 'password' => 'required|min-str-len:5|max-str-len:30', - 'email' => 'required|email' + 'email' => 'required|email', + 'user_photo' => '' ]; } @@ -21,7 +22,9 @@ class CreateUserForm extends FormModel return [ 'username' => 'required|min-str-len:5|max-str-len:30', 'password' => '', - 'email' => 'required|email' + 'email' => 'required|email', + 'user_photo' => '' + ]; } diff --git a/kernel/modules/user/routs/user.php b/kernel/modules/user/routs/user.php old mode 100644 new mode 100755 index 5572c92..25eda62 --- a/kernel/modules/user/routs/user.php +++ b/kernel/modules/user/routs/user.php @@ -17,6 +17,11 @@ App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){ App::$collector->any('/update/{id}', [\kernel\modules\user\controllers\UserController::class, 'actionUpdate']); App::$collector->any("/edit/{id}", [\kernel\modules\user\controllers\UserController::class, 'actionEdit']); App::$collector->get('/delete/{id}', [\kernel\modules\user\controllers\UserController::class, 'actionDelete']); + App::$collector->group(["prefix" => "profile"], callback: function (RouteCollector $router) { + App::$collector->get('/', [\kernel\modules\user\controllers\UserController::class, 'actionProfile']); + App::$collector->get('/update', [\kernel\modules\user\controllers\UserController::class, 'actionProfileUpdate']); + App::$collector->post('/edit', [\kernel\modules\user\controllers\UserController::class, 'actionProfileEdit']); + }); }); }); }); \ No newline at end of file diff --git a/kernel/modules/user/service/UserService.php b/kernel/modules/user/service/UserService.php old mode 100644 new mode 100755 index 9e8dd5d..9915c2a --- a/kernel/modules/user/service/UserService.php +++ b/kernel/modules/user/service/UserService.php @@ -15,6 +15,7 @@ class UserService $model->username = $form_model->getItem('username'); $model->email = $form_model->getItem('email'); $model->password_hash = password_hash($form_model->getItem('password'), PASSWORD_DEFAULT); + $model->user_photo = $form_model->getItem('user_photo'); if ($model->save()){ return $model; } @@ -29,6 +30,7 @@ class UserService if ($form_model->getItem('password')) { $user->password_hash = password_hash($form_model->getItem('password'), PASSWORD_DEFAULT); } + $user->user_photo = $form_model->getItem('user_photo'); if ($user->save()){ return $user; } @@ -80,6 +82,28 @@ class UserService return ''; } + public static function getAuthUserId(): string + { + $user = self::getAuthUser(); + if ($user){ + return $user->id; + } + + return ''; + } + + public static function getAuthUserPhoto(): string|null + { + $user = self::getAuthUser(); + if ($user){ + if ($user->user_photo) { + return $user->user_photo; + } + } + + return null; + } + public function getByAccessToken(string $token) { return $this->getByField("access_token", $token); diff --git a/kernel/modules/user/table/columns/UserDeleteActionColumn.php b/kernel/modules/user/table/columns/UserDeleteActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/user/table/columns/UserEditActionColumn.php b/kernel/modules/user/table/columns/UserEditActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/user/table/columns/UserViewActionColumn.php b/kernel/modules/user/table/columns/UserViewActionColumn.php old mode 100644 new mode 100755 diff --git a/kernel/modules/user/views/form.php b/kernel/modules/user/views/form.php old mode 100644 new mode 100755 index e32d35f..89f94d2 --- a/kernel/modules/user/views/form.php +++ b/kernel/modules/user/views/form.php @@ -32,6 +32,16 @@ $form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", param ->setLabel("Email") ->render(); +if (!empty($model->user_photo)){ + echo "
"; +} +$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [ + 'class' => "form-control", + 'value' => $model->user_photo ?? '' +]) + ->setLabel("Фото профиля") + ->render(); + $entityRelations = new \kernel\EntityRelation(); if (!isset($model)) { $model = new User(); diff --git a/kernel/modules/user/views/form_profile.php b/kernel/modules/user/views/form_profile.php new file mode 100755 index 0000000..0c9ca1a --- /dev/null +++ b/kernel/modules/user/views/form_profile.php @@ -0,0 +1,74 @@ +beginForm("/admin/user/profile/edit", enctype: 'multipart/form-data'); + +$form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [ + 'class' => "form-control", + 'placeholder' => 'Логин', + 'value' => $model->username ?? '' +]) + ->setLabel("Логин") + ->render(); + +$form->field(class: \itguild\forms\inputs\TextInput::class, name: "password", params: [ + 'class' => "form-control", + 'type' => "password", +]) + ->setLabel("Пароль") + ->render(); + +$form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", params: [ + 'class' => "form-control", + 'type' => "email", + 'placeholder' => 'test@mail.ru', + 'value' => $model->email ?? '' +]) + ->setLabel("Email") + ->render(); + +if (!empty($model->user_photo)){ + echo "
"; +} +$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [ + 'class' => "form-control", + 'value' => $model->user_photo ?? '' +]) + ->setLabel("Фото профиля") + ->render(); + +$entityRelations = new \kernel\EntityRelation(); +if (!isset($model)) { + $model = new User(); +} +$entityRelations->renderEntityAdditionalPropertyFormBySlug("user", $model); +?> +
+
+ field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [ + 'class' => "btn btn-primary ", + 'value' => 'Отправить', + 'typeInput' => 'submit' + ]) + ->render(); + ?> +
+
+ field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [ + 'class' => "btn btn-warning", + 'value' => 'Сбросить', + 'typeInput' => 'reset' + ]) + ->render(); + ?> +
+
+endForm(); diff --git a/kernel/modules/user/views/index.php b/kernel/modules/user/views/index.php old mode 100644 new mode 100755 index e492f5e..abfce5b --- a/kernel/modules/user/views/index.php +++ b/kernel/modules/user/views/index.php @@ -17,13 +17,15 @@ use kernel\widgets\IconBtn\IconBtnDeleteWidget; use kernel\widgets\IconBtn\IconBtnEditWidget; use kernel\widgets\IconBtn\IconBtnViewWidget; +$get = (new \kernel\Request())->get(); + $table = new ListEloquentTable(new EloquentDataProvider(User::class, [ 'currentPage' => $page_number, 'perPage' => 3, 'params' => ["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/user", - 'filters' => ['email'], -])); + 'searchPrefix' => "", + 'searchParams' => $get,])); $entityRelation = new \kernel\EntityRelation(); $additionals = $entityRelation->getEntityRelationsBySlug("user"); @@ -37,9 +39,13 @@ foreach ($additionals as $additional) { $table->columns([ 'username' => [ "filter" => [ - 'class' => \Itguild\Tables\Filter\InputTextFilter::class + 'class' => \kernel\filters\BootstrapTextFilter::class, + 'value' => $get['username'] ?? null, ] ], + 'user_photo' => function ($data) { + return $data ? "" : ""; + }, 'created_at' => function ($data) { if (!$data){ return null; diff --git a/kernel/modules/user/views/view.php b/kernel/modules/user/views/view.php old mode 100644 new mode 100755 index 856186f..f234627 --- a/kernel/modules/user/views/view.php +++ b/kernel/modules/user/views/view.php @@ -35,6 +35,9 @@ foreach ($additionals as $key => $additional) { } $table->rows([ + 'user_photo' => function ($data) { + return $data ? "" : ""; + }, 'created_at' => function ($data) { if (!$data){ return null; diff --git a/kernel/modules/user/views/view_profile.php b/kernel/modules/user/views/view_profile.php new file mode 100755 index 0000000..b9b027f --- /dev/null +++ b/kernel/modules/user/views/view_profile.php @@ -0,0 +1,56 @@ + ["class" => "table table-bordered", "border" => "2"], + 'baseUrl' => "/admin/user", +])); +$table->beforePrint(function () use ($user) { + $btn = IconBtnEditWidget::create(['url' => '/admin/user/profile/edit'])->run(); + $btn .= IconBtnDeleteWidget::create(['url' => '/admin/user/delete/' . $user->id])->run(); + return $btn; +}); + +$entityRelation = new \kernel\EntityRelation(); +$additionals = $entityRelation->getEntityAdditionalProperty("user", $user); + +foreach ($additionals as $key => $additional) { + $table->addRow($key, function () use ($additional) { + return $additional; + }, ['after' => 'email']); +} + +$table->rows([ + 'user_photo' => function ($data) { + return $data ? "" : ""; + }, + 'created_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + }, + 'updated_at' => function ($data) { + if (!$data){ + return null; + } + + return (new DateTimeImmutable($data))->format("d-m-Y"); + } +]); +$table->create(); +$table->render(); \ No newline at end of file diff --git a/kernel/routs/admin.php b/kernel/routs/admin.php old mode 100644 new mode 100755 diff --git a/kernel/services/AdminThemeService.php b/kernel/services/AdminThemeService.php old mode 100644 new mode 100755 index 457fa02..f8d5aea --- a/kernel/services/AdminThemeService.php +++ b/kernel/services/AdminThemeService.php @@ -4,12 +4,16 @@ namespace kernel\services; use DirectoryIterator; use kernel\helpers\Debug; +use kernel\helpers\Files; use kernel\helpers\Manifest; use kernel\helpers\RESTClient; use kernel\models\Option; +use ZipArchive; class AdminThemeService { + protected array $errors = []; + protected Option $option; protected string $active_theme; protected ModuleService $moduleService; @@ -22,6 +26,24 @@ class AdminThemeService $this->moduleService = new ModuleService(); } + /** + * @return array + */ + public function getErrors(): array + { + return $this->errors; + } + + /** + * @param $msg + * @return void + */ + public function addError($msg): void + { + $this->errors[] = $msg; + } + + public function findActiveAdminTheme(): void { $model = Option::where("key", "active_admin_theme")->first(); @@ -50,7 +72,7 @@ class AdminThemeService $info = []; $theme = getConst($theme); $info['path'] = $theme; - if (file_exists($theme . "/manifest.json")){ + if (file_exists($theme . "/manifest.json")) { $manifest = file_get_contents($theme . "/manifest.json"); $manifest = Manifest::getWithVars($manifest); $manifest['preview'] = $manifest['resource'] . "/" . $manifest['preview']; @@ -60,6 +82,11 @@ class AdminThemeService return $info; } + public function getAdminThemeInfoBySlug(string $slug) + { + // TODO + } + public function isInstall(string $slug): bool { $adminThemePaths = Option::where("key", "admin_theme_paths")->first(); @@ -85,12 +112,13 @@ class AdminThemeService public function isLastVersion(string $slug): bool { if ($this->moduleService->isServerAvailable()) { - $modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); + $modulesInfo = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); - $modules_info = json_decode($modules_info->getBody()->getContents(), true); + $modulesInfo = json_decode($modulesInfo->getBody()->getContents(), true); $themeInfo = $this->getAdminThemeInfo($slug); - foreach ($modules_info as $mod) { +// Debug::dd($themeInfo); + foreach ($modulesInfo as $mod) { if ($mod['slug'] === $themeInfo['slug'] && $mod['version'] === $themeInfo['version']) { return true; } @@ -99,4 +127,79 @@ class AdminThemeService return false; } + + public function pack(string $path): void + { + $themeName = basename($path); + + $tmpThemeDirFull = RESOURCES_DIR . '/tmp/ad/' . $themeName . "/"; + + $fileHelper = new Files(); + $fileHelper->copy_folder(ROOT_DIR . $path, $tmpThemeDirFull . 'meta/'); + $fileHelper->copy_folder(RESOURCES_DIR . '/' . $themeName, $tmpThemeDirFull . 'resources/'); + + if (!is_dir(RESOURCES_DIR . '/tmp/admin_themes')) { + $old_mask = umask(0); + mkdir(RESOURCES_DIR . '/tmp/admin_themes', 0775, true); + umask($old_mask); + } + $fileHelper->pack($tmpThemeDirFull, RESOURCES_DIR . '/tmp/admin_themes/' . $themeName . '.igt'); + } + + public function install(string $path): bool + { + $zip = new ZipArchive; + $tmpThemeDir = md5(time()); + $res = $zip->open(ROOT_DIR . $path); + if ($res === TRUE) { + $tmpThemeDirFull = RESOURCES_DIR . '/tmp/ad/' . $tmpThemeDir . "/"; + $zip->extractTo($tmpThemeDirFull); + $zip->close(); + } else { + $this->addError('unable to open zip archive'); + return false; + } + + if (!file_exists($tmpThemeDirFull . "meta/manifest.json")){ + $this->addError('manifest.json not found'); + return false; + } + + $manifestJson = getConst(file_get_contents($tmpThemeDirFull . "meta/manifest.json")); + $manifest = Manifest::getWithVars($manifestJson); + + $fileHelper = new Files(); + if (isset($manifest['theme_path'])) { + $fileHelper->copy_folder($tmpThemeDirFull . "meta", $manifest['theme_path']); + } else { + $fileHelper->copy_folder($tmpThemeDirFull . "meta", APP_DIR . '/admin_themes/' . $manifest['slug']); + } + + if (isset($manifest['resource_path'])) { + $fileHelper->copy_folder($tmpThemeDirFull . "resources", $manifest['resource_path']); + } else { + $fileHelper->copy_folder($tmpThemeDirFull . "resources", RESOURCES_DIR . '/' . $manifest['slug']); + } + + $fileHelper->recursiveRemoveDir($tmpThemeDirFull); + unlink(ROOT_DIR . $path); + return true; + } + + public function uninstall(string $path): void + { + $themeInfo = $this->getAdminThemeInfo(APP_DIR . '/admin_themes/' . basename($path)); + + $active_admin_theme = Option::where("key", "active_admin_theme")->first(); + if ($active_admin_theme->value === ROOT_DIR . $path) { + $this->setActiveAdminTheme(KERNEL_ADMIN_THEMES_DIR . '/default'); + } + $fileHelper = new Files(); + if (file_exists(ROOT_DIR . $path)) { + $fileHelper->recursiveRemoveDir(ROOT_DIR . $path); + } + if (file_exists(RESOURCES_DIR . '/' . $themeInfo['slug'])) { + $fileHelper->recursiveRemoveDir(RESOURCES_DIR . '/' . $themeInfo['slug']); + } + } } \ No newline at end of file diff --git a/kernel/services/ConsoleService.php b/kernel/services/ConsoleService.php old mode 100644 new mode 100755 diff --git a/kernel/services/KernelService.php b/kernel/services/KernelService.php old mode 100644 new mode 100755 diff --git a/kernel/services/MigrationService.php b/kernel/services/MigrationService.php old mode 100644 new mode 100755 diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php old mode 100644 new mode 100755 index 56ca7be..2a0eb69 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -362,11 +362,15 @@ class ModuleService if (file_exists(KERNEL_APP_MODULES_DIR . '/' . $moduleName)) { $fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $tmpModuleDirFull . 'kernel/'); } else { - mkdir($tmpModuleDirFull . 'kernel/'); + $old_mask = umask(0); + mkdir($tmpModuleDirFull . 'kernel/', 0775, true); + umask($old_mask); } if (!is_dir(RESOURCES_DIR . '/tmp/modules')) { - mkdir(RESOURCES_DIR . '/tmp/modules', 0777, true); + $old_mask = umask(0); + mkdir(RESOURCES_DIR . '/tmp/modules', 0775, true); + umask($old_mask); } $fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.igm'); } diff --git a/kernel/services/ModuleShopService.php b/kernel/services/ModuleShopService.php old mode 100644 new mode 100755 diff --git a/kernel/services/TokenService.php b/kernel/services/TokenService.php old mode 100644 new mode 100755 diff --git a/kernel/templates/controllers/app_controller_template b/kernel/templates/controllers/app_controller_template old mode 100644 new mode 100755 diff --git a/kernel/templates/controllers/kernel_controller_template b/kernel/templates/controllers/kernel_controller_template old mode 100644 new mode 100755 diff --git a/kernel/templates/manifests/manifest_template b/kernel/templates/manifests/manifest_template old mode 100644 new mode 100755 diff --git a/kernel/templates/models/forms/create_form_template b/kernel/templates/models/forms/create_form_template old mode 100644 new mode 100755 diff --git a/kernel/templates/models/model_template b/kernel/templates/models/model_template old mode 100644 new mode 100755 diff --git a/kernel/templates/module_files/app_module_file_template b/kernel/templates/module_files/app_module_file_template old mode 100644 new mode 100755 diff --git a/kernel/templates/module_files/kernel_module_file_template b/kernel/templates/module_files/kernel_module_file_template old mode 100644 new mode 100755 diff --git a/kernel/templates/routs/app_routs_template b/kernel/templates/routs/app_routs_template old mode 100644 new mode 100755 diff --git a/kernel/templates/routs/kernel_routs_template b/kernel/templates/routs/kernel_routs_template old mode 100644 new mode 100755 diff --git a/kernel/templates/services/service_template b/kernel/templates/services/service_template old mode 100644 new mode 100755 diff --git a/kernel/templates/views/form_template b/kernel/templates/views/form_template old mode 100644 new mode 100755 diff --git a/kernel/templates/views/index_template b/kernel/templates/views/index_template old mode 100644 new mode 100755 index a7a7171..44953ea --- a/kernel/templates/views/index_template +++ b/kernel/templates/views/index_template @@ -51,6 +51,16 @@ $table = new \Itguild\Tables\ListJsonTable(json_encode( ] )); +// Пример фильтра +$table->columns([ + 'title' => [ + 'filter' => [ + 'class' => \Itguild\Tables\Filter\InputTextFilter::class, + 'value' => $get['title'] ?? '' + ] + ], +] + $table->beforePrint(function () { return IconBtnCreateWidget::create(['url' => '/admin/{slug}/create'])->run(); }); diff --git a/kernel/templates/views/view_template b/kernel/templates/views/view_template old mode 100644 new mode 100755 diff --git a/kernel/views/mailing/login_by_code.php b/kernel/views/mailing/login_by_code.php old mode 100644 new mode 100755 diff --git a/kernel/views/mailing/register_by_code.php b/kernel/views/mailing/register_by_code.php old mode 100644 new mode 100755 diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php old mode 100644 new mode 100755 diff --git a/kernel/views/module/view.php b/kernel/views/module/view.php old mode 100644 new mode 100755 diff --git a/kernel/views/widgets/action_button.php b/kernel/views/widgets/action_button.php old mode 100644 new mode 100755 diff --git a/kernel/views/widgets/menu.php b/kernel/views/widgets/menu.php old mode 100644 new mode 100755 diff --git a/kernel/views/widgets/tabs.php b/kernel/views/widgets/tabs.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/ActionButtonWidget.php b/kernel/widgets/ActionButtonWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnActivateWidget.php b/kernel/widgets/IconBtn/IconBtnActivateWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnCreateWidget.php b/kernel/widgets/IconBtn/IconBtnCreateWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnDeactivateWidget.php b/kernel/widgets/IconBtn/IconBtnDeactivateWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnDeleteWidget.php b/kernel/widgets/IconBtn/IconBtnDeleteWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnEditWidget.php b/kernel/widgets/IconBtn/IconBtnEditWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnInstallWidget.php b/kernel/widgets/IconBtn/IconBtnInstallWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnListWidget.php b/kernel/widgets/IconBtn/IconBtnListWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnUpdateWidget.php b/kernel/widgets/IconBtn/IconBtnUpdateWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/IconBtn/IconBtnViewWidget.php b/kernel/widgets/IconBtn/IconBtnViewWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/MenuWidget.php b/kernel/widgets/MenuWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/ModuleTabsWidget.php b/kernel/widgets/ModuleTabsWidget.php old mode 100644 new mode 100755 diff --git a/kernel/widgets/TagTabsWidget.php b/kernel/widgets/TagTabsWidget.php old mode 100644 new mode 100755 diff --git a/resources/default_user_photo/noPhoto.png b/resources/default_user_photo/noPhoto.png new file mode 100644 index 0000000000000000000000000000000000000000..05d1bacaedfaec2e640b3ff9877ba3c9d93b2c71 GIT binary patch literal 4085 zcmb_fXE+<&`zDPFib$)air8ACwGz}wtQb|JYHvzQRZDcx5YgHtMr+loS!!>wsg~EO zQ8T>MN{uwJYUY>s^Z)Dr!*ibN+|P4g=R9ZJ*Evz9cTw!DS6LYt7}yQ;bZigfQoOOgAquDkd3q%GdpU*kMV&>fMr z^{TJg_1ZsV)3YOMRpYs=t)-K%%4H=074F4VmAZzN6fRlb5DOKKdJ?=#kT_6lmg^$M zpCPr|+ZN(CCbR+4ZhH;Gr+eEg84Us_(F{44<$w$ULQn=4Fc=F2fe-*75XuMu;29Vh z^|4q6Q3Qek0{#CFQ_|#K=(=a-l;b<3r0uK2uNXHeOTlXTb$q#YZXu09krHnn_I-7u zSa18T4rd14F24#d6j(0wV|>fT zFKDxG4^P?|{KGaLjzwG7J#y2s;{h#5DjqGVUnu-IVP}A2$IXE893wZlnB)(#5eRzCjT1Ww{XSwNM%uMMq56yGc{;NnaJEIEp=g4Nk zj;F_U-Nz~%y?sz<@j1pvN&E1A7xWG_NHeP_nWcfYAHkGoP2Ulp$nL79;8QBICtI@o zy?fag-#aMd-U;EF!T8I(OWaij8!0!7Ding(7PTka5;tQs)!IJQ$e0QOMsdp5%t%L5 z)<<1(0SErJ$G>)vwzG|fO5(x?)lVRa=WG-8KM-4%uEW94qSbI%#p{EMsi}WsqvIWy z9eFP>|C2C4BFm*^;z84YJ^d6m#S|*dcqC~K25Zk0ErxPhrg$WVp-^Lef93JNe@%8R z{U-fZyg(H`BpI@slK|r*)0yrcB_tBFPQoC;Ws{2v{_qTjK$X_Reri(Xua)~XK3(p+ zR}5v3TvIVuPM$4!nQSCV*k4IH5Y4GsmIJyAs%mHT8gy7%gqfXCDGz((`x!m^{6XJk zpXfDpgxZv7IJw-xx1xjH;{vBLZ*%T_z*wH_km@P~vbhU|d|oQ7qFh1xOc7M_6)G8~ zRy`&)cdL9JJ+XB1Zr0!SdPMBt1$pLf*p2KF7iTy^PEvY7{rk$1J0XPl4;Wt}pIs;( zt`YQO1hY5A7#m*#DC{{=!+rH8JrxZRQ&6$q$~ z;TA}1Q6ldZ8$%|6dDYk1ZK~!6qM*4=BXqQ2qAs9tUUBW zei{hCtY)c&VaH7!_St89dxP^+o;-(haqaE)kQ_lE#ZBt)d~U~#LG{m!Lt$Y4`HSv` zK&5Bld(FmK^x3l~$hg9L9K4vd^+D_Z=)>>Pq#|@!c>gy? z+4fE~efAY9c6(~^G@QxAQ6KIGVaHB@{#C1K*wBzUmkyx$623?8}EPwwwFc`x6`wCPt`AR z(TJt6WYZlhtK%q*`p1PP1w>ZKNf-dE8nlH}FRoU3T z&0>VKb%hvVSzS}x-}{mBjNI}{n@fWp{PL{Tsu_V;UNv*9`AFS zBePrme0tJ~q2a5~ZF)+vFNw@in@51ogZ0iVLU-TG3cKivu$JF=Z7F!!}=<;PfC#EV~}xnyU>p9MCpTk%q0 z(1G(3(=eABo{DXLcd9oj>KnJtpSf2TMWe&yda{)ITetInsqOaeF;Vu!U-fQazm%PF z-Op!K#jUV{P{O_mo-G`a?D4Of?xAW5*MdzxZU~~);bcpd<5p`kVRA|xTsZJ@d?e?_ zlJ3G^esDeg7K6@V(!N*j{h?@8WLWo}2YuJrp5yZCbe7r|ef50<+t|J@6zeW#XXk$! zFR8HUM$>*p(^(ud?<6FodFa&UrdS!xz1Y!!>g^J_ywXxrb8_ORfWhkLsxuB4S=iYL z9+x{0_-Tu`m~4W_CRg86&(hF*WC0%XeCXGhps7UJn+bHy*z{Ub>(*mmP@sIha>-zM zYyCbqKx<||-g9Ii(1u2dNef|hS@1zF3Ia_b$l+05T!E!NLjJQ?VnO-fFd^&Zx+oowaR zGgYq_f)aST591q5EUBYp0gZgO5Y1G7nqaUYSR3I8iJw~boy*E|EShk2T~bJI4uYTk z9U7G{!|bKTIB5zTV3xh$KzB|zNpiZac9O!u=akb`IIRGV`Q-N}X_|?DbTHu$)588d zkrQC9?OZcCw>6H|^7rduI8)uK*9U1~kMpK3?5eb=5tWOqn&;w@bJsVFcTwF;1#QZHr7 zLCB`AJe)`+7CJRD%KRP@9RXPz^fRlBZDlEj3XDuNKMxB?fqbd+f&fN23{ZB#N84nB zYK(;a+S~?nmu)C^SGi1}W!qyY#_lDkgbAb{uf6w>6ENCssy-8etqnD34*bkgf;tA{ z1qy0btLr<91-6igK+}L@0q-qP2`UJT-$$<`wlB!I9cP8%(sp5$K!+FZI9OR$$X+V@ zvn;@uCa)_u^!cP`Apu-IwtFFVemg1hIDSKp^MFyIBi9MzX^x%Yj5Jy_&Ys4iSjItL z6QMDG%64qT&z>K_DB8xUij7@+_{t_TGvgx@;@!Z*o4l=eO$>7>?f7u9C8oVMt<-4pupbUl2GqW9wGN!O`gGMrJCA!R0DA^;+yEs1of}4>6dKsv7 z-REy?Rt>`ZHadS>x*OC3jt++pLUtyjDZ3;9vH4UpnLk+l3R!ER2&L#oFHj3H;5N$?3+s=>S&X{FTB<|L9A%9f(Wvh zlzH;T9i(3>T>(2PaC6i2Yuzfle-S8nF`pGMszy9G7KEHt&94@DkcSCY^Ix22H%a99BdbrFL zbvu_|41_p%ORB^NfTZu(~_&R96ld@|4=-Fd*?IPFbyQQ%9$Bi1IT%2hm z?miY8i;lZD_pDMs=X-aeJKbBvW4B6przAyBr6a7X0^h=orOO~D#yqccjU_NBA2dha z6(LFX4Wjr5%c#gt5d)oxmQh9y7GiO>b&u9?pQK{Al7Z?M@rE^|gyV;1v&4w$6n!b+ zgOJbcAi%Sy;N+uG2!1Q7*(-@9bUiXN=k*aHERj{+6Vi&BAw1Ug>jW~x=?Jrm|@$5mfo{nZKdoA8him zzwvjE{!OV_SEa@*o1xBf&V3?`sx5U$>#k5mcKHM2pD#PqcsmN)QgcH_?+Pvli5RsF zn;sX=Xf8VM*v4BX6@Ez1QAHT5x1bB2NMMS{rkRo20oXt%V^-MsZ^_v_J_s4Hp@&hw9*%X|q0s^0uM0b~sAP8jvVVLKKLZIqCR zfBzH|r$eDn6~)Ch#_VMMTW$)PPG*tfupK{sQ*G#^ILEp^G5hA~gPdHEa4h0ry^BK) z03fdXn)MIlW6j&VNyzDYOUDnN_>)I$ivZNR0~> zL-Ae{L&s9za1@R^H$Fu%wJ!FSHSPpcu&72bc%7f0XHiQK7#NY|y)r>ONLtyhWE! axciXR3O>X8x9Puh1_Rx@I^|lpA#IKeB literal 0 HcmV?d00001