ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAvailableRolesStatusTableGUI.php
Go to the documentation of this file.
1 <?php
2 include_once('./Services/Table/classes/class.ilTable2GUI.php');
3 
14 {
18  public function __construct($a_parent_obj, $a_parent_cmd)
19  {
20  global $DIC;
21 
22  $lng = $DIC->language();
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->setId('available_roles' . $this->parent_obj->user->getId());
27  $this->setEnableHeader(true);
28  $this->disable('numinfo');
29  $this->setLimit(100);
30  $this->setRowTemplate("tpl.available_roles_status_row.html", "Services/AccessControl");
31 
32  $this->addColumn("", "status", "5%");
33  $this->addColumn($lng->txt("role"), "role", "32%");
34  $this->addColumn(str_replace(" ", "&nbsp;", $lng->txt("info_permission_source")), "effective_from", "32%");
35  $this->addColumn(str_replace(" ", "&nbsp;", $lng->txt("info_permission_origin")), "original_position");
36 
37  include_once('./Services/Link/classes/class.ilLink.php');
38  }
39 
43  protected function fillRow($a_set)
44  {
45  global $DIC;
46 
47  $lng = $DIC['lng'];
48  $ilCtrl = $DIC['ilCtrl'];
49 
50  if ($a_set["img"] == ilObjectPermissionStatusGUI::IMG_OK) {
51  $img_path = ilUtil::getImagePath("icon_ok.svg");
52  $img_info = $lng->txt("info_assigned");
53  } else {
54  $img_path = ilUtil::getImagePath("icon_not_ok.svg");
55  $img_info = $lng->txt("info_not_assigned");
56  }
57  $this->tpl->setVariable("IMG_PATH", $img_path);
58  $this->tpl->setVariable("IMG_INFO", $img_info);
59 
60  $link = $ilCtrl->getLinkTargetByClass(array('ilpermissiongui'), 'perm', '', true);
61  $this->tpl->setVariable("ROLE_LINK", $link);
62  $this->tpl->setVariable("TXT_ROLE", $a_set["role"]);
63 
64  if ($a_set["effective_from"] != "") {
65  $this->tpl->setCurrentBlock("effective_from");
66  $this->tpl->setVariable("EFFECTIVE_FROM_LINK", ilLink::_getLink($a_set["effective_from_ref_id"]));
67  $this->tpl->setVariable("TXT_EFFECTIVE_FROM", $a_set["effective_from"]);
68  $this->tpl->parseCurrentBlock();
69  }
70 
71  if ($a_set["original_position_ref_id"] !== false) {
72  $this->tpl->setCurrentBlock("original_position_with_link");
73  $this->tpl->setVariable("TXT_ORIGINAL_POSITION_WITH_LINK", $a_set["original_position"]);
74  $this->tpl->setVariable("ORIGINAL_POSITION_LINK", ilLink::_getLink($a_set["original_position_ref_id"]));
75  $this->tpl->parseCurrentBlock();
76  } else {
77  $this->tpl->setVariable("TXT_ORIGINAL_POSITION", $a_set["original_position"]);
78  }
79  }
80 }
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
global $DIC
Definition: saml.php:7
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
Class ilTable2GUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
disable($a_module_name)
diesables particular modules of table
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.
setEnableHeader($a_enableheader)
Set Enable Header.
Table for Available Roles in Permission > Permission of User.
setLimit($a_limit=0, $a_default_limit=0)