HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
TbDropdown.php
Go to the documentation of this file.
1
<?php
11
Yii::import(
'booster.widgets.TbBaseMenu'
);
12
20
class
TbDropdown
extends
TbBaseMenu
{
26
public
function
init
() {
27
28
parent::init
();
29
30
if
(isset($this->htmlOptions[
'class'
])) {
31
$this->htmlOptions[
'class'
] .=
' dropdown-menu'
;
32
}
else
{
33
$this->htmlOptions[
'class'
] =
'dropdown-menu'
;
34
}
35
}
36
47
protected
function
renderMenuItem
($item) {
48
49
if
(isset($item[
'icon'
])) {
50
if
(strpos($item[
'icon'
],
'icon'
) ===
false
&& strpos($item[
'icon'
],
'fa'
) ===
false
) {
51
$item[
'icon'
] =
'icon-'
. implode(
' icon-'
, explode(
' '
, $item[
'icon'
]));
52
}
53
54
$item[
'label'
] =
'<i class="'
. $item[
'icon'
] .
'"></i> '
. $item[
'label'
];
55
}
56
57
if
(!isset($item[
'linkOptions'
])) {
58
$item[
'linkOptions'
] = array();
59
}
60
61
// TODO: Bootstrap 3 does not support submenu
62
// http://stackoverflow.com/questions/18023493/bootstrap-3-dropdown-sub-menu-missing
63
// we may use this to support it
64
/* if (isset($item['items']) && !empty($item['items']) && empty($item['url'])) {
65
$item['url'] = '#';
66
} */
67
68
$item[
'linkOptions'
][
'tabindex'
] = -1;
69
70
if
(isset($item[
'url'
])) {
71
return
CHtml::link($item[
'label'
], $item[
'url'
], $item[
'linkOptions'
]);
72
}
else
{
73
return
CHtml::link($item[
'label'
],
'#'
, array());
74
}
75
}
76
83
public
function
getDividerCssClass
()
84
{
85
return
'divider'
;
86
}
87
94
public
function
getDropdownCssClass
()
95
{
96
return
'dropdown-submenu'
;
97
}
98
105
public
function
isVertical
()
106
{
107
return
true
;
108
}
109
}
app
protected
extensions
booster
widgets
TbDropdown.php
Generated on Tue Jun 30 2015 20:12:33 for HCE Project DC service web UI by
1.8.1.2