diff --git a/admin-dev/themes/default/admin.css b/admin-dev/themes/default/admin.css index ca2f3ae0b..8deeb6e7e 100644 --- a/admin-dev/themes/default/admin.css +++ b/admin-dev/themes/default/admin.css @@ -169,4 +169,5 @@ form.defaultForm{ background-color:#ebedf4; border:1px solid #ccced7; min-heig .product-tab-content h4.tab { display:none;} /*FOOTER*/ -#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666} \ No newline at end of file +#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666} +div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;} diff --git a/admin-dev/themes/template/footer.tpl b/admin-dev/themes/template/footer.tpl index 0405396c0..a2079f88e 100644 --- a/admin-dev/themes/template/footer.tpl +++ b/admin-dev/themes/template/footer.tpl @@ -37,9 +37,9 @@ {if $iso_is_fr} Questions / Renseignements / Formations : +33 (0)1.40.18.30.04 de 09h à 18h {/if} - | {l s='Contact'} - | {l s='Bug Tracker'} - | {l s='Forum'} + | {l s='Contact'} + | {l s='Bug Tracker'} + | {l s='Forum'} @@ -53,5 +53,35 @@ } {/if} + + diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index 8cd028b8c..bd2d1caa3 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -64,7 +64,8 @@ {/if} -
+
+
{if $show_toolbar} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
@@ -75,6 +76,7 @@ {/if}
{block name="leadin"}{/block}
+
{if isset($fields.title)}

{$fields.title}

{/if}
{if $form_id} diff --git a/admin-dev/themes/template/helper/list/list_footer.tpl b/admin-dev/themes/template/helper/list/list_footer.tpl index 858109471..e360a5519 100644 --- a/admin-dev/themes/template/helper/list/list_footer.tpl +++ b/admin-dev/themes/template/helper/list/list_footer.tpl @@ -37,8 +37,3 @@
- -{* -if (isset($this->_includeTab) AND sizeof($this->_includeTab)) - echo '

'; -*} \ No newline at end of file diff --git a/admin-dev/themes/template/helper/list/list_header.tpl b/admin-dev/themes/template/helper/list/list_header.tpl index 423771a2c..ad3fba81a 100644 --- a/admin-dev/themes/template/helper/list/list_header.tpl +++ b/admin-dev/themes/template/helper/list/list_header.tpl @@ -60,7 +60,8 @@ {/if}{* End if simple_header *} {if $show_toolbar} -
+
+
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}

{block name=pageTitle} @@ -68,6 +69,7 @@ {/block}

+
{/if}
{block name="leadin"}{/block}
  diff --git a/classes/AdminController.php b/classes/AdminController.php index a84da23bd..2b220712f 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -102,6 +102,9 @@ class AdminControllerCore extends Controller /** @var array list of toolbar buttons */ protected $toolbar_btn = null; + /** @var array list of toolbar buttons */ + protected $toolbar_fix = true; + /** @var boolean set to false to hide toolbar and page title */ protected $show_toolbar = true; @@ -272,10 +275,21 @@ class AdminControllerCore extends Controller public function initToolbarTitle() { // Breadcrumbs - $tabs= array(); - $tabs= Tab::recursiveTab($this->id, $tabs); - $tabs= array_reverse($tabs); + $tabs = array(); + $tabs = Tab::recursiveTab($this->id, $tabs); + $tabs = array_reverse($tabs); $bread = ''; + switch ($this->display) + { + case 'edit': + array_pop($tabs); + $tabs[] = array('name' => sprintf($this->l('Edit %s'), $this->table)); + break; + case 'add': + array_pop($tabs); + $tabs[] = array('name' => sprintf($this->l('Add %s'), $this->table)); + break; + } // note : this should use a tpl file foreach ($tabs AS $key => $item) $bread .= ''.$item['name'].' : '; @@ -1307,8 +1321,10 @@ class AdminControllerCore extends Controller } $helper->tpl_vars = $this->tpl_list_vars; - $this->setHelperListDisplay($helper); - return $helper->generateList($this->_list, $this->fieldsDisplay); + $this->setHelperDisplay($helper); + $list = $helper->generateList($this->_list, $this->fieldsDisplay); + $this->toolbar_fix = false; + return $list; } /** @@ -1324,16 +1340,21 @@ class AdminControllerCore extends Controller * @param Helper $helper * @return void */ - public function setHelperListDisplay(Helper $helper) + public function setHelperDisplay(Helper $helper) { if (empty($this->toolbar_title)) $this->initToolbarTitle(); + // tocheck + if ($this->object && $this->object->id) + $helper->id = $this->object->id; + // @todo : move that in Helper $helper->actions = $this->actions; $helper->simple_header = $this->list_simple_header; $helper->title = $this->toolbar_title; $helper->toolbar_btn = $this->toolbar_btn; $helper->show_toolbar = $this->show_toolbar; + $helper->toolbar_fix = $this->toolbar_fix; $helper->bulk_actions = $this->bulk_actions; $helper->currentIndex = self::$currentIndex; $helper->className = $this->className; @@ -1371,19 +1392,11 @@ class AdminControllerCore extends Controller $this->getlanguages(); $helper = new HelperForm($this); $helper->override_folder = $this->tpl_folder; - $helper->currentIndex = self::$currentIndex; - $helper->token = $this->token; - $helper->table = $this->table; - $helper->identifier = $this->identifier; - $helper->id = $this->object->id; + $this->setHelperDisplay($helper); $helper->languages = $this->_languages; $helper->default_form_language = $this->default_form_language; $helper->allow_employee_form_lang = $this->allow_employee_form_lang; $helper->fields_value = $this->getFieldsValue($this->object); - $helper->toolbar_btn = $this->toolbar_btn; - $helper->title = $this->toolbar_title; - $helper->show_toolbar = $this->show_toolbar; - $helper->no_back = isset($this->no_back) ? $this->no_back : false; $helper->tpl_vars = $this->tpl_form_vars; if ($this->tabAccess['view']) { @@ -1392,7 +1405,9 @@ class AdminControllerCore extends Controller else $helper->tpl_vars['back'] = Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)); } - return $helper->generateForm($this->fields_form); + $form = $helper->generateForm($this->fields_form); + $this->toolbar_fix = false; + return $form; } } diff --git a/classes/HelperForm.php b/classes/HelperForm.php index 38df17da7..b39410e12 100644 --- a/classes/HelperForm.php +++ b/classes/HelperForm.php @@ -103,7 +103,9 @@ class HelperFormCore extends Helper 'iso' => file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en', 'path_css' => _THEME_CSS_DIR_, 'ad' => dirname($_SERVER["PHP_SELF"]), - 'show_toolbar' => $this->show_toolbar + 'show_toolbar' => $this->show_toolbar, + 'toolbar_fix' => $this->toolbar_fix, + )); return parent::generate(); } diff --git a/classes/HelperList.php b/classes/HelperList.php index e93f3f51a..d63c8407b 100644 --- a/classes/HelperList.php +++ b/classes/HelperList.php @@ -589,6 +589,7 @@ class HelperListCore extends Helper 'name' => isset($name) ? $name : null, 'name_id' => isset($name_id) ? $name_id : null, 'show_toolbar' => $this->show_toolbar, + 'toolbar_fix' => $this->toolbar_fix, 'back' => Tools::getValue('back'), 'no_back' => $this->no_back, diff --git a/controllers/admin/AdminCatalogController.php b/controllers/admin/AdminCatalogController.php index 1ed6571e9..0d37a9151 100644 --- a/controllers/admin/AdminCatalogController.php +++ b/controllers/admin/AdminCatalogController.php @@ -67,7 +67,7 @@ class AdminCatalogController extends AdminController } self::$_category = new Category($id_category); if (!Validate::isLoadedObject(self::$_category)) - die('Category cannot be loaded'); + throw new PrestashopException('Category cannot be loaded'); $this->table = array('category', 'product'); // $this->adminCategories = new AdminCategories(); diff --git a/controllers/admin/AdminTrackingController.php b/controllers/admin/AdminTrackingController.php index 856ac7f3d..44cffc02f 100644 --- a/controllers/admin/AdminTrackingController.php +++ b/controllers/admin/AdminTrackingController.php @@ -329,7 +329,7 @@ class AdminTrackingController extends AdminController ) AND quantity <= 0)'; $this->list_title = $this->l('Product out of stock'); - $this->list_simple_header = 1; + $this->list_simple_header = true; $list = $this->initList(); $this->_filter = ''; @@ -347,6 +347,7 @@ class AdminTrackingController extends AdminController $this->_filter = 'AND active = 0'; $this->list_no_filter = true; $this->list_title = $this->l('Product disabled'); + $this->list_simple_header = true; $list = $this->initList(); $this->_filter = ''; return $list;