<? if ( is_array( $this -> pages ) ):?>
  <ol>
    <? foreach ( $this -> pages as $page ):?>
      <li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="list_<?= $page['id'];?>" menu="<?= $page['menu_id'];?>">
        <div class="content">
          <span class="disclose"><span></span></span>
          <? if ( !$page['status'] ) echo '<i class="fa fa-ban fa-lg text-danger" title="Strona nieaktywna"></i>';?> 
          <? if ( $page['start'] ) echo '<i class="fa fa-star fa-lg text-system" title="Strona startowa"></i>';?>
          <?= mb_substr( $page['title'], 0, 75, 'UTF-8' );?><? if ( mb_strlen( $page['title'], 'utf-8' ) > 75 ) echo '...';?>
          <? 
            if ( is_array( $page['languages'] ) ):
              echo '<div class="btn-group flags" style="display: inline-block;">';
                foreach ( $page['languages'] as $lg )
                  echo '<img src="/admin/css/lang-' . $lg['lang_id'] . '.jpg" />';
              echo '</div>';              
            endif;
          ?>
          <? if ( $this -> step < 3 ):?>
            <div class="btn-group ml20 pull-right">
              <a href="/admin/pages/page_edit/id=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Edytuj stronę" class="btn btn-sm btn-system">
                <i class="fa fa-file-text"></i> <span class="hidden-xs">Edytuj stronę</span>
              </a>
              <a href="#" title="Usuń stronę" class="btn btn-sm btn-danger page-delete" page-id="<?= $page['id'];?>">
                <i class="fa fa-trash"></i> <span class="hidden-xs">Usuń stronę</span>
              </a>
              <a href="/admin/pages/page_articles/id=<?= $page['id'];?>" title="Lista artykułów" class="btn btn-sm btn-info" page-id="<?= $page['id'];?>">
                <i class="fa fa-bars"></i> <span class="hidden-xs">Lista artykułów</span>
              </a>
              <a href="/admin/pages/page_edit/pid=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Dodaj podstronę" class="btn btn-sm btn-success">
                <i class="fa fa-plus-circle"></i> <span class="hidden-xs">Dodaj podstronę</span>
              </a>
            </div>
          <? else:?>
            <div class="btn-group ml20 pull-right">
              <a href="/admin/pages/page_edit/id=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Edytuj stronę" class="btn btn-sm btn-system">
                <i class="fa fa-file-text"></i> <span class="hidden-xs">Edytuj stronę</span>
              </a>
              <a href="#" title="Usuń stronę" class="btn btn-sm btn-danger page-delete" page-id="<?= $page['id'];?>">
                <i class="fa fa-trash"></i> <span class="hidden-xs">Usuń stronę</span>
              </a>
              <a href="/admin/pages/page_articles/id=<?= $page['id'];?>" title="Lista artykułów" class="btn btn-sm btn-info" page-id="<?= $page['id'];?>">
                <i class="fa fa-bars"></i> <span class="hidden-xs">Lista artykułów</span>
              </a>
            </div>
          <? endif;?>
        </div>
        <?
        if ( is_array( $page['subpages'] ) )
          echo \admin\view\Pages::subpages_list( $page['subpages'], $page['id'], $this -> step + 1 );
        ?>
      </li>
    <? endforeach;?>
  </ol>
<? endif;?>