diff --git a/admin-dev/themes/default/admin.css b/admin-dev/themes/default/admin.css index 8543e37fc..3a9f2f07e 100644 --- a/admin-dev/themes/default/admin.css +++ b/admin-dev/themes/default/admin.css @@ -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 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;} -.toolbar_btn span{font-size:small;margin-top:5px;text-align:center} +.table_grid{width:100%} diff --git a/admin-dev/themes/template/categories/list_header.tpl b/admin-dev/themes/template/categories/list_header.tpl index d4d6394ae..b58e775fd 100644 --- a/admin-dev/themes/template/categories/list_header.tpl +++ b/admin-dev/themes/template/categories/list_header.tpl @@ -63,10 +63,10 @@   {l s='Home'} >  - {foreach $categories_tree as $key => $category} + {foreach $categories_tree key=key item=category} + {if $key != 0} - - {$category.name} >  + {l s='edit'} {$category.name} >  {else} {$category.name} @@ -75,24 +75,32 @@ {/if} -

{l s='Categories'}

-

- {if $list_total == 0} - {l s='There are no subcategories in '} "{$categories_name}" - {else} - {$list_total}  - {if $list_total < 1} - {l s='subcategories'} + +
+ +
+

{l s='Categories'} {$categories_name}

+ {if $list_total == 0} + {l s='There are no subcategories in '} "{$categories_name}" {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 $add_button} -
{l s='Add new'}

- {/if} + +  
diff --git a/admin-dev/themes/template/customers/form.tpl b/admin-dev/themes/template/customers/form.tpl index c65af23db..382216c18 100644 --- a/admin-dev/themes/template/customers/form.tpl +++ b/admin-dev/themes/template/customers/form.tpl @@ -54,8 +54,22 @@ {/if} +
+ +
{* todo : what to display as title for each items (table_lang.name ? *} +

{$current_obj_name|default:' '}

+
+
{if isset($fields.title)}

{$fields.title}

{/if} - + {if $form_id} {/if} diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index ef93b8d8c..57a7cbb6a 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -54,8 +54,22 @@ {/if} +
+ +
{* todo : what to display as title for each items (table_lang.name ? *} +

{$current_obj_name|default:' '}

+
+
{if isset($fields.title)}

{$fields.title}

{/if} - + {if $form_id} {/if} @@ -235,9 +249,9 @@ value="" /> {elseif $input.type == 'group'} {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'} - {include file='form_shop.tpl'} + {include file='helper/form/form_shop.tpl'} {elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
diff --git a/admin-dev/themes/template/helper/list/list_header.tpl b/admin-dev/themes/template/helper/list/list_header.tpl index 0b8b320c5..bb9626532 100644 --- a/admin-dev/themes/template/helper/list/list_header.tpl +++ b/admin-dev/themes/template/helper/list/list_header.tpl @@ -56,15 +56,26 @@ }); - {if $add_button} -
{l s='Add new'}

- {/if} +
+ +
{* todo : what to display as title for each items (table_lang.name ? *} +

{$current_obj_name|default:' '}

+
+
  {/if}{* End if simple_header *} - +
{if !$simple_header}
diff --git a/admin-dev/themes/template/home/content.tpl b/admin-dev/themes/template/home/content.tpl index 3a113c1a7..43ac4fbde 100644 --- a/admin-dev/themes/template/home/content.tpl +++ b/admin-dev/themes/template/home/content.tpl @@ -62,6 +62,7 @@ $(document).ready(function() { }); }); +
{/if}
    diff --git a/classes/AdminController.php b/classes/AdminController.php index 4439b8d45..5d3f0fd98 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -718,6 +718,19 @@ class AdminControllerCore extends Controller */ 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); } @@ -1119,6 +1132,7 @@ class AdminControllerCore extends Controller } $helper->actions = $this->actions; + $helper->toolbar_btn = $this->toolbar_btn; $helper->bulk_actions = $this->bulk_actions; $helper->currentIndex = self::$currentIndex; $helper->className = $this->className; diff --git a/classes/HelperList.php b/classes/HelperList.php index 36598e64f..4adf72c8b 100644 --- a/classes/HelperList.php +++ b/classes/HelperList.php @@ -286,7 +286,6 @@ class HelperListCore extends Helper 'fields_display' => $this->fieldsDisplay, 'list' => $this->_list, 'actions' => $this->actions, - 'toolbar_btn' => $this->toolbar_btn, 'no_link' => $this->no_link, 'current_index' => $this->currentIndex, 'view' => in_array('view', $this->actions), @@ -528,7 +527,7 @@ class HelperListCore extends Helper 'id_cat' => $id_cat, 'shop_link_type' => $this->shopLinkType, '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_dnd' => isset($table_dnd) ? $table_dnd : null, 'name' => isset($name) ? $name : null, diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 190fd3d5d..561eed879 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -123,11 +123,28 @@ class AdminCategoriesControllerCore extends AdminController public function initView() { + $this->initToolbar(); $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() { + $obj = $this->loadObject(true); $selected_cat = array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1)); if (sizeof($selected_cat) > 0) {