From 16cec04f6f245990841acc470856d44d071813b0 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Tue, 19 Nov 2024 12:31:48 +0300 Subject: [PATCH] kernel update --- app/modules/tag/manifest.json | 2 +- composer.lock | 641 +++++++++++++++++-- kernel/admin_themes/default/layout/main.php | 2 +- kernel/controllers/ModuleController.php | 23 +- kernel/services/ModuleService.php | 57 +- kernel/views/module/index.php | 6 +- kernel/views/widgets/admin/action_button.php | 9 + kernel/views/widgets/admin/menu.php | 28 + kernel/views/widgets/admin/module_tabs.php | 14 + kernel/widgets/ActionButtonWidget.php | 16 + views/widgets/admin/action_button.php | 9 + views/widgets/admin/menu.php | 2 +- views/widgets/admin/module_tabs.php | 14 + 13 files changed, 716 insertions(+), 107 deletions(-) create mode 100644 kernel/views/widgets/admin/action_button.php create mode 100644 kernel/views/widgets/admin/menu.php create mode 100644 kernel/views/widgets/admin/module_tabs.php create mode 100644 kernel/widgets/ActionButtonWidget.php create mode 100644 views/widgets/admin/action_button.php create mode 100644 views/widgets/admin/module_tabs.php diff --git a/app/modules/tag/manifest.json b/app/modules/tag/manifest.json index 3159ed4..87665ad 100644 --- a/app/modules/tag/manifest.json +++ b/app/modules/tag/manifest.json @@ -1,6 +1,6 @@ { "name": "Tags", - "version": "0.3", + "version": "0.1", "author": "ITGuild", "slug": "tag", "description": "Tags module", diff --git a/composer.lock b/composer.lock index 2757482..ca65c63 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "da3890f2b5b477bf758306141b8c8583", + "content-hash": "9b8653e1a4f451d6e125cb1732ffdeef", "packages": [ { "name": "brick/math", @@ -399,17 +399,342 @@ "time": "2024-07-20T21:45:45+00:00" }, { - "name": "illuminate/collections", - "version": "v11.29.0", + "name": "guzzlehttp/guzzle", + "version": "7.9.2", "source": { "type": "git", - "url": "https://github.com/illuminate/collections.git", - "reference": "2d99ccbb19e34450508ff3ab2f62ba90aa2e9793" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/2d99ccbb19e34450508ff3ab2f62ba90aa2e9793", - "reference": "2d99ccbb19e34450508ff3ab2f62ba90aa2e9793", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2024-07-24T11:22:20+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2024-10-17T10:06:22+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2024-07-18T11:15:46+00:00" + }, + { + "name": "illuminate/collections", + "version": "v11.32.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "a01a9d0799700bf34ab3797988fdd5f420d42bfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/a01a9d0799700bf34ab3797988fdd5f420d42bfe", + "reference": "a01a9d0799700bf34ab3797988fdd5f420d42bfe", "shasum": "" }, "require": { @@ -451,11 +776,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-10T19:23:07+00:00" + "time": "2024-11-15T15:43:48+00:00" }, { "name": "illuminate/conditionable", - "version": "v11.29.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -501,16 +826,16 @@ }, { "name": "illuminate/container", - "version": "v11.29.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb" + "reference": "6e31eb49e9c9e68356a55cd8f18fb8830b8158cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/06dfc614aff58384b28ba5ad191f6a02d6b192cb", - "reference": "06dfc614aff58384b28ba5ad191f6a02d6b192cb", + "url": "https://api.github.com/repos/illuminate/container/zipball/6e31eb49e9c9e68356a55cd8f18fb8830b8158cd", + "reference": "6e31eb49e9c9e68356a55cd8f18fb8830b8158cd", "shasum": "" }, "require": { @@ -548,20 +873,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-11T15:30:11+00:00" + "time": "2024-11-14T15:31:35+00:00" }, { "name": "illuminate/contracts", - "version": "v11.29.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "56312862af937bd6da8e6dc8bbd88188dfb478f8" + "reference": "44c15aec6ea0d997e0885aa5b04876fe8a141433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/56312862af937bd6da8e6dc8bbd88188dfb478f8", - "reference": "56312862af937bd6da8e6dc8bbd88188dfb478f8", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/44c15aec6ea0d997e0885aa5b04876fe8a141433", + "reference": "44c15aec6ea0d997e0885aa5b04876fe8a141433", "shasum": "" }, "require": { @@ -596,7 +921,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-09-22T15:08:08+00:00" + "time": "2024-11-15T15:40:33+00:00" }, { "name": "illuminate/database", @@ -735,7 +1060,7 @@ }, { "name": "illuminate/macroable", - "version": "v11.29.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -781,16 +1106,16 @@ }, { "name": "illuminate/support", - "version": "v11.29.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "fc86f3de6640a0fb204bf13e76037a7f191232d7" + "reference": "213bc04ed2a75dac441e602df4568154c36a3670" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/fc86f3de6640a0fb204bf13e76037a7f191232d7", - "reference": "fc86f3de6640a0fb204bf13e76037a7f191232d7", + "url": "https://api.github.com/repos/illuminate/support/zipball/213bc04ed2a75dac441e602df4568154c36a3670", + "reference": "213bc04ed2a75dac441e602df4568154c36a3670", "shasum": "" }, "require": { @@ -853,7 +1178,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-22T13:59:47+00:00" + "time": "2024-11-14T16:30:16+00:00" }, { "name": "itguild/eloquent-table", @@ -1178,20 +1503,20 @@ }, { "name": "nesbot/carbon", - "version": "3.8.0", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f" + "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f", - "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e1268cdbc486d97ce23fef2c666dc3c6b6de9947", + "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947", "shasum": "" }, "require": { - "carbonphp/carbon-doctrine-types": "*", + "carbonphp/carbon-doctrine-types": "<100.0", "ext-json": "*", "php": "^8.1", "psr/clock": "^1.0", @@ -1280,7 +1605,7 @@ "type": "tidelift" } ], - "time": "2024-08-19T06:22:39+00:00" + "time": "2024-11-07T17:46:48+00:00" }, { "name": "phpoption/phpoption", @@ -1458,6 +1783,166 @@ }, "time": "2021-11-05T16:47:00+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, { "name": "psr/simple-cache", "version": "3.0.0", @@ -1555,6 +2040,50 @@ }, "time": "2020-08-27T05:07:01+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "samejack/php-argv", "version": "dev-master", @@ -1610,16 +2139,16 @@ }, { "name": "symfony/clock", - "version": "v7.1.1", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/clock.git", - "reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7" + "reference": "97bebc53548684c17ed696bc8af016880f0f098d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/clock/zipball/3dfc8b084853586de51dd1441c6242c76a28cbe7", - "reference": "3dfc8b084853586de51dd1441c6242c76a28cbe7", + "url": "https://api.github.com/repos/symfony/clock/zipball/97bebc53548684c17ed696bc8af016880f0f098d", + "reference": "97bebc53548684c17ed696bc8af016880f0f098d", "shasum": "" }, "require": { @@ -1664,7 +2193,7 @@ "time" ], "support": { - "source": "https://github.com/symfony/clock/tree/v7.1.1" + "source": "https://github.com/symfony/clock/tree/v7.1.6" }, "funding": [ { @@ -1680,7 +2209,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1751,16 +2280,16 @@ }, { "name": "symfony/finder", - "version": "v7.1.4", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", + "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", "shasum": "" }, "require": { @@ -1795,7 +2324,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.4" + "source": "https://github.com/symfony/finder/tree/v7.1.6" }, "funding": [ { @@ -1811,7 +2340,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:28:19+00:00" + "time": "2024-10-01T08:31:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2206,16 +2735,16 @@ }, { "name": "symfony/translation", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea" + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/235535e3f84f3dfbdbde0208ede6ca75c3a489ea", - "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea", + "url": "https://api.github.com/repos/symfony/translation/zipball/b9f72ab14efdb6b772f85041fa12f820dee8d55f", + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f", "shasum": "" }, "require": { @@ -2280,7 +2809,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.1.5" + "source": "https://github.com/symfony/translation/tree/v7.1.6" }, "funding": [ { @@ -2296,7 +2825,7 @@ "type": "tidelift" } ], - "time": "2024-09-16T06:30:38+00:00" + "time": "2024-09-28T12:35:13+00:00" }, { "name": "symfony/translation-contracts", @@ -2428,16 +2957,16 @@ }, { "name": "twig/twig", - "version": "v3.14.0", + "version": "v3.15.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72" + "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/2d5b3964cc21d0188633d7ddce732dc8e874db02", + "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02", "shasum": "" }, "require": { @@ -2491,7 +3020,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.0" + "source": "https://github.com/twigphp/Twig/tree/v3.15.0" }, "funding": [ { @@ -2503,7 +3032,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T17:55:12+00:00" + "time": "2024-11-17T15:59:19+00:00" }, { "name": "vlucas/phpdotenv", @@ -2676,5 +3205,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/kernel/admin_themes/default/layout/main.php b/kernel/admin_themes/default/layout/main.php index 704683f..5864fb1 100644 --- a/kernel/admin_themes/default/layout/main.php +++ b/kernel/admin_themes/default/layout/main.php @@ -14,7 +14,7 @@ - + diff --git a/kernel/controllers/ModuleController.php b/kernel/controllers/ModuleController.php index fab7bd3..3e2bb18 100644 --- a/kernel/controllers/ModuleController.php +++ b/kernel/controllers/ModuleController.php @@ -3,6 +3,7 @@ namespace kernel\controllers; use DirectoryIterator; +use JetBrains\PhpStorm\NoReturn; use Josantonius\Session\Facades\Session; use kernel\AdminController; use kernel\helpers\Debug; @@ -53,10 +54,6 @@ class ModuleController extends AdminController $i++; } } -// foreach (ModuleShopClientService::getModuleShopClientInfo() as $module) { -// $module->id = $i++; -// $modules_info[] = $module; -// } $module_count = count($modules_info); $modules_info = array_slice($modules_info, $per_page*($page_number-1), $per_page); @@ -106,25 +103,11 @@ class ModuleController extends AdminController $this->cgView->render("view.php", ['data' => $mod_info]); } - public function actionUpdate(): void + #[NoReturn] public function actionUpdate(): void { $request = new Request(); $slug = $request->get('slug'); - if ($this->moduleService->isKernelModule($slug)) { - $active_res = $this->moduleService->updateModule($request->get("slug")); - if (!$active_res){ - Session::start(); - Session::set("error", implode(";", $this->moduleService->getErrors())); - $this->redirect("/admin", 302); - } - $mod_info = $this->moduleService->getModuleInfoBySlug($request->get('slug')); - } else { - $this->redirect("/admin/module_shop_client/update/?slug=" . $slug, 302); - } - - - - $this->cgView->render("view.php", ['data' => $mod_info]); + $this->redirect("/admin/module_shop_client/update/?slug=" . $slug, 302); } } \ No newline at end of file diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php index cc45d1a..3840192 100644 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -189,8 +189,8 @@ class ModuleService */ public function runInitScript($mod_info): void { - if (isset($mod_info['module_class'])){ - if (isset($mod_info['module_class_file'])){ + if (isset($mod_info['module_class'])) { + if (isset($mod_info['module_class_file'])) { require_once $mod_info['module_class_file']; } $moduleClass = new $mod_info['module_class'](); @@ -204,8 +204,8 @@ class ModuleService */ public function runDeactivateScript($mod_info): void { - if (isset($mod_info['module_class'])){ - if (isset($mod_info['module_class_file'])){ + if (isset($mod_info['module_class'])) { + if (isset($mod_info['module_class_file'])) { require_once $mod_info['module_class_file']; } $moduleClass = new $mod_info['module_class'](); @@ -233,11 +233,11 @@ class ModuleService foreach ($dirs as $dir) { foreach (new DirectoryIterator($dir) as $fileInfo) { - if($fileInfo->isDot() or !in_array($fileInfo->getFilename(), $active_modules['modules'])) continue; + if ($fileInfo->isDot() or !in_array($fileInfo->getFilename(), $active_modules['modules'])) continue; $modules[] = $this->getModuleInfo($fileInfo->getPathname()); } } - + return $modules; } @@ -248,8 +248,8 @@ class ModuleService { $routs = []; $modules = $this->getActiveModules(); - foreach ($modules as $module){ - if (isset($module['routs'])){ + foreach ($modules as $module) { + if (isset($module['routs'])) { $routs[] = $module['path'] . "/" . $module['routs']; } } @@ -264,8 +264,8 @@ class ModuleService { $migrationsPaths = []; $modules = $this->getActiveModules(); - foreach ($modules as $module){ - if (isset($module['migration_path'])){ + foreach ($modules as $module) { + if (isset($module['migration_path'])) { $migrationsPaths[] = $module['path'] . "/" . $module['migration_path']; } } @@ -326,7 +326,7 @@ class ModuleService $fileHelper = new Files(); if (file_exists(APP_DIR . '/modules/' . $moduleInfo['slug'])) { - $fileHelper->recursiveRemoveDir(APP_DIR . '/modules/'. $moduleInfo['slug']); + $fileHelper->recursiveRemoveDir(APP_DIR . '/modules/' . $moduleInfo['slug']); } if (file_exists(KERNEL_APP_MODULES_DIR . '/' . $moduleInfo['slug'])) { $fileHelper->recursiveRemoveDir(KERNEL_APP_MODULES_DIR . '/' . $moduleInfo['slug']); @@ -345,10 +345,9 @@ class ModuleService $fileHelper = new Files(); $fileHelper->copy_folder(ROOT_DIR . $path, $tmpModuleDirFull . 'app/'); - if (file_exists(KERNEL_APP_MODULES_DIR . '/' . $moduleName)){ + if (file_exists(KERNEL_APP_MODULES_DIR . '/' . $moduleName)) { $fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $tmpModuleDirFull . 'kernel/'); - } - else { + } else { mkdir($tmpModuleDirFull . 'kernel/'); } @@ -419,15 +418,15 @@ class ModuleService { $module_paths = Option::where("key", "module_paths")->first(); $dirs = []; - if ($module_paths){ + if ($module_paths) { $path = json_decode($module_paths->value); - foreach ($path->paths as $p){ + foreach ($path->paths as $p) { $dirs[] = getConst($p); } } - foreach ($dirs as $dir){ + foreach ($dirs as $dir) { foreach (new DirectoryIterator($dir) as $fileInfo) { - if($fileInfo->isDot()) continue; + if ($fileInfo->isDot()) continue; if ($this->getModuleInfo($fileInfo->getPathname())['slug'] === $slug) { return true; }; @@ -454,17 +453,25 @@ class ModuleService public function isKernelModule(string $slug): bool { - $modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); - - $modules_info = json_decode($modules_info->getBody()->getContents(), true); - $mod_info = $this->getModuleInfoBySlug($slug); + $modules_info = $this->getKernelModules(); foreach ($modules_info as $mod) { - if ($mod['slug'] === $mod_info['slug']) { - return false; + if ($mod['slug'] === $slug) { + return true; } } - return true; + return false; + } + + public function getKernelModules(): array + { + $modules_info = []; + foreach (new DirectoryIterator(KERNEL_MODULES_DIR) as $fileInfo) { + if ($fileInfo->isDot()) continue; + $modules_info[] = $this->getModuleInfo($fileInfo->getPathname()); + } + + return $modules_info; } } \ No newline at end of file diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php index 3cbf641..5caf429 100644 --- a/kernel/views/module/index.php +++ b/kernel/views/module/index.php @@ -34,9 +34,9 @@ $table->addAction(function ($row, $url) use ($moduleService) { $btn = "$label"; } else { - $label = "Активировать"; + $label = ""; $btn_type = "success"; - $btn = "$label"; + $btn = "$label"; } return $btn; @@ -60,7 +60,7 @@ $table->addAction(function ($row, $url) use ($moduleService){ return false; }); -$table->addAction(function ($row, $url) use ($moduleService){ +$table->addAction(function ($row) use ($moduleService){ $slug = $row['slug']; if (!$moduleService->isKernelModule($slug)){ $label = "Удалить"; diff --git a/kernel/views/widgets/admin/action_button.php b/kernel/views/widgets/admin/action_button.php new file mode 100644 index 0000000..32dee23 --- /dev/null +++ b/kernel/views/widgets/admin/action_button.php @@ -0,0 +1,9 @@ + + +"$icon"; \ No newline at end of file diff --git a/kernel/views/widgets/admin/menu.php b/kernel/views/widgets/admin/menu.php new file mode 100644 index 0000000..124c239 --- /dev/null +++ b/kernel/views/widgets/admin/menu.php @@ -0,0 +1,28 @@ + + \ No newline at end of file diff --git a/kernel/views/widgets/admin/module_tabs.php b/kernel/views/widgets/admin/module_tabs.php new file mode 100644 index 0000000..ac618d2 --- /dev/null +++ b/kernel/views/widgets/admin/module_tabs.php @@ -0,0 +1,14 @@ + + + +
\ No newline at end of file diff --git a/kernel/widgets/ActionButtonWidget.php b/kernel/widgets/ActionButtonWidget.php new file mode 100644 index 0000000..adea90f --- /dev/null +++ b/kernel/widgets/ActionButtonWidget.php @@ -0,0 +1,16 @@ +data['icon']; + $btn = $this->data['btn']; + $url = $this->data['url']; + $this->cgView->render('/admin/action_button.php', ['icon' => $icon, 'btn' => $btn, 'url' => $url]); + } +} \ No newline at end of file diff --git a/views/widgets/admin/action_button.php b/views/widgets/admin/action_button.php new file mode 100644 index 0000000..32dee23 --- /dev/null +++ b/views/widgets/admin/action_button.php @@ -0,0 +1,9 @@ + + +"$icon"; \ No newline at end of file diff --git a/views/widgets/admin/menu.php b/views/widgets/admin/menu.php index fe5773b..124c239 100644 --- a/views/widgets/admin/menu.php +++ b/views/widgets/admin/menu.php @@ -18,7 +18,7 @@ -
  • "> +
  • "> label ?>
  • diff --git a/views/widgets/admin/module_tabs.php b/views/widgets/admin/module_tabs.php new file mode 100644 index 0000000..ac618d2 --- /dev/null +++ b/views/widgets/admin/module_tabs.php @@ -0,0 +1,14 @@ + + + +
    \ No newline at end of file