summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/gallery_event.php18
-rw-r--r--modules/gallery/libraries/Identity.php22
2 files changed, 35 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index a6aa0657..84b84f7d 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -190,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::active()) > 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")))
diff --git a/modules/gallery/libraries/Identity.php b/modules/gallery/libraries/Identity.php
index 9eb4b83b..9e5f0bb5 100644
--- a/modules/gallery/libraries/Identity.php
+++ b/modules/gallery/libraries/Identity.php
@@ -24,6 +24,8 @@
class Identity_Core {
protected static $instance;
+ protected static $active;
+
// Configuration
protected $config;
@@ -81,6 +83,26 @@ class Identity_Core {
}
/**
+ * Return a list of installed and activated Identity Drivers.
+ *
+ * @return boolean true if the driver supports updates; false if read only
+ */
+ static function active() {
+ if (empty(self::$active)) {
+ $drivers = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
+ foreach (module::active() as $module) {
+ $module_name = $module->name;
+ if (file_exists(MODPATH . "{$module->name}/config/identity.php") &&
+ ($info = module::info($module_name))) {
+ $drivers->$module_name = $info->description;
+ }
+ }
+ self::$active = $drivers;
+ }
+ return self::$active;
+ }
+
+ /**
* Determine if if the current driver supports updates.
*
* @return boolean true if the driver supports updates; false if read only