// Helper now can uses toolbar
// bugfix in category listing and editing // display fix in adminHome
This commit is contained in:
@@ -145,5 +145,4 @@ form.defaultForm{ background-color:#ebedf4; border:1px solid #ccced7; min-heig
|
|||||||
|
|
||||||
ul.cc_button {float:right;margin:0;padding:6px 0;}
|
ul.cc_button {float:right;margin:0;padding:6px 0;}
|
||||||
ul.cc_button li {float:left;text-decoration: none;list-style: none;font-size:12px;padding:5px 0;}
|
ul.cc_button li {float:left;text-decoration: none;list-style: none;font-size:12px;padding:5px 0;}
|
||||||
.toolbar_btn {border:2px outset black;display:block;height:50px;margin:2px;padding:3px 2px 1px 2px;width:60px;}
|
.table_grid{width:100%}
|
||||||
.toolbar_btn span{font-size:small;margin-top:5px;text-align:center}
|
|
||||||
|
|||||||
@@ -63,10 +63,10 @@
|
|||||||
<a href="{$currentIndex}&id_category=1&viewcategory&token={$token}">
|
<a href="{$currentIndex}&id_category=1&viewcategory&token={$token}">
|
||||||
<img src="../img/admin/home.gif" alt="" /> {l s='Home'} >
|
<img src="../img/admin/home.gif" alt="" /> {l s='Home'} >
|
||||||
</a>
|
</a>
|
||||||
{foreach $categories_tree as $key => $category}
|
{foreach $categories_tree key=key item=category}
|
||||||
|
<a href="{$currentIndex}&id_category={$category.id_category}&{if $category.id_category == 1}viewcategory{else}addcategory{/if}&token={$token}">
|
||||||
{if $key != 0}
|
{if $key != 0}
|
||||||
<a href="{$currentIndex}&id_category={$category.id_category}&viewcategory&token={$token}">
|
<img src="../img/admin/edit.gif" alt="{l s='edit'}" /> {$category.name} >
|
||||||
<img src="../img/admin/edit.gif" alt="" /> {$category.name} >
|
|
||||||
</a>
|
</a>
|
||||||
{else}
|
{else}
|
||||||
<img src="../img/admin/edit.gif" alt="" /> {$category.name}
|
<img src="../img/admin/edit.gif" alt="" /> {$category.name}
|
||||||
@@ -75,24 +75,32 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>{l s='Categories'}</h2>
|
|
||||||
|
|
||||||
<h3>
|
|
||||||
{if $list_total == 0}
|
<div class="toolbarBox">
|
||||||
{l s='There are no subcategories in '} "{$categories_name}"
|
<ul class="cc_button">
|
||||||
{else}
|
{foreach from=$toolbar_btn item=btn key=k}
|
||||||
{$list_total}
|
<li>
|
||||||
{if $list_total < 1}
|
<a class="toolbar_btn" href="{$btn.href}" title="{$btn.desc}">
|
||||||
{l s='subcategories'}
|
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>{$btn.desc}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<div class="pageTitle">
|
||||||
|
<h3>{l s='Categories'}<span id="current_obj" style="font-weight:normal"> {$categories_name}</span></h3>
|
||||||
|
{if $list_total == 0}
|
||||||
|
{l s='There are no subcategories in '} "{$categories_name}"
|
||||||
{else}
|
{else}
|
||||||
{l s='subcategory'} {l s='in category'} "{$categories_name}"
|
{$list_total}
|
||||||
|
{if $list_total < 1}
|
||||||
|
{l s='subcategories'}
|
||||||
|
{else}
|
||||||
|
{l s='subcategory'} {l s='in category'} "{$categories_name}"
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
</div>
|
||||||
</h3>
|
</div>
|
||||||
|
|
||||||
{if $add_button}
|
|
||||||
<br /><a href="{$currentIndex}&add{$table}&token={$token}"><img src="../img/admin/add.gif" border="0" /> {l s='Add new'}</a><br /><br />
|
|
||||||
{/if}
|
|
||||||
<a name="{$table}"> </a>
|
<a name="{$table}"> </a>
|
||||||
|
|
||||||
<form method="post" action="{$action}" class="form">
|
<form method="post" action="{$action}" class="form">
|
||||||
|
|||||||
@@ -54,8 +54,22 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="../js/form.js"></script>
|
<script type="text/javascript" src="../js/form.js"></script>
|
||||||
{/if}
|
{/if}
|
||||||
|
<div class="toolbarBox">
|
||||||
|
<ul class="cc_button">
|
||||||
|
{foreach from=$toolbar_btn item=btn key=k}
|
||||||
|
<li>
|
||||||
|
<a class="toolbar_btn" href="{$btn.href}" title="{$btn.desc}">
|
||||||
|
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>{$btn.desc}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<div class="pageTitle">{* todo : what to display as title for each items (table_lang.name ? *}
|
||||||
|
<h3><span id="current_obj" style="font-weight: normal;">{$current_obj_name|default:' '}</span></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
|
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
|
||||||
<form action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
|
<form class="defaultForm" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
|
||||||
{if $form_id}
|
{if $form_id}
|
||||||
<input type="hidden" name="id_{$table}" value="{$form_id}" />
|
<input type="hidden" name="id_{$table}" value="{$form_id}" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -54,8 +54,22 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="../js/form.js"></script>
|
<script type="text/javascript" src="../js/form.js"></script>
|
||||||
{/if}
|
{/if}
|
||||||
|
<div class="toolbarBox">
|
||||||
|
<ul class="cc_button">
|
||||||
|
{foreach from=$toolbar_btn item=btn key=k}
|
||||||
|
<li>
|
||||||
|
<a class="toolbar_btn" href="{$btn.href}" title="{$btn.desc}">
|
||||||
|
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>{$btn.desc}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<div class="pageTitle">{* todo : what to display as title for each items (table_lang.name ? *}
|
||||||
|
<h3><span id="current_obj" style="font-weight: normal;">{$current_obj_name|default:' '}</span></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
|
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
|
||||||
<form action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
|
<form class="defaultForm" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
|
||||||
{if $form_id}
|
{if $form_id}
|
||||||
<input type="hidden" name="id_{$table}" value="{$form_id}" />
|
<input type="hidden" name="id_{$table}" value="{$form_id}" />
|
||||||
{/if}
|
{/if}
|
||||||
@@ -235,9 +249,9 @@
|
|||||||
value="" />
|
value="" />
|
||||||
{elseif $input.type == 'group'}
|
{elseif $input.type == 'group'}
|
||||||
{assign var=groups value=$input.values}
|
{assign var=groups value=$input.values}
|
||||||
{include file='form_group.tpl'}
|
{include file='helper/form/form_group.tpl'}
|
||||||
{elseif $input.type == 'shop' OR $input.type == 'group_shop'}
|
{elseif $input.type == 'shop' OR $input.type == 'group_shop'}
|
||||||
{include file='form_shop.tpl'}
|
{include file='helper/form/form_shop.tpl'}
|
||||||
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
|
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
|
||||||
<label>{l s='Shop association:'}</label>
|
<label>{l s='Shop association:'}</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
|
|||||||
@@ -56,15 +56,26 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{if $add_button}
|
<div class="toolbarBox">
|
||||||
<br /><a href="{$currentIndex}&add{$table}&token={$token}"><img src="../img/admin/add.gif" border="0" /> {l s='Add new'}</a><br /><br />
|
<ul class="cc_button">
|
||||||
{/if}
|
{foreach from=$toolbar_btn item=btn key=k}
|
||||||
|
<li>
|
||||||
|
<a class="toolbar_btn" href="{$btn.href}" title="{$btn.desc}">
|
||||||
|
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>{$btn.desc}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
<div class="pageTitle">{* todo : what to display as title for each items (table_lang.name ? *}
|
||||||
|
<h3><span id="current_obj" style="font-weight: normal;">{$current_obj_name|default:' '}</span></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<a name="{$table}"> </a>
|
<a name="{$table}"> </a>
|
||||||
|
|
||||||
<form method="post" action="{$action}" class="form">
|
<form method="post" action="{$action}" class="form">
|
||||||
{/if}{* End if simple_header *}
|
{/if}{* End if simple_header *}
|
||||||
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
|
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
|
||||||
<table>
|
<table class="table_grid">
|
||||||
{if !$simple_header}
|
{if !$simple_header}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="vertical-align: bottom;">
|
<td style="vertical-align: bottom;">
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<div class="clear"></div>
|
||||||
{/if}
|
{/if}
|
||||||
<div id="column_left">
|
<div id="column_left">
|
||||||
<ul class="F_list clearfix">
|
<ul class="F_list clearfix">
|
||||||
|
|||||||
@@ -718,6 +718,19 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public function initToolbar()
|
public function initToolbar()
|
||||||
{
|
{
|
||||||
|
switch ($this->display)
|
||||||
|
{
|
||||||
|
// @todo defining default buttons
|
||||||
|
case 'add':
|
||||||
|
case 'edit':
|
||||||
|
case 'options':
|
||||||
|
break;
|
||||||
|
default: // list
|
||||||
|
$this->toolbar_btn['new'] = array(
|
||||||
|
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||||
|
'desc' => $this->l('Add new')
|
||||||
|
);
|
||||||
|
}
|
||||||
$this->context->smarty->assign('toolbar_btn', $this->toolbar_btn);
|
$this->context->smarty->assign('toolbar_btn', $this->toolbar_btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1119,6 +1132,7 @@ class AdminControllerCore extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$helper->actions = $this->actions;
|
$helper->actions = $this->actions;
|
||||||
|
$helper->toolbar_btn = $this->toolbar_btn;
|
||||||
$helper->bulk_actions = $this->bulk_actions;
|
$helper->bulk_actions = $this->bulk_actions;
|
||||||
$helper->currentIndex = self::$currentIndex;
|
$helper->currentIndex = self::$currentIndex;
|
||||||
$helper->className = $this->className;
|
$helper->className = $this->className;
|
||||||
|
|||||||
@@ -286,7 +286,6 @@ class HelperListCore extends Helper
|
|||||||
'fields_display' => $this->fieldsDisplay,
|
'fields_display' => $this->fieldsDisplay,
|
||||||
'list' => $this->_list,
|
'list' => $this->_list,
|
||||||
'actions' => $this->actions,
|
'actions' => $this->actions,
|
||||||
'toolbar_btn' => $this->toolbar_btn,
|
|
||||||
'no_link' => $this->no_link,
|
'no_link' => $this->no_link,
|
||||||
'current_index' => $this->currentIndex,
|
'current_index' => $this->currentIndex,
|
||||||
'view' => in_array('view', $this->actions),
|
'view' => in_array('view', $this->actions),
|
||||||
@@ -528,7 +527,7 @@ class HelperListCore extends Helper
|
|||||||
'id_cat' => $id_cat,
|
'id_cat' => $id_cat,
|
||||||
'shop_link_type' => $this->shopLinkType,
|
'shop_link_type' => $this->shopLinkType,
|
||||||
'has_actions' => (boolean)count($this->actions),
|
'has_actions' => (boolean)count($this->actions),
|
||||||
'add_button' => in_array('edit', $this->actions) && (!isset($this->noAdd) || !$this->noAdd),
|
'toolbar_btn' => $this->toolbar_btn,
|
||||||
'table_id' => isset($table_id) ? $table_id : null,
|
'table_id' => isset($table_id) ? $table_id : null,
|
||||||
'table_dnd' => isset($table_dnd) ? $table_dnd : null,
|
'table_dnd' => isset($table_dnd) ? $table_dnd : null,
|
||||||
'name' => isset($name) ? $name : null,
|
'name' => isset($name) ? $name : null,
|
||||||
|
|||||||
@@ -123,11 +123,28 @@ class AdminCategoriesControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initView()
|
public function initView()
|
||||||
{
|
{
|
||||||
|
$this->initToolbar();
|
||||||
$this->content .= $this->initList();
|
$this->content .= $this->initList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function initToolbar()
|
||||||
|
{
|
||||||
|
if (empty($this->display))
|
||||||
|
$this->toolbar_btn['new'] = array(
|
||||||
|
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||||
|
'desc' => $this->l('Add new')
|
||||||
|
);
|
||||||
|
if ($this->display == 'view')
|
||||||
|
$this->toolbar_btn['new'] = array(
|
||||||
|
'href' => self::$currentIndex.'&add'.$this->table.'&id_parent='.Tools::getValue('id_category').'&token='.$this->token,
|
||||||
|
'desc' => $this->l('Add new')
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function initForm()
|
public function initForm()
|
||||||
{
|
{
|
||||||
|
$obj = $this->loadObject(true);
|
||||||
$selected_cat = array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1));
|
$selected_cat = array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1));
|
||||||
if (sizeof($selected_cat) > 0)
|
if (sizeof($selected_cat) > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user