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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15721 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte committed 2012-05-29 08:58:32 +00:00
1 parent ea07cfacfc
commit f00f054ccd
2 files changed
+22 -4

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 ';
+13 -4
View File
@@ -35,13 +35,13 @@ class AdminCmsControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->table = 'cms'; $this->table = 'cms';
$this->className = 'CMS'; $this->className = 'CMS';
$this->lang = true; $this->lang = true;
$this->addRowAction('view'); $this->addRowAction('view');
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $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( $this->fields_list = array(
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), '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) '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`)';