/** * Delete language with all information * * @param request iso */ public function deleteJsonAction() { $iso = $this->_getParam('iso'); $model = new RM_Languages(); $language = $model->find($iso)->current(); if ($language == null) { continue; } // set back to default language $model = new RM_Config(); $configData = $model->fetchAll(); foreach ($configData as $data) { if ($data->id == 'rm_config_language_default_back') { $data->value = "cms"; $data->save(); } if ($data->id == 'rm_config_language_default_front') { $data->value = "cms"; $data->save(); } } $manager = new RM_Language_Manager(); $manager->deleteLanguage($iso); return array('data' => array('success' => true)); }
/** * Updates configuration. * * @param request all values this values for the config update * @return json boolean response of true or false in json format (true is success) */ function updateJsonAction() { $model = new RM_Config(); $fields = $model->fetchAll(); foreach ($fields as $field) { switch ($field->xtype) { case "checkbox": $value = $this->_getParam($field->id); break; default: $value = $this->_getParam($field->id, $this->_getParam($field->id . "_hidden")); } if ($value !== null) { $field->value = $value; $field->save(); } } // process image resizing if ($this->_getParam('image_resize', 0) == 1) { //1. resize images for media, if we will later add extra options for admin thumnails //$mediaManager = new RM_Media_Manager(); //$mediaManager->resize(); //2. resize images for units $unitModel = new RM_Units(); $units = $unitModel->fetchAll(); foreach ($units as $unit) { $unitMediaManager = new RM_Media_Unit_Manager($unit); $unitMediaManager->resize(); } } return array('data' => array('success' => true)); }
/** * Updates the maximised/minimised state of the admin GUI * * @return JSON */ public function updatemaxminstateJsonAction() { $GUIstate = $this->_getParam('GUIstate'); $model = new RM_Config(); $fields = $model->fetchAll(); foreach ($fields as $field) { if ($field->id == "rm_config_admin_gui_maximised") { $field->value = $GUIstate; $result = $field->save(); } } if ($result) { if ($GUIstate) { $url = RM_Environment::getInstance()->getRouter()->_('', '', array("index3" => true)); } else { $url = RM_Environment::getInstance()->getRouter()->_('', '', array()); } return array('data' => array('success' => true, 'url' => $url)); } else { return array('data' => array('success' => false)); } }