diff options
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index e0de2152..95be4813 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -23,7 +23,11 @@ class gallery_event_Core { * Initialization. */ static function gallery_ready() { - user::load_user(); + // Call Identity::instance() now to force the load of the user interface classes. + // Session::load_user will attempt to load the active user from the session and needs + // the user definition class, which can't be reached by Kohana's heiracrchical lookup. + Identity::instance(); + Session::load_user(); locales::set_request_locale(); } @@ -135,7 +139,7 @@ class gallery_event_Core { } } - if (user::active()->admin) { + if (Session::active_user()->admin) { $menu->append($admin_menu = Menu::factory("submenu") ->id("admin_menu") ->label(t("Admin"))); @@ -186,11 +190,19 @@ class gallery_event_Core { ->append(Menu::factory("link") ->id("sidebar") ->label(t("Manage Sidebar")) - ->url(url::site("admin/sidebar")))) - ->append(Menu::factory("link") - ->id("users_groups") - ->label(t("Users/Groups")) - ->url(url::site("admin/users"))) + ->url(url::site("admin/sidebar")))); + if (count(Identity::providers()) > 1) { + $menu + ->append(Menu::factory("submenu") + ->id("identity_menu") + ->label(t("Identity Management")) + ->append(Menu::factory("link") + ->id("identity_drivers") + ->label(t("Identity Drivers")) + ->url(url::site("admin/identity")))); + } + + $menu ->append(Menu::factory("submenu") ->id("statistics_menu") ->label(t("Statistics"))) |