41 $this->
lng = $DIC->language();
42 $this->
user = $DIC->user();
43 $this->
ctrl = $DIC->ctrl();
44 $this->tpl = $DIC[
"tpl"];
45 $this->
ui = $DIC->ui();
46 $this->tile =
new Tile($DIC);
48 $lng = $DIC->language();
49 $ilUser = $DIC->user();
50 $ilCtrl = $DIC->ctrl();
54 $a_user_id = $ilUser->getId();
57 $this->
setId(
"bdgprs");
74 $this->
setFormAction($ilCtrl->getFormAction($this->getParentObject()));
91 $badge =
new ilBadge($ass->getBadgeId());
94 if ($badge->getParentId()) {
96 if ($parent[
"type"] ===
"bdga") {
102 "id" => $badge->getId(),
103 "title" => $badge->getTitle(),
104 "image" => $badge->getImagePath(),
105 "issued_on" => $ass->getTimestamp(),
106 "parent_title" => $parent ? $parent[
"title"] : null,
108 "active" => (bool) $ass->getPosition(),
109 "renderer" => fn() => $this->tile->asTitle(
110 $this->tile->modalContentWithAssignment($badge, $ass)
118 protected function fillRow(array $a_set): void
123 $current = $a_set[
"active"] ? [
124 'target' =>
'deactivate',
125 'text' =>
'badge_remove_from_profile',
126 'active' => $this->
language->txt(
'yes'),
128 'target' =>
'activate',
129 'text' =>
'badge_add_to_profile',
130 'active' => $this->
language->txt(
'no'),
133 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
134 $this->tpl->setVariable(
"PREVIEW", $this->
ui->renderer()->render($a_set[
"renderer"]()));
136 $this->tpl->setVariable(
"TXT_ACTIVE", $current[
"active"]);
138 if ($a_set[
"parent"]) {
139 $this->tpl->setVariable(
"TXT_PARENT", $a_set[
"parent_title"]);
140 $this->tpl->setVariable(
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
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)
setEnableTitle(bool $a_enabletitle)
static getInstancesByUserId(int $a_user_id)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
Provides fluid interface to RBAC services.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_user_id=null)
readonly ilLanguage $language
TableGUI class for user badge listing.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
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)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
addMultiCommand(string $a_cmd, string $a_text)