public function changeChildStatusAction() { $id = $this->_getParam('id'); $status = $this->_getParam('status'); if ($status == 0) { $status = 1; } else { $status = 0; } $model = new Base_Security_Menu(); $model->changeChildStatus($id, $status); if ($status == 1) { $txt = "it is child"; } else { $txt = "it is not a child"; } if (false === $model) { $this->_flashMessenger->addMessage(array('error' => 'Operation failed. Please try again.')); } else { $this->_flashMessenger->addMessage(array('success' => 'Status changed for menu ID : ' . $id . ', Now it is ' . $txt)); } $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/menu')); }
public function changeChildStatusAction() { $this->view->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $id = $this->_getParam('id'); $status = $this->_getParam('status'); if ($status == 0) { $status = 1; } else { $status = 0; } $model = new Base_Security_Menu(); $res = $model->changeChildStatus($id, $status); if (false === $res) { $arrResult = array("result" => 0); } else { $arrResult = array("result" => 1); } echo Zend_Json::encode($arrResult); }