Merge pull request #301 from DrySs/patch-2

[-] BO: fixed bad set of display status set in AdminCMS
This commit is contained in:
Vincent Augagneur
2013-03-04 07:18:53 -08:00
+7 -7
View File
@@ -68,6 +68,13 @@ class AdminCmsControllerCore extends AdminController
public function renderForm() public function renderForm()
{ {
if (!$this->loadObject(true))
return;
if (Validate::isLoadedObject($this->object))
$this->display = 'edit';
else
$this->display = 'add';
$this->toolbar_btn['save-and-preview'] = array( $this->toolbar_btn['save-and-preview'] = array(
'href' => '#', 'href' => '#',
@@ -79,13 +86,6 @@ class AdminCmsControllerCore extends AdminController
'desc' => $this->l('Save and stay'), 'desc' => $this->l('Save and stay'),
); );
$this->initToolbar(); $this->initToolbar();
if (!$this->loadObject(true))
return;
if (Validate::isLoadedObject($this->object))
$this->display = 'edit';
else
$this->display = 'add';
$categories = CMSCategory::getCategories($this->context->language->id, false); $categories = CMSCategory::getCategories($this->context->language->id, false);
$html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1); $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);