35 $ilCtrl = $DIC[
'ilCtrl'];
37 $this->rbacreview = $DIC->rbac()->review();
41 $this->parent_obj = $a_parent_obj;
43 $this->
setId(
"usrrolesp");
57 $this->
setRowTemplate(
"tpl.user_role_starting_point_row.html",
"Services/User");
81 "criteria" =>
$lng->
txt(
"user_chooses_starting_page"),
82 "starting_page" => $status,
83 "starting_position" => self::TABLE_POSITION_USER_CHOOSES
88 foreach ($points as $point) {
89 $starting_point = $point[
'starting_point'];
90 $position = $point[
'position'];
91 $sp_text = $valid_points[$starting_point] ??
"";
95 $type = $dc->lookupType($object_id);
96 $title = $dc->lookupTitle($object_id);
97 $sp_text = $this->
lng->txt(
"obj_" .
$type) .
" <i>\"" .
$title .
"\"</i> [" . $point[
'starting_object'] .
"]";
101 $options = unserialize($point[
'rule_options'], [
'allowed_classes' =>
false]);
104 if (!($role_obj instanceof \
ilObjRole)) {
109 "id" => $point[
'id'],
110 "criteria" => $role_obj->getTitle(),
111 "starting_page" => $sp_text,
112 "starting_position" => (
int) $position,
113 "role_id" => $role_obj->getId()
119 $starting_point = $valid_points[$default_sp];
124 $type = $dc->lookupType($object_id);
125 $title = $dc->lookupTitle($object_id);
126 $starting_point = $this->
lng->txt(
"obj_" .
$type) .
" " .
"<i>\"" .
$title .
"\" ($reference_id)</i>";
131 "criteria" =>
$lng->
txt(
"default"),
132 "starting_page" => $starting_point,
133 "starting_position" => self::TABLE_POSITION_DEFAULT
143 protected function fillRow(array $a_set): void
148 $ilCtrl = $DIC[
'ilCtrl'];
151 $list->setListTitle(
$lng->
txt(
"actions"));
156 if ($a_set[
'id'] > 0 && $a_set[
'id'] !=
'default' && $a_set[
'id'] !=
'user') {
158 $ilCtrl->setParameter($this->
getParentObject(),
"rolid", $a_set[
"role_id"]);
161 $list->setId($a_set[
"id"]);
163 $edit_url = $ilCtrl->getLinkTarget($this->
getParentObject(),
"initRoleStartingPointForm");
164 $list->addItem(
$lng->
txt(
"edit"),
"", $edit_url);
165 $delete_url = $ilCtrl->getLinkTarget($this->
getParentObject(),
"confirmDeleteStartingPoint");
166 $list->addItem(
$lng->
txt(
"delete"),
"", $delete_url);
167 $this->tpl->setVariable(
"VAL_ID",
"position[" . $a_set[
'id'] .
"]");
168 $this->tpl->setVariable(
"VAL_POS", $a_set[
"starting_position"]);
172 $ref_id = $this->rbacreview->getObjectReferenceOfRole($a_set[
"role_id"]);
177 $this->tpl->setVariable(
"TXT_TITLE", $this->
lng->txt(
"has_role") .
": " .
180 if ($a_set[
'id'] ==
"default") {
182 $edit_url = $ilCtrl->getLinkTarget($this->
getParentObject(),
"initRoleStartingPointForm");
185 $edit_url = $ilCtrl->getLinkTarget($this->
getParentObject(),
"initUserStartingPointForm");
188 $list->addItem(
$lng->
txt(
"edit"),
"", $edit_url);
190 $this->tpl->setVariable(
"HIDDEN",
"hidden");
192 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"criteria"]);
195 $this->tpl->setVariable(
"TXT_PAGE", $a_set[
"starting_page"]);
197 $this->tpl->setVariable(
"ACTION", $list->getHTML());
const TABLE_POSITION_USER_CHOOSES
static getLogger(string $a_component_id)
Get component logger.
static getStartingPoints()
Get all the starting points in database.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
const TABLE_POSITION_DEFAULT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static reArrangePositions(array $a_items)
static getStartingPoint()
Get current starting point setting.
static hasPersonalStartingPoint()
Can starting point be personalized?
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setExternalSorting(bool $a_val)
static getPossibleStartingPoints(bool $a_force_all=false)
Get all valid starting points.
static _lookupTitle(int $obj_id)
static _getTranslation(string $a_role_title)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static getStartingObject()
Get ref id of starting object.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
const START_REPOSITORY_OBJ
static _lookupType(int $id, bool $reference=false)
__construct(object $a_parent_obj)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)