summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Identity.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/libraries/Identity.php')
-rw-r--r--modules/gallery/libraries/Identity.php22
1 files changed, 22 insertions, 0 deletions
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