19 declare(strict_types=1);
34 private \ILIAS\ResourceStorage\Services
$storage;
36 private \ILIAS\UI\Component\Panel\Listing\Standard
$icon_list;
38 private \ILIAS\UI\Component\Input\Container\Filter\Standard
$filter;
39 private \ILIAS\HTTP\Services
$http;
47 $this->
ctrl = $DIC->ctrl();
48 $this->
lng = $DIC->language();
49 $this->
lng->loadLanguageModule(
'file');
50 $this->ui_factory = $DIC->ui()->factory();
52 $this->storage = $DIC->resourceStorage();
53 $this->
http = $DIC->http();
54 $this->filter_service = $DIC->uiService()->filter();
63 $this->
filter = $this->filter_service->standard(
64 $this->gui::class .
'_filter7',
65 $this->
ctrl->getLinkTarget($this->gui),
67 'suffixes' => $this->ui_factory->input()->field()->text($this->
lng->txt(
'suffixes')),
68 'active' => $this->ui_factory->input()->field()->select($this->
lng->txt(
'status'), [
69 '1' => $this->
lng->txt(
'active'),
70 '0' => $this->
lng->txt(
'inactive'),
72 'is_default_icon' => $this->ui_factory->input()->field()->select($this->
lng->txt(
'default'), [
73 '1' => $this->
lng->txt(
'yes'),
74 '0' => $this->
lng->txt(
'no'),
95 $this->icon_repo->getIcons();
98 $filter_data = $this->filter_service->getData($this->
filter) ?? [];
100 foreach ($this->icon_repo->getIconsForFilter($filter_data) as $icon) {
101 $this->
ctrl->setParameterByClass(
102 ilObjFileIconsOverviewGUI::class,
106 $edit_target = $this->
ctrl->getLinkTargetByClass(
107 ilObjFileIconsOverviewGUI::class,
110 $change_activation_target = $this->
ctrl->getLinkTargetByClass(
111 ilObjFileIconsOverviewGUI::class,
116 $item_action_entries = [
117 $this->ui_factory->button()->shy(
118 $this->
lng->txt(
'de_activate_icon'),
119 $change_activation_target
122 if (!$icon->isDefaultIcon()) {
123 $item_action_entries[] = $this->ui_factory->button()->shy($this->
lng->txt(
'edit'), $edit_target);
124 $item_action_entries[] = $this->ui_factory->button()->shy($this->
lng->txt(
'delete'),
'#')->withOnClick(
125 $deletion_modal->getShowSignal()
128 $item_actions = $this->ui_factory->dropdown()->standard($item_action_entries);
130 $id = $this->storage->manage()->find($icon->getRid());
133 $icon_src = $this->storage->consume()->src(
$id)->getSrc();
136 $suffixes_array_into_string = $this->icon_repo->turnSuffixesArrayIntoString(
140 $icon_image = $this->ui_factory->symbol()->icon()->custom(
142 "Icon $suffixes_array_into_string" 143 )->withSize(
'large');
145 $icon_items[] = $this->ui_factory->item()
146 ->standard($this->
lng->txt(
'icon') .
" $suffixes_array_into_string")
147 ->withActions($item_actions)
150 $this->
lng->txt(
'active') => $icon->isActive() ? $this->
lng->txt(
152 ) : $this->
lng->txt(
'no'),
153 $this->
lng->txt(
'default') => $icon->isDefaultIcon(
154 ) ? $this->
lng->txt(
'yes') : $this->
lng->txt(
'no'),
157 ) => $suffixes_array_into_string
160 ->withLeadIcon($icon_image);
163 $this->icon_list = $this->ui_factory->panel()->listing()->standard(
164 $this->
lng->txt(
'suffix_specific_icons'),
165 [$this->ui_factory->item()->group(
"", $icon_items)]
184 $target = $this->
ctrl->getLinkTargetByClass(
185 ilObjFileIconsOverviewGUI::class,
188 $rid = $this->
refinery->kindlyTo()->string()->transform($a_icon->
getRid());
190 $id = $this->storage->manage()->find($rid);
193 $icon_src = $this->storage->consume()->src(
$id)->getSrc();
195 $img_icon = $this->ui_factory->image()->standard(
199 $txt_suffixes = $this->
lng->txt(
'suffixes') .
": " . $this->icon_repo->turnSuffixesArrayIntoString(
203 return $this->ui_factory->modal()->interruptive(
204 $this->
lng->txt(
"delete"),
205 $this->
lng->txt(
'msg_confirm_entry_deletion'),
207 )->withAffectedItems([
208 $this->ui_factory->modal()->interruptiveItem()->standard(
ILIAS ResourceStorage Services $storage
ILIAS Refinery Factory $refinery
ILIAS UI Factory $ui_factory
ILIAS UI Component Input Container Filter Standard $filter
ilUIFilterService $filter_service
Interface Observer Contains several chained tasks and infos about them.
ILIAS HTTP Services $http
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CMD_OPEN_UPDATING_FORM
const CMD_CHANGE_ACTIVATION
static http()
Fetches the global http state from ILIAS.
ILIAS UI Component Panel Listing Standard $icon_list
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
__construct(private IconRepositoryInterface $icon_repo, private object $gui)
getDeletionConfirmationModal(Icon $a_icon)