35 string $a_parent_cmd =
"",
36 int $a_parent_obj_id = 0,
37 protected bool $has_write =
false 41 $this->
ctrl = $DIC->ctrl();
42 $this->
lng = $DIC->language();
43 $this->
ui = $DIC->ui();
44 $this->tile =
new Tile($DIC);
45 $ilCtrl = $DIC->ctrl();
46 $lng = $DIC->language();
48 $this->
setId(
"bdgbdg");
57 if ($this->has_write) {
65 if ($this->has_write) {
96 $valid_types =
$handler->getAvailableTypesForObjType($this->parent_type);
98 count($valid_types) > 1) {
101 $options = array(
"" =>
$lng->
txt(
"search_any"));
102 foreach ($valid_types as
$id => $type) {
108 $type->setOptions($options);
109 $this->filter[
"type"] = $type->getValue();
113 public function getItems(
int $a_parent_obj_id): void
119 "id" => $badge->getId(),
120 "title" => $badge->getTitle(),
121 "active" => $badge->isActive(),
122 "type" => ($this->parent_type !==
"bdga")
124 : $badge->getTypeInstance()->getCaption(),
125 "manual" => (!$badge->getTypeInstance() instanceof
ilBadgeAuto),
126 "renderer" => fn() => $this->tile->asTitle($this->tile->modalContent($badge)),
133 protected function fillRow(array $a_set): void
138 if ($this->has_write) {
139 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
142 $this->tpl->setVariable(
"PREVIEW", $this->
ui->renderer()->render($a_set[
"renderer"]()));
143 $this->tpl->setVariable(
"TXT_TYPE", $a_set[
"type"]);
144 $this->tpl->setVariable(
"TXT_ACTIVE", $a_set[
"active"]
148 if ($this->has_write) {
151 if ($a_set[
"manual"] && $a_set[
"active"]) {
166 $actions = $this->
ui->factory()->dropdown()->standard(
$buttons)->withLabel(
$lng->
txt(
"actions"));
168 $this->tpl->setVariable(
"ACTIONS", $this->
ui->renderer()->render($actions));
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)
setResetCommand(string $a_val, string $a_caption="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides fluid interface to RBAC services.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
static getExtendedTypeCaption(ilBadgeType $a_type)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
static getInstancesByParentId(int $a_parent_id, array $a_filter=null)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
TableGUI class for badge listing.
setLimit(int $a_limit=0, int $a_default_limit=0)
__construct(object $a_parent_obj, string $a_parent_cmd="", int $a_parent_obj_id=0, protected bool $has_write=false)
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)
getItems(int $a_parent_obj_id)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static _lookupType(int $id, bool $reference=false)
addMultiCommand(string $a_cmd, string $a_text)