4require_once 
'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
 
   32                parent::__construct($a_title, $a_postvar);
 
   42                $this->values = array();
 
   43                if (is_array($a_value))
 
   45                        if (is_array($a_value[
'key']))
 
   47                                foreach ($a_value[
'key'] as $idx => $key)
 
   49                                        array_push($this->values, array($key, $a_value[
'value'][$idx]));
 
   62                $this->key_size = $a_size;
 
   82                $this->value_size = $a_size;
 
  102                $this->key_maxlength = $a_maxlength;
 
  122                $this->value_maxlength = $a_maxlength;
 
  142                $this->value_name = $a_name;
 
  162                $this->key_name = $a_name;
 
  182                $this->values = $a_values;
 
  202                $this->allowMove = $a_allow_move;
 
  226                if (is_array($foundvalues))
 
  229                        if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value']))
 
  231                                foreach ($foundvalues[
'key'] as $val)
 
  235                                                $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  239                                foreach ($foundvalues[
'value'] as $val)
 
  243                                                $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  252                                        $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  261                                $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  277                $tpl = 
new ilTemplate(
"tpl.prop_kvpwizardinput.html", 
true, 
true, 
"Modules/TestQuestionPool");
 
  279                foreach ($this->values as 
$value)
 
  283                                $tpl->setCurrentBlock(
"prop_key_propval");
 
  285                                $tpl->parseCurrentBlock();
 
  286                                $tpl->setCurrentBlock(
"prop_value_propval");
 
  288                                $tpl->parseCurrentBlock();
 
  292                                $tpl->setCurrentBlock(
"move");
 
  293                                $tpl->setVariable(
"CMD_UP", 
"cmd[up" . $this->
getFieldId() . 
"][$i]");
 
  294                                $tpl->setVariable(
"CMD_DOWN", 
"cmd[down" . $this->
getFieldId() . 
"][$i]");
 
  298                                $tpl->parseCurrentBlock();
 
  301                        $tpl->setCurrentBlock(
"row");
 
  302                        $class = ($i % 2 == 0) ? 
"even" : 
"odd";
 
  303                        if ($i == 0) $class .= 
" first";
 
  304                        if ($i == count($this->values)-1) $class .= 
" last";
 
  305                        $tpl->setVariable(
"ROW_CLASS", $class);
 
  306                        $tpl->setVariable(
"ROW_NUMBER", $i);
 
  313                        $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() . 
"[value][$i]");
 
  317                        $tpl->setVariable(
"CMD_ADD", 
"cmd[add" . $this->
getFieldId() . 
"][$i]");
 
  318                        $tpl->setVariable(
"CMD_REMOVE", 
"cmd[remove" . $this->
getFieldId() . 
"][$i]");
 
  324                        $tpl->parseCurrentBlock();
 
  332                $a_tpl->setCurrentBlock(
"prop_generic");
 
  333                $a_tpl->setVariable(
"PROP_GENERIC", 
$tpl->get());
 
  334                $a_tpl->parseCurrentBlock();
 
  337                $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
 
  338                $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/kvpwizard.js");
 
An exception for terminatinating execution or to throw for unit testing.
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public