From c7193f9b2ede6ed913d16a9a8047b6867b8afada Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 24 Dec 2008 04:22:22 +0000 Subject: Normalize our Admin controllers so that functions always print out their results, as opposed to having them return their view back upstream. This is a little more code in every controller, but it's much less magical and more consistent. Look up the active_theme and active_admin_theme inside the view itself, no need to do that in the controllers. This makes view initialization easier in the controllers. --- core/controllers/admin.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'core/controllers/admin.php') diff --git a/core/controllers/admin.php b/core/controllers/admin.php index 6e44c54e..6f4ec47a 100644 --- a/core/controllers/admin.php +++ b/core/controllers/admin.php @@ -24,14 +24,9 @@ class Admin_Controller extends Controller { if (!(user::active()->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(); @@ -48,11 +43,7 @@ class Admin_Controller extends Controller { $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; + call_user_func_array(array(new $controller_name, $method), $args); } } -- cgit v1.2.3