Horde_Registry::listApps PHP Method

listApps() public method

Return a list of the installed and registered applications.
public listApps ( array $filter = null, boolean $assoc = false, integer $perms = Horde_Perms::SHOW ) : array
$filter array An array of the statuses that should be returned. Defaults to non-hidden.
$assoc boolean Return hash with app names as keys and config parameters as values?
$perms integer The permission level to check for in the list. If null, skips permission check.
return array List of apps registered with Horde. If no applications are defined returns an empty array.
    public function listApps($filter = null, $assoc = false, $perms = Horde_Perms::SHOW)
    {
        if (is_null($filter)) {
            $filter = array('notoolbar', 'active');
        }
        if (!$this->isAdmin() && in_array('active', $filter) && !in_array('noadmin', $filter)) {
            $filter[] = 'noadmin';
        }
        $apps = array();
        foreach ($this->applications as $app => $params) {
            if (in_array($params['status'], $filter)) {
                /* Topbar apps can only be displayed if the parent app is
                 * active. */
                if ($params['status'] == 'topbar' && $this->isInactive($params['app'])) {
                    continue;
                }
                if (is_null($perms) || $this->hasPermission($app, $perms)) {
                    $apps[$app] = $params;
                }
            }
        }
        return $assoc ? $apps : array_keys($apps);
    }

Usage Example

コード例 #1
0
ファイル: RootCollection.php プロジェクト: horde/horde
 /**
  * Returns an array with all the child nodes
  *
  * @return DAV\INode[]
  */
 public function getChildren()
 {
     $apps = $this->_collections;
     foreach ($this->_registry->listApps() as $app) {
         if ($this->_registry->hasMethod('browse', $app)) {
             $apps[] = new Horde_Dav_Collection($app, array(), $this->_registry, $this->_mimedb);
         }
     }
     return $apps;
 }
All Usage Examples Of Horde_Registry::listApps