<?php
global $site;
?>
<ul <? if ( !$this -> _step && !$this -> _type ) echo 'class="dropdown"';?> id="menu_<?= $this -> _menu_id . '_' . $this->_step;?>">
  <?
  if ( is_array( $this -> _pages ) ) foreach ( $this -> _pages as $site_tmp )
  {
    ?>
    <li class="menu_li_<?= $this -> _menu_id . '_' . $this -> _step;?>">
      <?
      switch( $site_tmp -> _values['id_page_type'] )
      {
        case 8:
          $link = $site_tmp -> _values['link'];
        break;
        case 9:
          $link = 'rejestracja';
        break;
        case 10:
          $link = 'wyszukiwarka';
        break;
        case 11:
          $link = 'mapa_strony';
        break;
        default:
          if ( $site_tmp -> _values['seo_link'] )
            $link = $site_tmp -> _values['seo_link'];          
          else
            $link = 's,' . $site_tmp -> _values['id'] . ',' . \System::seo( $site_tmp -> _values['title'] );
        break;
      }

      echo '<a href="' . $link . '"';
      if ( $site_tmp -> _values['id'] == $site -> _values['id'] )
        echo ' class="menu_active menu_link_' . $this -> _menu_id . '_' . $this -> _step . '"';
      else
        echo ' class="menu_inactive menu_link_' . $this -> _menu_id . '_' . $this -> _step . '"';
      echo ' id="menu_link_' . $this -> _menu_id . '_' . $site_tmp -> _values['id'] . '" title="' . ucfirst( $site_tmp -> _values['title'] ) . '">';
        echo ucfirst( $site_tmp -> _values['title'] );
      echo '</a>';

      if ( is_array( $site_tmp -> _values['subpages'] ) )
        echo \menu\VMenu::drawSubpages( $site_tmp -> _values['subpages'], $this -> _menu_id, $this -> _step + 1 );
      ?>
    </li>
    <?
  }
  ?>
</ul>
