<? if ( is_array( $this -> categories ) ):?>
  <ol>
    <? foreach ( $this -> categories as $category ):?>
    <li id="list_<?= $category['id'];?>" class="list_<?= $category['id'];?>" category="<?= $category['id'];?>">
      <div class="context_0 content content_menu">
        <button type="button" class="disclose layout-tree-toggle" aria-expanded="false" title="Rozwin / zwin">
          <i class="fa fa-caret-right"></i>
        </button>
        <? if ( !$category['status'] ) echo '<i class="fa fa-ban fa-lg text-danger" title="Kategoria nieaktywna"></i>';?> 
        <b><?= $category['languages'][$this -> dlang]['title'];?></b>
        <div class="btn-group ml20 pull-right">
          <a href="#" title="Wybierz kategorię" class="btn btn-sm btn-system button category-select" category-title="<?= $category['languages'][$this -> dlang]['title'];?>" category-id="<?= $category['id'];?>">
            <i class="fa fa-check"></i> <span class="hidden-xs">wybierz</span>
          </a>
        </div>
      </div>
      <?= \Tpl::view( 'shop-category/subcategory-browse-list', [
              'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
              'level' => $this -> level + 1,
              'dlang' => $this -> dlang
            ] );?>
    </li>
    <? endforeach;?>
  </ol>
<? endif;?>