For moving, you need to provide a destination directory. To do this, this example will add a second directory-selector box when the move action is selected.
We will describe the JavaScript side of this function before writing the PHP.
First, replace the $(document).ready
function in the file_manager.js
file with this:
$(document).ready(function(){ fm_getFiles(); $('select[name="selected_file"]').change(function(){ fm_getFiles(); }); $('<select id="selected_file_options"></select>') .insertAfter($('select[name="selected_file"]')) .change(fm_runAction); $('<span id="selected_file_extras"></span>') .insertAfter($('#selected_file_options')); });
Note that we've changed the way the fm_getFiles
function is called. In this example, we need to tell the fm_getFiles
function which select box it needs to act on. To accomplish this, we will change the code so that if a parameter is supplied, it should use that...