update
This commit is contained in:
@@ -6,6 +6,7 @@ if ( is_array( $this -> pages ) ) {
|
||||
|
||||
foreach ( $this -> pages as $page ) {
|
||||
$url = "";
|
||||
$hasChildren = is_array( $page['pages'] ) && !empty( $page['pages'] );
|
||||
|
||||
if ( $page['page_type'] == 3 ) {
|
||||
$page['language']['link'] ? $url = $page['language']['link'] : $url = '#';
|
||||
@@ -26,10 +27,10 @@ if ( is_array( $this -> pages ) ) {
|
||||
if ( $page['id'] == $this -> current_page )
|
||||
echo ' active';
|
||||
|
||||
if ( is_array( $page['pages'] ) and in_array( $this -> current_page, $children ) )
|
||||
if ( $hasChildren and is_array( $children ) and in_array( $this -> current_page, $children ) )
|
||||
echo ' open';
|
||||
|
||||
if ( is_array( $page['pages'] ) )
|
||||
if ( $hasChildren )
|
||||
echo ' parent';
|
||||
|
||||
echo '">';
|
||||
@@ -40,16 +41,17 @@ if ( is_array( $this -> pages ) ) {
|
||||
if ( $page['language']['noindex'] )
|
||||
echo 'rel="nofollow"';
|
||||
echo ' title="' . $page['language']['title'] . '"';
|
||||
if ( is_array( $page['pages'] ) )
|
||||
if ( $hasChildren )
|
||||
echo "class='menu-trigger'";
|
||||
echo '>';
|
||||
echo $page['language']['title'];
|
||||
echo '</a>';
|
||||
if ( is_array( $page['pages'] ) )
|
||||
if ( $hasChildren )
|
||||
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
|
||||
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
|
||||
if ( $hasChildren )
|
||||
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user