24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
   46         public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access = 
false)
 
   61                 $this->
setStyle(
'table', 
'fullwidth');
 
   68                 $this->
addColumn($this->lng->txt(
"title"),
'title', 
'');
 
   69                 $this->
addColumn($this->lng->txt(
"obligatory"), 
"");
 
   73                         if (strcmp($c, 
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description', 
'');
 
   74                         if (strcmp($c, 
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'type', 
'');
 
   75                         if (strcmp($c, 
'author') == 0) $this->
addColumn($this->lng->txt(
"author"),
'author', 
'');
 
   76                         if (strcmp($c, 
'created') == 0) $this->
addColumn($this->lng->txt(
"create_date"),
'created', 
'');
 
   77                         if (strcmp($c, 
'updated') == 0) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp', 
'');
 
   91                         if (array_key_exists(
"spl_clipboard", 
$_SESSION))
 
   96                         $this->
addCommandButton(
"saveObligatory", $this->lng->txt(
"spl_save_obligatory_state"));
 
  101                 $this->
setRowTemplate(
"tpl.il_svy_qpl_questions_row.html", 
"Modules/SurveyQuestionPool");
 
  103                 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
  109                 $this->
enable(
'select_all');
 
  124                 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  128                 $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  130                 $ti->readFromSession();
 
  131                 $this->filter[
"title"] = $ti->getValue();
 
  134                 $ti = 
new ilTextInputGUI($lng->txt(
"description"), 
"description");
 
  137                 $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  139                 $ti->readFromSession();
 
  140                 $this->filter[
"description"] = $ti->getValue();
 
  146                 $ti->setValidationRegexp(
'/^[^%]+$/is');
 
  148                 $ti->readFromSession();
 
  149                 $this->filter[
"author"] = $ti->getValue();
 
  152                 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  153                 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php");
 
  154                 $types = ilObjSurveyQuestionPool::_getQuestionTypes();
 
  156                 $options[
""] = $lng->txt(
'filter_all_question_types');
 
  157                 foreach ($types as $translation => 
$row)
 
  159                         $options[
$row[
'type_tag']] = $translation;
 
  163                 $si->setOptions($options);
 
  165                 $si->readFromSession();
 
  166                 $this->filter[
"type"] = 
$si->getValue();
 
  173                 $cols[
"description"] = array(
 
  174                         "txt" => $lng->txt(
"description"),
 
  177                 $cols[
"type"] = array(
 
  178                         "txt" => $lng->txt(
"question_type"),
 
  181                 $cols[
"author"] = array(
 
  182                         "txt" => $lng->txt(
"author"),
 
  185                 $cols[
"created"] = array(
 
  186                         "txt" => $lng->txt(
"create_date"),
 
  189                 $cols[
"updated"] = array(
 
  190                         "txt" => $lng->txt(
"last_update"),
 
  207                 include_once 
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
 
  208                 include_once 
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
 
  210                 $guiclass = $class . 
"GUI";
 
  211                 $this->ctrl->setParameterByClass(strtolower($guiclass), 
"q_id", 
$data[
"question_id"]);
 
  215                         $url_edit = $this->ctrl->getLinkTargetByClass(strtolower($guiclass), 
"editQuestion");
 
  217                         $this->tpl->setCurrentBlock(
"title_link_bl");
 
  218                         $this->tpl->setVariable(
"QUESTION_TITLE_LINK", 
$data[
"title"]);
 
  219                         $this->tpl->setVariable(
"URL_TITLE", $url_edit);
 
  220                         $this->tpl->parseCurrentBlock();                        
 
  224                         $this->tpl->setCurrentBlock(
"title_nolink_bl");
 
  225                         $this->tpl->setVariable(
"QUESTION_TITLE", 
$data[
"title"]);
 
  226                         $this->tpl->parseCurrentBlock();
 
  229                 if (
$data[
"complete"] == 0)
 
  231                         $this->tpl->setCurrentBlock(
"qpl_warning");
 
  233                         $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  234                         $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
 
  235                         $this->tpl->parseCurrentBlock();
 
  240                         if (strcmp($c, 
'description') == 0)
 
  242                                 $this->tpl->setCurrentBlock(
'description');
 
  243                                 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ? 
$data[
"description"] : 
" ");
 
  244                                 $this->tpl->parseCurrentBlock();
 
  246                         if (strcmp($c, 
'type') == 0)
 
  248                                 $this->tpl->setCurrentBlock(
'type');
 
  250                                 $this->tpl->parseCurrentBlock();
 
  252                         if (strcmp($c, 
'author') == 0)
 
  254                                 $this->tpl->setCurrentBlock(
'author');
 
  255                                 $this->tpl->setVariable(
"QUESTION_AUTHOR", 
$data[
"author"]);
 
  256                                 $this->tpl->parseCurrentBlock();
 
  258                         if (strcmp($c, 
'created') == 0)
 
  260                                 $this->tpl->setCurrentBlock(
'created');
 
  262                                 $this->tpl->parseCurrentBlock();
 
  264                         if (strcmp($c, 
'updated') == 0)
 
  266                                 $this->tpl->setCurrentBlock(
'updated');
 
  268                                 $this->tpl->parseCurrentBlock();
 
  273                 include_once 
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
 
  275                 $list->setId(
$data[
"question_id"]);
 
  276                 $list->setListTitle($this->lng->txt(
"actions"));                                        
 
  279                         $list->addItem($this->lng->txt(
"edit"), 
"", $url_edit);
 
  281                 $list->addItem($this->lng->txt(
"preview"), 
"", $this->ctrl->getLinkTargetByClass(strtolower($guiclass), 
"preview"));    
 
  282                 $this->tpl->setVariable(
"ACTION", $list->getHTML());
 
  283                 $this->tpl->parseCurrentBlock();
 
  288                         $checked = 
$data[
"obligatory"] ? 
" checked=\"checked\"" : 
"";
 
  289                         $obligatory = 
"<input type=\"checkbox\" name=\"obligatory_".
 
  290                                 $data[
"question_id"] . 
"\" value=\"1\"".$checked.
" />";
 
  292                 else if(
$data[
"obligatory"])
 
  294                         $obligatory = 
"<img src=\"".ilUtil::getImagePath(
"obligatory.png", 
"Modules/Survey").
 
  295                                 "\" alt=\"".$this->lng->txt(
"question_obligatory").
 
  296                                 "\" title=\"".$this->lng->txt(
"question_obligatory").
"\" />";
 
  298                 $this->tpl->setVariable(
"OBLIGATORY", $obligatory);
 
  302                         $this->tpl->setVariable(
'CBOX_ID', 
$data[
"question_id"]);
 
  304                 $this->tpl->setVariable(
'QUESTION_ID', 
$data[
"question_id"]);                           
 
  309                 $this->editable = $value;
 
  319                 $this->writeAccess = $value;