public function setisactiveAction() { if ($datas = $this->getRequest()->getPost()) { try { if (empty($datas['value_id'])) { throw new Exception($this->_('An error occurred while saving')); } // Récupère les données de l'application pour cette option $option_value = new Application_Model_Option_Value(); $option_value->find($datas['value_id']); if (isset($datas['is_active'])) { $option_value->setIsActive($datas['is_active']); } else { if (isset($datas['is_social_sharing_active'])) { $option_value->setSocialSharingIsActive($datas['is_social_sharing_active']); } else { throw new Exception($this->_('An error occurred while saving')); } } $option_value->save(); $html = array('success' => 1, 'option_id' => $option_value->getId(), 'is_folder' => (int) ($option_value->getCode() == 'folder')); } catch (Exception $e) { $html = array('message' => $this->_('An error occurred while saving'), 'message_button' => 1, 'message_loader' => 1); } $this->_sendHtml($html); } }