From 7fa014ae61b7463632e67923b745a6de07dd3f20 Mon Sep 17 00:00:00 2001 From: Felix Rabinovich Date: Sun, 14 Dec 2008 07:59:24 +0000 Subject: refactored admin views and added 'List User' --- core/controllers/admin.php | 28 ++- themes/default_admin/views/admin.html.php | 192 +++++++++++++++ themes/default_admin/views/dashboard.html.php | 309 +++++-------------------- themes/default_admin/views/list_users.html.php | 12 + 4 files changed, 282 insertions(+), 259 deletions(-) create mode 100644 themes/default_admin/views/admin.html.php create mode 100644 themes/default_admin/views/list_users.html.php 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; } } diff --git a/themes/default_admin/views/admin.html.php b/themes/default_admin/views/admin.html.php new file mode 100644 index 00000000..e37ddbe4 --- /dev/null +++ b/themes/default_admin/views/admin.html.php @@ -0,0 +1,192 @@ + + + + + + G3: Admin Dashboard + " type="text/css" media="screen,projection"> + " type="text/css" media="screen,projection"> + + + " type="text/css" media="screen,projection"> + " type="text/css" media="screen,projection"> + + + + + + + +
+
+
+ + " id="gLogo" alt="Gallery 3: Your Photos on Your Web Site" /> + + +
+
+
+
+
+
+ display($subpage); ?> +
+
+
+
+ +
+ X +
+
+ Add Dashboard Blocks + + +
+
+
+ +
+ X +

Gallery Stats

+
    +
  • Version: 3.0
  • +
  • Your gallery has 34 albums containing 603 photos with 26 comments.
  • +
+
+ +
+ X +

Platform Information

+
    +
  • Platform +
      +
    • Apache 2.0.24 +
        +
      • mod_rewrite: active
      • +
      +
    • +
    • PHP 5.2.8 +
        +
      • Memory: 32MB
      • +
      • +
      • +
      +
    • +
    • MySQL 5.0.1
    • +
    • Graphics Toolkits +
        +
      • ImageMagick 1.6
      • +
      • GD
      • +
      • FFMPEG
      • +
      +
    • +
    +
  • +
+

^ Display as a tree widget

+
+ +
+ X +

Gallery Project News

+ +
+ +
+
+
+
+ Footer +
+
+
+ + + \ No newline at end of file diff --git a/themes/default_admin/views/dashboard.html.php b/themes/default_admin/views/dashboard.html.php index b6da7f6b..98bb9d12 100644 --- a/themes/default_admin/views/dashboard.html.php +++ b/themes/default_admin/views/dashboard.html.php @@ -1,254 +1,61 @@ - - - - - - G3: Admin Dashboard - " type="text/css" media="screen,projection"> - " type="text/css" media="screen,projection"> - - - " type="text/css" media="screen,projection"> - " type="text/css" media="screen,projection"> - - - - - +
+ X +

Welcome to Gallery 3!

+
+

This is your administration dashboard and it provides a quick overview of status messages, + recent updates, and frequently used options. Add or remove blocks and rearrange them + to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options + and settings. Here are a few of the most used options to get you started.

+ +
+
- -
-
-
- - " id="gLogo" alt="Gallery 3: Your Photos on Your Web Site" /> - - -
-
-
-
-
-
+ -
- X -

Welcome to Gallery 3!

-
-

This is your administration dashboard and it provides a quick overview of status messages, - recent updates, and frequently used options. Add or remove blocks and rearrange them - to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options - and settings. Here are a few of the most used options to get you started.

- -
-
- - - -
- X -

Photo Stream

-
-

Recent photos added to your Gallery

- " alt="" /> -

Slider type of display. Show titles underneath or on hover. Draw a keyline around albums, or differentiate some how. Each will be linked to item view

-
-
- -
- X -

Recent Comments

-
    -
  • username 2008-12-10 23:02:23 Something happened
  • -
  • username 2008-12-10 23:02:23 Someone logged in
  • -
  • username 2008-12-10 23:02:23 New module installed
  • -
  • username 2008-12-10 23:02:23 Someone logged in
  • -
  • username 2008-12-10 23:02:23 RSS feed updated
  • -
-
- -
- X -

Log Entries

-
    -
  • 2008-12-10 23:02:23 Something happened
  • -
  • 2008-12-10 23:02:23 Someone logged in
  • -
  • 2008-12-10 23:02:23 New module installed
  • -
  • 2008-12-10 23:02:23 Someone logged in
  • -
  • 2008-12-10 23:02:23 RSS feed updated
  • -
-
- -
-
-
-
- -
- X -
-
- Add Dashboard Blocks - - -
-
-
- -
- X -

Gallery Stats

-
    -
  • Version: 3.0
  • -
  • Your gallery has 34 albums containing 842 photos with 26 comments.
  • -
-
- -
- X -

Platform Information

-
    -
  • Platform -
      -
    • Apache 2.0.24 -
        -
      • mod_rewrite: active
      • -
      -
    • -
    • PHP 5.2.8 -
        -
      • Memory: 32MB
      • -
      • -
      • -
      -
    • -
    • MySQL 5.0.1
    • -
    • Graphics Toolkits -
        -
      • ImageMagick 1.6
      • -
      • GD
      • -
      • FFMPEG
      • -
      -
    • -
    -
  • -
-

^ Display as a tree widget

-
- -
- X -

Gallery Project News

- -
- -
-
-
-
- Footer -
-
-
+
+ X +

Photo Stream

+
+

Recent photos added to your Gallery

+ " alt="" /> +

Slider type of display. Show titles underneath or on hover. Draw a keyline around albums, or differentiate some how. Each will be linked to item view

+
+
- - \ No newline at end of file +
+ X +

Recent Comments

+ +
+ +
+ X +

Log Entries

+ +
diff --git a/themes/default_admin/views/list_users.html.php b/themes/default_admin/views/list_users.html.php new file mode 100644 index 00000000..409cacc5 --- /dev/null +++ b/themes/default_admin/views/list_users.html.php @@ -0,0 +1,12 @@ +
+ X +

User Administration

+
+

These are the users in your system

+ + $user): ?> + + +
name ?>
+
+
-- cgit v1.2.3