4include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
    5include_once 
'./Services/AccessControl/classes/class.ilPermissionGUI.php';
 
    6require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
 
   35    public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id, $a_type, $a_show_admin_permissions = 
false)
 
   39        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   40        $rbacreview = 
$DIC[
'rbacreview'];
 
   43        $this->tpl_type = $a_type;
 
   44        $this->show_admin_permissions = $a_show_admin_permissions;
 
   48        $this->
setId(
'role_template_' . $a_ref_id . 
'_' . $a_type);
 
   52        $this->lng->loadLanguageModule(
'rbac');
 
   54        $this->ref_id = $a_ref_id;
 
   55        $this->role_id = $a_role_id;
 
   57        $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html", 
"Services/AccessControl");
 
   79        $this->show_change_existing_objects = $a_status;
 
   98        $rbacreview = 
$DIC[
'rbacreview'];
 
  100        if (self::$template_permissions !== 
null) {
 
  103        self::$template_permissions = $rbacreview->getAllOperationsOfRole(
 
  116        return self::$template_permissions[$a_type] ? self::$template_permissions[$a_type] : array();
 
  181        $objDefinition = 
$DIC[
'objDefinition'];
 
  183        if (isset($row[
'show_ce'])) {
 
  184            $this->tpl->setCurrentBlock(
'ce_td');
 
  186            $this->tpl->parseCurrentBlock();
 
  188            $this->tpl->setCurrentBlock(
'ce_desc_td');
 
  190            $this->tpl->setVariable(
'CE_LONG', $this->lng->txt(
'change_existing_object_type_desc'));
 
  192            if ($objDefinition->isSystemObject($this->getTemplateType())) {
 
  193                $this->tpl->setVariable(
 
  195                    $this->lng->txt(
"change_existing_prefix_single") . 
" " .
 
  196                    $this->lng->txt(
"obj_" . $this->getTemplateType()) . 
" " .
 
  197                    $this->lng->txt(
"change_existing_suffix_single")
 
  205                    : $this->lng->txt(
'objs_' . $this->getTemplateType());
 
  206                $this->tpl->setVariable(
 
  208                    $this->lng->txt(
'change_existing_prefix') . 
' ' .
 
  210                    $this->lng->txt(
'change_existing_suffix')
 
  212                $this->tpl->parseCurrentBlock();
 
  216            $this->tpl->setCurrentBlock(
'perm_td');
 
  218            $this->tpl->setVariable(
'PERM_PERM_ID', $row[
'ops_id']);
 
  219            $this->tpl->setVariable(
'PERM_CHECKED', $row[
'set'] ? 
'checked="checked"' : 
'');
 
  222                $this->tpl->setVariable(
'PERM_DISABLED', 
'disabled="disabled"');
 
  225            $this->tpl->parseCurrentBlock();
 
  227            $this->tpl->setCurrentBlock(
'perm_desc_td');
 
  229            $this->tpl->setVariable(
'DESC_PERM_ID', $row[
'ops_id']);
 
  231            if ($row[
"create_type"] != 
"" && $objDefinition->isPlugin($row[
'create_type'])) {
 
  232                $this->tpl->setVariable(
 
  239            } elseif ($row[
"create_type"] == 
"" && $objDefinition->isPlugin($this->getTemplateType())) {
 
  240                $this->tpl->setVariable(
 
  248                if (substr($row[
'name'], 0, 6) == 
'create') {
 
  249                    #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']); 
  250                    $perm = $this->lng->txt(
'rbac' . 
'_' . $row[
'name']);
 
  251                } elseif ($this->lng->exists($this->getTemplateType() . 
'_' . $row[
'name'] . 
'_short')) {
 
  252                    $perm = $this->lng->txt($this->
getTemplateType() . 
'_' . $row[
'name'] . 
'_short') . 
': ' .
 
  255                    $perm = $this->lng->txt($row[
'name']) . 
': ' . $this->lng->txt($this->
getTemplateType() . 
'_' . $row[
'name']);
 
  258                $this->tpl->setVariable(
'TXT_PERMISSION', $perm);
 
  260            $this->tpl->parseCurrentBlock();
 
  274        $rbacreview = 
$DIC[
'rbacreview'];
 
  275        $objDefinition = 
$DIC[
'objDefinition'];
 
  282        foreach ($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(), 
'object') as $ops_id) {
 
  285            $operation = $rbacreview->getOperation($ops_id);
 
  287            $perm[
'ops_id'] = $ops_id;
 
  289            $perm[
'name'] = $operation[
'operation'];
 
  295        $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
 
  298        foreach ($objects as 
$type => $info) {
 
  299            $ops_id = $ops_ids[
$type];
 
  305            $perm[
'ops_id'] = $ops_id;
 
  308            $perm[
'name'] = 
'create_' . $info[
'name'];
 
  309            $perm[
'create_type'] = $info[
'name'];
 
  315            !$this->show_admin_permissions &&
 
  318            $rows[] = array(
'show_ce' => 1);
 
An exception for terminatinating execution or to throw for unit testing.
static lookupTxtById($plugin_id, $lang_var)
Table for object role permissions.
getShowChangeExistingObjects()
getRefId()
Get ref id of current object.
getPermissions($a_type)
Get permissions by type.
$show_change_existing_objects
getTemplateType()
get current tempalte type
initTemplateType($a_type)
Set object type for current template permission table.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id, $a_type, $a_show_admin_permissions=false)
Constructor.
parse()
Parse permissions.
getRoleId()
Get currrent role id.
fillRow($row)
Fill row template.
setShowChangeExistingObjects($a_status)
initTemplatePermissions()
static $template_permissions
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
setEnableHeader($a_enableheader)
Set Enable Header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setNoEntriesText($a_text)
Set text for an empty table.
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.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
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.
setFormName($a_formname="")
Set Form name.
disable($a_module_name)
diesables particular modules of table
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc