diff --git a/classes/AdminController.php b/classes/AdminController.php index 9e00615be..c030f16c1 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -269,7 +269,7 @@ class AdminControllerCore extends Controller $this->shopLinkType = ''; // Get the name of the folder containing the custom tpl files - $this->tpl_folder = strtolower($controller[5]).substr($controller, 6); + $this->tpl_folder = substr($controller, 5); $this->tpl_folder = Tools::toUnderscoreCase($this->tpl_folder).'/'; $this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); @@ -286,6 +286,7 @@ class AdminControllerCore extends Controller $tabs = array(); $tabs = Tab::recursiveTab($this->id, $tabs); $tabs = array_reverse($tabs); + $bread = ''; switch ($this->display) { @@ -1210,6 +1211,7 @@ class AdminControllerCore extends Controller { if (!$this->loadObject(true)) return; + $this->content .= $this->initForm(); } else if ($this->display == 'view') diff --git a/classes/Tools.php b/classes/Tools.php index 5c00bbad3..bd0cb0675 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1236,14 +1236,16 @@ class ToolsCore } /** - * * Transform a CamelCase string to underscore_case string + * * @param string $string * @return string */ public static function toUnderscoreCase($string) { - return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $string)); + // 'CMSCategories' => 'cms_categories' + // 'RangePrice' => 'range_price' + return strtolower(preg_replace('/([a-zA-Z])([A-Z][a-z])/', '$1_$2', $string)); } public static function getBrightness($hex)