15 public function __construct($a_parent_obj, $a_parent_cmd, $a_exc_id)
19 $this->ctrl = $DIC->ctrl();
20 $this->lng = $DIC->language();
22 $lng = $DIC->language();
24 $this->exc_id = $a_exc_id;
25 $this->
setId(
"exccritcat" . $this->exc_id);
34 $this->
addColumn($this->lng->txt(
"position"),
"pos",
"10%");
35 $this->
addColumn($this->lng->txt(
"title"),
"title");
36 $this->
addColumn($this->lng->txt(
"exc_criterias"));
37 $this->
addColumn($this->lng->txt(
"exc_assignments"));
38 $this->
addColumn($this->lng->txt(
"actions"));
44 $this->
setRowTemplate(
"tpl.exc_crit_cat_row.html",
"Modules/Exercise");
60 $protected = $assigned = array();
62 if ($ass->getPeerReviewCriteriaCatalogue()) {
63 $assigned[$ass->getPeerReviewCriteriaCatalogue()][$ass->getId()] = $ass->getTitle();
66 if ($peer_review->hasPeerReviewGroups()) {
67 $protected[$ass->getPeerReviewCriteriaCatalogue()][] = $ass->getId();
72 if (
sizeof($protected)) {
82 $crits[] = array($crit->getTranslatedType(), $crit->getTitle());
86 "id" => $item->getId()
88 ,
"title" => $item->getTitle()
89 ,
"criterias" => $crits
90 ,
"protected" => array_key_exists($item->getId(), $protected)
91 ? $protected[$item->getId()]
93 ,
"assigned" => array_key_exists($item->getId(), $assigned)
94 ? $assigned[$item->getId()]
101 return (
bool)
sizeof(
$data);
106 return in_array($a_field, array(
"pos"));
114 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
115 $this->tpl->setVariable(
"POS", $a_set[
"pos"]);
116 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
121 if (
sizeof($a_set[
"criterias"])) {
122 $this->tpl->setCurrentBlock(
"crit_bl");
123 foreach ($a_set[
"criterias"] as $crit) {
124 $this->tpl->setVariable(
"CRIT_TYPE", $crit[0]);
125 $this->tpl->setVariable(
"CRIT_TITLE", $crit[1]);
126 $this->tpl->parseCurrentBlock();
130 $this->tpl->setCurrentBlock(
"action_bl");
131 $this->tpl->setVariable(
"ACTION_URL",
$url);
132 $this->tpl->setVariable(
"ACTION_TXT",
$lng->txt(
"edit"));
133 $this->tpl->parseCurrentBlock();
135 if (is_array($a_set[
"assigned"])) {
136 foreach ($a_set[
"assigned"] as $ass_id => $ass_title) {
137 if (is_array($a_set[
"protected"]) &&
138 in_array($ass_id, $a_set[
"protected"])) {
139 $this->tpl->setCurrentBlock(
"ass_protected_bl");
140 $this->tpl->setVariable(
"ASS_PROTECTED",
$lng->txt(
"exc_crit_cat_protected_assignment"));
141 $this->tpl->parseCurrentBlock();
144 $this->tpl->setCurrentBlock(
"ass_bl");
145 $this->tpl->setVariable(
"ASS_TITLE", $ass_title);
146 $this->tpl->parseCurrentBlock();
151 if (!is_array($a_set[
"protected"])) {
152 $url =
$ilCtrl->getLinkTargetByClass(
"ilExcCriteriaGUI",
"");
154 $this->tpl->setCurrentBlock(
"action_bl");
155 $this->tpl->setVariable(
"ACTION_URL",
$url);
156 $this->tpl->setVariable(
"ACTION_TXT",
$lng->txt(
"exc_edit_criterias"));
157 $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)
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
__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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static getInstancesByParentId($a_parent_id)
__construct(Container $dic, ilPlugin $plugin)
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)