ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 12 of file class.ilADTExternalLinkFormBridge.php.

Constructor & Destructor Documentation

◆ __construct()

ilADTExternalLinkFormBridge::__construct ( ilADT  $a_adt)

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

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

17  {
18  global $DIC;
19  parent::__construct($a_adt);
20 
21  $this->logger = $DIC->logger()->amet();
22  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToForm()

ilADTExternalLinkFormBridge::addToForm ( )

Add element to form.

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

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

37  : void
38  {
39  $def = $this->getADT()->getCopyOfDefinition();
40 
41  $both = new ilCombinationInputGUI($this->getTitle(), $this->getElementId());
42  $this->addBasicFieldProperties($both, $def);
43 
44  $title = new ilTextInputGUI('', $this->getElementId() . '_title');
45  $title->setMaxLength(250);
46  $title->setValue($this->getADT()->getTitle());
47  $both->addCombinationItem('title', $title, $this->lng->txt('title'));
48 
49  $url = new ilTextInputGUI('', $this->getElementId() . '_url');
50  $url->setMaxLength(1000);
51  $url->setValue($this->getADT()->getUrl());
52  $both->addCombinationItem('url', $url, $this->lng->txt('url'));
53 
54  $this->addToParentElement($both);
55  }
addToParentElement(ilFormPropertyGUI $a_field)
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$url
+ Here is the call graph for this function:

◆ importFromPost()

ilADTExternalLinkFormBridge::importFromPost ( )

Import from post.

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

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

60  : void
61  {
62  $this->getADT()->setUrl($this->getForm()->getInput($this->getElementId() . '_url'));
63  $this->getADT()->setTitle($this->getForm()->getInput($this->getElementId() . '_title'));
64 
65  $combination = $this->getForm()->getItemByPostVar($this->getElementId());
66  if (!$combination instanceof ilCombinationInputGUI) {
67  $this->logger->warning('Cannot find combination input gui');
68  return;
69  }
70 
71  $combination->getCombinationItem('url')->setValue($this->getADT()->getUrl());
72  $combination->getCombinationItem('title')->setValue($this->getADT()->getTitle());
73  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ isValidADT()

ilADTExternalLinkFormBridge::isValidADT ( ilADT  $a_adt)
protected

Is valid type.

Parameters
ilADT$a_adt
Returns
bool

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

29  : bool
30  {
31  return $a_adt instanceof ilADTExternalLink;
32  }

Field Documentation

◆ $logger

ilLogger ilADTExternalLinkFormBridge::$logger
protected

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


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