ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTInternalLinkFormBridge.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
33 protected function isValidADT(ilADT $a_adt): bool
34 {
35 return $a_adt instanceof ilADTInternalLink;
36 }
37
41 public function addToForm(): void
42 {
43 $def = $this->getADT()->getCopyOfDefinition();
44
45 $subitems = new ilRepositorySelector2InputGUI(
46 $this->getTitle(),
47 $this->getElementId(),
48 false
49 );
50 $subitems->setValue($this->getADT()->getTargetRefId());
51 $exp = $subitems->getExplorerGUI();
52 $exp->setSkipRootNode(false);
53 $exp->setRootId(ROOT_FOLDER_ID);
54 $this->addBasicFieldProperties($subitems, $def);
55 $this->addToParentElement($subitems);
56 }
57
61 public function importFromPost(): void
62 {
63 $this->getADT()->setTargetRefId((int) $this->getForm()->getInput($this->getElementId()));
64 }
65}
ADT form bridge base class.
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
addToParentElement(ilFormPropertyGUI $a_field)
ADT base class.
Definition: class.ilADT.php:26
const ROOT_FOLDER_ID
Definition: constants.php:32