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

Commit

Permalink
Internalize setHiddenAttribute in fsAccessDriver instead of AJXP_Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Apr 1, 2015
1 parent 6ced826 commit bc181ac
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/src/plugins/access.fs/class.fsAccessDriver.php
Expand Up @@ -70,8 +70,8 @@ public function initRepository()
@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);
} else {
$this->setHiddenAttribute(new AJXP_Node($this->urlBase ."/".$recycle));
}
}
$dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
Expand Down Expand Up @@ -1956,6 +1956,18 @@ public function recursivePurge($dirName, $hardPurgeTime, $softPurgeTime = 0)
closedir($handle);
}

/**
* Apply specific operation to set a node as hidden.
* Can be overwritten, or will probably do nothing.
* @param AJXP_Node $node
*/
public function setHiddenAttribute($node){
if($this->getWrapperClassName() == "fsAccessWrapper" && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
$realPath = call_user_func(array($this->wrapperClassName, "getRealFSReference"),$node->getUrl());
@shell_exec("attrib +H " . escapeshellarg($realPath));
}
}

private function purge($fileName)
{
$node = new AJXP_Node($fileName);
Expand Down

0 comments on commit bc181ac

Please sign in to comment.