57 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrases.php";
62 $this->gui_object =& $a_object;
65 $this->ref_id = $a_object->ref_id;
73 $cmd = $this->ctrl->getCmd();
74 $next_class = $this->ctrl->getNextClass($this);
109 $checked_phrases = array();
110 foreach ($_POST as $key => $value)
112 if (preg_match(
"/phrase_(\d+)/", $key, $matches))
114 array_push($checked_phrases, $matches[1]);
117 if (count($checked_phrases))
130 $this->tpl->setCurrentBlock(
"obligatory");
131 $this->tpl->setVariable(
"TEXT_OBLIGATORY", $this->lng->txt(
"obligatory"));
132 $this->tpl->setVariable(
"CHECKED_OBLIGATORY",
" checked=\"checked\"");
133 $this->tpl->parseCurrentBlock();
134 $this->tpl->setCurrentBlock(
"adm_content");
135 $this->tpl->setVariable(
"DEFINE_QUESTIONBLOCK_HEADING", $this->lng->txt(
"define_questionblock"));
136 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"title"));
137 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
138 $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
139 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
140 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
141 $this->tpl->parseCurrentBlock();
153 if ($rbacsystem->checkAccess(
"write", $this->ref_id))
155 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_phrases.html",
"Modules/SurveyQuestionPool");
156 $phrases =& $this->
object->_getAvailablePhrases(1);
159 include_once
"./Services/Utilities/classes/class.ilUtil.php";
160 $colors = array(
"tblrow1",
"tblrow2");
162 foreach ($phrases as $phrase_id => $phrase_array)
164 $this->tpl->setCurrentBlock(
"phraserow");
165 $this->tpl->setVariable(
"PHRASE_ID", $phrase_id);
166 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter++ % 2]);
167 $this->tpl->setVariable(
"PHRASE_TITLE", $phrase_array[
"title"]);
168 $categories =& $this->
object->_getCategoriesForPhrase($phrase_id);
169 $this->tpl->setVariable(
"PHRASE_CONTENT", join($categories,
", "));
170 $this->tpl->parseCurrentBlock();
173 $this->tpl->setCurrentBlock(
"selectall");
174 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
175 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter++ % 2]);
176 $this->tpl->parseCurrentBlock();
177 $this->tpl->setCurrentBlock(
"Footer");
178 $this->tpl->setVariable(
"ARROW",
"<img src=\"" .
ilUtil::getImagePath(
"arrow_downright.gif") .
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\">");
179 $this->tpl->setVariable(
"TEXT_DELETE", $this->lng->txt(
"delete"));
180 $this->tpl->parseCurrentBlock();
184 $this->tpl->setCurrentBlock(
"Emptytable");
185 $this->tpl->setVariable(
"TEXT_EMPTYTABLE", $this->lng->txt(
"no_user_phrases_defined"));
186 $this->tpl->parseCurrentBlock();
188 $this->tpl->setCurrentBlock(
"adm_content");
189 $this->tpl->setVariable(
"INTRODUCTION_MANAGE_PHRASES", $this->lng->txt(
"introduction_manage_phrases"));
190 $this->tpl->setVariable(
"TEXT_PHRASE_TITLE", $this->lng->txt(
"phrase"));
191 $this->tpl->setVariable(
"TEXT_PHRASE_CONTENT", $this->lng->txt(
"categories"));
192 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
193 $this->tpl->parseCurrentBlock();
206 $this->ctrl->redirect($this,
"phrases");
215 foreach ($_POST as $key => $value)
217 if (preg_match(
"/phrase_(\d+)/", $key, $matches))
219 array_push($phrases, $matches[1]);
222 $this->
object->deletePhrases($phrases);
224 $this->ctrl->redirect($this,
"phrases");
238 $phrases =& $this->
object->_getAvailablePhrases(1);
239 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_qpl_confirm_delete_phrases.html",
"Modules/SurveyQuestionPool");
240 $colors = array(
"tblrow1",
"tblrow2");
242 foreach ($checked_phrases as $id)
244 $this->tpl->setCurrentBlock(
"row");
245 $this->tpl->setVariable(
"COLOR_CLASS", $colors[$counter++ % 2]);
246 $this->tpl->setVariable(
"PHRASE_TITLE", $phrases[$id][
"title"]);
247 $categories =& $this->
object->_getCategoriesForPhrase($id);
248 $this->tpl->setVariable(
"PHRASE_CONTENT", join($categories,
", "));
249 $this->tpl->parseCurrentBlock();
250 $this->tpl->setCurrentBlock(
"hidden");
251 $this->tpl->setVariable(
"HIDDEN_NAME",
"phrase_$id");
252 $this->tpl->setVariable(
"HIDDEN_VALUE",
"1");
253 $this->tpl->parseCurrentBlock();
256 $this->tpl->setCurrentBlock(
"adm_content");
257 $this->tpl->setVariable(
"TEXT_PHRASE_TITLE", $this->lng->txt(
"phrase"));
258 $this->tpl->setVariable(
"TEXT_PHRASE_CONTENT", $this->lng->txt(
"categories"));
259 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
260 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
261 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
262 $this->tpl->parseCurrentBlock();