ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilADTExternalLinkFormBridge Class Reference

external link form bridge More...

+ Inheritance diagram for ilADTExternalLinkFormBridge:
+ Collaboration diagram for ilADTExternalLinkFormBridge:

Public Member Functions

 __construct (ilADT $a_adt)
 
 addToForm ()
 Add element to form. More...
 
 importFromPost ()
 Import from post. More...
 
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 
 getADT ()
 
 setForm (ilPropertyFormGUI $a_form)
 
 getForm ()
 
 setElementId (string $a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 
 setTitle (string $a_value)
 
 getTitle ()
 
 setInfo (string $a_value)
 
 getInfo ()
 
 setParentElement ($a_value)
 
 getParentElement ()
 Get parent element. More...
 
 setDisabled (bool $a_value)
 
 isDisabled ()
 
 setRequired (bool $a_value)
 
 isRequired ()
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 addJS (ilGlobalTemplateInterface $a_tpl)
 Add ADT-specific JS-files to template. More...
 
 shouldBeImportedFromPost (?ilADTFormBridge $a_parent_adt=null)
 Check if incoming values should be imported at all. More...
 
 importFromPost ()
 Import values from form request POST data. More...
 
 validate ()
 
 setExternalErrors (array $a_errors)
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Is valid type. More...
 
- Protected Member Functions inherited from ilADTFormBridge
 isValidADT (ilADT $a_adt)
 
 setADT (ilADT $a_adt)
 
 addBasicFieldProperties (ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
 Helper method to handle generic properties like setRequired(), setInfo() More...
 
 findParentElementInForm ()
 
 addToParentElement (ilFormPropertyGUI $a_field)
 
 isActiveForSubItems ($a_parent_option=null)
 Check if element is currently active for subitem(s) More...
 

Protected Attributes

ilLogger $logger
 
- Protected Attributes inherited from ilADTFormBridge
ilADT $adt
 
ilPropertyFormGUI $form
 
 $parent
 
string $id = null
 
string $title = ''
 
string $info = ''
 
 $parent_element
 
bool $required = false
 
bool $disabled = false
 
ilLanguage $lng
 

Detailed Description

external link form bridge

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilADTExternalLinkFormBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTExternalLinkFormBridge::__construct ( ilADT  $a_adt)

Reimplemented from ilADTFormBridge.

Definition at line 30 of file class.ilADTExternalLinkFormBridge.php.

31 {
32 global $DIC;
33 parent::__construct($a_adt);
34
35 $this->logger = $DIC->logger()->amet();
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToForm()

ilADTExternalLinkFormBridge::addToForm ( )

Add element to form.

Reimplemented from ilADTFormBridge.

Definition at line 51 of file class.ilADTExternalLinkFormBridge.php.

51 : void
52 {
53 $def = $this->getADT()->getCopyOfDefinition();
54
55 $both = new ilCombinationInputGUI($this->getTitle(), $this->getElementId());
56 $this->addBasicFieldProperties($both, $def);
57
58 $title = new ilTextInputGUI('', $this->getElementId() . '_title');
59 $title->setMaxLength(250);
60 $title->setValue($this->getADT()->getTitle());
61 $both->addCombinationItem('title', $title, $this->lng->txt('title'));
62
63 $url = new ilTextInputGUI('', $this->getElementId() . '_url');
64 $url->setMaxLength(1000);
65 $url->setValue($this->getADT()->getUrl());
66 $both->addCombinationItem('url', $url, $this->lng->txt('url'));
67
68 $this->addToParentElement($both);
69 }
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
addToParentElement(ilFormPropertyGUI $a_field)
This class represents a number property in a property form.
This class represents a text property in a property form.
$url
Definition: shib_logout.php:68

References ilADTFormBridge\$title, $url, ilADTFormBridge\addBasicFieldProperties(), ilADTFormBridge\addToParentElement(), ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), ilADTFormBridge\getTitle(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ importFromPost()

ilADTExternalLinkFormBridge::importFromPost ( )

Import from post.

Reimplemented from ilADTFormBridge.

Definition at line 74 of file class.ilADTExternalLinkFormBridge.php.

74 : void
75 {
76 $this->getADT()->setUrl($this->getForm()->getInput($this->getElementId() . '_url'));
77 $this->getADT()->setTitle($this->getForm()->getInput($this->getElementId() . '_title'));
78
79 $combination = $this->getForm()->getItemByPostVar($this->getElementId());
80 if (!$combination instanceof ilCombinationInputGUI) {
81 $this->logger->warning('Cannot find combination input gui');
82 return;
83 }
84
85 $combination->getCombinationItem('url')->setValue($this->getADT()->getUrl());
86 $combination->getCombinationItem('title')->setValue($this->getADT()->getTitle());
87 }

References ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), ilADTFormBridge\getForm(), ilADTFormBridge\getTitle(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ isValidADT()

ilADTExternalLinkFormBridge::isValidADT ( ilADT  $a_adt)
protected

Is valid type.

Parameters
ilADT$a_adt
Returns
bool

Reimplemented from ilADTFormBridge.

Definition at line 43 of file class.ilADTExternalLinkFormBridge.php.

43 : bool
44 {
45 return $a_adt instanceof ilADTExternalLink;
46 }

Field Documentation

◆ $logger

ilLogger ilADTExternalLinkFormBridge::$logger
protected

Definition at line 28 of file class.ilADTExternalLinkFormBridge.php.


The documentation for this class was generated from the following file: