19 declare(strict_types=1);
28 self::VIEW_SELECTED_ITEMS,
29 self::VIEW_MY_MEMBERSHIPS,
30 self::VIEW_MY_STUDYPROGRAMME
34 self::SORT_BY_LOCATION,
36 self::SORT_BY_START_DATE
40 self::PRESENTATION_LIST,
41 self::PRESENTATION_TILE
45 self::VIEW_SELECTED_ITEMS => [
46 self::SORT_BY_LOCATION,
48 self::SORT_BY_ALPHABET,
50 self::VIEW_MY_MEMBERSHIPS => [
51 self::SORT_BY_LOCATION,
53 self::SORT_BY_START_DATE,
54 self::SORT_BY_ALPHABET,
56 self::VIEW_MY_STUDYPROGRAMME => []
60 self::VIEW_SELECTED_ITEMS => [
61 self::PRESENTATION_LIST,
62 self::PRESENTATION_TILE
64 self::VIEW_MY_MEMBERSHIPS => [
65 self::PRESENTATION_LIST,
66 self::PRESENTATION_TILE
68 self::VIEW_MY_STUDYPROGRAMME => []
80 int $view = self::VIEW_SELECTED_ITEMS,
86 $this->
settings = $settings ?? $DIC->settings();
89 $this->currentView = $view;
95 return self::VIEW_MY_MEMBERSHIPS;
100 return self::VIEW_SELECTED_ITEMS;
105 return self::VIEW_MY_STUDYPROGRAMME;
110 return self::PRESENTATION_LIST;
115 return self::PRESENTATION_TILE;
135 return self::SORT_BY_START_DATE;
140 return self::SORT_BY_LOCATION;
145 return self::SORT_BY_TYPE;
150 return self::SORT_BY_ALPHABET;
155 return self::$availableSortOptionsByView[$view];
160 return self::$availablePresentationsByView[$view];
206 if (!in_array($type, $active,
true)) {
214 $this->
settings->set(
'selected_items_def_sort', $type);
218 $this->
settings->set(
'my_memberships_def_sort', $type);
222 $this->
settings->set(
'pd_active_sort_view_' . $view, serialize($active));
227 $val = $this->
settings->get(
'pd_active_sort_view_' . $view,
'');
228 return ($val ===
'') ? [] : unserialize($val);
233 if (!in_array($default, $active,
true)) {
234 $active[] = $default;
236 $this->
settings->set(
'pd_def_pres_view_' . $view, $default);
237 $this->
settings->set(
'pd_active_pres_view_' . $view, serialize($active));
242 return $this->
settings->get(
'pd_def_pres_view_' . $view,
'list');
247 $val = $this->
settings->get(
'pd_active_pres_view_' . $view,
'');
248 return ($val ===
'') ? [] : unserialize($val);
253 return $this->
settings->get(
'disable_my_memberships',
'0') ===
'0';
258 return $this->
settings->get(
'disable_my_offers',
'0') ===
'0';
263 $this->
settings->set(
'disable_my_memberships', $status ?
'0' :
'1');
268 $this->
settings->set(
'disable_my_offers', $status ?
'0' :
'1');
288 $this->
settings->set(
'personal_items_default_view', (
string) $view);
293 $this->validViews = self::$availableViews;
301 $mode = $this->actor->getPref(
'pd_view_pres_' . $this->currentView);
312 $mode = $this->actor->getPref(
'pd_order_items_' . $this->currentView);
326 return array_intersect(
337 if (!$this->
access->canChangePresentation($this->actor->getId())) {
340 return array_intersect(
349 $this->actor->writePref(
350 'pd_view_pres_' . $this->currentView,
359 $this->actor->writePref(
360 'pd_order_items_' . $this->currentView,
383 return in_array($view, $this->validViews,
true);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isSelectedItemsViewActive()
storeViewSorting(int $view, string $type, array $active)
getEffectiveSortingMode()
enableSelectedItems(bool $status)
static array $availableSortOptions
string $currentSortOption
static array $availablePresentationsByView
getEffectivePresentationMode()
getTilePresentationMode()
static array $availableViews
getDefaultSortingByView(int $view)
enableMemberships(bool $status)
getActivePresentationsByView(int $view)
getActiveSortingsByView(int $view)
storeDefaultView(int $view)
storeViewPresentation(int $view, string $default, array $active)
string $currentPresentationOption
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSelectableSortingModes()
getListPresentationMode()
getDefaultPresentationByView(int $view)
storeActorSortingMode(string $sortingMode)
storeActorPresentationMode(string $presentationMode)
isMembershipsViewActive()
getAvailablePresentationsByView(int $view)
isStudyProgrammeViewActive()
__construct(ilObjUser $actor, int $view=self::VIEW_SELECTED_ITEMS, Setting $settings=null, DashboardAccess $access=null)
getAvailableSortOptionsByView(int $view)
getSelectablePresentationModes()
static array $availableSortOptionsByView
static array $availablePresentations