Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
8a1bf045
Commit
8a1bf045
authored
Aug 26, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #790: added visible for Nav and Dropdown
parent
c835f17d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
Dropdown.php
framework/yii/bootstrap/Dropdown.php
+6
-1
Nav.php
framework/yii/bootstrap/Nav.php
+6
-1
No files found.
framework/yii/bootstrap/Dropdown.php
View file @
8a1bf045
...
...
@@ -26,6 +26,7 @@ class Dropdown extends Widget
*
* - label: string, required, the label of the item link
* - url: string, optional, the url of the item link. Defaults to "#".
* - visible: boolean, optional, whether this menu item is visible. Defaults to true.
* - linkOptions: array, optional, the HTML attributes of the item link.
* - options: array, optional, the HTML attributes of the item.
*/
...
...
@@ -64,7 +65,11 @@ class Dropdown extends Widget
protected
function
renderItems
(
$items
)
{
$lines
=
array
();
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$i
=>
$item
)
{
if
(
isset
(
$item
[
'visible'
])
&&
!
$item
[
'visible'
])
{
unset
(
$items
[
$i
]);
continue
;
}
if
(
is_string
(
$item
))
{
$lines
[]
=
$item
;
continue
;
...
...
framework/yii/bootstrap/Nav.php
View file @
8a1bf045
...
...
@@ -60,6 +60,7 @@ class Nav extends Widget
*
* - label: string, required, the nav item label.
* - url: optional, the item's URL. Defaults to "#".
* - visible: boolean, optional, whether this menu item is visible. Defaults to true.
* - linkOptions: array, optional, the HTML attributes of the item's link.
* - options: array, optional, the HTML attributes of the item container (LI).
* - active: boolean, optional, whether the item should be on active state or not.
...
...
@@ -123,7 +124,11 @@ class Nav extends Widget
public
function
renderItems
()
{
$items
=
array
();
foreach
(
$this
->
items
as
$item
)
{
foreach
(
$this
->
items
as
$i
=>
$item
)
{
if
(
isset
(
$item
[
'visible'
])
&&
!
$item
[
'visible'
])
{
unset
(
$items
[
$i
]);
continue
;
}
$items
[]
=
$this
->
renderItem
(
$item
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment