当前位置: 首页>>代码示例>>PHP>>正文


PHP Horde_Registry::listApps方法代码示例

本文整理汇总了PHP中Horde_Registry::listApps方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Registry::listApps方法的具体用法?PHP Horde_Registry::listApps怎么用?PHP Horde_Registry::listApps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_Registry的用法示例。


在下文中一共展示了Horde_Registry::listApps方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getChildren

 /**
  * 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;
 }
开发者ID:horde,项目名称:horde,代码行数:15,代码来源:RootCollection.php

示例2: getAvailable

 /**
  * Returns the available permissions for a given level.
  *
  * @param string $name  The permission's name.
  *
  * @return array  An array of available permissions and their titles or
  *                false if not sub permissions exist for this level.
  * @throws Horde_Perms_Exception
  */
 public function getAvailable($name)
 {
     if ($name == Horde_Perms::ROOT) {
         $name = '';
     }
     if (empty($name)) {
         /* No name passed, so top level permissions are requested. These
          * can only be applications. */
         $apps = $this->_registry->listApps(array('notoolbar', 'active', 'hidden'), true);
         foreach (array_keys($apps) as $app) {
             $apps[$app] = $this->_registry->get('name', $app) . ' (' . $app . ')';
         }
         asort($apps);
         return $apps;
     }
     /* Name has been passed, explode the name to get all the levels in
      * permission being requisted, with the app as the first level. */
     $levels = explode(':', $name);
     /* First level is always app. */
     $app = $levels[0];
     /* Call the app's permission function to return the permissions
      * specific to this app. */
     $perms = $this->getApplicationPermissions($app);
     if (!count($perms)) {
         return false;
     }
     /* Get the part of the app's permissions based on the permission
      * name requested. */
     $children = Horde_Array::getElement($perms['tree'], $levels);
     if ($children === false || !is_array($children) || !count($children)) {
         /* No array of children available for this permission name. */
         return false;
     }
     $perms_list = array();
     foreach (array_keys($children) as $perm_key) {
         $perms_list[$perm_key] = $perms['title'][$name . ':' . $perm_key];
     }
     return $perms_list;
 }
开发者ID:horde,项目名称:horde,代码行数:48,代码来源:Perms.php

示例3: _listFolder

 /**
  * Returns an unsorted file list of the specified directory.
  *
  * @param string $path          The path of the directory.
  * @param string|array $filter  Regular expression(s) to filter
  *                              file/directory name on.
  * @param boolean $dotfiles     Show dotfiles?
  * @param boolean $dironly      Show only directories?
  *
  * @return array  File list.
  * @throws Horde_Vfs_Exception
  */
 protected function _listFolder($path, $filter = null, $dotfiles = true, $dironly = false)
 {
     $list = array();
     if ($path == '/') {
         try {
             $apps = $this->_registry->listApps(null, false, Horde_Perms::READ);
         } catch (Horde_Exception $e) {
             throw new Horde_Vfs_Exception($e->getMessage());
         }
         foreach ($apps as $app) {
             if ($this->_registry->hasMethod('browse', $app)) {
                 $file = array('name' => $app, 'date' => time(), 'type' => '**dir', 'size' => -1);
                 $list[] = $file;
             }
         }
         return $list;
     }
     if (substr($path, 0, 1) == '/') {
         $path = substr($path, 1);
     }
     $pieces = explode('/', $path);
     try {
         $items = $this->_registry->callByPackage($pieces[0], 'browse', array('path' => $path, 'properties' => array('name', 'browseable', 'contenttype', 'contentlength', 'modified')));
     } catch (Horde_Exception $e) {
         throw new Horde_Vfs_Exception($e->getMessage());
     }
     if (!is_array(reset($items))) {
         /* We return an object's content. */
         throw new Horde_Vfs_Exception('Unknown error');
     }
     foreach ($items as $sub_path => $i) {
         if ($dironly && !$i['browseable']) {
             continue;
         }
         $name = basename($sub_path);
         if ($this->_filterMatch($filter, $name)) {
             continue;
         }
         $type = class_exists('Horde_Mime_Magic') ? Horde_Mime_Magic::mimeToExt(empty($i['contenttype']) ? 'application/octet-stream' : $i['contenttype']) : '**none';
         $file = array('name' => $name, 'date' => empty($i['modified']) ? 0 : $i['modified'], 'type' => $i['browseable'] ? '**dir' : $type, 'size' => empty($i['contentlength']) ? 0 : $i['contentlength']);
         $list[] = $file;
     }
     return $list;
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:56,代码来源:Horde.php

示例4: horde_listApis

 /**
  * Return all active api interfaces.
  *
  * @return array  An array of interface names.
  */
 public function horde_listApis()
 {
     $apis = $this->_registry->horde->listAPIs();
     // Note support not added until 5.1. Need to check the feature.
     // @TODO: H6, add this check to all apps. BC break to check it now,
     // since we didn't have this feature earlier.
     if ($key = array_search('notes', $apis)) {
         if (!$this->hasFeature('activesync', 'notes')) {
             unset($apis[$key]);
         }
     }
     $inactive = $this->_registry->listApps(array('inactive'));
     $active_apis = array();
     foreach ($apis as $api) {
         if (!$this->_registry->isInactive($this->_registry->hasInterface($api))) {
             $active_apis[] = $api;
         }
     }
     return $active_apis;
 }
开发者ID:horde,项目名称:horde,代码行数:25,代码来源:Connector.php


注:本文中的Horde_Registry::listApps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。