[-] BO : #PSCFV-2568 - CmsController and CmsCategoriesController cannot be called dirrectly

This commit is contained in:
mDeflotte committed 2012-05-29 08:58:32 +00:00
1 parent dec6ce1108
commit a1eef4ee8d
2 files changed
+18

No files matched your search

@@ -52,6 +52,15 @@ class AdminCmsCategoriesControllerCore extends AdminController
'align' => 'center','type' => 'bool', 'orderby' => false 'align' => 'center','type' => 'bool', 'orderby' => false
)); ));
// The controller can't be call directly
// In this case, AdminCmsContentController::getCurrentCMSCategory() is null
if (!AdminCmsContentController::getCurrentCMSCategory())
{
elog('rrrr');
$this->redirect_after = '?controller=AdminCmsContent&token='.Tools::getAdminTokenLite('AdminCmsContent');
$this->redirect();
}
$this->cms_category = AdminCmsContentController::getCurrentCMSCategory(); $this->cms_category = AdminCmsContentController::getCurrentCMSCategory();
$this->_filter = 'AND `id_parent` = '.(int)$this->cms_category->id; $this->_filter = 'AND `id_parent` = '.(int)$this->cms_category->id;
$this->_select = 'position '; $this->_select = 'position ';
+9
View File
@@ -51,6 +51,15 @@ class AdminCmsControllerCore extends AdminController
'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) 'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
); );
// The controller can't be call directly
// In this case, AdminCmsContentController::getCurrentCMSCategory() is null
if (!AdminCmsContentController::getCurrentCMSCategory())
{
elog('rrrr');
$this->redirect_after = '?controller=AdminCmsContent&token='.Tools::getAdminTokenLite('AdminCmsContent');
$this->redirect();
}
$this->_category = AdminCmsContentController::getCurrentCMSCategory(); $this->_category = AdminCmsContentController::getCurrentCMSCategory();
$this->_join = ' $this->_join = '
LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)'; LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';