File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed
Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 11/vendor
22composer.phar
33composer.lock
4- .DS_Store
4+ .DS_Store
5+ .idea
Original file line number Diff line number Diff line change @@ -79,6 +79,34 @@ public static function renderNavTabsDropdowns( $structure = array(), $depth = 1
7979 if ( $ depth === 1 ) return ob_get_clean ();
8080 }
8181
82+ /**
83+ * Render bootstrap menu
84+ *
85+ * @param array $structure
86+ * @param int $depth
87+ * @return string
88+ */
89+ public static function renderBootstrapNav ($ structure = array (), $ depth = 1 )
90+ {
91+ if ( $ depth === 1 ) ob_start ();
92+ foreach ( $ structure as $ level ) :
93+ $ class = preg_replace ( '/current/ ' , 'active ' , $ level ['class ' ] );
94+ echo '<li class=" ' . $ class . ' ' . ( empty ( $ level ['children ' ] ) ? '' : 'dropdown ' ) . '"> ' ;
95+ $ icon = $ level ['icon ' ] ? '<i class=" ' .$ level ['icon ' ].'"></i> ' : '' ;
96+ if ( ! empty ( $ level ['children ' ] ) ) :
97+
98+ echo '<a href="#" > ' . $ icon . $ level ['text ' ] . ' <span class="fa fa-chevron-down"></span></a> ' ;
99+ echo '<ul class="nav child_menu" role="menu"> ' ;
100+ echo self ::renderNavTabsDropdowns ( $ level ['children ' ], ($ depth +1 ) );
101+ echo '</ul> ' ;
102+ else :
103+ echo '<a href=" ' . $ level ['URL ' ] . '"> ' . $ icon . $ level ['text ' ] . '</a> ' ;
104+ endif ;
105+ echo '</li> ' ;
106+ endforeach ;
107+ if ( $ depth === 1 ) return ob_get_clean ();
108+ }
109+
82110}
83111
84- ?>
112+ ?>
You can’t perform that action at this time.
0 commit comments