FEATURE #1531 - Allow moving files in root assets file (hamish)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@66163 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-11-18 21:38:57 +00:00 committed by Sam Minnee
parent 6078fe75dc
commit 53f59b6593
2 changed files with 21 additions and 24 deletions

View File

@ -298,8 +298,8 @@ HTML;
* Called and returns in same way as 'save' function
*/
public function movemarked($urlParams, $form) {
if($_REQUEST['DestFolderID'] && is_numeric($_REQUEST['DestFolderID'])) {
$destFolderID = $_REQUEST['DestFolderID'];
if($_REQUEST['DestFolderID'] && (is_numeric($_REQUEST['DestFolderID']) || ($_REQUEST['DestFolderID']) == 'root')) {
$destFolderID = ($_REQUEST['DestFolderID'] == 'root') ? 0 : $_REQUEST['DestFolderID'];
$fileList = "'" . ereg_replace(' *, *',"','",trim(addslashes($_REQUEST['FileIDs']))) . "'";
$numFiles = 0;

View File

@ -238,8 +238,6 @@ DropFileItem.prototype = {
// eg: <li id="treenode-6"> would give a recordID of 6
if(this.id && this.id.match(/-([^-]+)$/))
this.recordID = RegExp.$1;
// Do not allow files to be dropped to the root
if (this.recordID != 'root') {
this.droppable = Droppables.add(this.id, {accept:'dragfile', hoverclass:'filefolderhover',
onDrop:function(droppedElement) {
// Get this.recordID from the last "-" separated chunk of the id HTML attribute
@ -261,7 +259,6 @@ DropFileItem.prototype = {
$('Form_EditForm').save(false, null, 'movemarked')
}
});
}
},
destroy: function() {
this.droppable = null;