admin)) { throw new Exception("@todo UNAUTHORIZED", 401); } parent::__construct(); } public function index() { $theme_name = module::get_var("core", "active_admin_theme", "admin_default"); $template = new Admin_View("admin.html", $theme_name); $template->content = new View("dashboard.html"); print $template; } public function __call($page_name, $args) { $theme_name = module::get_var("core", "active_admin_theme", "admin_default"); // For now, we have only two legal pages. // @todo get these pages from the modules switch($page_name) { case "users": $view = new Admin_View("users.html", $theme_name); $view->users = ORM::factory("user")->find_all(); break; case "dashboard": $view = new Admin_View("dashboard.html", $theme_name); break; default: Kohana::show_404(); } print $view; } }