Skip to content
Code-Schnipsel Gruppen Projekte
Commit 24714519 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next' into 'master'

Next

See merge request !17
Übergeordnete 4db0f661 00ad67cf
No related branches found
Tags 3.1.0
3 Merge Requests!19Dev,!18Feat menu manager improvement,!17Next
Pipeline #5372 bestanden mit Phase
in 37 Sekunden
werden angezeigt mit 116 Ergänzungen und 100 Löschungen
include:
- project: 'quiqqer/stabilization/semantic-release'
file: '/ci-templates/.gitlab-ci.yml'
- GPL-3.0+
- PCSG QL-1.0
\ No newline at end of file
......@@ -15,7 +15,7 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_create',
function ($title, $workingTitle) {
$title = json_decode($title, true);
$title = json_decode($title, true);
$workingTitle = json_decode($workingTitle, true);
$Menu = \QUI\Menu\Independent\Factory::createMenu();
......
......@@ -4,13 +4,10 @@
* This file contains package_quiqqer_menu_ajax_backend_independent_get
*/
/**
*
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_get',
function ($id) {
$Menu = QUI\Menu\Independent\Handler::getMenu($id);
$Menu = QUI\Menu\Independent\Handler::getMenu($id);
$result = $Menu->toArray();
function parseChildren(&$data)
......@@ -36,7 +33,7 @@ function parseChildren(&$data)
$data['children'][$key] = parseChildren($entry);
}
$data['children'][$key]['typeIcon'] = $icon;
$data['children'][$key]['typeIcon'] = $icon;
$data['children'][$key]['titleFrontend'] = $Item->getTitle();
}
......
......@@ -3,6 +3,7 @@
/**
* This file contains package_quiqqer_menu_ajax_backend_independent_getData
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_getData',
function ($id) {
......
......@@ -12,15 +12,15 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_getItemTypes',
function () {
$list = QUI\Menu\Independent\Handler::getItemList();
$list = QUI\Menu\Independent\Handler::getItemList();
$result = [];
foreach ($list as $class) {
$result[] = [
'title' => call_user_func([$class, 'itemTitle']),
'icon' => call_user_func([$class, 'itemIcon']),
'title' => call_user_func([$class, 'itemTitle']),
'icon' => call_user_func([$class, 'itemIcon']),
'jsControl' => call_user_func([$class, 'itemJsControl']),
'class' => $class
'class' => $class
];
}
......
......@@ -4,15 +4,12 @@
* This file contains package_quiqqer_menu_ajax_backend_independent_save
*/
/**
*
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_menu_ajax_backend_independent_save',
function ($id, $title, $workingTitle, $data) {
$title = json_decode($title, true);
$title = json_decode($title, true);
$workingTitle = json_decode($workingTitle, true);
$data = json_decode($data, true);
$data = json_decode($data, true);
$Menu = QUI\Menu\Independent\Handler::getMenu($id);
$Menu->setTitle($title);
......
bin/images/readme/settings-slideout-1.png

94,2 KiB

bin/images/readme/settings-slideout-2.png

27,4 KiB

bin/images/readme/settings-slideout-advanced-1.png

19,4 KiB

bin/images/readme/slideout-advanced-live-example.gif

670 KiB

bin/images/readme/slideout-live-example-1.png

31,5 KiB

......@@ -25,18 +25,25 @@ public function __construct($attributes = [])
{
// default options
$this->setAttributes([
'class' => 'quiqqer-floatedNavControl',
'menuId' => false,
'posX' => 'right', // right, left
'forceVerticalCenter' => true, // if true, container will be centered per JS. pure css way (top: 50%; transform: translateY: (-50%);) causes jumping effect on mobile, when url bar disappears
'size' => 'medium', // small, medium, large
'design' => 'iconBar', // iconBar, flat
'animationType' => false, // false, showAll (show entire control), showOneByOne (show each entry one by one)
'initAnimation' => false,
'animationEasing' => 'easeOutExpo', // see easing names on https://easings.net/
'class' => 'quiqqer-floatedNavControl',
'menuId' => false,
'posX' => 'right',
// right, left
'forceVerticalCenter' => true,
// if true, container will be centered per JS. pure css way (top: 50%; transform: translateY: (-50%);) causes jumping effect on mobile, when url bar disappears
'size' => 'medium',
// small, medium, large
'design' => 'iconBar',
// iconBar, flat
'animationType' => false,
// false, showAll (show entire control), showOneByOne (show each entry one by one)
'initAnimation' => false,
'animationEasing' => 'easeOutExpo',
// see easing names on https://easings.net/
// 'navInitOpen' => 'always', // always, desktop, never
'showToggleButton' => 'mobile', // always, mobile, hide,
'showLangSwitch' => false,
'showToggleButton' => 'mobile',
// always, mobile, hide,
'showLangSwitch' => false,
]);
parent::__construct($attributes);
......@@ -44,7 +51,7 @@ public function __construct($attributes = [])
$this->setJavaScriptControl('package/quiqqer/menu/bin/Controls/FloatedNav');
$this->addCSSFile(
dirname(__FILE__).'/FloatedNav.css'
dirname(__FILE__) . '/FloatedNav.css'
);
}
......@@ -55,7 +62,7 @@ public function __construct($attributes = [])
*/
public function getBody()
{
$Engine = QUI::getTemplateManager()->getEngine();
$Engine = QUI::getTemplateManager()->getEngine();
$LangSwitch = null;
try {
......@@ -91,7 +98,7 @@ public function getBody()
case 'small':
case 'medium':
case 'large':
$size = 'quiqqer-floatedNavControl__size-'.$this->getAttribute('size');
$size = 'quiqqer-floatedNavControl__size-' . $this->getAttribute('size');
break;
default:
......@@ -100,7 +107,7 @@ public function getBody()
switch ($this->getAttribute('design')) {
case 'flat':
$design = 'quiqqer-floatedNavControl__design-'.$this->getAttribute('design');
$design = 'quiqqer-floatedNavControl__design-' . $this->getAttribute('design');
break;
case 'iconBar':
......@@ -111,7 +118,7 @@ public function getBody()
switch ($this->getAttribute('posX')) {
case 'left':
case 'right':
$posX = 'quiqqer-floatedNavControl__posX-'.$this->getAttribute('posX');
$posX = 'quiqqer-floatedNavControl__posX-' . $this->getAttribute('posX');
$this->setJavaScriptControlOption('position', $this->getAttribute('posX'));
break;
......@@ -126,7 +133,7 @@ public function getBody()
try {
$LangSwitch = new QUI\Bricks\Controls\LanguageSwitches\Flags([
'showFlags' => 0,
'class' => 'quiqqer-floatedNav-entry'
'class' => 'quiqqer-floatedNav-entry'
]);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
......@@ -140,7 +147,7 @@ public function getBody()
case 'showOneByOne':
$this->setJavaScriptControlOption('animationtype', $this->getAttribute('animationType'));
$this->setJavaScriptControlOption('animationeasing', $this->getAnimationEasingName());
$animation = 'quiqqer-floatedNav__animation-'.$this->getAttribute('animationType');
$animation = 'quiqqer-floatedNav__animation-' . $this->getAttribute('animationType');
break;
}
......@@ -164,14 +171,14 @@ public function getBody()
$children = $IndependentMenu->getChildren();
$Engine->assign([
'this' => $this,
'children' => $children,
'animation' => $animation,
'LangSwitch' => $LangSwitch,
'this' => $this,
'children' => $children,
'animation' => $animation,
'LangSwitch' => $LangSwitch,
'showToggleButton' => $showToggleButton
]);
return $Engine->fetch(dirname(__FILE__).'/FloatedNav.html');
return $Engine->fetch(dirname(__FILE__) . '/FloatedNav.html');
}
/**
......
......@@ -25,29 +25,37 @@ public function __construct($attributes = [])
{
// default options
$this->setAttributes([
'class' => 'quiqqer-tabs',
'qui-class' => 'package/quiqqer/menu/bin/Controls/NavTabs',
'activeEntry' => 1, // number
'entries' => [],
'template' => 'simple',
'class' => 'quiqqer-tabs',
'qui-class' => 'package/quiqqer/menu/bin/Controls/NavTabs',
'activeEntry' => 1,
// number
'entries' => [],
'template' => 'simple',
// tabs nav
'navImgHeight' => 20, // number
'navStyle' => 'imgLeft', // imgLeft, imgTop, onlyImg
'navWrapText' => 'wrap', // wrap / noWrap; allow breaking text on space. 'noWrap' set "white-space: nowrap;" CSS property on nav text
'navFillSpace' => false, // it feels the available space
'navCenter' => false,
'navImgHeight' => 20,
// number
'navStyle' => 'imgLeft',
// imgLeft, imgTop, onlyImg
'navWrapText' => 'wrap',
// wrap / noWrap; allow breaking text on space. 'noWrap' set "white-space: nowrap;" CSS property on nav text
'navFillSpace' => false,
// it feels the available space
'navCenter' => false,
'enableDragToScroll' => true,
// tabs content
'contentImgMinWidth' => 200, // number; do not use large values, recommended is between 100 and 600
'contentImgMaxWidth' => 400, // number; do not use large values, recommended is between 200 and 600
'contentTextWidth' => 600, // number
'contentImgMinWidth' => 200,
// number; do not use large values, recommended is between 100 and 600
'contentImgMaxWidth' => 400,
// number; do not use large values, recommended is between 200 and 600
'contentTextWidth' => 600,
// number
]);
parent::__construct($attributes);
$this->addCSSFile(dirname(__FILE__).'/Tabs.css');
$this->addCSSFile(dirname(__FILE__) . '/Tabs.css');
}
/**
......@@ -57,8 +65,8 @@ public function __construct($attributes = [])
*/
public function getBody()
{
$Engine = QUI::getTemplateManager()->getEngine();
$entries = $this->getAttribute('entries');
$Engine = QUI::getTemplateManager()->getEngine();
$entries = $this->getAttribute('entries');
$enabledEntries = [];
if (is_string($entries)) {
......@@ -85,11 +93,11 @@ public function getBody()
$template = 'simple';
/* nav */
$showNavText = true;
$navWrapText = 'navText__wrap';
$showNavText = true;
$navWrapText = 'navText__wrap';
$navTabStyleCss = 'navTabStyle__imgLeft';
$navAlignment = '';
$navFillSpace = '';
$navAlignment = '';
$navFillSpace = '';
switch ($this->getAttribute('navStyle')) {
case 'imgTop':
......@@ -97,7 +105,7 @@ public function getBody()
break;
case 'onlyImg':
$navTabStyleCss = 'navTabStyle__onlyImg';
$showNavText = false;
$showNavText = false;
}
if (!$this->getAttribute('navFillSpace') && $this->getAttribute('navCenter')) {
......@@ -114,21 +122,21 @@ public function getBody()
}
$Engine->assign([
'this' => $this,
'entries' => $enabledEntries,
'active' => $active,
'navImgHeight' => $this->getAttribute('navImgHeight'),
'navStyle' => $this->getAttribute('navStyle'),
'navWrapText' => $navWrapText,
'navTabStyleCss' => $navTabStyleCss,
'showNavText' => $showNavText,
'navAlignment' => $navAlignment,
'navFillSpace' => $navFillSpace,
'contentTextWidth' => $this->getAttribute('contentTextWidth'),
'this' => $this,
'entries' => $enabledEntries,
'active' => $active,
'navImgHeight' => $this->getAttribute('navImgHeight'),
'navStyle' => $this->getAttribute('navStyle'),
'navWrapText' => $navWrapText,
'navTabStyleCss' => $navTabStyleCss,
'showNavText' => $showNavText,
'navAlignment' => $navAlignment,
'navFillSpace' => $navFillSpace,
'contentTextWidth' => $this->getAttribute('contentTextWidth'),
'contentImgMaxWidth' => $this->getAttribute('contentImgMaxWidth'),
'contentImgMinWidth' => $this->getAttribute('contentImgMinWidth'),
]);
return $Engine->fetch(dirname(__FILE__).'/Tabs.html');
return $Engine->fetch(dirname(__FILE__) . '/Tabs.html');
}
}
......@@ -28,7 +28,7 @@ public function __construct($attributes = [])
parent::__construct($attributes);
$this->addCSSFile(\dirname(__FILE__).'/DropDownMenu.css');
$this->addCSSFile(\dirname(__FILE__) . '/DropDownMenu.css');
}
/**
......@@ -39,7 +39,7 @@ public function __construct($attributes = [])
*/
public function getBody()
{
$cache = EventHandler::menuCacheName().'/dropDownMenu/';
$cache = EventHandler::menuCacheName() . '/dropDownMenu/';
$attributes = $this->getAttributes();
$attributes = \array_filter($attributes, function ($entry) {
......@@ -47,10 +47,10 @@ public function getBody()
});
$cache .= \md5(
$this->getSite()->getCachePath().
$this->getSite()->getCachePath() .
\serialize($attributes)
);
try {
return QUI\Cache\Manager::get($cache);
} catch (QUI\Exception $Exception) {
......@@ -59,13 +59,13 @@ public function getBody()
$Engine = QUI::getTemplateManager()->getEngine();
$Engine->assign([
'this' => $this,
'Site' => $this->getSite(),
'Project' => $this->getProject(),
'FileMenu' => \dirname(__FILE__).'/DropDownMenu.Children.html'
'this' => $this,
'Site' => $this->getSite(),
'Project' => $this->getProject(),
'FileMenu' => \dirname(__FILE__) . '/DropDownMenu.Children.html'
]);
$result = $Engine->fetch(\dirname(__FILE__).'/DropDownMenu.html');
$result = $Engine->fetch(\dirname(__FILE__) . '/DropDownMenu.html');
QUI\Cache\Manager::set($cache, $result);
......
......@@ -20,7 +20,7 @@ class Elastic extends QUI\Control
/**
* @param array $attributes
*/
public function __construct($attributes = array())
public function __construct($attributes = [])
{
parent::__construct($attributes);
}
......@@ -33,13 +33,13 @@ public function getBody()
{
$Engine = QUI::getTemplateManager()->getEngine();
$Engine->assign(array(
'FileMenu' => dirname(__FILE__) . '/Menu.Children.html',
'this' => $this,
'Site' => $this->getSite(),
'Project' => $this->getProject(),
$Engine->assign([
'FileMenu' => dirname(__FILE__) . '/Menu.Children.html',
'this' => $this,
'Site' => $this->getSite(),
'Project' => $this->getProject(),
'jsControl' => 'package/quiqqer/menu/bin/ElasticMenu'
));
]);
return $Engine->fetch(dirname(__FILE__) . '/Menu.html');
}
......
......@@ -49,7 +49,8 @@ public static function onProjectConfigSave()
*/
public static function onSmartyInit(Smarty $Smarty)
{
if (!isset($Smarty->registered_plugins['function'])
if (
!isset($Smarty->registered_plugins['function'])
|| !isset($Smarty->registered_plugins['function']['menu'])
) {
$Smarty->registerPlugin("function", "menu", "\\QUI\\Menu\\Independent\\Smarty::menu");
......
......@@ -18,9 +18,9 @@ public static function createMenu(): Menu
QUI\Permissions\Permission::checkPermission('quiqqer.menu.create');
QUI::getDataBase()->insert(Handler::table(), [
'title' => '',
'title' => '',
'workingTitle' => '',
'data' => ''
'data' => ''
]);
$lastId = QUI::getPDO()->lastInsertId();
......
......@@ -39,9 +39,9 @@ public static function getMenu(int $menuId): Menu
public static function getMenuCacheName($menuId = false, QUI\Projects\Project $Project = null): string
{
if ($Project) {
$project = $Project->getName();
$lang = $Project->getLang();
$template = $Project->getAttribute('template');
$project = $Project->getName();
$lang = $Project->getLang();
$template = $Project->getAttribute('template');
$projectHash = '/' . md5($project . '/' . $lang . '/' . $template);
} else {
$projectHash = '';
......@@ -64,7 +64,7 @@ public static function getMenuCacheName($menuId = false, QUI\Projects\Project $P
public static function getMenuData(int $menuId): array
{
$data = QUI::getDataBase()->fetch([
'from' => self::table(),
'from' => self::table(),
'where' => [
'id' => $menuId
],
......
......@@ -39,7 +39,7 @@ public function getTitle(Locale $Locale = null): string
}
$current = $Locale->getCurrent();
$title = $this->attributes['title'];
$title = $this->attributes['title'];
if (is_string($title)) {
$title = json_decode($title, true);
......@@ -62,7 +62,7 @@ public function getName(Locale $Locale = null): string
$Locale = QUI::getLocale();
}
$data = $this->getCustomData();
$data = $this->getCustomData();
$current = $Locale->getCurrent();
if (is_array($data) && isset($data['name'])) {
......@@ -198,9 +198,9 @@ public function getHTML(QUI\Locale $Locale = null): string
$Locale = QUI::getLocale();
}
$url = $this->getUrl();
$title = $this->getTitle($Locale);
$name = $this->getName($Locale);
$url = $this->getUrl();
$title = $this->getTitle($Locale);
$name = $this->getName($Locale);
$relValue = $this->getRel();
// rel attribute
......@@ -227,7 +227,7 @@ public function getHTML(QUI\Locale $Locale = null): string
}
// target attribute
$target = $this->getTarget();
$target = $this->getTarget();
$targetAttribute = '';
if (!empty($target)) {
......
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