Theme_model::load_active_theme PHP Method

load_active_theme() public method

Load the config file for the active theme.
public load_active_theme ( $theme ) : boolean
return boolean
    public function load_active_theme($theme)
    {
        $preview = $this->theme_dir . $theme . '/preview.png';
        $data['theme']['dir'] = $theme;
        if (file_exists($preview)) {
            $data['theme']['preview'] = base_url() . 'themes/' . $theme . '/preview.png';
        } else {
            $data['theme']['preview'] = base_url() . 'themes/cp/images/nopreview.gif';
        }
        if (file_exists($this->theme_dir . $theme . '/config.php')) {
            include $this->theme_dir . $theme . '/config.php';
            if (file_exists($this->theme_dir . $theme . '/admin.php')) {
                $data['theme']['admin'] = TRUE;
            } else {
                $data['theme']['admin'] = FALSE;
            }
        } else {
            $data['theme']['name'] = $theme;
            $data['theme']['description'] = '';
            $data['theme']['admin'] = FALSE;
        }
        return $data['theme'];
    }