summaryrefslogtreecommitdiff
path: root/core/controllers/admin.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-24 04:22:22 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-24 04:22:22 +0000
commitc7193f9b2ede6ed913d16a9a8047b6867b8afada (patch)
treecd7bf045bb8f6a971eda11de9b91b4c61d52f4f6 /core/controllers/admin.php
parentb2c9a59d1b80cfe651c740c2eabbc0862a7a867e (diff)
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.
Diffstat (limited to 'core/controllers/admin.php')
-rw-r--r--core/controllers/admin.php11
1 files changed, 1 insertions, 10 deletions
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);
}
}