<?
if ( is_array( $this -> pages ) )
{
  
  echo '<ul class="level-' . $this -> level . '" id="submenu-' . $this -> page_id . '">';
    foreach ( $this -> pages as $page )
    {
      $page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \Shared\Helpers\Helpers::seo( $page['language']['title'] );
      
      if ( $page['page_type'] == 3 and $page['link'] )
        $url = $page['link'];
      
      echo '<li id="link-' . $page['id'] . '" class="'; if ( $page['id'] == $this -> current_page ) echo ' active'; echo '">';
        echo '<a href="';        
          if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
            echo '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' );
          echo $url . '"'; if ( $page['language']['noindex'] ) echo 'rel="nofollow"'; echo ' title="' . $page['language']['title'] . '"'; if ( is_array( $page['pages'] ) ) echo "class='menu-trigger'";  echo '>';
          echo $page['language']['title'];
          if ( is_array( $page['pages'] ) and $this -> level == 0 )
            echo '<i class="fa fa-chevron-down"></i>';
        echo '</a>';
        echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
      echo '</li>';
    }
  echo '</ul>';
}
