diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-18 09:21:34 -0700 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-18 09:21:34 -0700 | 
| commit | c9a030dd08711f89a985504ce26378a315d7ff1f (patch) | |
| tree | 4014ed3eeba41c7f96efc3202c0e221ecb028ebf /modules/gallery/libraries | |
| parent | 6d5c12e13e6f1199a96180e69cac69d77ecbbcc2 (diff) | |
Add a menu item to manage the Identity drivers if there is more than one installed
Diffstat (limited to 'modules/gallery/libraries')
| -rw-r--r-- | modules/gallery/libraries/Identity.php | 22 | 
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 | 
