本文整理汇总了PHP中Repository::hasContentFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::hasContentFilter方法的具体用法?PHP Repository::hasContentFilter怎么用?PHP Repository::hasContentFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::hasContentFilter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFromHttpVars
/**
* Init the selection from the query vars
* @param array $passedArray
* @return void
*/
public function initFromHttpVars($passedArray = null)
{
if ($passedArray != null) {
if (isset($passedArray["selection_nodes"]) && is_array($passedArray["selection_nodes"])) {
$this->initFromNodes($passedArray["selection_nodes"]);
} else {
$this->initFromArray($passedArray);
}
} else {
$this->initFromArray($_GET);
$this->initFromArray($_POST);
}
if (isset($this->repository) && $this->repository->hasContentFilter()) {
$this->repository->getContentFilter()->filterUserSelection($this);
}
}
示例2: UserSelection
/**
* Construction selector
* @param Repository|null $repository
*/
public function UserSelection($repository = null, $httpVars = null)
{
$this->files = array();
if (isset($repository) && $repository->hasContentFilter()) {
$this->contentFilter = $repository->getContentFilter();
}
if (isset($httpVars)) {
$this->initFromHttpVars($httpVars);
}
}
示例3: 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>";
}
示例4: switchAction
//.........这里部分代码省略.........
}
if (RecycleBinManager::recycleEnabled() && $node->getPath() == RecycleBinManager::getRecyclePath()) {
continue;
}
$node->loadNodeInfo(false, false, $lsOptions["l"] ? "all" : "minimal");
if (!empty($node->metaData["nodeName"]) && $node->metaData["nodeName"] != $nodeName) {
$node->setUrl(dirname($node->getUrl()) . "/" . $node->metaData["nodeName"]);
}
if (!empty($node->metaData["hidden"]) && $node->metaData["hidden"] === true) {
continue;
}
if (!empty($node->metaData["mimestring_id"]) && array_key_exists($node->metaData["mimestring_id"], $mess)) {
$node->mergeMetadata(array("mimestring" => $mess[$node->metaData["mimestring_id"]]));
}
if (isset($httpVars["page_position"]) && $httpVars["page_position"] == "true") {
// Detect page position: we have to loading "siblings"
$parentPath = AJXP_Utils::safeDirname($node->getPath());
$siblings = scandir($this->urlBase . $parentPath);
foreach ($siblings as $i => $s) {
if ($this->filterFile($s, true)) {
unset($siblings[$i]);
}
if ($this->filterFolder($s)) {
unset($siblings[$i]);
}
}
if (count($siblings) > $threshold) {
//usort($siblings, "strcasecmp");
$siblings = $this->orderNodes($siblings, $this->urlBase . $parentPath, $orderField, $orderDirection);
$index = array_search($node->getLabel(), $siblings);
$node->mergeMetadata(array("page_position" => floor($index / $limitPerPage) + 1));
}
}
if ($this->repository->hasContentFilter()) {
$externalPath = $this->repository->getContentFilter()->externalPath($node);
$node->setUrl($this->urlBase . $externalPath);
}
AJXP_XMLWriter::renderAjxpNode($node);
}
AJXP_XMLWriter::close();
break;
}
$streamIsSeekable = AJXP_MetaStreamWrapper::wrapperIsSeekable($path);
$sharedHandle = null;
if ($streamIsSeekable) {
$handle = opendir($path);
$sharedHandle = $handle;
}
$countFiles = $this->countFiles($path, !$lsOptions["f"], false, $sharedHandle);
if (isset($sharedHandle)) {
rewind($handle);
}
if (isset($crt_nodes)) {
$crt_nodes += $countFiles;
}
$totalPages = $crtPage = 1;
if (isset($threshold) && isset($limitPerPage) && $countFiles > $threshold) {
$offset = 0;
$crtPage = 1;
if (isset($page)) {
$offset = (intval($page) - 1) * $limitPerPage;
$crtPage = $page;
}
$totalPages = floor($countFiles / $limitPerPage) + 1;
} else {
$offset = $limitPerPage = 0;
示例5: 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);
}
}