Skip to content
Code-Schnipsel Gruppen Projekte
Commit 86c2c2f9 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

Merge branch 'next-3.x' into 'main'

Next 3.x

See merge request !33
Übergeordnete 01ff2ccc 43ace3de
No related branches found
Tags 3.2.0
2 Merge Requests!34Update 'next-4.x' with latest changes from 'main',!33Next 3.x
Pipeline #11994 mit Warnungen bestanden mit Phase
in 53 Sekunden
# Ignore developer files when exporting
.gitattributes export-ignore
.gitignore export-ignore
.gitlab-ci.yml export-ignore
.phive export-ignore
captainhook.json export-ignore
phpcs.xml.dist export-ignore
phpstan-baseline.neon export-ignore
phpstan.dist.neon export-ignore
phpunit.dist.xml export-ignore
tests export-ignore
# Explicitly set file type and line endings for PHP files, improves git diff output
*.php text eol=lf diff=php
\ No newline at end of file
tools/
phpstan.neon
.phpunit.result.cache
phpunit.xml
\ No newline at end of file
phpunit.xml
tools/
phpstan.neon
.phpunit.result.cache
phpunit.xml
include:
- project: 'quiqqer/stabilization/semantic-release'
file: '/ci-templates/.gitlab-ci.yml'
- component: dev.quiqqer.com/quiqqer/stabilization/ci-cd-components/quiqqer-package-bundle/quiqqer-package-bundle@main
# Remove the entire phpunit-php8.1 block, to allow PHPUnit to run on PHP 8.1 in your pipeline
phpunit-php8.1:
rules:
- when: never
# Remove the entire phpunit-php8.2 block, to allow PHPUnit to run on PHP 8.2 in your pipeline
phpunit-php8.2:
rules:
- when: never
# Remove the entire phpunit-php8.3 block, to allow PHPUnit to run on PHP 8.3 in your pipeline
phpunit-php8.3:
rules:
- when: never
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="^1.10.67" installed="1.10.67" location="./tools/phpstan" copy="false"/>
<phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/>
<phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/>
<phar name="captainhook" version="^5.23.3" installed="5.23.3" location="./tools/captainhook" copy="false"/>
</phive>
# Contributing
This package follows the [QUIQQER contribution guidelines](https://dev.quiqqer.com/quiqqer/stabilization/documentation/-/wikis/home).
\ No newline at end of file
{
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
},
{
"action": "composer test"
}
]
}
}
\ No newline at end of file
{
"name": "quiqqer/menu",
"type": "quiqqer-module",
"description": "The Plugin menu provides various menu controls.",
"license": [
"GPL-3.0+",
"PCSG QL-1.0"
],
"authors": [
{
"name": "Henning Leutz",
"email": "leutz@pcsg.de",
"homepage": "https://www.pcsg.de",
"role": "Developer"
"name": "quiqqer/menu",
"type": "quiqqer-module",
"description": "The Plugin menu provides various menu controls.",
"license": [
"GPL-3.0+",
"PCSG QL-1.0"
],
"authors": [
{
"name": "Henning Leutz",
"email": "leutz@pcsg.de",
"homepage": "https://www.pcsg.de",
"role": "Developer"
}
],
"support": {
"email": "support@pcsg.de",
"url": "https://www.pcsg.de"
},
"require": {
"php": "^8.1",
"quiqqer/core": "^2"
},
"autoload": {
"psr-4": {
"QUI\\Menu\\": "src/QUI/Menu"
}
},
"scripts": {
"test": [
"@dev:lint",
"@dev:phpunit"
],
"dev:phpunit": "./tools/phpunit",
"dev:lint": [
"@dev:lint:phpstan",
"@dev:lint:style"
],
"dev:lint:phpstan": "./tools/phpstan",
"dev:lint:style": "./tools/phpcs",
"dev:lint:style:fix": "./tools/phpcbf",
"dev:init": [
"@dev:init:check-requirements",
"@dev:init:tools",
"@dev:init:git-hooks"
],
"dev:init:check-requirements": [
"which composer > /dev/null || (echo 'Error: composer has to be globally installed'; exit 1)",
"which phive > /dev/null || (echo 'Error: PHIVE has to be globally installed'; exit 1)"
],
"dev:init:tools": "phive install --temporary",
"dev:init:git-hooks": "./tools/captainhook install --only-enabled --force"
},
"scripts-aliases": {
"test": [
"dev:test"
]
},
"scripts-descriptions": {
"test": "Runs linting, static analysis, and unit tests.",
"dev:phpunit": "Run PHPUnit test suites",
"dev:lint": "Run PHPStan and code style check",
"dev:lint:phpstan": "Run PHPStan",
"dev:lint:style": "Run code style check (PHP_CodeSniffer)",
"dev:lint:style:fix": "Try to fix code style errors automatically",
"dev:init": "Initialize the developer tooling (tools and git hooks)",
"dev:init:check-requirements": "Check if the necessary requirements are met",
"dev:init:tools": "Install all developer tools (requires PHIVE)",
"dev:init:git-hooks": "Install all git hooks (may require tools to be installed)"
}
],
"support": {
"email": "support@pcsg.de",
"url": "https://www.pcsg.de"
},
"require": {
"php": "^8.1",
"quiqqer/core": "^2"
},
"autoload": {
"psr-4": {
"QUI\\Menu\\": "src/QUI/Menu"
}
}
}
\ No newline at end of file
......@@ -5,4 +5,5 @@
<event on="onSmartyInit" fire="\QUI\Menu\EventHandler::onSmartyInit"/>
<event on="onAdminLoadFooter" fire="\QUI\Menu\EventHandler::onAdminLoadFooter"/>
<event on="onQuiqqerMenuIndependentClear" fire="\QUI\Menu\EventHandler::onQuiqqerMenuIndependentClear"/>
<event on="onQuiqqer::template::body::end" fire="\QUI\Menu\EventHandler::onQuiqqerTemplateBodyEnd"/>
</events>
......@@ -719,6 +719,53 @@
<de><![CDATA[Das Menü wurde erfolgreich gespeichert.]]></de>
<en><![CDATA[The menu has been saved successfully.]]></en>
</locale>
<!-- floating menu -->
<locale name="floatingMenu.settings.title">
<de><![CDATA[Schwebendes Menü]]></de>
<en><![CDATA[Floated menu]]></en>
</locale>
<locale name="floatingMenu.settings.desc">
<de><![CDATA[Ein "Schwebendes Menü" ist ein Menü, das sich über den Inhalt der Seite legt und dabei oft an einer bestimmten Position "schwebt" oder fixiert bleibt, selbst wenn man nach unten scrollt. Dieses Menü kann z.B. am Rand des Bildschirms oder in einer Ecke platziert sein und bleibt sichtbar, damit der Nutzer jederzeit schnell darauf zugreifen kann.]]></de>
<en><![CDATA[A "Floating menu" is a menu that is superimposed over the content of the page and often "floats" or remains fixed in a certain position, even when scrolling down. This menu can be placed at the edge of the screen or in a corner, for example, and remains visible so that the user can access it quickly at any time.]]></en>
</locale>
<locale name="floatingMenu.settings.menuId">
<de><![CDATA[Menu ID]]></de>
<en><![CDATA[Menu ID]]></en>
</locale>
<locale name="floatingMenu.settings.menuId.desc">
<de><![CDATA[Wenn hier ein Menü ausgewählt wird, wird es automatisch aktiviert und für die Benutzer auf der Seite sichtbar. Zuvor muss ein Menü unter <i>Einstellungen → Menü Verwaltung</i> erstellt werden. Möchte man das schwebende Menü deaktivieren, muss lediglich das ausgewählte Menü durch Klick auf den X Button entfernt werden.]]></de>
<en><![CDATA[If a menu is selected here, it is automatically activated and visible to users on the page. A menu must first be created under <i>Settings → Menu management</i>. If you want to deactivate the floating menu, simply remove the selected menu by clicking on the X button.]]></en>
</locale>
<locale name="floatingMenu.settings.showLangSwitch">
<de><![CDATA[Sprachewechsel aktivieren]]></de>
<en><![CDATA[Enable lang switch]]></en>
</locale>
<locale name="floatingMenu.settings.showLangSwitch.desc">
<de><![CDATA[Wenn das Projekt mehrsprachig ist, kann man mit dieser Option den Sprachwechsel aktivieren.]]></de>
<en><![CDATA[If the project is multilingual, you can use this option to enable language switching.]]></en>
</locale>
<locale name="floatingMenu.settings.toggleButton">
<de><![CDATA[Umschaltbutton]]></de>
<en><![CDATA[Toggle button]]></en>
</locale>
<locale name="floatingMenu.settings.toggleButton.desc">
<de><![CDATA[Der Umschaltbutton zeigt und versteckt die schwebende Navigation. Mit dieser Option kann festgelegt werden, wann er angezeigt wird oder ob er vollständig verborgen bleibt.]]></de>
<en><![CDATA[The toggle button shows and hides the floating navigation. This option allows you to specify when it is displayed or if it remains completely hidden.]]></en>
</locale>
<locale name="floatingMenu.settings.toggleButton.mobile">
<de><![CDATA[Nur mobile anzeigen]]></de>
<en><![CDATA[Show only mobile]]></en>
</locale>
<locale name="floatingMenu.settings.toggleButton.always">
<de><![CDATA[Mobile und Desktop anzeigen]]></de>
<en><![CDATA[Show on mobile and on desktop]]></en>
</locale>
<locale name="floatingMenu.settings.toggleButton.hide">
<de><![CDATA[Deaktivieren]]></de>
<en><![CDATA[Disabled]]></en>
</locale>
</groups>
<groups name="quiqqer/menu" datatype="js">
......
<?xml version="1.0"?>
<ruleset>
<!-- Use PSR-12 ruleset -->
<rule ref="PSR12"/>
<!-- Only scan *.php files -->
<arg name="extensions" value="php"/>
<!-- Ignore warnings -->
<arg name="warning-severity" value="0"/>
<!-- Process 64 (or number of CPU cores) files in parallel -->
<arg name="parallel" value="64"/>
<!-- Output relative file paths, by setting the current folder as the basepath -->
<arg name="basepath" value="."/>
<!-- Show colored output -->
<arg name="colors"/>
<!-- Scan everything in the current folder -->
<file>.</file>
</ruleset>
parameters:
ignoreErrors:
-
message: "#^Strict comparison using \\=\\=\\= between mixed and '' will always evaluate to false\\.$#"
count: 1
path: src/QUI/Menu/Bricks/Submenu.php
-
message: "#^Call to an undefined method QUI\\\\Interfaces\\\\Projects\\\\Site\\:\\:getCachePath\\(\\)\\.$#"
count: 1
path: src/QUI/Menu/DropDownMenu.php
-
message: "#^Parameter \\#1 \\$menuId of static method QUI\\\\Menu\\\\Independent\\\\Handler\\:\\:getMenu\\(\\) expects int, string\\|false given\\.$#"
count: 1
path: src/QUI/Menu/Independent/Factory.php
-
message: "#^Call to an undefined method QUI\\\\Interfaces\\\\Projects\\\\Site\\:\\:getCachePath\\(\\)\\.$#"
count: 1
path: src/QUI/Menu/MegaMenu.php
-
message: "#^Variable \\$Site in PHPDoc tag @var does not match any variable in the foreach loop\\: \\$data, \\$dataSet$#"
count: 1
path: src/QUI/Menu/NavTabs.php
......@@ -2,9 +2,11 @@ includes:
- phpstan-baseline.neon
parameters:
level: 1
level: 5
paths:
- src
- ajax
excludePaths:
- src/QUI/Menu/Rest/Provider.php
bootstrapFiles:
- tests/phpstan-bootstrap.php
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/phpunit-bootstrap.php">
<testsuites>
<testsuite name="Tests">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
......@@ -31,7 +31,7 @@
<type><![CDATA[number]]></type>
<defaultvalue>1</defaultvalue>
</conf>
</section>`
</section>
<section name="mobileMenu.slideoutAdvanced.settings">
<conf name="homeLink">
<type><![CDATA[number]]></type>
......@@ -41,6 +41,19 @@
<type><![CDATA[number]]></type>
</conf>
</section>
<section name="floatingMenu.settings">
<conf name="menuId">
<type><![CDATA[number]]></type>
</conf>
<conf name="showLangSwitch">
<type><![CDATA[bool]]></type>
<defaultvalue>false</defaultvalue>
</conf>
<conf name="toggleButton">
<type><![CDATA[text]]></type>
<defaultvalue>mobile</defaultvalue>
</conf>
</section>
</config>
<window>
......@@ -176,6 +189,56 @@
</description>
</input>
</settings>
<!-- floated menu -->
<settings title="floatingMenu.settings" name="floatingMenu.settings">
<title>
<locale group="quiqqer/menu" var="floatingMenu.settings.title"/>
</title>
<text>
<locale group="quiqqer/menu" var="floatingMenu.settings.desc"/>
</text>
<input conf="floatingMenu.settings.menuId" type="text"
data-qui="package/quiqqer/menu/bin/Controls/Independent/Input"
>
<text>
<locale group="quiqqer/menu" var="floatingMenu.settings.menuId"/>
</text>
<description>
<locale group="quiqqer/menu" var="floatingMenu.settings.menuId.desc"/>
</description>
</input>
<input conf="floatingMenu.settings.showLangSwitch" type="checkbox">
<text>
<locale group="quiqqer/menu" var="floatingMenu.settings.showLangSwitch"/>
</text>
<description>
<locale group="quiqqer/menu" var="floatingMenu.settings.showLangSwitch.desc"/>
</description>
</input>
<!-- <select conf="floatingMenu.settings.toggleButton">-->
<!-- <text>-->
<!-- <locale group="quiqqer/menu" var="floatingMenu.settings.toggleButton"/>-->
<!-- </text>-->
<!-- <description>-->
<!-- <locale group="quiqqer/menu" var="floatingMenu.settings.toggleButton.desc"/>-->
<!-- </description>-->
<!-- <option value="mobile">-->
<!-- <locale group="quiqqer/menu" var="floatingMenu.settings.toggleButton.mobile"/>-->
<!-- </option>-->
<!-- <option value="always">-->
<!-- <locale group="quiqqer/menu" var="floatingMenu.settings.toggleButton.always"/>-->
<!-- </option>-->
<!-- <option value="hide">-->
<!-- <locale group="quiqqer/menu" var="floatingMenu.settings.toggleButton.hide"/>-->
<!-- </option>-->
<!-- </select>-->
</settings>
</category>
</categories>
......
......@@ -3,9 +3,11 @@
namespace QUI\Menu;
use QUI;
use QUI\Config;
use QUI\Interfaces\Projects\Site;
use Smarty;
use SmartyException;
use QUI\Smarty\Collector;
/**
* Class EventHandler
......@@ -14,6 +16,11 @@
*/
class EventHandler
{
/**
* Cache Manager Configs
*/
public static ?Config $Config = null;
/**
* @return string
*/
......@@ -76,4 +83,32 @@ public static function onQuiqqerMenuIndependentClear($menuId): void
{
QUI\Cache\Manager::clear(self::menuCacheName());
}
/**
* @param Collector $Collector
* @param QUI\Template $Template
* @return void
*/
public static function onQuiqqerTemplateBodyEnd(Collector $Collector, QUI\Template $Template): void
{
$Project = $Template->getAttribute('Project');
$menuId = intval($Project->getConfig('floatingMenu.settings.menuId'));
if (!$menuId) {
return;
}
$showLandSwitch = $Project->getConfig('floatingMenu.settings.showLangSwitch');
$toggleButton = $Project->getConfig('floatingMenu.settings.toggleButton');
// todo - showToggleButton works not correctly in FloatedNav
$toggleButton = 'mobile';
$FloatingMenu = new QUI\Menu\Controls\FloatedNav([
'menuId' => $menuId,
'showLangSwitch' => $showLandSwitch,
'showToggleButton' => $toggleButton
]);
$Collector->append($FloatingMenu->create());
}
}
<?php
if (!defined('QUIQQER_SYSTEM')) {
define('QUIQQER_SYSTEM', true);
}
if (!defined('QUIQQER_AJAX')) {
define('QUIQQER_AJAX', true);
}
require_once __DIR__ . '/../../../../bootstrap.php';
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren