13 self::VIEW_SELECTED_ITEMS,
14 self::VIEW_MY_MEMBERSHIPS,
15 self::VIEW_MY_STUDYPROGRAMME
22 self::SORT_BY_LOCATION,
24 self::SORT_BY_START_DATE
31 self::PRESENTATION_LIST,
32 self::PRESENTATION_TILE
39 self::VIEW_SELECTED_ITEMS => [
40 self::SORT_BY_LOCATION,
43 self::VIEW_MY_MEMBERSHIPS => [
44 self::SORT_BY_LOCATION,
46 self::SORT_BY_START_DATE
48 self::VIEW_MY_STUDYPROGRAMME => []
55 self::VIEW_SELECTED_ITEMS => [
56 self::PRESENTATION_LIST,
57 self::PRESENTATION_TILE
59 self::VIEW_MY_MEMBERSHIPS => [
60 self::PRESENTATION_LIST,
61 self::PRESENTATION_TILE
63 self::VIEW_MY_STUDYPROGRAMME => []
103 $this->currentView = $view;
104 $this->access = new \ILIAS\Dashboard\Access\DashboardAccess();
112 return self::VIEW_MY_MEMBERSHIPS;
120 return self::VIEW_SELECTED_ITEMS;
128 return self::VIEW_MY_STUDYPROGRAMME;
136 return self::PRESENTATION_LIST;
144 return self::PRESENTATION_TILE;
176 return self::SORT_BY_START_DATE;
184 return self::SORT_BY_LOCATION;
192 return self::SORT_BY_TYPE;
203 return self::$availableSortOptionsByView[$view];
214 return self::$availablePresentationsByView[$view];
280 if (!in_array($type, $active)) {
288 $this->
settings->set(
'selected_items_def_sort', $type);
292 $this->
settings->set(
'my_memberships_def_sort', $type);
296 $this->
settings->set(
'pd_active_sort_view_' . $view, serialize($active));
307 $val = $this->
settings->get(
'pd_active_sort_view_' . $view);
322 if (!in_array($default, $active)) {
323 $active[] = $default;
325 $this->
settings->set(
'pd_def_pres_view_' . $view, $default);
326 $this->
settings->set(
'pd_active_pres_view_' . $view, serialize($active));
337 return $this->
settings->get(
'pd_def_pres_view_' . $view,
"list");
348 $val = $this->
settings->get(
'pd_active_pres_view_' . $view,
'');
360 return $this->
settings->get(
'disable_my_memberships', 0) == 0;
368 return $this->
settings->get(
'disable_my_offers', 0) == 0;
376 $this->
settings->set(
'disable_my_memberships', (
int) !$status);
384 $this->
settings->set(
'disable_my_offers', (
int) !$status);
416 $this->
settings->set(
'personal_items_default_view', $view);
424 $this->validViews = self::$availableViews;
456 $mode = $this->actor->getPref(
'pd_view_pres_' . $this->currentView);
471 $mode = $this->actor->getPref(
'pd_order_items_' . $this->currentView);
485 return array_intersect(
496 if (!$this->access->canChangePresentation($this->actor->getId())) {
499 return array_intersect(
511 $this->actor->writePref(
512 'pd_view_pres_' . $this->currentView,
524 $this->actor->writePref(
525 'pd_order_items_' . $this->currentView,
561 return in_array($view, $this->validViews);
isSelectedItemsViewActive()
storeViewSorting(int $view, string $type, array $active)
getEffectiveSortingMode()
enableSelectedItems(bool $status)
getEffectivePresentationMode()
$currentPresentationOption
getTilePresentationMode()
getDefaultSortingByView(int $view)
enableMemberships(bool $status)
getActivePresentationsByView(int $view)
Get active presentations by view.
static $availablePresentations
getActiveSortingsByView(int $view)
Get active sort options by view.
storeDefaultView(int $view)
__construct(ilObjUser $actor, int $view=self::VIEW_SELECTED_ITEMS)
ilPDSelectedItemsBlockViewSettings constructor.
storeViewPresentation(int $view, string $default, array $active)
Store default presentation.
static $availablePresentationsByView
getSelectableSortingModes()
static $availableSortOptionsByView
getListPresentationMode()
getDefaultPresentationByView(int $view)
Get default presentation.
storeActorSortingMode(string $sortingMode)
storeActorPresentationMode(string $presentationMode)
isMembershipsViewActive()
getAvailablePresentationsByView(int $view)
Get available presentations by view.
isStudyProgrammeViewActive()
getAvailableSortOptionsByView(int $view)
Get available sort options by view.
getSelectablePresentationModes()
static $availableSortOptions