ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjFileGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5
17{
18 const CMD_EDIT = "edit";
19 const CMD_VERSIONS = "versions";
20 const CMD_UPLOAD_FILES = "uploadFiles";
24 public $object;
25 public $lng;
26 protected $log = null;
27 protected $obj_service;
28
35 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
36 {
37 global $DIC;
38 $this->lng = $DIC->language();
39 $this->log = ilLoggerFactory::getLogger('file');
40 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
41 $this->obj_service = $DIC->object();
42 $this->lng->loadLanguageModule("file");
43 }
44
45 public function getType()
46 {
47 return "file";
48 }
49
50 public function executeCommand()
51 {
52 global $DIC;
53 $ilNavigationHistory = $DIC['ilNavigationHistory'];
54 $ilCtrl = $DIC['ilCtrl'];
55 $ilUser = $DIC['ilUser'];
56 $ilTabs = $DIC['ilTabs'];
57 $ilErr = $DIC['ilErr'];
58
59 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd();
61
62 if (!$this->getCreationMode()) {
63 if ($this->id_type == self::REPOSITORY_NODE_ID
64 && $this->checkPermissionBool("read")
65 ) {
66 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->node_id);
67 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
68 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
69
70 // add entry to navigation history
71 $ilNavigationHistory->addItem(
72 $this->node_id,
73 $link,
74 "file"
75 );
76 }
77 }
78
79 $this->prepareOutput();
80
81 switch ($next_class) {
82 case "ilinfoscreengui":
83 $this->infoScreenForward(); // forwards command
84 break;
85
86 case 'ilobjectmetadatagui':
87 if (!$this->checkPermissionBool("write")) {
88 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
89 }
90
91 $ilTabs->activateTab("id_meta");
92
93 $md_gui = new ilObjectMetaDataGUI($this->object);
94
95 // todo: make this work
96 // $md_gui->addMDObserver($this->object,'MDUpdateListener','Technical');
97
98 $this->ctrl->forwardCommand($md_gui);
99 break;
100
101 // repository permissions
102 case 'ilpermissiongui':
103 $ilTabs->activateTab("id_permissions");
104 $perm_gui = new ilPermissionGUI($this);
105 $ret = $this->ctrl->forwardCommand($perm_gui);
106 break;
107
108 case "ilexportgui":
109 $ilTabs->activateTab("export");
110 $exp_gui = new ilExportGUI($this);
111 $exp_gui->addFormat("xml");
112 $ret = $this->ctrl->forwardCommand($exp_gui);
113 break;
114
115 case 'ilobjectcopygui':
116 $cp = new ilObjectCopyGUI($this);
117 $cp->setType('file');
118 $this->ctrl->forwardCommand($cp);
119 break;
120
121 // personal workspace permissions
122 case "ilworkspaceaccessgui":
123 $ilTabs->activateTab("id_permissions");
124 $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler());
125 $this->ctrl->forwardCommand($wspacc);
126 break;
127
128 case "ilcommonactiondispatchergui":
130 $this->ctrl->forwardCommand($gui);
131 break;
132
133 case "illearningprogressgui":
134 $ilTabs->activateTab('learning_progress');
135 $new_gui = new ilLearningProgressGUI(
137 $this->object->getRefId(),
138 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
139 );
140 $this->ctrl->forwardCommand($new_gui);
141 $this->tabs_gui->setTabActive('learning_progress');
142 break;
143 case strtolower(ilFileVersionsGUI::class):
144 $this->tabs_gui->activateTab("id_versions");
145
146 if (!$this->checkPermissionBool("write")) {
147 $this->ilErr->raiseError($this->lng->txt("permission_denied"), $this->ilErr->MESSAGE);
148 }
149 $this->ctrl->forwardCommand(new ilFileVersionsGUI($this->object));
150 break;
151 default:
152 // in personal workspace use object2gui
153 if ((int)$this->id_type === self::WORKSPACE_NODE_ID) {
154 $this->addHeaderAction();
155
156 // coming from goto we need default command
157 if (empty($cmd)) {
158 $ilCtrl->setCmd("infoScreen");
159 }
160 $ilTabs->clearTargets();
161
162 return parent::executeCommand();
163 }
164
165 if (empty($cmd) || $cmd === 'render') {
166 $cmd = "infoScreen";
167 }
168
169 $this->$cmd();
170 break;
171 }
172
173 $this->addHeaderAction();
174 }
175
180 protected function render() : void
181 {
182 $this->infoScreen();
183 }
184
189 protected function initCreationForms($a_new_type) : array
190 {
191 $forms = [];
192 $forms[] = $this->initMultiUploadForm();
193
194 // repository only
195 if ((int) $this->id_type !== self::WORKSPACE_NODE_ID) {
196 $forms[self::CFORM_IMPORT] = $this->initImportForm('file');
197 $forms[self::CFORM_CLONE] = $this->fillCloneTemplate(null, "file");
198 }
199
200 return $forms;
201 }
202
208 protected function uploadFiles() : void
209 {
210 // Response
212
213 $dnd_form_gui = $this->initMultiUploadForm();
214 // Form not valid, abort
215 if (!$dnd_form_gui->checkInput()) {
216 $dnd_input = $dnd_form_gui->getItemByPostVar("upload_files");
217 $response->error = $dnd_input->getAlert();
218 $response->send();
219 // end
220 }
221
222 // Form valid, proceed
223
227 global $DIC;
228
229 $upload = $DIC->upload();
230 $upload->register(new ilCountPDFPagesPreProcessors());
231 $post = $DIC->http()->request()->getParsedBody();
232 // Sanitize POST
233 array_walk($post, function (&$item) {
234 if (is_string($item)) {
235 $item = ilUtil::stripSlashes($item);
236 }
237 });
238
239 if (!$upload->hasBeenProcessed()) {
240 $upload->process();
241 }
242
243 $extract = isset($post['extract']) ? (bool) $post['extract'] : false;
244 $keep_structure = isset($post['keep_structure']) ? (bool) $post['keep_structure'] : false;
245
246 foreach ($upload->getResults() as $result) {
247 if (!$result->isOK()) {
248 $response->error = $result->getStatus()->getMessage();
249 $response->send();
250 continue;
251 }
252 if ($extract) {
253 if ($keep_structure) {
254 $delegate = new ilObjFileUnzipRecursiveDelegate(
255 $this->access_handler,
256 (int) $this->id_type,
257 $this->tree);
258 } else {
259 $delegate = new ilObjFileUnzipFlatDelegate(
260 $this->access_handler,
261 (int) $this->id_type,
262 $this->tree);
263 }
264 } else {
265 $delegate = new ilObjFileSingleFileDelegate();
266 }
267 $response = $delegate->handle(
268 (int) $this->parent_id,
269 $post,
270 $result,
271 $this
272 );
273
274 $suffixes = array_unique($delegate->getUploadedSuffixes());
275 if (count(array_diff($suffixes, ilFileUtils::getValidExtensions())) > 0) {
277 $this->lng->txt('file_upload_info_file_with_critical_extension'),
278 true
279 );
280 }
281 $response->send();
282 }
283
284 }
285
290 public function update()
291 {
292 global $DIC;
293 $ilTabs = $DIC['ilTabs'];
294
295 $form = $this->initPropertiesForm();
296 if (!$form->checkInput()) {
297 $ilTabs->activateTab("settings");
298 $form->setValuesByPost();
299 $this->tpl->setContent($form->getHTML());
300
301 return false;
302 }
303
304 $title = $form->getInput('title');
305 // bugfix mantis 26045:
306 $filename = empty($data["name"]) ? $this->object->getFileName() : $data["name"];
307 if (strlen(trim($title)) == 0) {
308 $title = $filename;
309 } else {
310 $title = $this->object->checkFileExtension($filename, $title);
311 }
312
313 $this->object->handleChangedObjectTitle($title);
314 $this->object->setDescription($form->getInput('description'));
315 $this->object->setRating($form->getInput('rating'));
316
317 $this->update = $this->object->update();
318 $this->obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
319
320 // BEGIN ChangeEvent: Record update event.
321 if (!empty($data["name"])) {
322 global $DIC;
323 $ilUser = $DIC['ilUser'];
324 ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
325 ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
326 }
327 // END ChangeEvent: Record update event.
328
329 // Update ecs export settings
330 $ecs = new ilECSFileSettings($this->object);
331 $ecs->handleSettingsUpdate();
332
333 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
334 ilUtil::redirect($this->ctrl->getLinkTarget($this, self::CMD_EDIT, '', false, false));
335 }
336
341 public function edit()
342 {
343 global $DIC;
344 $ilTabs = $DIC['ilTabs'];
345 $ilErr = $DIC['ilErr'];
346
347 if (!$this->checkPermissionBool("write")) {
348 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"));
349 }
350
351 $ilTabs->activateTab("settings");
352
353 $form = $this->initPropertiesForm(self::CMD_EDIT);
354
355 $val = array();
356 $val['title'] = $this->object->getTitle();
357 $val['description'] = $this->object->getLongDescription();
358 $val['rating'] = $this->object->hasRating();
359 $form->setValuesByArray($val);
360
361 // Edit ecs export settings
362 include_once 'Modules/File/classes/class.ilECSFileSettings.php';
363 $ecs = new ilECSFileSettings($this->object);
364 $ecs->addSettingsToForm($form, 'file');
365
366 $this->tpl->setContent($form->getHTML());
367
368 return true;
369 }
370
375 protected function initPropertiesForm($mode = "create")
376 {
377 $form = new ilPropertyFormGUI();
378 $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
379
380 $form->setTitle($this->lng->txt('file_edit'));
381 $form->addCommandButton('update', $this->lng->txt('save'));
382 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
383
384 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
385 $title->setValue($this->object->getTitle());
386 $title->setInfo($this->lng->txt("if_no_title_then_filename"));
387 $form->addItem($title);
388
389 if ($mode === 'create') {
390
391 $file = new ilFileStandardDropzoneInputGUI($this->lng->txt('obj_file'), 'file');
392 $file->setRequired(false);
393 $form->addItem($file);
394
395 $group = new ilRadioGroupInputGUI('', 'replace');
396 $group->setValue(0);
397
398 $replace = new ilRadioOption($this->lng->txt('replace_file'), 1);
399 $replace->setInfo($this->lng->txt('replace_file_info'));
400 $group->addOption($replace);
401
402 $keep = new ilRadioOption($this->lng->txt('file_new_version'), 0);
403 $keep->setInfo($this->lng->txt('file_new_version_info'));
404 $group->addOption($keep);
405
406 $file->addSubItem($group);
407
408 } else {
409 $o = new ilNonEditableValueGUI($this->lng->txt('upload_info'));
410 $o->setValue($this->lng->txt('upload_info_desc'));
411 $form->addItem($o);
412 }
413 $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
414 $desc->setRows(3);
415 $form->addItem($desc);
416
417 if ($this->id_type == self::REPOSITORY_NODE_ID) {
418 $this->lng->loadLanguageModule('rating');
419 $rate = new ilCheckboxInputGUI($this->lng->txt('rating_activate_rating'), 'rating');
420 $rate->setInfo($this->lng->txt('rating_activate_rating_info'));
421 $form->addItem($rate);
422 }
423
424 $presentationHeader = new ilFormSectionHeaderGUI();
425 $presentationHeader->setTitle($this->lng->txt('settings_presentation_header'));
426 $form->addItem($presentationHeader);
427 $this->obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
428
429 return $form;
430 }
431
432 public function sendFile()
433 {
434 global $DIC;
435
436 try {
437 if (ANONYMOUS_USER_ID == $DIC->user()->getId() && isset($_GET['transaction'])) {
438 $a_hist_entry_id = isset($_GET["hist_id"]) ? $_GET["hist_id"] : null;
439 $this->object->sendFile($a_hist_entry_id);
440 }
441
442 if ($this->checkPermissionBool("read")) {
443 // BEGIN ChangeEvent: Record read event.
444 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
445
446 // Record read event and catchup with write events
448 $this->object->getType(),
449 $this->object->getRefId(),
450 $this->object->getId(),
451 $DIC->user()->getId()
452 );
453 // END ChangeEvent: Record read event.
454
455 require_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
456 ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
457
458 $a_hist_entry_id = isset($_GET["hist_id"]) ? $_GET["hist_id"] : null;
459 $this->object->sendFile($a_hist_entry_id);
460 } else {
461 $this->ilErr->raiseError($this->lng->txt("permission_denied"), $this->ilErr->MESSAGE);
462 }
463 } catch (\ILIAS\Filesystem\Exception\FileNotFoundException $e) {
464 $this->ilErr->raiseError($e->getMessage(), $this->ilErr->MESSAGE);
465 }
466
467 return true;
468 }
469
473 public function versions()
474 {
475 $this->ctrl->redirectByClass(ilFileVersionsGUI::class);
476 }
477
483 public function infoScreen()
484 {
485 $this->ctrl->setCmd("showSummary");
486 $this->ctrl->setCmdClass("ilinfoscreengui");
487 $this->infoScreenForward();
488 }
489
493 public function infoScreenForward()
494 {
495 global $DIC;
496 $ilTabs = $DIC['ilTabs'];
497 $ilErr = $DIC['ilErr'];
498 $ilToolbar = $DIC['ilToolbar'];
499
500 $ilTabs->activateTab("id_info");
501
502 if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
503 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
504 }
505
506 $info = new ilInfoScreenGUI($this);
507
508 if ($this->checkPermissionBool("read", "sendfile")) {
509 $button = ilLinkButton::getInstance();
510 $button->setCaption("file_download");
511 $button->setPrimary(true);
512
513 // get permanent download link for repository
514 if ($this->id_type === self::REPOSITORY_NODE_ID) {
515 $button->setUrl(ilObjFileAccess::_getPermanentDownloadLink($this->node_id));
516 } else {
517 $button->setUrl($this->ctrl->getLinkTarget($this, "sendfile"));
518 }
519
520 $ilToolbar->addButtonInstance($button);
521 }
522
523 $info->enablePrivateNotes();
524
525 if ($this->checkPermissionBool("read")) {
526 $info->enableNews();
527 }
528
529 // no news editing for files, just notifications
530 $info->enableNewsEditing(false);
531 if ($this->checkPermissionBool("write")) {
532 $news_set = new ilSetting("news");
533 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
534
535 if ($enable_internal_rss) {
536 $info->setBlockProperty("news", "settings", true);
537 $info->setBlockProperty("news", "public_notifications_option", true);
538 }
539 }
540
541 // standard meta data
542 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
543
544 // File Info
545 $info->addSection($this->lng->txt("file_info"));
546 $info->addProperty($this->lng->txt("filename"), $this->object->getFileName());
547 $info->addProperty($this->lng->txt("type"), $this->object->getFileType());
548 $info->addProperty($this->lng->txt("resource_id"), $this->object->getResourceId());
549 $info->addProperty($this->lng->txt("storage_id"), $this->object->getStorageID());
550
551 $info->addProperty($this->lng->txt("size"),
552 ilUtil::formatSize(ilObjFileAccess::_lookupFileSize($this->object->getId()), 'long'));
553 $info->addProperty($this->lng->txt("version"), $this->object->getVersion());
554
555 $version = $this->object->getVersions([$this->object->getVersion()]);
556 $version = end($version);
557 if($version instanceof ilObjFileVersion) {
558 $info->addProperty($this->lng->txt("version_uploaded"), (new ilDateTime($version->getDate(), IL_CAL_DATETIME))->get(IL_CAL_DATETIME));
559 }
560
561
562 if ($this->object->getPageCount() > 0) {
563 $info->addProperty($this->lng->txt("page_count"), $this->object->getPageCount());
564 }
565
566 // using getVersions function instead of ilHistory direct
567 $uploader = $this->object->getVersions();
568 $uploader = array_shift($uploader);
569 $uploader = $uploader["user_id"];
570
571 include_once "Services/User/classes/class.ilUserUtil.php";
572 $info->addProperty($this->lng->txt("file_uploaded_by"), ilUserUtil::getNamePresentation($uploader));
573
574 // download link added in repository
575 if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read", "sendfile")) {
576 $tpl = new ilTemplate("tpl.download_link.html", true, true, "Modules/File");
577 $tpl->setVariable("LINK", ilObjFileAccess::_getPermanentDownloadLink($this->node_id));
578 $info->addProperty($this->lng->txt("download_link"), $tpl->get());
579 }
580
581 if ($this->id_type == self::WORKSPACE_NODE_ID) {
582 $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
583 }
584
585 // display previews
586 include_once("./Services/Preview/classes/class.ilPreview.php");
587 if (!$this->ctrl->isAsynch()
588 && ilPreview::hasPreview($this->object->getId(), $this->object->getType())
589 && $this->checkPermissionBool("read")
590 ) {
591 include_once("./Services/Preview/classes/class.ilPreviewGUI.php");
592
593 // get context for access checks later on
594 switch ($this->id_type) {
598 break;
599
600 default:
602 break;
603 }
604
605 $preview = new ilPreviewGUI($this->node_id, $context, $this->object->getId(), $this->access_handler);
606 $info->addProperty($this->lng->txt("preview"), $preview->getInlineHTML());
607 }
608
609 // forward the command
610 // $this->ctrl->setCmd("showSummary");
611 // $this->ctrl->setCmdClass("ilinfoscreengui");
612 $this->ctrl->forwardCommand($info);
613 }
614
615 // get tabs
616 public function setTabs()
617 {
618 global $DIC;
619 $ilTabs = $DIC['ilTabs'];
620 $lng = $DIC['lng'];
621 $ilHelp = $DIC['ilHelp'];
622
623 $ilHelp->setScreenIdComponent("file");
624
625 $this->ctrl->setParameter($this, "ref_id", $this->node_id);
626
627 if ($this->checkPermissionBool("write")) {
628 $ilTabs->addTab(
629 "id_versions",
630 $lng->txt(self::CMD_VERSIONS),
631 $this->ctrl->getLinkTargetByClass(ilFileVersionsGUI::class, ilFileVersionsGUI::CMD_DEFAULT)
632 );
633 }
634
635 if ($this->checkPermissionBool("visible") || $this->checkPermissionBool("read")) {
636 $ilTabs->addTab(
637 "id_info",
638 $lng->txt("info_short"),
639 $this->ctrl->getLinkTargetByClass(array("ilobjfilegui", "ilinfoscreengui"), "showSummary")
640 );
641 }
642
643 if ($this->checkPermissionBool("write")) {
644 $ilTabs->addTab(
645 "settings",
646 $lng->txt("settings"),
647 $this->ctrl->getLinkTarget($this, self::CMD_EDIT)
648 );
649 }
650
651 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
652 $ilTabs->addTab(
653 'learning_progress',
654 $lng->txt('learning_progress'),
655 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'), '')
656 );
657 }
658
659 // meta data
660 if ($this->checkPermissionBool("write")) {
661 $mdgui = new ilObjectMetaDataGUI($this->object);
662 $mdtab = $mdgui->getTab();
663 if ($mdtab) {
664 $ilTabs->addTab(
665 "id_meta",
666 $lng->txt("meta_data"),
667 $mdtab
668 );
669 }
670 }
671
672 // export
673 if ($this->checkPermissionBool("write")) {
674 $ilTabs->addTab(
675 "export",
676 $lng->txt("export"),
677 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
678 );
679 }
680
681 // will add permission tab if needed
682 parent::setTabs();
683 }
684
685 public static function _goto($a_target, $a_additional = null)
686 {
687 global $DIC;
688 $ilErr = $DIC['ilErr'];
689 $lng = $DIC['lng'];
690 $ilAccess = $DIC['ilAccess'];
691
692 if ($a_additional && substr($a_additional, -3) == "wsp") {
693 $_GET["baseClass"] = "ilsharedresourceGUI";
694 $_GET["wsp_id"] = $a_target;
695 include("ilias.php");
696 exit;
697 }
698
699 // added support for direct download goto links
700 if ($a_additional && substr($a_additional, -8) == "download") {
701 ilObjectGUI::_gotoRepositoryNode($a_target, "sendfile");
702 }
703
704 // static method, no workspace support yet
705
706 if ($ilAccess->checkAccess("visible", "", $a_target)
707 || $ilAccess->checkAccess("read", "", $a_target)
708 ) {
709 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
710 } else {
711 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
712 ilUtil::sendFailure(sprintf(
713 $lng->txt("msg_no_perm_read_item"),
715 ), true);
717 }
718 }
719
720 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
721 }
722
726 public function addLocatorItems()
727 {
728 global $DIC;
729 $ilLocator = $DIC['ilLocator'];
730
731 if (is_object($this->object)) {
732 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
733 }
734 }
735
740 public function initMultiUploadForm()
741 {
742 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
743 $dnd_form_gui = new ilPropertyFormGUI();
744 $dnd_form_gui->setMultipart(true);
745 $dnd_form_gui->setHideLabels();
746
747 // file input
748 include_once("Services/Form/classes/class.ilDragDropFileInputGUI.php");
749 $dnd_input = new ilDragDropFileInputGUI($this->lng->txt("files"), "upload_files");
750 $dnd_input->setArchiveSuffixes(["zip"]);
751 $dnd_input->setCommandButtonNames(self::CMD_UPLOAD_FILES, "cancel");
752 $dnd_form_gui->addItem($dnd_input);
753
754 // add commands
755 $dnd_form_gui->addCommandButton(self::CMD_UPLOAD_FILES, $this->lng->txt("upload_files"));
756 $dnd_form_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
757
758 $dnd_form_gui->setTableWidth("100%");
759 $dnd_form_gui->setTarget($this->getTargetFrame("save"));
760 $dnd_form_gui->setTitle($this->lng->txt("upload_files_title"));
761 $dnd_form_gui->setTitleIcon(ilUtil::getImagePath('icon_file.gif'));
762
763 $this->ctrl->setParameter($this, "new_type", "file");
764 $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this, self::CMD_UPLOAD_FILES));
765
766 return $dnd_form_gui;
767 }
768
769 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
770 {
771 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
772 if ($lg instanceof ilObjectListGUI && $this->object->hasRating()) {
773 $lg->enableRating(
774 true,
775 null,
776 false,
777 [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
778 );
779 }
780
781 return $lg;
782 }
783}
$result
$filename
Definition: buildRTE.php:89
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
const IL_CAL_DATETIME
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilCountPDFPagesPreProcessors.
@classDescription Date and time handling
This class represents a file input property where multiple files can be dopped in a property form.
Class ilECSFileSettings.
Export User Interface Class.
Class ilFileStandardDropzoneInputGUI.
static getValidExtensions()
Valid extensions.
Class ilFileVersionsGUI.
This class represents a section header in a property form.
Class ilInfoScreenGUI.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
static getInstance()
Factory.
static getLogger($a_component_id)
Get component logger.
This class represents a non editable value in a property form.
static _lookupFileSize($a_id)
static _getPermanentDownloadLink($ref_id)
Gets the permanent download link for the file.
GUI class for file objects.
update()
updates object entry in object_data @access public
initCreationForms($a_new_type)
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
render()
This Method is needed if called from personal resources.
executeCommand()
execute command
getType()
Functions that must be overwritten.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
initMultiUploadForm()
Initializes the upload form for multiple files.
initPropertiesForm($mode="create")
static _goto($a_target, $a_additional=null)
infoScreenForward()
show information screen
edit()
edit object @access public
addLocatorItems()
Functions to be overwritten.
setTabs()
create tabs (repository/workspace switch)
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
Class ilObjFileSingleFileDelegate.
Class ilObjFileUnzipFlatDelegate.
Class ilObjFileUnzipRecursiveDelegate.
Class ilObjFileUploadResponse.
Class ilObjFileVersion.
New implementation of ilObjectGUI.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
getAccessHandler()
Get access handler.
prepareOutput($a_show_subobjects=true)
prepare output
getTargetFrame($a_cmd, $a_target_frame="")
get target frame for command (command is method name without "Object", e.g.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getCreationMode()
get creation mode
GUI class for the workflow of copying objects.
initImportForm($a_new_type)
Init object import form.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
addHeaderAction()
Add header action menu.
Class ilObjectListGUI.
Class ilObjectMetaDataGUI.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
ILIAS Setting Class.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30
global $DIC
Definition: goto.php:24
$preview
Definition: imgupload.php:55
$ilUser
Definition: imgupload.php:18
exit
Definition: login.php:29
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
$ret
Definition: parser.php:6
$response
$context
Definition: webdav.php:26