ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCombinationInputGUI Class Reference

This class represents a number property in a property form. More...

+ Inheritance diagram for ilCombinationInputGUI:
+ Collaboration diagram for ilCombinationInputGUI:

Public Member Functions

 addCombinationItem ($id, $item, $label="")
 Add property item.
 getCombinationItem ($id)
 Get property item.
 removeCombinationItem ($id)
 Remove property item.
 __call ($method, $param)
 Call item methods.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 setComparisonMode ($mode)
 Set mode for comparison (extended validation)
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
 render ()
 Render item.
 getTableFilterHTML ()
 Get HTML for table filter.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor.
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 setMultiValues (array $a_values)
 Set multi values.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Data Fields

const COMPARISON_ASCENDING = 1
const COMPARISON_DESCENDING = 2

Protected Attributes

 $items = array()
 $labels
 $comparison
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.

Detailed Description

This class represents a number property in a property form.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 31 of file class.ilCombinationInputGUI.php.

Member Function Documentation

ilCombinationInputGUI::__call (   $method,
  $param 
)

Call item methods.

Parameters
string$method
array$param

Definition at line 89 of file class.ilCombinationInputGUI.php.

References $result.

{
$result = array();
foreach($this->items as $id => $obj)
{
if(method_exists($obj, $method))
{
$result[$id] = call_user_func_array(array($obj, $method), $param);
}
}
return $result;
}
ilCombinationInputGUI::addCombinationItem (   $id,
  $item,
  $label = "" 
)

Add property item.

Parameters
string$id
object$item
string$label

Definition at line 47 of file class.ilCombinationInputGUI.php.

{
$this->items[$id] = $item;
if($label)
{
$this->labels[$id] = $label;
}
}
ilCombinationInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 255 of file class.ilCombinationInputGUI.php.

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

{
if(sizeof($this->items))
{
foreach($this->items as $id => $obj)
{
if(!$obj->checkInput())
{
return false;
}
}
if($this->comparison_mode)
{
$prev = NULL;
foreach($this->items as $id => $obj)
{
$value = $obj->getPostValueForComparison();
if($value != "")
{
if($prev !== NULL)
{
if($this->comparison_mode == self::COMPARISON_ASCENDING)
{
if($value < $prev)
{
return false;
}
}
else
{
if($value > $prev)
{
return false;
}
}
}
$prev = $value;
}
}
}
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilCombinationInputGUI::getCombinationItem (   $id)

Get property item.

Parameters
string$id
Returns
object

Definition at line 62 of file class.ilCombinationInputGUI.php.

{
if(isset($this->items[$id]))
{
return $this->items[$id];
}
}
ilCombinationInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Implements ilTableFilterItem.

Definition at line 348 of file class.ilCombinationInputGUI.php.

References render().

{
$html = $this->render();
return $html;
}

+ Here is the call graph for this function:

ilCombinationInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 219 of file class.ilCombinationInputGUI.php.

References $result.

{
$result = array();
foreach($this->items as $id => $obj)
{
if(method_exists($obj, "getValue"))
{
$result[$id] = $obj->getValue();
}
// datetime
else if(method_exists($obj, "setDate"))
{
$result[$id] = $obj->getDate();
}
}
return $result;
}
ilCombinationInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 306 of file class.ilCombinationInputGUI.php.

References render().

{
$html = $this->render();
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $html);
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilCombinationInputGUI::removeCombinationItem (   $id)

Remove property item.

Parameters
string$id

Definition at line 75 of file class.ilCombinationInputGUI.php.

{
if(isset($this->items[$id]))
{
unset($this->items[$id]);
}
}
ilCombinationInputGUI::render ( )

Render item.

Definition at line 318 of file class.ilCombinationInputGUI.php.

References $lng, and $tpl.

Referenced by getTableFilterHTML(), and insert().

{
global $lng;
$tpl = new ilTemplate("tpl.prop_combination.html", true, true, "Services/Form");
if(sizeof($this->items))
{
foreach($this->items as $id => $obj)
{
// label
if(isset($this->labels[$id]))
{
$tpl->setCurrentBlock("prop_combination_label");
$tpl->setVariable("LABEL", $this->labels[$id]);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("prop_combination");
$tpl->setVariable("FIELD", $obj->render());
$tpl->parseCurrentBlock();
}
}
return $tpl->get();
}

+ Here is the caller graph for this function:

ilCombinationInputGUI::serializeData ( )

serialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 105 of file class.ilCombinationInputGUI.php.

References $result.

{
$result = array();
foreach($this->items as $id => $obj)
{
$result[$id] = $obj->serializeData();
}
return serialize($result);
}
ilCombinationInputGUI::setComparisonMode (   $mode)

Set mode for comparison (extended validation)

Parameters
int$mode
Returns
bool

Definition at line 147 of file class.ilCombinationInputGUI.php.

{
if(in_array($mode, array(self::COMPARISON_ASCENDING, self::COMPARISON_DESCENDING)))
{
foreach($this->items as $obj)
{
if(!method_exists($obj, "getPostValueForComparison"))
{
return false;
}
}
$this->comparison_mode = $mode;
return true;
}
}
ilCombinationInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 168 of file class.ilCombinationInputGUI.php.

Referenced by unserializeData().

{
if(is_array($a_value))
{
foreach($a_value as $id => $value)
{
if(isset($this->items[$id]))
{
if(method_exists($this->items[$id], "setValue"))
{
$this->items[$id]->setValue($value);
}
// datetime
else if(method_exists($this->items[$id], "setDate"))
{
$this->items[$id]->setDate($value);
}
}
}
}
else if($a_value === NULL)
{
foreach($this->items as $item)
{
if(method_exists($item, "setValue"))
{
$item->setValue(NULL);
}
// datetime
else if(method_exists($item, "setDate"))
{
$item->setDate();
}
// duration
else if(method_exists($item, "setMonths"))
{
$item->setMonths(0);
$item->setDays(0);
$item->setHours(0);
$item->setMinutes(0);
$item->setSeconds(0);
}
}
}
}

+ Here is the caller graph for this function:

ilCombinationInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 242 of file class.ilCombinationInputGUI.php.

{
foreach($this->items as $id => $obj)
{
$obj->setValueByArray($a_values);
}
}
ilCombinationInputGUI::unserializeData (   $a_data)

unserialize data

Reimplemented from ilFormPropertyGUI.

Definition at line 118 of file class.ilCombinationInputGUI.php.

References setValue().

{
$data = unserialize($a_data);
if ($data)
{
foreach($this->items as $id => $obj)
{
$obj->unserializeData($data[$id]);
}
}
else
{
foreach($this->items as $id => $obj)
{
if(method_exists($obj, "setValue"))
{
$this->setValue(false);
}
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilCombinationInputGUI::$comparison
protected

Definition at line 35 of file class.ilCombinationInputGUI.php.

ilCombinationInputGUI::$items = array()
protected

Definition at line 33 of file class.ilCombinationInputGUI.php.

ilCombinationInputGUI::$labels
protected

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

const ilCombinationInputGUI::COMPARISON_DESCENDING = 2

Definition at line 38 of file class.ilCombinationInputGUI.php.


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