This commit does a couple of things - Creates OptionsLib which stores the 'Options' within the CI config system prefixed with "options_" - Loads the OptionsLib automatically - Adds function to OptionsLib for selecting the active stylesheet. - Adds function to get an option_value that isn't automatically loaded.
33 行
无行尾
623 B
PHP
33 行
无行尾
623 B
PHP
<?php
|
|
|
|
/*
|
|
Class: Options_model
|
|
This model handles all database interactions for the options table
|
|
used for global settings within cloudlog.
|
|
*/
|
|
|
|
class Options_model extends CI_Model {
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
// Returns all options that are autoload yes
|
|
function get_autoloads() {
|
|
$this->db->where('autoload', "yes");
|
|
return $this->db->get('options');
|
|
}
|
|
|
|
// Return option value for an option
|
|
function item($option_name) {
|
|
$this->db->where('option_name', $option_name);
|
|
$query = $this->db->get('options');
|
|
$row = $query->row();
|
|
|
|
return $row->option_value;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|