From b837a7c6c1db03fd14dda02f5582592dc71ee8d5 Mon Sep 17 00:00:00 2001 From: bMancone Date: Thu, 29 Dec 2011 17:26:16 +0000 Subject: [PATCH] // fixed translations problems due to r11899 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11910 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminStockManagementController.php | 6 +++--- controllers/admin/AdminSupplyOrdersController.php | 6 +++--- controllers/admin/AdminTranslationsController.php | 9 ++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index d966f3f51dda8..f270d653ee877 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -1072,7 +1072,7 @@ public function displayAddstockLink($token = null, $id) 'action' => self::$cache_lang['AddStock'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_addstock.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_addstock.tpl'); } /** @@ -1093,7 +1093,7 @@ public function displayRemovestockLink($token = null, $id) 'action' => self::$cache_lang['RemoveStock'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_removestock.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_removestock.tpl'); } /** @@ -1114,6 +1114,6 @@ public function displayTransferstockLink($token = null, $id) 'action' => self::$cache_lang['TransferStock'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_transferstock.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_transferstock.tpl'); } } \ No newline at end of file diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 76ef674e63daf..04967885a6c92 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -1306,7 +1306,7 @@ public function displayUpdateReceiptLink($token = null, $id) 'action' => self::$cache_lang['Receipt'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_receipt.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_supply_order_receipt.tpl'); } /** @@ -1327,7 +1327,7 @@ public function displayChangestateLink($token = null, $id) 'action' => self::$cache_lang['State'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_change_state.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_supply_order_change_state.tpl'); } /** @@ -1352,7 +1352,7 @@ public function displayCreateSupplyOrderLink($token = null, $id) 'action' => self::$cache_lang['CreateSupplyOrder'], )); - return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_create_from_template.tpl'); + return $this->context->smarty->fetch('helper/list/list_action_supply_order_create_from_template.tpl'); } /** diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 6c8ccaf891528..328d46f5a452d 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -974,7 +974,7 @@ public function initFormBack($lang) } /* List templates to parse */ - $templates = $this->listFiles(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'template'); + $templates = $this->listFiles(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes'); foreach ($templates as $template) if (preg_match('/^(.*).tpl$/', $template)) { @@ -983,13 +983,16 @@ public function initFormBack($lang) // get controller name instead of file name $prefix_key = Tools::toCamelCase(str_replace(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR, '', $tpl), true); - $prefix_key = 'Admin'.substr($prefix_key, 0, strpos($prefix_key, DIRECTORY_SEPARATOR)); + $pos = strrpos($prefix_key, DIRECTORY_SEPARATOR); + $tmp = substr($prefix_key, 0, $pos); + $prefix_key = 'Admin'.ucfirst(substr($tmp, strrpos($tmp, DIRECTORY_SEPARATOR) + 1, $pos)); + if ($prefix_key == 'AdminHelper') $prefix_key = 'Helper'; // @todo retrompatibility : we assume here than files directly in template/ // use the prefix "AdminController" (like old php files 'header', 'footer.inc', 'index', 'login', 'password', 'functions' - if ( $prefix_key == 'Admin') + if ( $prefix_key == 'Admin' || $prefix_key == 'AdminTemplate') $prefix_key = 'AdminController'; // and helpers in helper