Source

yii-ddmedia / models / DDMediaAction.php

Diff from to

models/DDMediaAction.php

                 }
                 break; // }}} 
             case 'upload': // {{{ 
+                var_dump($this->attributes);
                 $this->uploadedFile=CUploadedFile::getInstance($this,'uploadedFile');
-                $fileName = $this->oldName = $this->uploadedFile->name;
+                $fileName = $this->selectedItemsOld = $this->uploadedFile->name;
                 // Check if file already exists?
                 $filePathAndName = $this->path.'/'.basename($fileName);
                 $i=0;
                 while(is_file($filePathAndName.$add))
                     $add = '.'.(++$i+1);
                 $result = $this->uploadedFile->saveAs($this->path.'/'.basename($fileName).$add);
-                if($this->oldName!==basename($fileName).$add)
-                    $this->name = basename($fileName).$add;
+                if($this->selectedItemsOld!==basename($fileName).$add)
+                    $this->selectedItems = basename($fileName).$add;
                 break; // }}} 
             case 'newdir': // {{{ 
                 $newDir = $this->path.'/'.$this->p1;
                 if(!is_dir($newDir))
                     $result = @mkdir($newDir, 0770);
+                if(is_dir($newDir))
+                    $result = true;
                 break; // }}} 
         }
         return $result;