<?
global $gdb;

ob_start();
?>
  <ol class="sortable" id="article-list">
    <?
      if ( is_array( $this -> products ) ) foreach ( $this -> products as $product )
      {
        ?>
          <li id="list_<?= $product['product_id'];?>">
            <div class="content <? if ( !$product['status'] ) echo 'text-danger';?>"><button type="button" class="disclose layout-tree-toggle" aria-expanded="false" title="Przesuń"><i class="fa fa-arrows"></i></button> <?= $product['name'];?></div>
          </li>
        <?
      }
    ?>
  </ol>
<?
$out = ob_get_clean();

$grid = new \gridEdit;
$grid -> gdb_opt          = $gdb;
$grid -> include_plugins  = true;
$grid -> default_buttons  = false;
$grid -> external_code    = $out;
$grid -> title            = 'Lista produktów';
$grid -> buttons          = [ 
                              [ 
                                'label' => 'Wstecz', 
                                'url'   => '/admin/shop_category/view_list/', 
                                'icon'  => 'fa-reply',
                                'class' => 'btn-dark'
                              ]
                            ];
echo $grid -> draw();
?>
<?= \Tpl::view( 'shop-category/category-products-custom-script', [ 'category_id' => $this -> category_id ] ); ?>