24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
46 public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access =
false)
63 $this->
setStyle(
'table',
'fullwidth');
70 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
71 $this->
addColumn($this->lng->txt(
"obligatory"),
"");
75 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
76 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'type',
'');
77 if (strcmp($c,
'author') == 0) $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
78 if (strcmp($c,
'created') == 0) $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
79 if (strcmp($c,
'updated') == 0) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
93 if (array_key_exists(
"spl_clipboard",
$_SESSION))
98 $this->
addCommandButton(
"saveObligatory", $this->lng->txt(
"spl_save_obligatory_state"));
102 $this->
setRowTemplate(
"tpl.il_svy_qpl_questions_row.html",
"Modules/SurveyQuestionPool");
104 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
112 $this->
enable(
'select_all');
127 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
131 $ti->setValidationRegexp(
'/^[^%]+$/is');
133 $ti->readFromSession();
134 $this->filter[
"title"] = $ti->getValue();
137 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
140 $ti->setValidationRegexp(
'/^[^%]+$/is');
142 $ti->readFromSession();
143 $this->filter[
"description"] = $ti->getValue();
149 $ti->setValidationRegexp(
'/^[^%]+$/is');
151 $ti->readFromSession();
152 $this->filter[
"author"] = $ti->getValue();
155 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
156 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php");
157 $types = ilObjSurveyQuestionPool::_getQuestionTypes();
159 $options[
""] = $lng->txt(
'filter_all_question_types');
160 foreach ($types as $translation =>
$row)
168 $si->readFromSession();
169 $this->filter[
"type"] =
$si->getValue();
176 $cols[
"description"] = array(
177 "txt" => $lng->txt(
"description"),
180 $cols[
"type"] = array(
181 "txt" => $lng->txt(
"question_type"),
184 $cols[
"author"] = array(
185 "txt" => $lng->txt(
"author"),
188 $cols[
"created"] = array(
189 "txt" => $lng->txt(
"create_date"),
192 $cols[
"updated"] = array(
193 "txt" => $lng->txt(
"last_update"),
210 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
211 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
213 $guiclass = $class .
"GUI";
214 $this->ctrl->setParameterByClass(strtolower($guiclass),
"q_id",
$data[
"question_id"]);
218 $url_edit = $this->ctrl->getLinkTargetByClass(strtolower($guiclass),
"editQuestion");
220 $this->tpl->setCurrentBlock(
"title_link_bl");
221 $this->tpl->setVariable(
"QUESTION_TITLE_LINK",
$data[
"title"]);
222 $this->tpl->setVariable(
"URL_TITLE", $url_edit);
223 $this->tpl->parseCurrentBlock();
227 $this->tpl->setCurrentBlock(
"title_nolink_bl");
228 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
229 $this->tpl->parseCurrentBlock();
232 if (
$data[
"complete"] == 0)
234 $this->tpl->setCurrentBlock(
"qpl_warning");
236 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
237 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
238 $this->tpl->parseCurrentBlock();
243 if (strcmp($c,
'description') == 0)
245 $this->tpl->setCurrentBlock(
'description');
246 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
247 $this->tpl->parseCurrentBlock();
249 if (strcmp($c,
'type') == 0)
251 $this->tpl->setCurrentBlock(
'type');
253 $this->tpl->parseCurrentBlock();
255 if (strcmp($c,
'author') == 0)
257 $this->tpl->setCurrentBlock(
'author');
258 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
259 $this->tpl->parseCurrentBlock();
261 if (strcmp($c,
'created') == 0)
263 $this->tpl->setCurrentBlock(
'created');
265 $this->tpl->parseCurrentBlock();
267 if (strcmp($c,
'updated') == 0)
269 $this->tpl->setCurrentBlock(
'updated');
271 $this->tpl->parseCurrentBlock();
276 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
278 $list->setId(
$data[
"question_id"]);
279 $list->setListTitle($this->lng->txt(
"actions"));
282 $list->addItem($this->lng->txt(
"edit"),
"", $url_edit);
284 $list->addItem($this->lng->txt(
"preview"),
"", $this->ctrl->getLinkTargetByClass(strtolower($guiclass),
"preview"));
285 $this->tpl->setVariable(
"ACTION", $list->getHTML());
286 $this->tpl->parseCurrentBlock();
291 $checked =
$data[
"obligatory"] ?
" checked=\"checked\"" :
"";
292 $obligatory =
"<input type=\"checkbox\" name=\"obligatory_".
293 $data[
"question_id"] .
"\" value=\"1\"".$checked.
" />";
295 else if(
$data[
"obligatory"])
297 $obligatory =
"<img src=\"".ilUtil::getImagePath(
"obligatory.png",
"Modules/Survey").
298 "\" alt=\"".$this->lng->txt(
"question_obligatory").
299 "\" title=\"".$this->lng->txt(
"question_obligatory").
"\" />";
301 $this->tpl->setVariable(
"OBLIGATORY", $obligatory);
305 $this->tpl->setVariable(
'CBOX_ID',
$data[
"question_id"]);
307 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
312 $this->editable = $value;
322 $this->writeAccess = $value;