[Options] Added code comments

pull/753/head
Peter Goodhall 2020-12-13 16:59:08 +00:00
rodzic a012d73df2
commit 568d7cc307
1 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -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');
}
}