diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 3b8a8e04d..ca3a622d4 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -31,32 +31,6 @@ class Folder extends File { if(!$this->Name) $this->Name = _t('AssetAdmin.NEWFOLDER',"NewFolder"); } - function onBeforeWrite() { - // Ensure folders can't contain path information, just a name - $this->Name = basename($this->Name); - - // Get the folder to be created - if($this->ParentID) { - if(!is_numeric($this->ParentID)) $this->ParentID = 0; - $parentObj = DataObject::get_by_id($this->class, $this->ParentID); - } - // TODO Check that the $parentObj matches the ASSETS_PATH - if(isset($parentObj->ID)) $path = $parentObj->FullPath . $this->Name; - else $path = ASSETS_PATH . '/' . $this->Name; - - // Ensure uniqueness - $i = 2; - $basePath = $path . '-'; - while(file_exists($path)) { - $path = $basePath . $i; - $i++; - } - - Filesystem::makeFolder($path); - - parent::onBeforeWrite(); - } - /** * Find the given folder or create it both as {@link Folder} database records * and on the filesystem. If necessary, creates parent folders as well.