diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index bb389f6d..9919f97b 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -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; diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 5623a8b9..c8f507a7 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -238,30 +238,27 @@ DropFileItem.prototype = { // eg:
  • 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 - // eg:
  • would give a recordID of 6 - if(this.element.id && this.element.id.match(/-([^-]+)$/)) - this.recordID = RegExp.$1; - $('Form_EditForm').elements['DestFolderID'].value = this.recordID; + 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 + // eg:
  • would give a recordID of 6 + if(this.element.id && this.element.id.match(/-([^-]+)$/)) + this.recordID = RegExp.$1; + $('Form_EditForm').elements['DestFolderID'].value = this.recordID; - // Add the dropped file to the list of files to move - var list = droppedElement.getElementsByTagName('img')[0].id.replace('drag-img-Files-',''); - var i, checkboxes = $('Form_EditForm').elements['Files[]']; - if(!checkboxes) checkboxes = []; - if(!checkboxes.length) checkboxes = [ checkboxes ]; - // Add each checked file to the list of ones to move - for(i=0;i