5 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
23 public function __construct($a_parent_obj,$a_parent_cmd,$a_enable_editing =
false)
25 $this->enable_editing = $a_enable_editing;
40 $this->tpl->setVariable(
'OBJ_SRC', $a_row[
'icon']);
41 $this->tpl->setVariable(
'OBJ_ALT', $a_row[
'icon_alt']);
42 $this->tpl->setVariable(
'OBJ_TITLE',$a_row[
'title']);
43 include_once
'./Services/Link/classes/class.ilLink.php';
44 $this->tpl->setVariable(
'OBJ_LINK',
ilLink::_getLink($a_row[
'ref_id'], $a_row[
'type']));
45 $this->tpl->setVariable(
'OBJ_DESCRIPTION', $a_row[
'description']);
46 $this->tpl->setVariable(
'COND_ID', $a_row[
'id']);
47 $this->tpl->setVariable(
'OBJ_CONDITION', $a_row[
'condition']);
49 if(!$this->enable_editing)
51 $this->tpl->setCurrentBlock(
"obligatory_static");
52 $this->tpl->setVariable(
'OBL_SRC',
ilUtil::getImagePath($a_row[
'obligatory'] ?
'icon_ok.svg' :
'icon_not_ok.svg'));
53 $this->tpl->setVariable(
55 $this->lng->txt($a_row[
'obligatory'] ?
56 'precondition_obligatory_alt' :
57 'precondition_not_obligatory_alt')
59 $this->tpl->parseCurrentBlock();
63 $this->tpl->setCurrentBlock(
"obligatory_edit");
64 $this->tpl->setVariable(
'OBL_ID', $a_row[
'id']);
65 $this->tpl->setVariable(
'OBL_STATUS', $a_row[
'obligatory'] ?
' checked="checked"' :
'');
66 $this->tpl->parseCurrentBlock();
69 $ilCtrl->setParameterByClass(get_class($this->
getParentObject()),
'condition_id',$a_row[
'id']);
70 $this->tpl->setVariable(
'EDIT_LINK',$ilCtrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'edit'));
71 $this->tpl->setVariable(
'TXT_EDIT', $this->lng->txt(
'edit'));
81 foreach((array) $a_conditions as $condition)
83 if($condition[
'trigger_type'] ==
'crsg')
88 $row[
'id'] = $condition[
'condition_id'];
89 $row[
'ref_id'] = $condition[
'trigger_ref_id'];
90 $row[
'type'] = $condition[
'trigger_type'];
94 $row[
'icon_alt'] = $this->lng->txt(
'obj_'.$condition[
'trigger_type']);
95 $row[
'condition'] = $this->lng->txt(
'condition_'.$condition[
'operator']);
96 $row[
'obligatory'] = $condition[
'obligatory'];
111 $this->lng->loadLanguageModule(
'rbac');
113 $this->
setRowTemplate(
'tpl.condition_handler_row.html',
'Services/AccessControl');
115 $this->
setTitle($this->lng->txt(
'active_preconditions'));
118 $this->
addColumn($this->lng->txt(
'rbac_precondition_source'),
'title',
'66%');
119 $this->
addColumn($this->lng->txt(
'condition'),
'condition');
120 $this->
addColumn($this->lng->txt(
'precondition_obligatory'),
'obligatory');
121 $this->
addColumn($this->lng->txt(
'actions'));
123 $this->
enable(
'select_all');
132 if($this->enable_editing)
134 $this->
addCommandButton(
"saveObligatoryList", $this->lng->txt(
"rbac_precondition_save_obligatory"));