19declare(strict_types=1);
41 private \ILIAS\UI\Component\Input\Container\Filter\Standard
$filter;
46 private bool $write_access
50 $this->
ctrl = $DIC->ctrl();
51 $this->
lng = $DIC->language();
52 $this->
lng->loadLanguageModule(
'file');
53 $this->ui_factory =
$DIC->ui()->factory();
55 $this->storage =
$DIC->resourceStorage();
56 $this->filter_service =
$DIC->uiService()->filter();
65 $this->
filter = $this->filter_service->standard(
66 $this->gui::class .
'_filter7',
67 $this->
ctrl->getLinkTarget($this->gui),
69 'suffixes' => $this->ui_factory->input()->field()->text($this->lng->txt(
'suffixes')),
70 'active' => $this->ui_factory->input()->field()->select($this->lng->txt(
'status'), [
71 '1' => $this->lng->txt(
'active'),
72 '0' => $this->lng->txt(
'inactive'),
74 'is_default_icon' => $this->ui_factory->input()->field()->select($this->lng->txt(
'default'), [
75 '1' => $this->lng->txt(
'yes'),
76 '0' => $this->lng->txt(
'no'),
97 $this->icon_repo->getIcons();
100 $filter_data = $this->filter_service->getData($this->
filter) ?? [];
102 foreach ($this->icon_repo->getIconsForFilter($filter_data) as $icon) {
103 $this->
ctrl->setParameterByClass(
104 ilObjFileIconsOverviewGUI::class,
108 $edit_target = $this->
ctrl->getLinkTargetByClass(
109 ilObjFileIconsOverviewGUI::class,
112 $change_activation_target = $this->
ctrl->getLinkTargetByClass(
113 ilObjFileIconsOverviewGUI::class,
118 if ($this->write_access) {
119 $item_action_entries = [
120 $this->ui_factory->button()->shy(
121 $this->
lng->txt(
'de_activate_icon'),
122 $change_activation_target
125 if (!$icon->isDefaultIcon()) {
126 $item_action_entries[] = $this->ui_factory->button()->shy($this->
lng->txt(
'edit'), $edit_target);
127 $item_action_entries[] = $this->ui_factory->button()->shy($this->
lng->txt(
'delete'),
'#')->withOnClick(
128 $deletion_modal->getShowSignal()
132 $item_action_entries = [];
135 $item_actions = $this->ui_factory->dropdown()->standard($item_action_entries);
137 $id = $this->storage->manage()->find($icon->getRid());
140 $icon_src = $this->storage->consume()->src(
$id)->getSrc();
143 $suffixes_array_into_string = $this->icon_repo->turnSuffixesArrayIntoString(
147 $icon_image = $this->ui_factory->symbol()->icon()->custom(
149 "Icon $suffixes_array_into_string"
150 )->withSize(
'large');
152 $icon_items[] = $this->ui_factory->item()
153 ->standard($this->
lng->txt(
'icon') .
" $suffixes_array_into_string")
154 ->withActions($item_actions)
157 $this->
lng->txt(
'active') => $icon->isActive() ? $this->lng->txt(
159 ) : $this->lng->txt(
'no'),
160 $this->lng->txt(
'default') => $icon->isDefaultIcon(
161 ) ? $this->lng->txt(
'yes') : $this->lng->txt(
'no'),
164 ) => $suffixes_array_into_string
167 ->withLeadIcon($icon_image);
170 $this->icon_list = $this->ui_factory->panel()->listing()->standard(
171 $this->
lng->txt(
'suffix_specific_icons'),
172 [$this->ui_factory->item()->group(
"", $icon_items)]
191 $target = $this->
ctrl->getLinkTargetByClass(
192 ilObjFileIconsOverviewGUI::class,
195 $rid = $this->
refinery->kindlyTo()->string()->transform($a_icon->
getRid());
197 $id = $this->storage->manage()->find($rid);
200 $icon_src = $this->storage->consume()->src(
$id)->getSrc();
202 $img_icon = $this->ui_factory->image()->standard(
206 $txt_suffixes = $this->
lng->txt(
'suffixes') .
": " . $this->icon_repo->turnSuffixesArrayIntoString(
210 return $this->ui_factory->modal()->interruptive(
211 $this->
lng->txt(
"delete"),
212 $this->lng->txt(
'msg_confirm_entry_deletion'),
214 )->withAffectedItems([
215 $this->ui_factory->modal()->interruptiveItem()->standard(
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Builds a Color from either hex- or rgb values.
ILIAS Refinery Factory $refinery
ilUIFilterService $filter_service
getDeletionConfirmationModal(Icon $a_icon)
__construct(private IconRepositoryInterface $icon_repo, private ilObjFileIconsOverviewGUI $gui, private bool $write_access)
ILIAS UI Component Input Container Filter Standard $filter
const CMD_OPEN_UPDATING_FORM
const CMD_CHANGE_ACTIVATION
This describes a Standard Dropdown.
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.