From 29868fa865cd2460c079abd18088ddf52973ce98 Mon Sep 17 00:00:00 2001 From: Thorsten Rinne Date: Wed, 4 Dec 2024 18:17:46 +0100 Subject: [PATCH] refactor: migrated category overview page to controller (#3257) Additionally, we can create SBOMs now and we moved the compiled JS code to assets/public --- .gitignore | 2 +- .prettierignore | 2 +- composer.json | 5 +- composer.lock | 514 ++++++++++++- nginx.conf | 2 +- package.json | 1 + phpmyfaq/.htaccess | 2 +- phpmyfaq/admin/category.overview.php | 53 -- phpmyfaq/admin/header.php | 3 +- phpmyfaq/admin/index.php | 3 - .../templates/admin/content/category.add.twig | 5 +- .../admin/content/category.overview.twig | 8 +- .../admin/content/media.browser.twig | 4 +- phpmyfaq/assets/templates/admin/footer.twig | 2 +- phpmyfaq/assets/templates/admin/header.twig | 2 +- phpmyfaq/assets/templates/admin/index.twig | 4 +- phpmyfaq/assets/templates/default/index.twig | 8 +- phpmyfaq/assets/templates/setup/base.twig | 6 +- phpmyfaq/assets/templates/setup/update.twig | 4 +- phpmyfaq/src/admin-routes.php | 11 + .../AbstractAdministrationController.php | 4 +- .../Administration/CategoryController.php | 75 ++ pnpm-lock.yaml | 682 ++++++++++++++++++ vite.config.js | 16 +- 24 files changed, 1325 insertions(+), 93 deletions(-) delete mode 100644 phpmyfaq/admin/category.overview.php create mode 100644 phpmyfaq/src/phpMyFAQ/Controller/Administration/CategoryController.php diff --git a/.gitignore b/.gitignore index 0ea881f914..f927093d75 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,7 @@ phpmyfaq/src/libs phpmyfaq/admin/assets/css phpmyfaq/admin/assets/fonts phpmyfaq/admin/assets/js/editor/* -phpmyfaq/assets/dist +phpmyfaq/assets/public phpmyfaq/assets/js/libs phpmyfaq/assets/svg/*.svg !phpmyfaq/assets/templates/admin diff --git a/.prettierignore b/.prettierignore index 1ab81bbe05..3126fd1e1e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,7 +14,7 @@ package.json pnpm-lock.yaml # Ignore artifacts -phpmyfaq/assets/dist/ +phpmyfaq/assets/public/ # Ignore PNPM Cache .pnpm-store diff --git a/composer.json b/composer.json index 6fb2af133f..e3f504df90 100644 --- a/composer.json +++ b/composer.json @@ -50,10 +50,11 @@ "twig/twig": "^3.10" }, "require-dev": { + "cyclonedx/cyclonedx-php-composer": "^5.2", "doctrine/instantiator": "2.*", "mikey179/vfsstream": "^1.6", "phpdocumentor/reflection-docblock": "5.*", - "phpmd/phpmd" : "@stable", + "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.0.0", "phpunit/phpunit": "11.*", "rector/rector": "^1.0.0", @@ -76,6 +77,7 @@ "vendor-dir": "phpmyfaq/src/libs", "bin-dir": "phpmyfaq/src/libs/bin", "allow-plugins": { + "cyclonedx/cyclonedx-php-composer": true, "php-http/discovery": true }, "sort-packages": true @@ -96,6 +98,7 @@ "phpmd": "./phpmyfaq/src/libs/bin/phpmd ./phpmyfaq/src/phpMyFAQ html rulesets.xml > phpmd.html", "refactor": "./phpmyfaq/src/libs/bin/rector", "refactor:dryrun": "./phpmyfaq/src/libs/bin/rector --dry-run", + "sbom:create": "composer CycloneDX:make-sbom --output-format=JSON --output-file=sbom-php.json", "test": "./phpmyfaq/src/libs/bin/phpunit --coverage-text" }, "support": { diff --git a/composer.lock b/composer.lock index 49842c7254..1de7624cdb 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": "93420ec63886eef236d9da2279c0f12a", + "content-hash": "830ab849db3a8126e83a44ec06e066df", "packages": [ { "name": "2tvenom/cborencode", @@ -5264,6 +5264,86 @@ ], "time": "2024-11-12T16:29:46+00:00" }, + { + "name": "composer/spdx-licenses", + "version": "1.5.8", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-11-20T07:44:33+00:00" + }, { "name": "composer/xdebug-handler", "version": "3.0.5", @@ -5330,6 +5410,170 @@ ], "time": "2024-05-06T16:37:16+00:00" }, + { + "name": "cyclonedx/cyclonedx-library", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/CycloneDX/cyclonedx-php-library.git", + "reference": "c079276c96691fe92fa4d8f757f7eecf774e835a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CycloneDX/cyclonedx-php-library/zipball/c079276c96691fe92fa4d8f757f7eecf774e835a", + "reference": "c079276c96691fe92fa4d8f757f7eecf774e835a", + "shasum": "" + }, + "require": { + "composer/spdx-licenses": "^1.5", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "opis/json-schema": "^2.0", + "package-url/packageurl-php": "^1.0", + "php": "^8.1" + }, + "require-dev": { + "ext-simplexml": "*", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, + "composer-normalize": { + "indent-size": 4, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "CycloneDX\\Core\\": "src/Core/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Jan Kowalleck", + "email": "jan.kowalleck@gmail.com", + "homepage": "https://github.com/jkowalleck" + } + ], + "description": "Work with CycloneDX documents.", + "homepage": "https://github.com/CycloneDX/cyclonedx-php-library/#readme", + "keywords": [ + "CycloneDX", + "HBOM", + "OBOM", + "SBOM", + "SaaSBOM", + "bill-of-materials", + "bom", + "models", + "normalizer", + "owasp", + "package-url", + "purl", + "serializer", + "software-bill-of-materials", + "spdx", + "validator", + "vdr", + "vex" + ], + "support": { + "docs": "https://cyclonedx-php-library.readthedocs.io", + "issues": "https://github.com/CycloneDX/cyclonedx-php-library/issues", + "source": "https://github.com/CycloneDX/cyclonedx-php-library/" + }, + "funding": [ + { + "url": "https://owasp.org/donate/?reponame=www-project-cyclonedx&title=OWASP+CycloneDX", + "type": "other" + } + ], + "time": "2024-12-01T12:09:58+00:00" + }, + { + "name": "cyclonedx/cyclonedx-php-composer", + "version": "v5.2.0", + "source": { + "type": "git", + "url": "https://github.com/CycloneDX/cyclonedx-php-composer.git", + "reference": "f3a3cdc1a9e34bf1d5748e4279a24569cbf31fed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CycloneDX/cyclonedx-php-composer/zipball/f3a3cdc1a9e34bf1d5748e4279a24569cbf31fed", + "reference": "f3a3cdc1a9e34bf1d5748e4279a24569cbf31fed", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.3", + "cyclonedx/cyclonedx-library": "^3.3", + "package-url/packageurl-php": "^1.0", + "php": "^8.1" + }, + "require-dev": { + "composer/composer": "^2.3.0", + "roave/security-advisories": "dev-latest" + }, + "type": "composer-plugin", + "extra": { + "class": "CycloneDX\\Composer\\Plugin", + "branch-alias": { + "dev-master": "4.x-dev" + }, + "composer-normalize": { + "indent-size": 4, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "CycloneDX\\Composer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Jan Kowalleck", + "email": "jan.kowalleck@gmail.com", + "homepage": "https://github.com/jkowalleck" + } + ], + "description": "Creates CycloneDX Software Bill-of-Materials (SBOM) from PHP Composer projects", + "homepage": "https://github.com/CycloneDX/cyclonedx-php-composer/#readme", + "keywords": [ + "CycloneDX", + "SBOM", + "bill-of-materials", + "bom", + "composer", + "package-url", + "purl", + "software-bill-of-materials", + "spdx" + ], + "support": { + "issues": "https://github.com/CycloneDX/cyclonedx-php-composer/issues", + "source": "https://github.com/CycloneDX/cyclonedx-php-composer/" + }, + "funding": [ + { + "url": "https://owasp.org/donate/?reponame=www-project-cyclonedx&title=OWASP+CycloneDX", + "type": "other" + } + ], + "time": "2024-04-30T10:47:47+00:00" + }, { "name": "doctrine/deprecations", "version": "1.1.3", @@ -5557,6 +5801,262 @@ }, "time": "2024-10-08T18:51:32+00:00" }, + { + "name": "opis/json-schema", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/opis/json-schema.git", + "reference": "c48df6d7089a45f01e1c82432348f2d5976f9bfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/json-schema/zipball/c48df6d7089a45f01e1c82432348f2d5976f9bfb", + "reference": "c48df6d7089a45f01e1c82432348f2d5976f9bfb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "opis/string": "^2.0", + "opis/uri": "^1.0", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "ext-bcmath": "*", + "ext-intl": "*", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opis\\JsonSchema\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + }, + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + } + ], + "description": "Json Schema Validator for PHP", + "homepage": "https://opis.io/json-schema", + "keywords": [ + "json", + "json-schema", + "schema", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/opis/json-schema/issues", + "source": "https://github.com/opis/json-schema/tree/2.3.0" + }, + "time": "2022-01-08T20:38:03+00:00" + }, + { + "name": "opis/string", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/opis/string.git", + "reference": "9ebf1a1f873f502f6859d11210b25a4bf5d141e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/string/zipball/9ebf1a1f873f502f6859d11210b25a4bf5d141e7", + "reference": "9ebf1a1f873f502f6859d11210b25a4bf5d141e7", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "ext-json": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opis\\String\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "Multibyte strings as objects", + "homepage": "https://opis.io/string", + "keywords": [ + "multi-byte", + "opis", + "string", + "string manipulation", + "utf-8" + ], + "support": { + "issues": "https://github.com/opis/string/issues", + "source": "https://github.com/opis/string/tree/2.0.1" + }, + "time": "2022-01-14T15:42:23+00:00" + }, + { + "name": "opis/uri", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opis/uri.git", + "reference": "0f3ca49ab1a5e4a6681c286e0b2cc081b93a7d5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/uri/zipball/0f3ca49ab1a5e4a6681c286e0b2cc081b93a7d5a", + "reference": "0f3ca49ab1a5e4a6681c286e0b2cc081b93a7d5a", + "shasum": "" + }, + "require": { + "opis/string": "^2.0", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opis\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "Build, parse and validate URIs and URI-templates", + "homepage": "https://opis.io", + "keywords": [ + "URI Template", + "parse url", + "punycode", + "uri", + "uri components", + "url", + "validate uri" + ], + "support": { + "issues": "https://github.com/opis/uri/issues", + "source": "https://github.com/opis/uri/tree/1.1.0" + }, + "time": "2021-05-22T15:57:08+00:00" + }, + { + "name": "package-url/packageurl-php", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/package-url/packageurl-php.git", + "reference": "32058ad61f0d8b457fa26e7860bbd8b903196d3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/package-url/packageurl-php/zipball/32058ad61f0d8b457fa26e7860bbd8b903196d3f", + "reference": "32058ad61f0d8b457fa26e7860bbd8b903196d3f", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "ext-json": "*", + "phpunit/phpunit": "9.6.16", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "composer-normalize": { + "indent-size": 4, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "PackageUrl\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Kowalleck", + "email": "jan.kowalleck@gmail.com", + "homepage": "https://github.com/jkowalleck" + } + ], + "description": "Builder and parser based on the package URL (purl) specification.", + "homepage": "https://github.com/package-url/packageurl-php#readme", + "keywords": [ + "package", + "package-url", + "packageurl", + "purl", + "url" + ], + "support": { + "issues": "https://github.com/package-url/packageurl-php/issues", + "source": "https://github.com/package-url/packageurl-php/tree/1.1.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/jkowalleck", + "type": "github" + } + ], + "time": "2024-02-05T11:20:07+00:00" + }, { "name": "pdepend/pdepend", "version": "2.16.2", @@ -6045,16 +6545,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.10", + "version": "1.12.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071" + "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/fc463b5d0fe906dcf19689be692c65c50406a071", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", + "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", "shasum": "" }, "require": { @@ -6099,7 +6599,7 @@ "type": "github" } ], - "time": "2024-11-11T15:37:09+00:00" + "time": "2024-11-28T22:13:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -7931,7 +8431,7 @@ "ext-xmlwriter": "*", "ext-zip": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "8.2.0" }, diff --git a/nginx.conf b/nginx.conf index 613f27d89e..26d22b8842 100644 --- a/nginx.conf +++ b/nginx.conf @@ -129,7 +129,7 @@ server { rewrite admin/api/(.*) /admin/api/index.php last; # Administration pages - rewrite admin/(attachments|backup|comments|configuration|elasticsearch|export|glossary|group|import|instance|instances|news|password|questions|session-keep-alive|statistics|sticky-faqs|stopwords|system|tags|update|user) /admin/front.php last; + rewrite admin/(attachments|backup|category|comments|configuration|elasticsearch|export|glossary|group|import|instance|instances|news|password|questions|session-keep-alive|statistics|sticky-faqs|stopwords|system|tags|update|user) /admin/front.php last; # REST API v3.0 and v3.1 rewrite ^api/v3\.[01]/(.*) /api/index.php last; diff --git a/package.json b/package.json index fc0f3fd51a..300ed6f675 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "postcss": "^8.4.49", "prettier": "^3.4.1", "pretty-quick": "^4.0.0", + "rollup-plugin-sbom": "^1.1.1", "sass": "^1.81.0", "sigmund": "^1.0.1", "vite": "^6.0.1", diff --git a/phpmyfaq/.htaccess b/phpmyfaq/.htaccess index f673055876..d9cdc31d13 100644 --- a/phpmyfaq/.htaccess +++ b/phpmyfaq/.htaccess @@ -143,7 +143,7 @@ Header set Access-Control-Allow-Headers "Content-Type, Authorization" # Administration API RewriteRule ^admin/api/(.*) admin/api/index.php [L,QSA] # Administration pages - RewriteRule ^admin/(attachments|backup|comments|configuration|elasticsearch|export|glossary|group|import|instance|instances|news|password|questions|session-keep-alive|statistics|sticky-faqs|stopwords|system|tags|update|user) admin/front.php [L,QSA] + RewriteRule ^admin/(attachments|backup|category|comments|configuration|elasticsearch|export|glossary|group|import|instance|instances|news|password|questions|session-keep-alive|statistics|sticky-faqs|stopwords|system|tags|update|user) admin/front.php [L,QSA] # Private APIs RewriteRule ^api/(autocomplete|bookmark/delete|bookmark/create|user/data/update|user/password/update|user/request-removal|user/remove-twofactor|contact|voting|register|captcha|share|comment/create|faq/create|question/create|webauthn/prepare|webauthn/register|webauthn/prepare-login|webauthn/login) api/index.php [L,QSA] # Setup APIs diff --git a/phpmyfaq/admin/category.overview.php b/phpmyfaq/admin/category.overview.php deleted file mode 100644 index 7822e779a1..0000000000 --- a/phpmyfaq/admin/category.overview.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright 2023-2024 phpMyFAQ Team - * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 - * @link https://www.phpmyfaq.de - * @since 2013-12-30 - */ - -use phpMyFAQ\Category; -use phpMyFAQ\Session\Token; -use phpMyFAQ\Template\TwigWrapper; -use Symfony\Component\HttpFoundation\Request; - -if (!defined('IS_VALID_PHPMYFAQ')) { - http_response_code(400); - exit(); -} - -$request = Request::createFromGlobals(); -$faqConfig = $container->get('phpmyfaq.configuration'); - -$category = new Category($faqConfig, [], false); -$category->buildCategoryTree(); -$categoryInfo = $category->getAllCategories(); - -$categoryOrder = $container->get('phpmyfaq.category.order'); -$orderedCategories = $categoryOrder->getAllCategories(); -$categoryTree = $categoryOrder->getCategoryTree($orderedCategories); - -if (empty($categoryTree)) { - // Fallback if no category order is available - $categoryTree = $category->buildAdminCategoryTree($categoryInfo); -} - -$twig = new TwigWrapper(PMF_ROOT_DIR . '/assets/templates'); -$template = $twig->loadTemplate('@admin/content/category.overview.twig'); - -$templateVars = [ - 'csrfTokenInput' => Token::getInstance($container->get('session'))->getTokenInput('category'), - 'categoryTree' => $categoryTree, - 'categoryInfo' => $categoryInfo, -]; - -echo $template->render($templateVars); diff --git a/phpmyfaq/admin/header.php b/phpmyfaq/admin/header.php index 243928e044..2dd479292b 100644 --- a/phpmyfaq/admin/header.php +++ b/phpmyfaq/admin/header.php @@ -62,7 +62,8 @@ $secLevelEntries['content'] = $adminHelper->addMenuEntry( 'addcateg+editcateg+delcateg', 'category-overview', - 'msgHeaderCategoryOverview' + 'msgHeaderCategoryOverview', + 'category' ); $secLevelEntries['content'] .= $adminHelper->addMenuEntry( PermissionType::FAQ_ADD->value, diff --git a/phpmyfaq/admin/index.php b/phpmyfaq/admin/index.php index 411d8a44b0..9cdef0a385 100755 --- a/phpmyfaq/admin/index.php +++ b/phpmyfaq/admin/index.php @@ -272,9 +272,6 @@ case 'updatecategory': require 'category.main.php'; break; - case 'category-overview': - require 'category.overview.php'; - break; case 'addcategory': require 'category.add.php'; break; diff --git a/phpmyfaq/assets/templates/admin/content/category.add.twig b/phpmyfaq/assets/templates/admin/content/category.add.twig index 72dc545786..53ddef0178 100644 --- a/phpmyfaq/assets/templates/admin/content/category.add.twig +++ b/phpmyfaq/assets/templates/admin/content/category.add.twig @@ -1,3 +1,6 @@ +{% extends '@admin/index.twig' %} + +{% block content %}

{{ ad_categ_new }} @@ -183,4 +186,4 @@

- +{% endblock %} diff --git a/phpmyfaq/assets/templates/admin/content/category.overview.twig b/phpmyfaq/assets/templates/admin/content/category.overview.twig index 394033fc58..9772ead746 100644 --- a/phpmyfaq/assets/templates/admin/content/category.overview.twig +++ b/phpmyfaq/assets/templates/admin/content/category.overview.twig @@ -1,13 +1,16 @@ +{% extends '@admin/index.twig' %} + +{% block content %}

{{ 'msgHeaderCategoryOverview' | translate }}

{% endfor %} {% endmacro %} +{% endblock %} diff --git a/phpmyfaq/assets/templates/admin/content/media.browser.twig b/phpmyfaq/assets/templates/admin/content/media.browser.twig index 18ae5da9f2..b30fb5bff8 100644 --- a/phpmyfaq/assets/templates/admin/content/media.browser.twig +++ b/phpmyfaq/assets/templates/admin/content/media.browser.twig @@ -4,7 +4,7 @@ phpMyFAQ Media Browser @@ -35,7 +35,7 @@
{% endfor %} - + {% endif %} diff --git a/phpmyfaq/assets/templates/admin/footer.twig b/phpmyfaq/assets/templates/admin/footer.twig index f2a38964c1..c7cdf5812f 100644 --- a/phpmyfaq/assets/templates/admin/footer.twig +++ b/phpmyfaq/assets/templates/admin/footer.twig @@ -90,6 +90,6 @@ style="display: none;" name="keep-phpmyfaq-session-alive"> {% endif %} - + diff --git a/phpmyfaq/assets/templates/admin/header.twig b/phpmyfaq/assets/templates/admin/header.twig index 3239fabdec..3c5702ac7d 100644 --- a/phpmyfaq/assets/templates/admin/header.twig +++ b/phpmyfaq/assets/templates/admin/header.twig @@ -14,7 +14,7 @@ - + diff --git a/phpmyfaq/assets/templates/admin/index.twig b/phpmyfaq/assets/templates/admin/index.twig index be59de587b..337554af05 100644 --- a/phpmyfaq/assets/templates/admin/index.twig +++ b/phpmyfaq/assets/templates/admin/index.twig @@ -14,7 +14,7 @@ - + @@ -316,6 +316,6 @@ style="display: none;" name="keep-phpmyfaq-session-alive"> {% endif %} - + diff --git a/phpmyfaq/assets/templates/default/index.twig b/phpmyfaq/assets/templates/default/index.twig index bb016c6099..a37217bb83 100644 --- a/phpmyfaq/assets/templates/default/index.twig +++ b/phpmyfaq/assets/templates/default/index.twig @@ -13,9 +13,9 @@ - {% if isDebugEnabled %}{% endif %} + {% if isDebugEnabled %}{% endif %} - +