ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTTextFormBridge Class Reference
+ Inheritance diagram for ilADTTextFormBridge:
+ Collaboration diagram for ilADTTextFormBridge:

Public Member Functions

 setMulti ($a_value, $a_cols=null, $a_rows=null)
 Set multi-line.
 isMulti ()
 Is multi-line?
 addToForm ()
 Add ADT-specific fields to form.
 importFromPost ()
 Import values from form request POST data.
- Public Member Functions inherited from ilADTFormBridge
 __construct (ilADT $a_adt)
 Constructor.
 getADT ()
 Get ADT.
 setForm (ilPropertyFormGUI $a_form)
 Set form.
 getForm ()
 Get form.
 setElementId ($a_value)
 Set element id (aka form field)
 getElementId ()
 Get element id.
 setTitle ($a_value)
 Set title (aka form field caption)
 getTitle ()
 Get title.
 setInfo ($a_value)
 Set info (aka form field info text)
 getInfo ()
 Get info.
 setParentElement ($a_value)
 Set parent element.
 getParentElement ()
 Get parent element.
 setDisabled ($a_value)
 Set disabled.
 isDisabled ()
 Get disabled.
 setRequired ($a_value)
 Set required.
 isRequired ()
 Get required.
 addJS (ilTemplate $a_tpl)
 Add ADT-specific JS-files to template.
 shouldBeImportedFromPost (ilADTFormBridge $a_parent_adt=null)
 Check if incoming values should be imported at all.
 validate ()
 Validate ADT and parse error codes.
 setExternalErrors ($a_errors)

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Definition at line 5 of file class.ilADTTextFormBridge.php.

Member Function Documentation

ilADTTextFormBridge::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTFormBridge.

Definition at line 49 of file class.ilADTTextFormBridge.php.

References $size, ilADTFormBridge\addBasicFieldProperties(), ilADTFormBridge\addToParentElement(), ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), ilADTFormBridge\getTitle(), and isMulti().

{
$def = $this->getADT()->getCopyOfDefinition();
if(!$this->isMulti())
{
$text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
if($def->getMaxLength())
{
$max = $def->getMaxLength();
$size = $text->getSize();
$text->setMaxLength($max);
if($size && $max < $size)
{
$text->setSize($max);
}
}
}
else
{
$text = new ilTextAreaInputGUI($this->getTitle(), $this->getElementId());
if($this->multi_rows)
{
$text->setRows($this->multi_rows);
}
if($this->multi_cols)
{
$text->setCols($this->multi_cols);
}
}
$this->addBasicFieldProperties($text, $def);
$text->setValue($this->getADT()->getText());
$this->addToParentElement($text);
}

+ Here is the call graph for this function:

ilADTTextFormBridge::importFromPost ( )

Import values from form request POST data.

Reimplemented from ilADTFormBridge.

Definition at line 91 of file class.ilADTTextFormBridge.php.

References ilADTFormBridge\getADT(), ilADTFormBridge\getElementId(), and ilADTFormBridge\getForm().

{
// ilPropertyFormGUI::checkInput() is pre-requisite
$this->getADT()->setText($this->getForm()->getInput($this->getElementId()));
$field = $this->getForm()->getItemByPostvar($this->getElementId());
$field->setValue($this->getADT()->getText());
}

+ Here is the call graph for this function:

ilADTTextFormBridge::isMulti ( )

Is multi-line?

Returns
bool

Definition at line 34 of file class.ilADTTextFormBridge.php.

References $multi.

Referenced by addToForm().

{
return $this->multi;
}

+ Here is the caller graph for this function:

ilADTTextFormBridge::isValidADT ( ilADT  $a_adt)
protected

Check if given ADT is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADT$a_adt

Reimplemented from ilADTFormBridge.

Definition at line 44 of file class.ilADTTextFormBridge.php.

{
return ($a_adt instanceof ilADTText);
}
ilADTTextFormBridge::setMulti (   $a_value,
  $a_cols = null,
  $a_rows = null 
)

Set multi-line.

Parameters
string$a_value
int$a_cols
int$a_rows

Definition at line 22 of file class.ilADTTextFormBridge.php.

Referenced by ilAdvancedMDFieldDefinitionText\prepareElementForEditor().

{
$this->multi = (bool)$a_value;
$this->multi_rows = ($a_rows === null) ? null : (int)$a_rows;
$this->multi_cols = ($a_cols === null) ? null : (int)$a_cols;
}

+ Here is the caller graph for this function:

Field Documentation

ilADTTextFormBridge::$multi
protected

Definition at line 7 of file class.ilADTTextFormBridge.php.

Referenced by isMulti().

ilADTTextFormBridge::$multi_cols
protected

Definition at line 9 of file class.ilADTTextFormBridge.php.

ilADTTextFormBridge::$multi_rows
protected

Definition at line 8 of file class.ilADTTextFormBridge.php.


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