protected function actionSaveState($params) { //close writing to session so other concurrent requests won't be locked out. GO::session()->closeWriting(); if (isset($params['values'])) { $values = json_decode($params['values'], true); if (!is_array($values)) { trigger_error("Invalid value for Core::actionSaveState: " . var_export($params, true), E_USER_NOTICE); } else { foreach ($values as $name => $value) { $state = \GO\Base\Model\State::model()->findByPk(array('name' => $name, 'user_id' => GO::user()->id)); if (!$state) { $state = new \GO\Base\Model\State(); $state->name = $name; } $state->value = $value; $state->save(); } } } $response['success'] = true; echo json_encode($response); }
* * If you have questions write an e-mail to info@intermesh.nl * * @copyright Copyright Intermesh * @version $Id: default_scripts.inc.php 17932 2014-08-08 09:52:57Z mschering $ * @author Merijn Schering <*****@*****.**> */ $settings['state_index'] = 'go'; $settings['language'] = \GO::language()->getLanguage(); $user_id = \GO::user() ? \GO::user()->id : 0; $load_modules = \GO::modules()->getAllModules(true); $settings['state'] = array(); if (\GO::user()) { //state for Ext components $settings['html_editor_font'] = \GO::config()->html_editor_font; $settings['state'] = \GO\Base\Model\State::model()->getFullClientState($user_id); $settings['user_id'] = $user_id; $settings['has_admin_permission'] = \GO::user()->isAdmin(); $settings['username'] = \GO::user()->username; $settings['name'] = \GO::user()->name; $settings['email'] = \GO::user()->email; $settings['thousands_separator'] = \GO::user()->thousands_separator; $settings['decimal_separator'] = \GO::user()->decimal_separator; $settings['date_format'] = \GO::user()->completeDateFormat; $settings['date_separator'] = \GO::user()->date_separator; $settings['time_format'] = \GO::user()->time_format; $settings['currency'] = \GO::user()->currency; $settings['lastlogin'] = \GO::user()->lastlogin; $settings['max_rows_list'] = \GO::user()->max_rows_list; $settings['timezone'] = \GO::user()->timezone; $settings['start_module'] = \GO::user()->start_module;