24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
56 public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access =
false)
60 $this->rbacreview = $DIC->rbac()->review();
61 $this->
user = $DIC->user();
65 parent::__construct($a_parent_obj, $a_parent_cmd);
67 $lng = $DIC->language();
84 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
85 $this->
addColumn($this->lng->txt(
"obligatory"),
"");
88 if (strcmp($c,
'description') == 0) {
89 $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
91 if (strcmp($c,
'type') == 0) {
92 $this->
addColumn($this->lng->txt(
"question_type"),
'type',
'');
94 if (strcmp($c,
'author') == 0) {
95 $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
97 if (strcmp($c,
'created') == 0) {
98 $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
100 if (strcmp($c,
'updated') == 0) {
101 $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
115 if (array_key_exists(
"spl_clipboard",
$_SESSION)) {
119 $this->
addCommandButton(
"saveObligatory", $this->lng->txt(
"spl_save_obligatory_state"));
123 $this->
setRowTemplate(
"tpl.il_svy_qpl_questions_row.html",
"Modules/SurveyQuestionPool");
125 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
150 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
154 $ti->setValidationRegexp(
'/^[^%]+$/is');
156 $ti->readFromSession();
157 $this->filter[
"title"] = $ti->getValue();
163 $ti->setValidationRegexp(
'/^[^%]+$/is');
165 $ti->readFromSession();
166 $this->filter[
"description"] = $ti->getValue();
172 $ti->setValidationRegexp(
'/^[^%]+$/is');
174 $ti->readFromSession();
175 $this->filter[
"author"] = $ti->getValue();
178 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
179 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php");
180 $types = ilObjSurveyQuestionPool::_getQuestionTypes();
183 foreach ($types as $translation =>
$row) {
190 $si->readFromSession();
191 $this->filter[
"type"] =
$si->getValue();
198 "txt" =>
$lng->txt(
"description"),
202 "txt" =>
$lng->txt(
"question_type"),
205 $cols[
"author"] =
array(
206 "txt" =>
$lng->txt(
"author"),
209 $cols[
"created"] =
array(
210 "txt" =>
$lng->txt(
"create_date"),
213 $cols[
"updated"] =
array(
214 "txt" =>
$lng->txt(
"last_update"),
229 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
230 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
232 $guiclass = $class .
"GUI";
233 $this->ctrl->setParameterByClass(strtolower($guiclass),
"q_id",
$data[
"question_id"]);
236 $url_edit = $this->ctrl->getLinkTargetByClass(strtolower($guiclass),
"editQuestion");
238 $this->tpl->setCurrentBlock(
"title_link_bl");
239 $this->tpl->setVariable(
"QUESTION_TITLE_LINK",
$data[
"title"]);
240 $this->tpl->setVariable(
"URL_TITLE", $url_edit);
241 $this->tpl->parseCurrentBlock();
243 $this->tpl->setCurrentBlock(
"title_nolink_bl");
244 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
245 $this->tpl->parseCurrentBlock();
248 if (
$data[
"complete"] == 0) {
249 $this->tpl->setCurrentBlock(
"qpl_warning");
251 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
252 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
253 $this->tpl->parseCurrentBlock();
257 if (strcmp($c,
'description') == 0) {
258 $this->tpl->setCurrentBlock(
'description');
259 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
260 $this->tpl->parseCurrentBlock();
262 if (strcmp($c,
'type') == 0) {
263 $this->tpl->setCurrentBlock(
'type');
265 $this->tpl->parseCurrentBlock();
267 if (strcmp($c,
'author') == 0) {
268 $this->tpl->setCurrentBlock(
'author');
269 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
270 $this->tpl->parseCurrentBlock();
272 if (strcmp($c,
'created') == 0) {
273 $this->tpl->setCurrentBlock(
'created');
275 $this->tpl->parseCurrentBlock();
277 if (strcmp($c,
'updated') == 0) {
278 $this->tpl->setCurrentBlock(
'updated');
280 $this->tpl->parseCurrentBlock();
285 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
288 $list->setListTitle($this->lng->txt(
"actions"));
290 $list->addItem($this->lng->txt(
"edit"),
"", $url_edit);
292 $list->addItem($this->lng->txt(
"preview"),
"", $this->ctrl->getLinkTargetByClass(strtolower($guiclass),
"preview"));
293 $this->tpl->setVariable(
"ACTION",
$list->getHTML());
294 $this->tpl->parseCurrentBlock();
298 $checked =
$data[
"obligatory"] ?
" checked=\"checked\"" :
"";
299 $obligatory =
"<input type=\"checkbox\" name=\"obligatory_" .
300 $data[
"question_id"] .
"\" value=\"1\"" . $checked .
" />";
301 } elseif (
$data[
"obligatory"]) {
303 "\" alt=\"" . $this->lng->txt(
"question_obligatory") .
304 "\" title=\"" . $this->lng->txt(
"question_obligatory") .
"\" />";
306 $this->tpl->setVariable(
"OBLIGATORY", $obligatory);
309 $this->tpl->setVariable(
'CBOX_ID',
$data[
"question_id"]);
311 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
316 $this->editable = $value;
326 $this->writeAccess = $value;
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
if(isset($_REQUEST['delete'])) $list
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
getSelectedColumns()
Get selected columns.
setMaxLength($a_maxlength)
Set Max Length.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static _getGUIClassNameForId($a_q_id)
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
__construct($a_parent_obj, $a_parent_cmd, $a_write_access=false)
Constructor.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
setFilterCommand($a_val, $a_caption=null)
Set filter command.