4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40 $this->tree = $DIC->repositoryTree();
42 $lng = $DIC->language();
44 $this->question = $a_question;
46 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->
setId(
"il_svy_spl_sync");
50 $this->
setTitle($this->question->getTitle());
64 $this->
setRowTemplate(
"tpl.il_svy_qpl_sync.html",
"Modules/SurveyQuestionPool");
77 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
79 $table_data =
array();
80 foreach ($this->question->getCopyIds(
true) as $survey_obj_id => $questions) {
81 $survey_id =
new ilObjSurvey($survey_obj_id,
false);
82 $survey_id->loadFromDB();
83 $survey_id = $survey_id->getSurveyId();
91 foreach ($ref_ids as $ref_id) {
92 if ($ilAccess->checkAccess(
"edit",
"", $ref_id)) {
99 $message =
$lng->txt(
"survey_sync_insufficient_permissions");
106 $survey_path = $this->
buildPath($ref_ids);
108 foreach ($questions as $question_id) {
115 $table_data[] =
array(
116 "id" => $question_id,
118 "path" => $survey_path,
137 $this->tpl->setVariable(
"TXT_PATH",
$lng->txt(
"path"));
139 if ($a_set[
"message"]) {
140 $this->tpl->setCurrentBlock(
"message");
141 $this->tpl->setVariable(
"TXT_MESSAGE", $a_set[
"message"]);
142 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
"checkbox");
148 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
149 $this->tpl->parseCurrentBlock();
153 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
154 $this->tpl->setVariable(
"VALUE_PATH", implode(
"<br />", $a_set[
"path"]));
168 include_once
'./Services/Link/classes/class.ilLink.php';
170 if (!count($ref_ids)) {
173 foreach ($ref_ids as $ref_id) {
177 $path_full =
$tree->getPathFull($ref_id);
178 if (
sizeof($path_full)) {
179 foreach ($path_full as
$data) {
180 if (++
$counter < (count($path_full)-1)) {
183 $path .=
" » ";
184 if ($ref_id != $data[
'ref_id']) {
185 $path .= $data[
'title'];
187 $path .= (
'<a target="_top" href="' .
189 $data[
'title'] .
'</a>');
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDescription($a_val)
Set description.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
Survey sync table GUI class.
static _hasDatasets($survey_id)
static _getTitle($question_id)
Returns the question title of a question with a given id.
__construct($a_parent_obj, $a_parent_cmd, SurveyQuestion $a_question)
Constructor.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
catch(Exception $e) $message
Basic class for all survey question types.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
importData()
Import data from DB.
fillRow($a_set)
Fill table row.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
buildPath($ref_ids)
Build path with deep-link.