20 $form =
new AutoForm(
$documentMove,
"POST",
"/action/document/move_documents?document_library_id={$document_library_id}&document_ids={$document_ids}");
21 $form->ajaxSubmit(
"function(response) { moveDocumentsResponse(response); }");
23 $form->related(
DocumentLibrary,
"WHERE document_library_id={$document_library_id}",
"{name}",
"from",
"Move From",
false,
false);
24 $form->related(
DocumentLibrary,
"WHERE document_library_id!={$document_library_id} ORDER BY name",
"{name}",
"to",
"Move To",
false,
false);
25 $form->readonly(
"from");
26 $form->submitLabel =
"Move Documents";
27 $form->button(
"Cancel",
"ModalDialog.closeAllDialogs(); return true",
null,
true);
33 $docs = Query::create(
Document,
"WHERE document_id IN ($document_ids)")->execute();
35 foreach($docs as $doc)
37 $fromPath =
$library->getLibraryDirectory().DIRECTORY_SEPARATOR.$doc->file;
38 $toPath =
$to->getLibraryDirectory().DIRECTORY_SEPARATOR.$doc->file;
39 rename($fromPath, $toPath);
40 $doc->document_library_id =
$to->document_library_id;
This class maps the publication table.
static notifyOnNextPage($message, $blocking=false, $button="OK", $onClick="null")
Schedules a notification message to be displayed to the user at the next full page load.
static using()
Import the datamodels, views and manifest for the specified component(s).
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
$method
Pull out a simple reference to the request method.
if(! $library->allowManageFiles()) $documentMove
if(! $document_library_id||! $document_ids) $library
if($method=="POST") $script