ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilADTExternalLinkFormBridge Class Reference

external link form bridge More...

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

Public Member Functions

 addToForm ()
 Add element to form. More...
 
 importFromPost ()
 Import from post. More...
 
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 Get ADT. More...
 
 setForm (ilPropertyFormGUI $a_form)
 Set form. More...
 
 getForm ()
 Get form. More...
 
 setElementId ($a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 Get element id. More...
 
 setTitle ($a_value)
 Set title (aka form field caption) More...
 
 getTitle ()
 Get title. More...
 
 setInfo ($a_value)
 Set info (aka form field info text) More...
 
 getInfo ()
 Get info. More...
 
 setParentElement ($a_value)
 Set parent element. More...
 
 getParentElement ()
 Get parent element. More...
 
 setDisabled ($a_value)
 Set disabled. More...
 
 isDisabled ()
 Get disabled. More...
 
 setRequired ($a_value)
 Set required. More...
 
 isRequired ()
 Get required. More...
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 addJS (ilTemplate $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 ()
 Validate ADT and parse error codes. More...
 
 setExternalErrors ($a_errors)
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Is valid type. More...
 
- Protected Member Functions inherited from ilADTFormBridge
 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 
 addBasicFieldProperties (ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
 Helper method to handle generic properties like setRequired(), setInfo() More...
 
 findParentElementInForm ()
 Try to find parent element in form (could be option) More...
 
 addToParentElement (ilFormPropertyGUI $a_field)
 Add form field to parent element. More...
 
 isActiveForSubItems ($a_parent_option=null)
 Check if element is currently active for subitem(s) More...
 

Additional Inherited Members

- Protected Attributes inherited from ilADTFormBridge
 $adt
 
 $form
 
 $id
 
 $title
 
 $info
 
 $parent_element
 
 $required
 
 $disabled
 

Detailed Description

external link form bridge

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

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

Member Function Documentation

◆ addToForm()

ilADTExternalLinkFormBridge::addToForm ( )

Add element to form.

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

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

28  {
29  $lng = $GLOBALS['DIC']->language();
30 
31 
32  $def = $this->getADT()->getCopyOfDefinition();
33 
34  $both = new ilCombinationInputGUI($this->getTitle(), $this->getElementId());
35  $this->addBasicFieldProperties($both, $def);
36 
37  $title = new ilTextInputGUI('', $this->getElementId() . '_title');
38  $title->setMaxLength(250);
39  $title->setValue($this->getADT()->getTitle());
40  $both->addCombinationItem('title', $title, $lng->txt('title'));
41 
42  $url = new ilTextInputGUI('', $this->getElementId() . '_url');
43  $url->setSize(250);
44  $url->setValue($this->getADT()->getUrl());
45  $both->addCombinationItem('url', $url, $lng->txt('url'));
46 
47  $this->addToParentElement($both);
48  }
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
addBasicFieldProperties(ilFormPropertyGUI $a_field, ilADTDefinition $a_def)
Helper method to handle generic properties like setRequired(), setInfo()
This class represents a text property in a property form.
getElementId()
Get element id.
This class represents a number property in a property form.
global $lng
Definition: privfeed.php:17
$def
Definition: croninfo.php:21
$url
+ Here is the call graph for this function:

◆ importFromPost()

ilADTExternalLinkFormBridge::importFromPost ( )

Import from post.

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

References $GLOBALS, ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), ilADTFormBridge\getForm(), and ilADTFormBridge\getTitle().

54  {
55  $logger = $GLOBALS['DIC']->logger()->amet();
56 
57  $this->getADT()->setUrl($this->getForm()->getInput($this->getElementId() . '_url'));
58  $this->getADT()->setTitle($this->getForm()->getInput($this->getElementId() . '_title'));
59 
60  $combination = $this->getForm()->getItemByPostVar($this->getElementId());
61  if (!$combination instanceof ilCombinationInputGUI) {
62  $logger->warning('Cannot find combination input gui');
63  return;
64  }
65 
66  $combination->getCombinationItem('url')->setValue($this->getADT()->getUrl());
67  $combination->getCombinationItem('title')->setValue($this->getADT()->getTitle());
68  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getElementId()
Get element id.
This class represents a number property in a property form.
+ 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 19 of file class.ilADTExternalLinkFormBridge.php.

20  {
21  return $a_adt instanceof ilADTExternalLink;
22  }

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