5 include_once
"Services/Table/classes/class.ilTable2GUI.php";
17 public function __construct($a_parent_obj, $a_parent_cmd, $a_exc_id)
21 $this->exc_id = $a_exc_id;
22 $this->
setId(
"exccritcat".$this->exc_id);
24 parent::__construct($a_parent_obj, $a_parent_cmd);
28 $this->
setTitle($lng->txt(
"exc_criteria_catalogues"));
31 $this->
addColumn($this->lng->txt(
"position"),
"pos",
"10%");
32 $this->
addColumn($this->lng->txt(
"title"),
"title");
33 $this->
addColumn($this->lng->txt(
"exc_criterias"));
34 $this->
addColumn($this->lng->txt(
"exc_assignments"));
35 $this->
addColumn($this->lng->txt(
"actions"));
41 $this->
setRowTemplate(
"tpl.exc_crit_cat_row.html",
"Modules/Exercise");
58 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
59 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
60 include_once
"Modules/Exercise/classes/class.ilExPeerReview.php";
62 $protected = $assigned =
array();
65 if($ass->getPeerReviewCriteriaCatalogue())
67 $assigned[$ass->getPeerReviewCriteriaCatalogue()][$ass->getId()] = $ass->getTitle();
70 if($peer_review->hasPeerReviewGroups())
72 $protected[$ass->getPeerReviewCriteriaCatalogue()][] = $ass->getId();
77 if(
sizeof($protected))
90 $crits[] =
array($crit->getTranslatedType(), $crit->getTitle());
94 "id" => $item->getId()
96 ,
"title" => $item->getTitle()
97 ,
"criterias" => $crits
98 ,
"protected" => array_key_exists($item->getId(), $protected)
99 ? $protected[$item->getId()]
101 ,
"assigned" => array_key_exists($item->getId(), $assigned)
102 ? $assigned[$item->getId()]
109 return (
bool)
sizeof(
$data);
114 return in_array($a_field,
array(
"pos"));
121 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
122 $this->tpl->setVariable(
"POS", $a_set[
"pos"]);
123 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
125 $ilCtrl->setParameter($this->
getParentObject(),
"cat_id", $a_set[
"id"]);
128 if(
sizeof($a_set[
"criterias"]))
130 $this->tpl->setCurrentBlock(
"crit_bl");
131 foreach($a_set[
"criterias"] as $crit)
133 $this->tpl->setVariable(
"CRIT_TYPE", $crit[0]);
134 $this->tpl->setVariable(
"CRIT_TITLE", $crit[1]);
135 $this->tpl->parseCurrentBlock();
139 $this->tpl->setCurrentBlock(
"action_bl");
140 $this->tpl->setVariable(
"ACTION_URL",
$url);
141 $this->tpl->setVariable(
"ACTION_TXT", $lng->txt(
"edit"));
142 $this->tpl->parseCurrentBlock();
144 if(is_array($a_set[
"assigned"]))
146 foreach($a_set[
"assigned"] as $ass_id => $ass_title)
148 if(is_array($a_set[
"protected"]) &&
149 in_array($ass_id, $a_set[
"protected"]))
151 $this->tpl->setCurrentBlock(
"ass_protected_bl");
152 $this->tpl->setVariable(
"ASS_PROTECTED", $lng->txt(
"exc_crit_cat_protected_assignment"));
153 $this->tpl->parseCurrentBlock();
156 $this->tpl->setCurrentBlock(
"ass_bl");
157 $this->tpl->setVariable(
"ASS_TITLE", $ass_title);
158 $this->tpl->parseCurrentBlock();
163 if(!is_array($a_set[
"protected"]))
165 $url = $ilCtrl->getLinkTargetByClass(
"ilExcCriteriaGUI",
"");
167 $this->tpl->setCurrentBlock(
"action_bl");
168 $this->tpl->setVariable(
"ACTION_URL",
$url);
169 $this->tpl->setVariable(
"ACTION_TXT", $lng->txt(
"exc_edit_criterias"));
170 $this->tpl->parseCurrentBlock();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getInstancesByParentId($a_parent_id)
__construct($a_parent_obj, $a_parent_cmd, $a_exc_id)
static getInstancesByExercise($a_exc_id)
Class ilExcCriteriaCatalogueTableGUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
static getInstancesByParentId($a_parent_id)
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
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.
setLimit($a_limit=0, $a_default_limit=0)
numericOrdering($a_field)