public function initUploadForm() { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilDragDropFileInputGUI.php"; include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; $this->form = new ilPropertyFormGUI(); $this->form->setId("upload"); $this->form->setMultipart(true); $this->form->setHideLabels(); $file = new ilDragDropFileInputGUI($lng->txt("cld_upload_flies"), "upload_files"); $file->setRequired(true); $this->form->addItem($file); $this->form->addCommandButton("uploadFiles", $lng->txt("upload")); $this->form->addCommandButton("cancelAll", $lng->txt("cancel")); $this->form->setTableWidth("100%"); $this->form->setTitle($lng->txt("upload_files_title")); $this->form->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $lng->txt('obj_file')); $this->form->setTitle($lng->txt("upload_files")); $this->form->setFormAction($ilCtrl->getFormAction($this, "uploadFiles")); $this->form->setTarget("cld_blank_target"); }
/** * 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; }