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

Commit bc181ac

Browse files
committed
Internalize setHiddenAttribute in fsAccessDriver instead of AJXP_Utils
1 parent 6ced826 commit bc181ac

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

core/src/plugins/access.fs/class.fsAccessDriver.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public function initRepository()
7070
@mkdir($path."/".$recycle);
7171
if (!is_dir($path."/".$recycle)) {
7272
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
73-
} elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
74-
AJXP_Utils::winSetHidden($path."/".$recycle);
73+
} else {
74+
$this->setHiddenAttribute(new AJXP_Node($this->urlBase ."/".$recycle));
7575
}
7676
}
7777
$dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
@@ -1956,6 +1956,18 @@ public function recursivePurge($dirName, $hardPurgeTime, $softPurgeTime = 0)
19561956
closedir($handle);
19571957
}
19581958

1959+
/**
1960+
* Apply specific operation to set a node as hidden.
1961+
* Can be overwritten, or will probably do nothing.
1962+
* @param AJXP_Node $node
1963+
*/
1964+
public function setHiddenAttribute($node){
1965+
if($this->getWrapperClassName() == "fsAccessWrapper" && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
1966+
$realPath = call_user_func(array($this->wrapperClassName, "getRealFSReference"),$node->getUrl());
1967+
@shell_exec("attrib +H " . escapeshellarg($realPath));
1968+
}
1969+
}
1970+
19591971
private function purge($fileName)
19601972
{
19611973
$node = new AJXP_Node($fileName);

0 commit comments

Comments
 (0)