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


PHP Repository::getDisplay方法代码示例

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


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

示例1: initRepository

 function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path);
         }
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot create root path for repository (" . $this->repository->getDisplay() . "). Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             }
         }
     } else {
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:35,代码来源:class.fsAccessDriver.php

示例2: initRepository

 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if ($this->getFilteredOption("PROBE_REAL_SIZE", $this->repository->getId()) == true) {
         // PASS IT TO THE WRAPPER
         ConfService::setConf("PROBE_REAL_SIZE", $this->getFilteredOption("PROBE_REAL_SIZE", $this->repository->getId()));
     }
     $create = $this->repository->getOption("CREATE");
     $path = SystemTextEncoding::toStorageEncoding($this->repository->getOption("PATH"));
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     $chmod = $this->repository->getOption("CHMOD_VALUE");
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path, 0755, true);
         }
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot create root path for repository (" . $this->repository->getDisplay() . "). Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             } elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                 AJXP_Utils::winSetHidden($path . "/" . $recycle);
             }
         }
         $dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
         if (!empty($dataTemplate) && is_dir($dataTemplate) && !is_file($path . "/.ajxp_template")) {
             $errs = array();
             $succ = array();
             $repoData = array('base_url' => $this->urlBase, 'wrapper_name' => $this->wrapperClassName, 'chmod' => $chmod, 'recycle' => $recycle);
             $this->dircopy($dataTemplate, $path, $succ, $errs, false, false, $repoData, $repoData);
             touch($path . "/.ajxp_template");
         }
     } else {
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:50,代码来源:class.fsAccessDriver.php

示例3: initRepository

 function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if (isset($this->pluginConf["PROBE_REAL_SIZE"])) {
         // PASS IT TO THE WRAPPER
         ConfService::setConf("PROBE_REAL_SIZE", $this->pluginConf["PROBE_REAL_SIZE"]);
     }
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path, 0755, true);
         }
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot create root path for repository (" . $this->repository->getDisplay() . "). Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             }
         }
         $dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
         if (!empty($dataTemplate) && is_dir($dataTemplate) && !is_file($path . "/.ajxp_template")) {
             $errs = array();
             $succ = array();
             $this->dircopy($dataTemplate, $path, $succ, $errs, false, false);
             touch($path . "/.ajxp_template");
         }
     } else {
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:46,代码来源:class.fsAccessDriver.php

示例4: repositoryToXML

 /**
  * @param string $repoId
  * @param Repository $repoObject
  * @param array $exposed
  * @param array $streams
  * @param AbstractAjxpUser $loggedUser
  * @param string $accessStatus
  * @return string
  * @throws Exception
  */
 public static function repositoryToXML($repoId, $repoObject, $exposed, $streams, $loggedUser, $accessStatus = "")
 {
     $statusString = " repository_type=\"" . $repoObject->getRepositoryType() . "\"";
     if (empty($accessStatus)) {
         $accessStatus = $repoObject->getAccessStatus();
     }
     if (!empty($accessStatus)) {
         $statusString .= " access_status=\"{$accessStatus}\" ";
     } else {
         if ($loggedUser != null) {
             $lastConnected = $loggedUser->getArrayPref("repository_last_connected", $repoId);
             if (!empty($lastConnected)) {
                 $statusString .= " last_connection=\"{$lastConnected}\" ";
             }
         }
     }
     $streamString = "";
     if (in_array($repoObject->accessType, $streams)) {
         $streamString = "allowCrossRepositoryCopy=\"true\"";
     }
     if ($repoObject->getUniqueUser()) {
         $streamString .= " user_editable_repository=\"true\" ";
     }
     if ($repoObject->hasContentFilter()) {
         $streamString .= " hasContentFilter=\"true\"";
     }
     $slugString = "";
     $slug = $repoObject->getSlug();
     if (!empty($slug)) {
         $slugString = "repositorySlug=\"{$slug}\"";
     }
     $isSharedString = "";
     $currentUserIsOwner = false;
     $ownerLabel = null;
     if ($repoObject->hasOwner()) {
         $uId = $repoObject->getOwner();
         if (AuthService::usersEnabled() && AuthService::getLoggedUser()->getId() == $uId) {
             $currentUserIsOwner = true;
         }
         $label = ConfService::getUserPersonalParameter("USER_DISPLAY_NAME", $uId, "core.conf", $uId);
         $ownerLabel = $label;
         $isSharedString = 'owner="' . AJXP_Utils::xmlEntities($label) . '"';
     }
     if ($repoObject->securityScope() == "USER" || $currentUserIsOwner) {
         $streamString .= " userScope=\"true\"";
     }
     $descTag = "";
     $public = false;
     if (!empty($_SESSION["CURRENT_MINISITE"])) {
         $public = true;
     }
     $description = $repoObject->getDescription($public, $ownerLabel);
     if (!empty($description)) {
         $descTag = '<description>' . AJXP_Utils::xmlEntities($description, true) . '</description>';
     }
     $roleString = "";
     if ($loggedUser != null) {
         $merged = $loggedUser->mergedRole;
         $params = array();
         foreach ($exposed as $exposed_prop) {
             $metaOptions = $repoObject->getOption("META_SOURCES");
             if (!isset($metaOptions[$exposed_prop["PLUGIN_ID"]])) {
                 continue;
             }
             $value = $exposed_prop["DEFAULT"];
             if (isset($metaOptions[$exposed_prop["PLUGIN_ID"]][$exposed_prop["NAME"]])) {
                 $value = $metaOptions[$exposed_prop["PLUGIN_ID"]][$exposed_prop["NAME"]];
             }
             $value = $merged->filterParameterValue($exposed_prop["PLUGIN_ID"], $exposed_prop["NAME"], $repoId, $value);
             if ($value !== null) {
                 if ($value === true || $value === false) {
                     $value = $value === true ? "true" : "false";
                 }
                 $params[] = '<repository_plugin_param plugin_id="' . $exposed_prop["PLUGIN_ID"] . '" name="' . $exposed_prop["NAME"] . '" value="' . AJXP_Utils::xmlEntities($value) . '"/>';
                 $roleString .= str_replace(".", "_", $exposed_prop["PLUGIN_ID"]) . "_" . $exposed_prop["NAME"] . '="' . AJXP_Utils::xmlEntities($value) . '" ';
             }
         }
         $roleString .= 'acl="' . $merged->getAcl($repoId) . '"';
         if ($merged->hasMask($repoId)) {
             $roleString .= ' hasMask="true" ';
         }
     }
     return "<repo access_type=\"" . $repoObject->accessType . "\" id=\"" . $repoId . "\"{$statusString} {$streamString} {$slugString} {$isSharedString} {$roleString}><label>" . SystemTextEncoding::toUTF8(AJXP_Utils::xmlEntities($repoObject->getDisplay())) . "</label>" . $descTag . $repoObject->getClientSettings() . "</repo>";
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:94,代码来源:class.AJXP_XMLWriter.php

示例5: sortReposByLabel

 /**
  * @param Repository $a
  * @param Repository $b
  * @return integer
  */
 public function sortReposByLabel($a, $b)
 {
     return strcasecmp($a->getDisplay(), $b->getDisplay());
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:9,代码来源:class.ajxp_confAccessDriver.php

示例6: assignSharedRepositoryPermissions

 /**
  * @param Repository $parentRepository
  * @param Repository $childRepository
  * @param bool $isUpdate
  * @param array $users
  * @param array $groups
  * @param UserSelection $selection
  * @param bool|false $disableDownload
  * @throws Exception
  */
 public function assignSharedRepositoryPermissions($parentRepository, $childRepository, $isUpdate, $users, $groups, $selection)
 {
     $childRepoId = $childRepository->getId();
     if ($isUpdate) {
         $this->unregisterRemovedUsers($childRepoId, $users, $groups, $selection->getUniqueNode());
     }
     $confDriver = ConfService::getConfStorageImpl();
     $loggedUser = AuthService::getLoggedUser();
     foreach ($users as $userName => $userEntry) {
         if (AuthService::userExists($userName, "r")) {
             $userObject = $confDriver->createUserObject($userName);
             if (isset($userEntry["HIDDEN"]) && isset($userEntry["UPDATE_PASSWORD"])) {
                 AuthService::updatePassword($userName, $userEntry["UPDATE_PASSWORD"]);
             }
         } else {
             $mess = ConfService::getMessages();
             $hiddenUserLabel = "[" . $mess["share_center.109"] . "] " . AJXP_Utils::sanitize($childRepository->getDisplay(), AJXP_SANITIZE_EMAILCHARS);
             $userObject = $this->createNewUser($loggedUser, $userName, $userEntry["PASSWORD"], isset($userEntry["HIDDEN"]), $hiddenUserLabel);
         }
         // ASSIGN NEW REPO RIGHTS
         $userObject->personalRole->setAcl($childRepoId, $userEntry["RIGHT"]);
         // FORK MASK IF THERE IS ANY
         $childMask = $this->forkMaskIfAny($loggedUser, $parentRepository->getId(), $selection->getUniqueNode());
         if ($childMask != null) {
             $userObject->personalRole->setMask($childRepoId, $childMask);
         }
         // CREATE A MINISITE-LIKE ROLE FOR THIS REPOSITORY
         if (isset($userEntry["HIDDEN"]) && !isset($userEntry["REMOTE"])) {
             $minisiteRole = $this->createRoleForMinisite($childRepoId, $userEntry["DISABLE_DOWNLOAD"], $isUpdate);
             if ($minisiteRole != null) {
                 $userObject->addRole($minisiteRole);
             }
         }
         // ADD "my shared files" REPO OTHERWISE SOME USER CANNOT ACCESS
         if (!isset($userEntry["HIDDEN"]) && $childRepository->hasContentFilter()) {
             $inboxRepo = ConfService::getRepositoryById("inbox");
             $currentAcl = $userObject->mergedRole->getAcl("inbox");
             if ($inboxRepo !== null && empty($currentAcl)) {
                 $userObject->personalRole->setAcl("inbox", "rw");
             }
         }
         $userObject->save("superuser");
     }
     foreach ($groups as $group => $groupEntry) {
         $r = $groupEntry["RIGHT"];
         $grRole = AuthService::getRole($group, true);
         $grRole->setAcl($childRepoId, $r);
         AuthService::updateRole($grRole);
     }
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:60,代码来源:class.ShareRightsManager.php


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