admin)) { throw new Exception("@todo UNAUTHORIZED", 401); } $this->theme = $theme; parent::__construct(); } public function theme() { return $this->theme; } public function __call($controller_name, $args) { if (request::method() == "post") { access::verify_csrf(); } if ($controller_name == "index") { $controller_name = "dashboard"; } $controller_name = "Admin_{$controller_name}_Controller"; if ($args) { $method = array_shift($args); } else { $method = "index"; } $theme_name = module::get_var("core", "active_admin_theme", "admin_default"); $this->template = $template = new Admin_View("admin.html", $theme_name); $template->content = call_user_func_array( array(new $controller_name($template), $method), $args); print $template; } }