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

This commit is contained in:
mDeflotte
2012-05-29 08:58:32 +00:00
parent fd9149951f
commit d938203474
2 changed files with 22 additions and 4 deletions
+13 -4
View File
@@ -35,13 +35,13 @@ class AdminCmsControllerCore extends AdminController
public function __construct()
{
$this->table = 'cms';
$this->className = 'CMS';
$this->lang = true;
$this->table = 'cms';
$this->className = 'CMS';
$this->lang = true;
$this->addRowAction('view');
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array(
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
@@ -51,6 +51,15 @@ class AdminCmsControllerCore extends AdminController
'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->_join = '
LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';