示例#1
0
 protected function act_deleteDir()
 {
     if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir']))) {
         $this->errorMsg("Unknown error.");
     }
     $dir = $this->postDir();
     if (!dir::isWritable($dir)) {
         $this->errorMsg("Cannot delete the folder.");
     }
     $result = !dir::prune($dir, false);
     if (is_array($result) && count($result)) {
         $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result)));
     }
     $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}";
     if (is_dir($thumbDir)) {
         dir::prune($thumbDir);
     }
     return true;
 }