Minors improvements

This commit is contained in:
Frédéric Guillot 2014-02-08 17:11:17 -05:00
parent 1ae99f6a85
commit f93ce1fd7f
3 changed files with 10 additions and 3 deletions

View File

@ -32,11 +32,12 @@ class Config extends Base
if ($this->config->save($values)) { if ($this->config->save($values)) {
$this->config->reload(); $this->config->reload();
$this->session->flash(t('Settings saved successfully.')); $this->session->flash(t('Settings saved successfully.'));
$this->response->redirect('?controller=config');
} }
else { else {
$this->session->flashError(t('Unable to save your settings.')); $this->session->flashError(t('Unable to save your settings.'));
} }
$this->response->redirect('?controller=config');
} }
$this->response->html($this->template->layout('config_index', array( $this->response->html($this->template->layout('config_index', array(

View File

@ -4,8 +4,10 @@ class Session
{ {
const SESSION_LIFETIME = 2678400; const SESSION_LIFETIME = 2678400;
public function open($base_path = '/') public function open($base_path = '/', $save_path = '')
{ {
if ($save_path !== '') session_save_path($save_path);
session_set_cookie_params( session_set_cookie_params(
self::SESSION_LIFETIME, self::SESSION_LIFETIME,
$base_path, $base_path,

View File

@ -11,10 +11,14 @@ class Config extends Base
public function getLanguages() public function getLanguages()
{ {
return array( $languages = array(
'en_US' => t('English'), 'en_US' => t('English'),
'fr_FR' => t('French'), 'fr_FR' => t('French'),
); );
asort($languages);
return $languages;
} }
public function get($name, $default_value = '') public function get($name, $default_value = '')