summaryrefslogtreecommitdiff
path: root/core/controllers/admin.php
diff options
context:
space:
mode:
authorFelix Rabinovich <virshu@users.sourceforge.net>2008-12-14 07:59:24 +0000
committerFelix Rabinovich <virshu@users.sourceforge.net>2008-12-14 07:59:24 +0000
commit7fa014ae61b7463632e67923b745a6de07dd3f20 (patch)
tree252686cdbfbfb6bd96a2cf9722c0e0bf0268f025 /core/controllers/admin.php
parent8b81731846f4778fc176d04259eb6dbb30daa3d5 (diff)
refactored admin views and added 'List User'
Diffstat (limited to 'core/controllers/admin.php')
-rw-r--r--core/controllers/admin.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/core/controllers/admin.php b/core/controllers/admin.php
index 4824ce93..6625de37 100644
--- a/core/controllers/admin.php
+++ b/core/controllers/admin.php
@@ -18,22 +18,34 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Admin_Controller extends Controller {
- public function dashboard() {
+ public $template = null;
+
+ public function __construct() {
if (!(user::active()->admin)) {
throw new Exception("Unauthorized", 401);
}
- // giving default is probably overkill
- $theme_name = module::get_var("core", "active_admin_theme", "default_admin");
// For now, in order not to duplicate js and css, keep the regular ("item")
// theme in addition to admin theme.
- // Be careful, though - new Theme_View sets global theme as well!
$item_theme_name = module::get_var("core", "active_theme", "default");
$item_theme = new Theme_View("album.html", "album", $item_theme_name);
- $template = new Theme_View("dashboard.html", "admin", $theme_name);
- $template->item_theme = $item_theme;
-
- print $template;
+ // giving default is probably overkill
+ $theme_name = module::get_var("core", "active_admin_theme", "default_admin");
+ $this->template = new Theme_View("admin.html", "admin", $theme_name);
+ $this->template->item_theme = $item_theme;
+ parent::__construct();
+ }
+
+ public function dashboard() {
+ $this->template->subpage = "dashboard.html";
+ print $this->template;
+ }
+
+ public function list_users() {
+ $this->template->set_global('users', ORM::factory("user")->find_all());
+
+ $this->template->subpage = "list_users.html";
+ print $this->template;
}
}