Ejemplo n.º 1
0
 /**
  * Initializes the upload form for multiple files.
  *
  * @return object The created property form.
  */
 public function initMultiUploadForm()
 {
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $dnd_form_gui = new ilPropertyFormGUI();
     $dnd_form_gui->setMultipart(true);
     $dnd_form_gui->setHideLabels();
     // file input
     include_once "Services/Form/classes/class.ilDragDropFileInputGUI.php";
     $dnd_input = new ilDragDropFileInputGUI($this->lng->txt("files"), "upload_files");
     $dnd_input->setArchiveSuffixes(array("zip"));
     $dnd_input->setCommandButtonNames("uploadFiles", "cancel");
     $dnd_form_gui->addItem($dnd_input);
     // add commands
     $dnd_form_gui->addCommandButton("uploadFiles", $this->lng->txt("upload_files"));
     $dnd_form_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
     $dnd_form_gui->setTableWidth("100%");
     $dnd_form_gui->setTarget($this->getTargetFrame("save"));
     $dnd_form_gui->setTitle($this->lng->txt("upload_files_title"));
     $dnd_form_gui->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $this->lng->txt('obj_file'));
     $this->ctrl->setParameter($this, "new_type", "file");
     $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this, "uploadFiles"));
     return $dnd_form_gui;
 }