<?php
namespace JetApplicationModule\Admin\ManageAccess\Administrators\Users;

use Jet\UI;

use Jet\MVC_View;
use Jet\UI_button;

/**
 * @var MVC_View $this
 * @var Listing $listing
 */
$listing = $this->getRaw( 'listing' );

$items_count = $listing->getGrid()->getPaginator()->getDataItemsCount();

if(
	!$listing->getFilterWhere() ||
	$items_count<1 || $items_count>50
) {
	return;
}

$router = $this->getController()->getControllerRouter();
$grid = $listing->getGrid();
?>
<tr>
	<td colspan="<?=count( $grid->getColumns() )?>" class="toolbar">
		<?php foreach($listing->getOperations() as $operation):
			$URI = $router->getAction('bulk_operation_'.$operation->getKey())->URI();
			if(!$URI) {
				continue;
			}
			
			echo UI::button( $operation->getTitle() )->setUrl($URI)->setIcon($operation->getIcon())->setClass( UI_button::CLASS_INFO );
			
		endforeach; ?>
	</td>
</tr>


