diff --git a/application/controllers/Options.php b/application/controllers/Options.php index cb7899cf..57155690 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -75,7 +75,7 @@ class Options extends CI_Controller { else { // Update theme choice within the options system - $theme_update_status = $this->optionslib->update('theme', $this->input->post('theme')); + $theme_update_status = $this->optionslib->update('theme', $this->input->post('theme'), 'yes'); // If theme update is complete set a flashsession with a success note if($theme_update_status == TRUE) { diff --git a/application/libraries/OptionsLib.php b/application/libraries/OptionsLib.php index 40040926..c595bbb3 100644 --- a/application/libraries/OptionsLib.php +++ b/application/libraries/OptionsLib.php @@ -45,38 +45,32 @@ class OptionsLib { function get_option($option_name) { // Make Codeigniter functions available to library $CI =& get_instance(); - - if (strpos($option_name, 'option_')) { - if(!$CI->config->item('option_'.$option_name)) { - //Load the options model + if (strpos($option_name, 'option_') !== false) { + if(!$CI->config->item($option_name)) { + //Load the options model $CI->load->model('options_model'); - + $removed_options_tag = trim($option_name, 'option_'); // call library function to get options value - $options_result = $CI->options_model->item($option_name); - + $options_result = $CI->options_model->item($removed_options_tag); + // return option_value as a string return $options_result; } else { return $CI->config->item($option_name); } } else { - + if(!$CI->config->item($option_name)) { + //Load the options model + $CI->load->model('options_model'); + // call library function to get options value + $options_result = $CI->options_model->item($option_name); + + // return option_value as a string + return $options_result; + } else { return $CI->config->item($option_name); + } } - - if(!$CI->config->item('option_'.$option_name)) { - //Load the options model - $CI->load->model('options_model'); - - // call library function to get options value - $options_result = $CI->options_model->item($option_name); - - // return option_value as a string - return $options_result; - } else { - return $CI->config->item($option_name); - } - } // Function to save new option to options table diff --git a/application/views/options/appearance.php b/application/views/options/appearance.php index 748fcd21..d3fdc766 100644 --- a/application/views/options/appearance.php +++ b/application/views/options/appearance.php @@ -50,7 +50,7 @@ foldername . '"'; - if ($this->optionslib->get_option('theme') == $theme->foldername) { + if ($this->optionslib->get_option('option_theme') == $theme->foldername) { echo 'selected="selected"'; } echo '>' . $theme->name . '';