[+] BO Better filters display

This commit is contained in:
jeromenadaud
2013-08-01 16:59:08 +02:00
parent 047ab9d681
commit a29fa2dd09
2 changed files with 15 additions and 12 deletions
@@ -77,6 +77,7 @@
<fieldset class="col-lg-12">
{block name="override_header"}{/block}
{if $show_filters}
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
<span class="pull-right">
<button type="submit" name="submitReset{$table}" class="btn btn-default btn-small">
@@ -86,6 +87,7 @@
<i class="icon-filter"></i> {l s='Filter'}
</button>
</span>
{/if}
{/if}
<table
class="table table-hover"
@@ -131,7 +133,7 @@
<th>{l s='Actions'}{if !$simple_header}{/if}</th>
{/if}
</tr>
{if !$simple_header}
{if !$simple_header && $show_filters}
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
<td class="center">
{if $has_bulk_actions}
+12 -11
View File
@@ -574,31 +574,32 @@ class HelperListCore extends Helper
$this->fields_list[$key] = $params;
}
if (count($this->_list) <= 1)
$has_value = false;
foreach ($this->fields_list as $key => $field)
{
$simple_header = true;
$bulk_actions = array();
}
else
{
$simple_header = $this->simple_header;
$bulk_actions = $this->bulk_actions;
if (isset($field['value']) && $field['value'] !== false)
{
$has_value = true;
break;
}
}
Context::getContext()->smarty->assign(array(
'page' => $page,
'simple_header' => $simple_header,
'simple_header' => $this->simple_header,
'total_pages' => $total_pages,
'selected_pagination' => $selected_pagination,
'pagination' => $this->_pagination,
'list_total' => $this->listTotal,
'token' => $this->token,
'table' => $this->table,
'bulk_actions' => $bulk_actions
'bulk_actions' => (count($this->_list) <= 1 && !$has_value) ? array() : $this->bulk_actions
));
$this->header_tpl->assign(array_merge($this->tpl_vars, array(
'title' => $this->title,
'show_filters' => (count($this->_list) <= 1 && !$has_value) ? false : true,
'show_toolbar' => $this->show_toolbar,
'toolbar_scroll' => $this->toolbar_scroll,
'toolbar_btn' => $this->toolbar_btn,
@@ -613,7 +614,7 @@ class HelperListCore extends Helper
'id_cat' => $id_cat,
'shop_link_type' => $this->shopLinkType,
'has_actions' => !empty($this->actions),
'has_bulk_actions' => !empty($bulk_actions),
'has_bulk_actions' => (count($this->_list) <= 1 && !$has_value) ? false : !empty($this->bulk_actions),
'table_id' => isset($table_id) ? $table_id : null,
'table_dnd' => isset($table_dnd) ? $table_dnd : null,
'name' => isset($name) ? $name : null,