ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRadioGroupInputGUI Class Reference

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

+ Inheritance diagram for ilRadioGroupInputGUI:
+ Collaboration diagram for ilRadioGroupInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 addOption ($a_option)
 Add Option.
 getOptions ()
 Get Options.
 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 ()
 Insert property html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
- Public Member Functions inherited from ilFormPropertyGUI
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.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 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)

Protected Attributes

 $options = array()
 $value
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilRadioGroupInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

References ilFormPropertyGUI\setType().

{
parent::__construct($a_title, $a_postvar);
$this->setType("radio");
}

+ Here is the call graph for this function:

Member Function Documentation

ilRadioGroupInputGUI::addOption (   $a_option)
ilRadioGroupInputGUI::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 112 of file class.ilRadioGroupInputGUI.php.

References $_POST, $lng, $ok, getOptions(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

{
global $lng;
$_POST[$this->getPostVar()] =
if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
$ok = true;
foreach($this->getOptions() as $option)
{
foreach($option->getSubItems() as $item)
{
$item_ok = $item->checkInput();
if (!$item_ok && ($_POST[$this->getPostVar()] == $option->getValue()))
{
$ok = false;
}
}
}
return $ok;
}

+ Here is the call graph for this function:

ilRadioGroupInputGUI::getItemByPostVar (   $a_post_var)

Get item by post var.

Returns
mixed false or item object

Reimplemented from ilSubEnabledFormPropertyGUI.

Definition at line 235 of file class.ilRadioGroupInputGUI.php.

References $ret, getOptions(), and ilFormPropertyGUI\getPostVar().

{
if ($this->getPostVar() == $a_post_var)
{
return $this;
}
foreach($this->getOptions() as $option)
{
foreach($option->getSubItems() as $item)
{
if ($item->getType() != "section_header")
{
$ret = $item->getItemByPostVar($a_post_var);
if (is_object($ret))
{
return $ret;
}
}
}
}
return false;
}

+ Here is the call graph for this function:

ilRadioGroupInputGUI::getOptions ( )

Get Options.

Returns
array Array of RadioOption objects

Definition at line 65 of file class.ilRadioGroupInputGUI.php.

References $options.

Referenced by checkInput(), getItemByPostVar(), render(), and setValueByArray().

{
}

+ Here is the caller graph for this function:

ilRadioGroupInputGUI::getTableFilterHTML ( )

Get input item HTML to be inserted into table filters.

Implements ilTableFilterItem.

Definition at line 260 of file class.ilRadioGroupInputGUI.php.

References render().

{
return $this->render();
}

+ Here is the call graph for this function:

ilRadioGroupInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 85 of file class.ilRadioGroupInputGUI.php.

References $value.

Referenced by render().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilRadioGroupInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 145 of file class.ilRadioGroupInputGUI.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:

ilRadioGroupInputGUI::render ( )

Insert property html.

Definition at line 157 of file class.ilRadioGroupInputGUI.php.

References $tpl, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), getOptions(), ilFormPropertyGUI\getParentForm(), ilFormPropertyGUI\getPostVar(), and getValue().

Referenced by getTableFilterHTML(), and insert().

{
$tpl = new ilTemplate("tpl.prop_radio.html", true, true, "Services/Form");
foreach($this->getOptions() as $option)
{
// information text for option
if ($option->getInfo() != "")
{
$tpl->setCurrentBlock("radio_option_desc");
$tpl->setVariable("RADIO_OPTION_DESC", $option->getInfo());
$tpl->parseCurrentBlock();
}
if (count($option->getSubItems()) > 0)
{
if ($option->getValue() != $this->getValue())
{
$tpl->touchBlock("prop_radio_opt_hide");
$tpl->setVariable("HOP_ID", $this->getFieldId()."_".$option->getValue());
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("radio_option_subform");
$pf = new ilPropertyFormGUI();
$pf->setMode("subform");
$pf->setItems($option->getSubItems());
$tpl->setVariable("SUB_FORM", $pf->getContent());
$tpl->setVariable("SOP_ID", $this->getFieldId()."_".$option->getValue());
if ($pf->getMultipart())
{
$this->getParentForm()->setMultipart(true);
}
$tpl->parseCurrentBlock();
if ($pf->getMultipart())
{
$this->getParentForm()->setMultipart(true);
}
}
$tpl->setCurrentBlock("prop_radio_option");
if (!$this->getDisabled())
{
$tpl->setVariable("POST_VAR", $this->getPostVar());
}
$tpl->setVariable("VAL_RADIO_OPTION", $option->getValue());
$tpl->setVariable("OP_ID", $this->getFieldId()."_".$option->getValue());
$tpl->setVariable("FID", $this->getFieldId());
if($this->getDisabled() or $option->getDisabled())
{
$tpl->setVariable('DISABLED','disabled="disabled" ');
}
if ($option->getValue() == $this->getValue())
{
$tpl->setVariable("CHK_RADIO_OPTION",
'checked="checked"');
}
$tpl->setVariable("TXT_RADIO_OPTION", $option->getTitle());
$tpl->parseCurrentBlock();
}
$tpl->setVariable("ID", $this->getFieldId());
if ($this->getDisabled())
{
$tpl->setVariable("HIDDEN_INPUT",
$this->getHiddenTag($this->getPostVar(), $this->getValue()));
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRadioGroupInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 95 of file class.ilRadioGroupInputGUI.php.

References getOptions(), ilFormPropertyGUI\getPostVar(), and setValue().

{
$this->setValue($a_values[$this->getPostVar()]);
foreach($this->getOptions() as $option)
{
foreach($option->getSubItems() as $item)
{
$item->setValueByArray($a_values);
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilRadioGroupInputGUI::$options = array()
protected

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

Referenced by getOptions().

ilRadioGroupInputGUI::$value
protected

Definition at line 36 of file class.ilRadioGroupInputGUI.php.

Referenced by getValue().


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