Habari\AdminHandler::setup_admin_theme PHP Method

setup_admin_theme() public method

Create the admin theme instance
public setup_admin_theme ( string $page, string $type = '' )
$page string The admin page requested
$type string The content type included in the request
    public function setup_admin_theme($page, $type = '')
    {
        if (!isset($this->theme)) {
            $theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', true));
            $this->theme = Themes::create('_admin', 'RawPHPEngine', $theme_dir);
            // Add some default template variables
            $this->set_admin_template_vars($this->theme);
            $this->theme->admin_type = $type;
            $this->theme->admin_page = $page;
            $this->theme->admin_page_url = $page == 'dashboard' ? URL::get('admin', 'page=') : URL::get('admin', 'page=' . $page);
            $this->theme->page = $page;
            $this->theme->admin_title = MultiByte::ucwords($page) . ($type != '' ? ' ' . MultiByte::ucwords($type) : '');
            $this->theme->admin_title = isset($this->theme->mainmenu[$this->theme->admin_page]['text']) ? $this->theme->mainmenu[$this->theme->admin_page]['text'] : MultiByte::ucwords($page) . ($type != '' ? ' ' . MultiByte::ucwords($type) : '');
        }
    }