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


PHP INode::getDisplayName方法代码示例

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


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

示例1: beforeGetProperties

 /**
  * Triggered before properties are looked up in specific nodes.
  *
  * @param string $uri
  * @param DAV\INode $node
  * @param array $requestedProperties
  * @param array $returnedProperties
  * @TODO really should be broken into multiple methods, or even a class.
  * @return bool
  */
 public function beforeGetProperties($uri, DAV\INode $node, &$requestedProperties, &$returnedProperties)
 {
     // Checking the read permission
     if (!$this->checkPrivileges($uri, '{DAV:}read', self::R_PARENT, false)) {
         // User is not allowed to read properties
         if ($this->hideNodesFromListings) {
             return false;
         }
         // Marking all requested properties as '403'.
         foreach ($requestedProperties as $key => $requestedProperty) {
             unset($requestedProperties[$key]);
             $returnedProperties[403][$requestedProperty] = null;
         }
         return;
     }
     /* Adding principal properties */
     if ($node instanceof IPrincipal) {
         if (false !== ($index = array_search('{DAV:}alternate-URI-set', $requestedProperties))) {
             unset($requestedProperties[$index]);
             $returnedProperties[200]['{DAV:}alternate-URI-set'] = new DAV\Property\HrefList($node->getAlternateUriSet());
         }
         if (false !== ($index = array_search('{DAV:}principal-URL', $requestedProperties))) {
             unset($requestedProperties[$index]);
             $returnedProperties[200]['{DAV:}principal-URL'] = new DAV\Property\Href($node->getPrincipalUrl() . '/');
         }
         if (false !== ($index = array_search('{DAV:}group-member-set', $requestedProperties))) {
             unset($requestedProperties[$index]);
             $returnedProperties[200]['{DAV:}group-member-set'] = new DAV\Property\HrefList($node->getGroupMemberSet());
         }
         if (false !== ($index = array_search('{DAV:}group-membership', $requestedProperties))) {
             unset($requestedProperties[$index]);
             $returnedProperties[200]['{DAV:}group-membership'] = new DAV\Property\HrefList($node->getGroupMembership());
         }
         if (false !== ($index = array_search('{DAV:}displayname', $requestedProperties))) {
             $returnedProperties[200]['{DAV:}displayname'] = $node->getDisplayName();
         }
     }
     if (false !== ($index = array_search('{DAV:}principal-collection-set', $requestedProperties))) {
         unset($requestedProperties[$index]);
         $val = $this->principalCollectionSet;
         // Ensuring all collections end with a slash
         foreach ($val as $k => $v) {
             $val[$k] = $v . '/';
         }
         $returnedProperties[200]['{DAV:}principal-collection-set'] = new DAV\Property\HrefList($val);
     }
     if (false !== ($index = array_search('{DAV:}current-user-principal', $requestedProperties))) {
         unset($requestedProperties[$index]);
         if ($url = $this->getCurrentUserPrincipal()) {
             $returnedProperties[200]['{DAV:}current-user-principal'] = new Property\Principal(Property\Principal::HREF, $url . '/');
         } else {
             $returnedProperties[200]['{DAV:}current-user-principal'] = new Property\Principal(Property\Principal::UNAUTHENTICATED);
         }
     }
     if (false !== ($index = array_search('{DAV:}supported-privilege-set', $requestedProperties))) {
         unset($requestedProperties[$index]);
         $returnedProperties[200]['{DAV:}supported-privilege-set'] = new Property\SupportedPrivilegeSet($this->getSupportedPrivilegeSet($node));
     }
     if (false !== ($index = array_search('{DAV:}current-user-privilege-set', $requestedProperties))) {
         if (!$this->checkPrivileges($uri, '{DAV:}read-current-user-privilege-set', self::R_PARENT, false)) {
             $returnedProperties[403]['{DAV:}current-user-privilege-set'] = null;
             unset($requestedProperties[$index]);
         } else {
             $val = $this->getCurrentUserPrivilegeSet($node);
             if (!is_null($val)) {
                 unset($requestedProperties[$index]);
                 $returnedProperties[200]['{DAV:}current-user-privilege-set'] = new Property\CurrentUserPrivilegeSet($val);
             }
         }
     }
     /* The ACL property contains all the permissions */
     if (false !== ($index = array_search('{DAV:}acl', $requestedProperties))) {
         if (!$this->checkPrivileges($uri, '{DAV:}read-acl', self::R_PARENT, false)) {
             unset($requestedProperties[$index]);
             $returnedProperties[403]['{DAV:}acl'] = null;
         } else {
             $acl = $this->getACL($node);
             if (!is_null($acl)) {
                 unset($requestedProperties[$index]);
                 $returnedProperties[200]['{DAV:}acl'] = new Property\Acl($this->getACL($node));
             }
         }
     }
     /* The acl-restrictions property contains information on how privileges
      * must behave.
      */
     if (false !== ($index = array_search('{DAV:}acl-restrictions', $requestedProperties))) {
         unset($requestedProperties[$index]);
         $returnedProperties[200]['{DAV:}acl-restrictions'] = new Property\AclRestrictions();
     }
//.........这里部分代码省略.........
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:101,代码来源:Plugin.php


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