diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 38bfad9e..e9fe5b1d 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -14,7 +14,9 @@ class Options extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } - + + + // Default /options view just gives some text to explain the options area function index() { @@ -29,7 +31,7 @@ class Options extends CI_Controller { $this->load->view('interface_assets/footer'); } - + // function used to display the /appearance url function appearance() { $data['page_title'] = "Cloudlog Options"; $data['sub_heading'] = "Appearance"; @@ -39,10 +41,11 @@ class Options extends CI_Controller { $this->load->view('interface_assets/footer'); } + // Handles saving the appreance options to the options system. function appearance_save() { $data['page_title'] = "Cloudlog Options"; $data['sub_heading'] = "Appearance"; - + $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); @@ -57,11 +60,15 @@ class Options extends CI_Controller { } else { + // Update theme choice within the options system $theme_update_status = $this->optionslib->update('theme', $this->input->post('theme')); + // If theme update is complete set a flashsession with a success note if($theme_update_status == TRUE) { $this->session->set_flashdata('success', 'Theme changed to '.$this->input->post('theme')); } + + // Redirect back to /appearance redirect('/options/appearance'); } }