4 require_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)) {
44 if (is_array($a_value[
'key'])) {
45 foreach ($a_value[
'key'] as $idx =>
$key) {
46 array_push($this->values, array(
$key, $a_value[
'value'][$idx]));
59 $this->key_size = $a_size;
79 $this->value_size = $a_size;
99 $this->key_maxlength = $a_maxlength;
119 $this->value_maxlength = $a_maxlength;
139 $this->value_name = $a_name;
159 $this->key_name = $a_name;
179 $this->values = $a_values;
199 $this->allowMove = $a_allow_move;
226 if (is_array($foundvalues)) {
228 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value'])) {
229 foreach ($foundvalues[
'key'] as $val) {
235 foreach ($foundvalues[
'value'] as $val) {
266 $tpl =
new ilTemplate(
"tpl.prop_kvpwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
268 foreach ($this->values as
$value) {
269 if (is_array($value)) {
270 $tpl->setCurrentBlock(
"prop_key_propval");
272 $tpl->parseCurrentBlock();
273 $tpl->setCurrentBlock(
"prop_value_propval");
275 $tpl->parseCurrentBlock();
278 $tpl->setCurrentBlock(
"move");
279 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
280 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
284 $tpl->parseCurrentBlock();
287 $tpl->setCurrentBlock(
"row");
288 $class = (
$i % 2 == 0) ?
"even" :
"odd";
292 if (
$i == count($this->values) - 1) {
295 $tpl->setVariable(
"ROW_CLASS", $class);
296 $tpl->setVariable(
"ROW_NUMBER",
$i);
303 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
307 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
308 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
314 $tpl->parseCurrentBlock();
322 $a_tpl->setCurrentBlock(
"prop_generic");
323 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
324 $a_tpl->parseCurrentBlock();
328 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
329 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/kvpwizard.js");
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
This class represents a text property in a property form.