56 $this->lng = $DIC->language();
57 $this->tpl = $DIC[
"tpl"];
58 $lng = $DIC->language();
60 parent::__construct($a_title, $a_postvar);
62 $this->show_wizard =
false;
63 $this->show_save_phrase =
false;
64 $this->categorytext =
$lng->txt(
'row_text');
65 $this->use_other_answer =
false;
77 $this->use_other_answer = ($a_value) ?
true :
false;
87 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
89 if (is_array($a_value)) {
90 if (is_array($a_value[
'answer'])) {
92 $this->values->addCategory(
$value, $a_value[
'other'][
$index]);
105 $this->values = $a_values;
125 $this->allowMove = $a_allow_move;
140 $this->show_wizard = $a_value;
150 $this->categorytext = $a_text;
160 $this->labeltext = $a_text;
170 $this->show_save_phrase = $a_value;
190 if (is_array($foundvalues)) {
192 if (is_array($foundvalues[
'answer'])) {
193 foreach ($foundvalues[
'answer'] as $idx => $answervalue) {
194 if (((strlen($answervalue)) == 0) && ($this->
getRequired() && (!$foundvalues[
'other'][$idx]))) {
217 $tpl =
new ilTemplate(
"tpl.prop_matrixrowwizardinput.html",
true,
true,
"Modules/SurveyQuestionPool");
219 if (is_object($this->values)) {
220 for (
$i = 0;
$i < $this->values->getCategoryCount();
$i++) {
221 $cat = $this->values->getCategory(
$i);
222 $tpl->setCurrentBlock(
"prop_text_propval");
224 $tpl->parseCurrentBlock();
225 $tpl->setCurrentBlock(
"prop_label_propval");
227 $tpl->parseCurrentBlock();
230 $tpl->setCurrentBlock(
"other_answer_checkbox");
232 $tpl->setVariable(
"OTHER_ID", $this->
getPostVar() .
"[other][$i]");
233 $tpl->setVariable(
"ROW_NUMBER",
$i);
235 $tpl->setVariable(
"CHECKED_OTHER",
' checked="checked"');
237 $tpl->parseCurrentBlock();
241 $tpl->setCurrentBlock(
"move");
242 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
243 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
245 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
248 $tpl->parseCurrentBlock();
251 $tpl->setCurrentBlock(
"row");
253 $tpl->setVariable(
"ROW_NUMBER",
$i);
255 $tpl->setVariable(
"ID_LABEL", $this->
getPostVar() .
"[label][$i]");
257 $tpl->setVariable(
"SIZE_LABEL", 15);
260 $tpl->setVariable(
"DISABLED",
" disabled=\"disabled\"");
261 $tpl->setVariable(
"DISABLED_LABEL",
" disabled=\"disabled\"");
264 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
265 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
266 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
269 $tpl->parseCurrentBlock();
274 $tpl->setCurrentBlock(
"wizard");
275 $tpl->setVariable(
"CMD_WIZARD",
'cmd[wizard' . $this->
getFieldId() .
']');
277 $tpl->setVariable(
"WIZARD_TEXT",
$lng->txt(
'add_phrase'));
278 $tpl->parseCurrentBlock();
282 $tpl->setCurrentBlock(
'savephrase');
284 $tpl->setVariable(
"VALUE_SAVE_PHRASE",
$lng->txt(
'save_phrase'));
285 $tpl->parseCurrentBlock();
289 $tpl->setCurrentBlock(
'other_answer_title');
290 $tpl->setVariable(
"OTHER_TEXT",
$lng->txt(
'use_other_answer'));
291 $tpl->parseCurrentBlock();
297 $tpl->setVariable(
"ACTIONS_TEXT",
$lng->txt(
'actions'));
299 $a_tpl->setCurrentBlock(
"prop_generic");
300 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
301 $a_tpl->parseCurrentBlock();
304 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
305 $tpl->addJavascript(
"./Modules/SurveyQuestionPool/templates/default/matrixrowwizard.js");
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
static get($a_glyph, $a_text="")
Get glyph html.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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.
setMaxLength($a_maxlength)
Set Max Length.