diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-08 17:11:17 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-08 17:11:17 -0500 |
commit | f93ce1fd7fca1a7229a9c9da4f1f4a3f98823524 (patch) | |
tree | 583a1786e7a1c8c89eae14ec5326205dbe6b67be | |
parent | 1ae99f6a85743255c918af5c8321818a580b09cc (diff) |
Minors improvements
-rw-r--r-- | controllers/config.php | 3 | ||||
-rw-r--r-- | lib/session.php | 4 | ||||
-rw-r--r-- | models/config.php | 6 |
3 files changed, 10 insertions, 3 deletions
diff --git a/controllers/config.php b/controllers/config.php index 96a6a085..e01b2082 100644 --- a/controllers/config.php +++ b/controllers/config.php @@ -32,11 +32,12 @@ class Config extends Base if ($this->config->save($values)) { $this->config->reload(); $this->session->flash(t('Settings saved successfully.')); - $this->response->redirect('?controller=config'); } else { $this->session->flashError(t('Unable to save your settings.')); } + + $this->response->redirect('?controller=config'); } $this->response->html($this->template->layout('config_index', array( diff --git a/lib/session.php b/lib/session.php index c5a8271f..5ea6ceb0 100644 --- a/lib/session.php +++ b/lib/session.php @@ -4,8 +4,10 @@ class Session { 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( self::SESSION_LIFETIME, $base_path, diff --git a/models/config.php b/models/config.php index d854047d..4d39af87 100644 --- a/models/config.php +++ b/models/config.php @@ -11,10 +11,14 @@ class Config extends Base public function getLanguages() { - return array( + $languages = array( 'en_US' => t('English'), 'fr_FR' => t('French'), ); + + asort($languages); + + return $languages; } public function get($name, $default_value = '') |