Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/**
* This file contains QUI\Menu\Controls\FloatedNav
*/
namespace QUI\Menu\Controls;
use QUI;
use QUI\Menu\Independent;
/**
* Class WallpaperText
*
* @package quiqqer/menu
*/
class FloatedNav extends QUI\Control
{
/**
* constructor
*
* @param array $attributes
*/
public function __construct($attributes = [])
{
// default options
$this->setAttributes([
'menuId' => false,
'size' => 'medium', // small, medium, large
'design' => 'iconBar', // iconBar, flat
]);
parent::__construct($attributes);
$this->addCSSFile(
dirname(__FILE__).'/FloatedNav.css'
);
}
/**
* (non-PHPdoc)
*
* @see \QUI\Control::create()
*/
public function getBody()
{
$Engine = QUI::getTemplateManager()->getEngine();
$size = 'quiqqer-floatedNav__size-medium';
$design = 'quiqqer-floatedNav__iconsBar';
$showLangSwitch = false;
$IndependentMenu = Independent\Handler::getMenu($this->getAttribute('menuId'));
if (!$IndependentMenu) {
return '';
}
if ($this->getAttribute('size')) {
$size = 'quiqqer-floatedNav__size-'.$this->getAttribute('size');
}
if ($this->getAttribute('design')) {
$design = 'quiqqer-floatedNav__'.$this->getAttribute('design');
}
$showLangSwitch = true;
$LangSwitch = new QUI\Bricks\Controls\LanguageSwitches\Flags([
'showFlags' => 0
]);
$children = $IndependentMenu->getChildren();
$Engine->assign([
'this' => $this,
'children' => $children,
'size' => $size,
'design' => $design,
'showLangSwitch' => $showLangSwitch,
'LangSwitch' => $LangSwitch
]);
return $Engine->fetch(dirname(__FILE__).'/FloatedNav.html');
}
}