From fd6fa623884f719f8e5e3952e88312f05f807765 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 04:02:54 +0000 Subject: [PATCH] MINOR Fixed merge error git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112616 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/Folder.php | 26 -------------------------- 1 file changed, 26 deletions(-) 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.