ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\File\Icon\IconListingUI Class Reference
+ Collaboration diagram for ILIAS\File\Icon\IconListingUI:

Public Member Functions

 __construct (private IconRepositoryInterface $icon_repo, private object $gui)
 
 getFilter ()
 
 getIconList ()
 
 getDeletionModals ()
 

Protected Member Functions

 initListing ()
 

Private Member Functions

 initFilter ()
 
 getDeletionConfirmationModal (Icon $a_icon)
 

Private Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
Factory $ui_factory
 
ILIAS Refinery Factory $refinery
 
Services $storage
 
array $deletion_modals = []
 
Standard $icon_list
 
ilUIFilterService $filter_service
 
ILIAS UI Component Input Container Filter Standard $filter
 
ILIAS HTTP Services $http
 

Detailed Description

Author
Lukas Zehnder lukas.nosp@m.@sr..nosp@m.solut.nosp@m.ions

Definition at line 31 of file IconListingUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\File\Icon\IconListingUI::__construct ( private IconRepositoryInterface  $icon_repo,
private object  $gui 
)

Definition at line 44 of file IconListingUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\File\Icon\IconListingUI\initFilter(), ILIAS\File\Icon\IconListingUI\initListing(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

47  {
48  global $DIC;
49 
50  $this->ctrl = $DIC->ctrl();
51  $this->lng = $DIC->language();
52  $this->lng->loadLanguageModule('file');
53  $this->ui_factory = $DIC->ui()->factory();
54  $this->refinery = $DIC->refinery();
55  $this->storage = $DIC->resourceStorage();
56  $this->http = $DIC->http();
57  $this->filter_service = $DIC->uiService()->filter();
58 
59  $this->initFilter();
60  $this->initListing();
61  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getDeletionConfirmationModal()

ILIAS\File\Icon\IconListingUI::getDeletionConfirmationModal ( Icon  $a_icon)
private

Definition at line 185 of file IconListingUI.php.

References $id, ILIAS\File\Icon\ilObjFileIconsOverviewGUI\CMD_DELETE, ILIAS\Repository\ctrl(), ILIAS\File\Icon\Icon\getRid(), ILIAS\File\Icon\Icon\getSuffixes(), ILIAS\Repository\lng(), null, and ILIAS\Repository\refinery().

Referenced by ILIAS\File\Icon\IconListingUI\initListing().

185  : Interruptive
186  {
187  $target = $this->ctrl->getLinkTargetByClass(
188  ilObjFileIconsOverviewGUI::class,
190  );
191  $rid = $this->refinery->kindlyTo()->string()->transform($a_icon->getRid());
192 
193  $id = $this->storage->manage()->find($rid);
194  $icon_src = "";
195  if ($id !== null) {
196  $icon_src = $this->storage->consume()->src($id)->getSrc();
197  }
198  $img_icon = $this->ui_factory->image()->standard(
199  $icon_src,
200  "Icon"
201  );
202  $txt_suffixes = $this->lng->txt('suffixes') . ": " . $this->icon_repo->turnSuffixesArrayIntoString(
203  $a_icon->getSuffixes()
204  );
205 
206  return $this->ui_factory->modal()->interruptive(
207  $this->lng->txt("delete"),
208  $this->lng->txt('msg_confirm_entry_deletion'),
209  $target
210  )->withAffectedItems([
211  $this->ui_factory->modal()->interruptiveItem()->standard(
212  $rid,
213  $txt_suffixes,
214  $img_icon
215  )
216  ]);
217  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeletionModals()

ILIAS\File\Icon\IconListingUI::getDeletionModals ( )
Returns
mixed[]

Definition at line 180 of file IconListingUI.php.

References ILIAS\File\Icon\IconListingUI\$deletion_modals.

180  : array
181  {
182  return $this->deletion_modals;
183  }

◆ getFilter()

ILIAS\File\Icon\IconListingUI::getFilter ( )

Definition at line 90 of file IconListingUI.php.

References ILIAS\File\Icon\IconListingUI\$filter.

90  : \ILIAS\UI\Component\Input\Container\Filter\Standard
91  {
92  return $this->filter;
93  }
ILIAS UI Component Input Container Filter Standard $filter

◆ getIconList()

ILIAS\File\Icon\IconListingUI::getIconList ( )

Definition at line 172 of file IconListingUI.php.

References ILIAS\File\Icon\IconListingUI\$icon_list.

172  : Standard
173  {
174  return $this->icon_list;
175  }

◆ initFilter()

ILIAS\File\Icon\IconListingUI::initFilter ( )
private

Definition at line 63 of file IconListingUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\filter(), ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\File\Icon\IconListingUI\__construct().

63  : void
64  {
65  // Filters
66  $this->filter = $this->filter_service->standard(
67  $this->gui::class . '_filter7',
68  $this->ctrl->getLinkTarget($this->gui),
69  [
70  'suffixes' => $this->ui_factory->input()->field()->text($this->lng->txt('suffixes')),
71  'active' => $this->ui_factory->input()->field()->select($this->lng->txt('status'), [
72  '1' => $this->lng->txt('active'),
73  '0' => $this->lng->txt('inactive'),
74  ])->withValue('1'),
75  'is_default_icon' => $this->ui_factory->input()->field()->select($this->lng->txt('default'), [
76  '1' => $this->lng->txt('yes'),
77  '0' => $this->lng->txt('no'),
78  ])
79  ],
80  [
81  'suffix' => true,
82  'status' => true,
83  'type' => true,
84  ],
85  true,
86  true
87  );
88  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initListing()

ILIAS\File\Icon\IconListingUI::initListing ( )
protected

Definition at line 95 of file IconListingUI.php.

References $id, ILIAS\File\Icon\ilObjFileIconsOverviewGUI\CMD_CHANGE_ACTIVATION, ILIAS\File\Icon\ilObjFileIconsOverviewGUI\CMD_OPEN_UPDATING_FORM, ILIAS\Repository\ctrl(), ILIAS\Repository\filter(), ILIAS\File\Icon\IconListingUI\getDeletionConfirmationModal(), ILIAS\Repository\lng(), null, and ILIAS\File\Icon\ilObjFileIconsOverviewGUI\P_RID.

Referenced by ILIAS\File\Icon\IconListingUI\__construct().

95  : void
96  {
97  $icon_items = [];
98  $this->icon_repo->getIcons();
99 
100  // Filterting
101  $filter_data = $this->filter_service->getData($this->filter) ?? [];
102 
103  foreach ($this->icon_repo->getIconsForFilter($filter_data) as $icon) {
104  $this->ctrl->setParameterByClass(
105  ilObjFileIconsOverviewGUI::class,
107  $icon->getRid()
108  );
109  $edit_target = $this->ctrl->getLinkTargetByClass(
110  ilObjFileIconsOverviewGUI::class,
112  );
113  $change_activation_target = $this->ctrl->getLinkTargetByClass(
114  ilObjFileIconsOverviewGUI::class,
116  );
117  $this->deletion_modals[] = $deletion_modal = $this->getDeletionConfirmationModal($icon);
118 
119  $item_action_entries = [
120  $this->ui_factory->button()->shy(
121  $this->lng->txt('de_activate_icon'),
122  $change_activation_target
123  )
124  ];
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()
129  );
130  }
131  $item_actions = $this->ui_factory->dropdown()->standard($item_action_entries);
132 
133  $id = $this->storage->manage()->find($icon->getRid());
134  $icon_src = "";
135  if ($id !== null) {
136  $icon_src = $this->storage->consume()->src($id)->getSrc();
137  }
138 
139  $suffixes_array_into_string = $this->icon_repo->turnSuffixesArrayIntoString(
140  $icon->getSuffixes()
141  );
142 
143  $icon_image = $this->ui_factory->symbol()->icon()->custom(
144  $icon_src,
145  "Icon $suffixes_array_into_string"
146  )->withSize('large');
147 
148  $icon_items[] = $this->ui_factory->item()
149  ->standard($this->lng->txt('icon') . " $suffixes_array_into_string")
150  ->withActions($item_actions)
151  ->withProperties(
152  [
153  $this->lng->txt('active') => $icon->isActive() ? $this->lng->txt(
154  'yes'
155  ) : $this->lng->txt('no'),
156  $this->lng->txt('default') => $icon->isDefaultIcon(
157  ) ? $this->lng->txt('yes') : $this->lng->txt('no'),
158  $this->lng->txt(
159  'suffixes'
160  ) => $suffixes_array_into_string
161  ]
162  )
163  ->withLeadIcon($icon_image);
164  }
165 
166  $this->icon_list = $this->ui_factory->panel()->listing()->standard(
167  $this->lng->txt('suffix_specific_icons'),
168  [$this->ui_factory->item()->group("", $icon_items)]
169  );
170  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
getDeletionConfirmationModal(Icon $a_icon)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ILIAS\File\Icon\IconListingUI::$ctrl
private

Definition at line 33 of file IconListingUI.php.

◆ $deletion_modals

array ILIAS\File\Icon\IconListingUI::$deletion_modals = []
private

Definition at line 38 of file IconListingUI.php.

Referenced by ILIAS\File\Icon\IconListingUI\getDeletionModals().

◆ $filter

ILIAS UI Component Input Container Filter Standard ILIAS\File\Icon\IconListingUI::$filter
private

Definition at line 41 of file IconListingUI.php.

Referenced by ILIAS\File\Icon\IconListingUI\getFilter().

◆ $filter_service

ilUIFilterService ILIAS\File\Icon\IconListingUI::$filter_service
private

Definition at line 40 of file IconListingUI.php.

◆ $http

ILIAS HTTP Services ILIAS\File\Icon\IconListingUI::$http
private

Definition at line 42 of file IconListingUI.php.

◆ $icon_list

Standard ILIAS\File\Icon\IconListingUI::$icon_list
private

Definition at line 39 of file IconListingUI.php.

Referenced by ILIAS\File\Icon\IconListingUI\getIconList().

◆ $lng

ilLanguage ILIAS\File\Icon\IconListingUI::$lng
private

Definition at line 34 of file IconListingUI.php.

◆ $refinery

ILIAS Refinery Factory ILIAS\File\Icon\IconListingUI::$refinery
private

Definition at line 36 of file IconListingUI.php.

◆ $storage

Services ILIAS\File\Icon\IconListingUI::$storage
private

Definition at line 37 of file IconListingUI.php.

◆ $ui_factory

Factory ILIAS\File\Icon\IconListingUI::$ui_factory
private

Definition at line 35 of file IconListingUI.php.


The documentation for this class was generated from the following file: