[*] Project : Add possibility to use admin controllers in modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12678 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
jBreux
2012-01-25 14:12:36 +00:00
parent 0d16fb2892
commit 8c25b56777
2 changed files with 19 additions and 1 deletions
+12
View File
@@ -171,6 +171,9 @@ class AdminControllerCore extends Controller
/** @var array required_fields to display in the Required Fields form */
public $required_fields = array();
/** @var module contain the controller */
public $module;
/**
* @var array actions to execute on multiple selections
* Usage:
@@ -2583,6 +2586,15 @@ class AdminControllerCore extends Controller
*/
public function createTemplate($tpl_name)
{
// Use for module
if (!is_null($this->module))
{
$moduleTemplate = _PS_MODULE_DIR_.$this->module.'/templates/admin/'.$this->override_folder.$tpl_name;
if ($this->viewAccess() && file_exists($moduleTemplate))
return $this->context->smarty->createTemplate($moduleTemplate, $this->context->smarty);
}
// Use override tpl if it exists
// If view access is denied, we want to use the default template that will be used to display an error
if ($this->viewAccess()