diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 926c042f..561e8570 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -33,6 +33,11 @@ class Options extends CI_Controller { // function used to display the /appearance url function appearance() { + + // Get Language Options + $directory = 'application/language'; + $data['language_options'] = array_diff(scandir($directory), array('..', '.')); + $data['page_title'] = "Cloudlog Options"; $data['sub_heading'] = "Appearance"; @@ -43,6 +48,11 @@ class Options extends CI_Controller { // Handles saving the appreance options to the options system. function appearance_save() { + + // Get Language Options + $directory = 'application/language'; + $data['language_options'] = array_diff(scandir($directory), array('..', '.')); + $data['page_title'] = "Cloudlog Options"; $data['sub_heading'] = "Appearance"; @@ -68,6 +78,14 @@ class Options extends CI_Controller { $this->session->set_flashdata('success', 'Theme changed to '.$this->input->post('theme')); } + // Update Lang choice within the options system + $lang_update_status = $this->optionslib->update('language', $this->input->post('language')); + + // If Lang update is complete set a flashsession with a success note + if($lang_update_status == TRUE) { + $this->session->set_flashdata('success', 'Language changed to '.ucfirst($this->input->post('language'))); + } + // Redirect back to /appearance redirect('/options/appearance'); } diff --git a/application/views/options/appearance.php b/application/views/options/appearance.php index a61c1308..e27695c0 100644 --- a/application/views/options/appearance.php +++ b/application/views/options/appearance.php @@ -33,6 +33,16 @@ +
+ + + Select the default language for Cloudlog. +
+