Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 481e176

Browse files
committed
Add the function filterNodeName() to the AjxpWrapperProvider, and use it in the webdav collection to correctly load the hidden files/folders configurations. Alternative to fix #862 and fix #861
1 parent a6c2f85 commit 481e176

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

core/src/core/classes/interface.AjxpWrapperProvider.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ public function nodeChanged(&$from, &$to, $copy = false);
6363

6464
/**
6565
* @param String $node
66+
* @param null $newSize
67+
* @return
6668
*/
6769
public function nodeWillChange($node, $newSize = null);
70+
71+
/**
72+
* @param $nodePath
73+
* @param $nodeName
74+
* @param $isLeaf
75+
* @param $lsOptions
76+
* @return mixed
77+
*/
78+
public function filterNodeName($nodePath, $nodeName, &$isLeaf, $lsOptions);
6879
}

core/src/core/classes/sabredav/ajaxplorer/class.AJXP_Sabre_Collection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,11 @@ public function getChildren()
153153
if ($file == "." || $file == "..") {
154154
continue;
155155
}
156-
if ( !$this->repository->getOption("SHOW_HIDDEN_FILES") && AJXP_Utils::isHidden($file)) {
156+
// This function will perform the is_dir() call and update $isDir variable.
157+
if (!$this->getAccessDriver()->filterNodeName($this->getUrl(), $file, $isLeaf, array("d"=>true, "f"=>true, "z"=>true))){
157158
continue;
158159
}
159-
if ( is_dir( $this->getUrl() . "/" . $file ) ) {
160+
if ( !$isLeaf ) {
160161
// Add collection without any children
161162
$contents[] = new AJXP_Sabre_Collection($this->path."/".$file, $this->repository, $this->getAccessDriver());
162163
} else {

0 commit comments

Comments
 (0)