Exemple #1
0
 protected function delete($uploadpath)
 {
     if (isset($_GET['deletefile']) && file_exists($uploadpath . $_GET['dir'] . "/" . $_GET['deletefile'])) {
         if ($_GET['dir'] == "" || $_GET['dir'] == "/") {
             $imagePath = Settings::getInstance()->get("host") . "content/uploads/" . $_GET['deletefile'];
         } else {
             $imagePath = Settings::getInstance()->get("host") . "content/uploads" . $_GET['dir'] . "/" . $_GET['deletefile'];
         }
         ImageServer::delete($imagePath);
         unlink($uploadpath . $_GET['dir'] . "/" . $_GET['deletefile']);
         $this->template->assign_var("MESSAGE", $GLOBALS['language']->getString("FILE") . " " . htmlentities($_GET['deletefile']) . " " . $GLOBALS['language']->getString("WAS_DELETED"));
     }
 }