ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjDashboardSettingsGUI Class Reference

ilObjDashboardSettingsGUI: ilPermissionGUI ilObjDashboardSettingsGUI: ilAdministrationGUI More...

+ Inheritance diagram for ilObjDashboardSettingsGUI:
+ Collaboration diagram for ilObjDashboardSettingsGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 
 editSettings ()
 
 editSorting ()
 
 getViewForm (string $mode)
 
 getViewSectionSorting (int $view, string $title)
 
 getViewByMode (string $mode, int $view)
 
 saveSettings ()
 
 setSettingsSubTabs (string $a_active)
 
 editPresentation ()
 
 getViewSectionPresentation (int $view, string $title)
 
 saveSorting ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const VIEW_MODE_SETTINGS = 'Settings'
 
const VIEW_MODE_PRESENTATION = 'Presentation'
 
const VIEW_MODE_SORTING = 'Sorting'
 
const DASH_SORT_PREFIX = 'dash_sort_by_'
 
const DASH_ENABLE_PREFIX = 'dash_enable_'
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 savePresentation ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

Factory $ui_factory
 
Renderer $ui_renderer
 
ilPDSelectedItemsBlockViewSettings $viewSettings
 
UIServices $ui
 
ilDashboardSidePanelSettingsRepository $side_panel_settings
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 maybeDisable (array $fields)
 
 canWrite ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjDashboardSettingsGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

Definition at line 46 of file class.ilObjDashboardSettingsGUI.php.

References $DIC, ilObjectGUI\$lng, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\settings(), and ILIAS\Repository\ui().

51  {
52  global $DIC;
53 
54  $this->lng = $DIC->language();
55  $this->rbac_system = $DIC->rbac()->system();
56  $this->access = $DIC->access();
57  $this->ctrl = $DIC->ctrl();
58  $this->settings = $DIC->settings();
59  $lng = $DIC->language();
60  $this->ui_factory = $DIC->ui()->factory();
61  $this->ui_renderer = $DIC->ui()->renderer();
62  $this->request = $DIC->http()->request();
63  $this->ui = $DIC->ui();
64 
65  $this->type = 'dshs';
66  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
67 
68  $lng->loadLanguageModule('dash');
69 
70  $this->viewSettings = new ilPDSelectedItemsBlockViewSettings($DIC->user());
71 
72  $this->side_panel_settings = new ilDashboardSidePanelSettingsRepository();
73  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ canWrite()

ilObjDashboardSettingsGUI::canWrite ( )
private

Definition at line 378 of file class.ilObjDashboardSettingsGUI.php.

References ILIAS\Repository\object().

Referenced by editSettings(), getViewSectionSorting(), maybeDisable(), savePresentation(), saveSettings(), and saveSorting().

378  : bool
379  {
380  return $this->rbac_system->checkAccess('write', $this->object->getRefId());
381  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editPresentation()

ilObjDashboardSettingsGUI::editPresentation ( )

Definition at line 284 of file class.ilObjDashboardSettingsGUI.php.

References getViewForm(), setSettingsSubTabs(), and ILIAS\Repository\ui().

Referenced by savePresentation().

284  : void
285  {
286  $this->tabs_gui->activateTab('settings');
287  $this->setSettingsSubTabs('presentation');
288 
289  $form = $this->getViewForm(self::VIEW_MODE_PRESENTATION);
290 
291  $this->tpl->setContent($this->ui->renderer()->renderAsync($form));
292  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

ilObjDashboardSettingsGUI::editSettings ( )

Definition at line 122 of file class.ilObjDashboardSettingsGUI.php.

References canWrite(), ILIAS\Repository\lng(), setSettingsSubTabs(), and ILIAS\Repository\settings().

Referenced by saveSettings().

122  : void
123  {
124  if ($this->settings->get('rep_favourites', '0') !== '1') {
125  $content[] = $this->ui_factory->messageBox()->info($this->lng->txt('favourites_disabled_info'));
126  }
127 
128  if ($this->settings->get('mmbr_my_crs_grp', '0') !== '1') {
129  $content[] = $this->ui_factory->messageBox()->info($this->lng->txt('memberships_disabled_info'));
130  }
131  $this->setSettingsSubTabs('general');
132  $table = new ilDashboardSortationTableGUI($this, 'editSettings', !$this->canWrite());
133  $this->tpl->setContent($table->getHTML());
134  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSorting()

ilObjDashboardSettingsGUI::editSorting ( )

Definition at line 136 of file class.ilObjDashboardSettingsGUI.php.

References getViewForm(), setSettingsSubTabs(), and ILIAS\Repository\ui().

Referenced by saveSorting().

136  : void
137  {
138  $this->tabs_gui->activateTab('settings');
139  $this->setSettingsSubTabs('sorting');
140  $form = $this->getViewForm(self::VIEW_MODE_SORTING);
141  $this->tpl->setContent($this->ui->renderer()->renderAsync($form));
142  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjDashboardSettingsGUI::executeCommand ( )

Definition at line 75 of file class.ilObjDashboardSettingsGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

75  : void
76  {
77  $cmd = $this->ctrl->getCmd();
78 
79  $this->prepareOutput();
80 
81  if (!$this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
82  throw new ilPermissionException($this->lng->txt('no_permission'));
83  }
84 
85  switch ($this->ctrl->getNextClass($this)) {
86  case strtolower(ilPermissionGUI::class):
87  $this->tabs_gui->setTabActive('perm_settings');
88  $perm_gui = new ilPermissionGUI($this);
89  $this->ctrl->forwardCommand($perm_gui);
90  break;
91 
92  default:
93  if (!$cmd || $cmd === 'view') {
94  $cmd = 'editSettings';
95  }
96 
97  $this->$cmd();
98  break;
99  }
100  }
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjDashboardSettingsGUI::getAdminTabs ( )

Definition at line 102 of file class.ilObjDashboardSettingsGUI.php.

References ILIAS\Repository\ctrl().

102  : void
103  {
104  if ($this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
105  $this->tabs_gui->addTarget(
106  'settings',
107  $this->ctrl->getLinkTarget($this, 'editSettings'),
108  ['editSettings', 'view']
109  );
110  }
111 
112  if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
113  $this->tabs_gui->addTarget(
114  'perm_settings',
115  $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm'),
116  [],
117  ilPermissionGUI::class
118  );
119  }
120  }
+ Here is the call graph for this function:

◆ getViewByMode()

ilObjDashboardSettingsGUI::getViewByMode ( string  $mode,
int  $view 
)

Definition at line 204 of file class.ilObjDashboardSettingsGUI.php.

References getViewSectionPresentation(), getViewSectionSorting(), and ILIAS\Repository\lng().

Referenced by getViewForm().

204  : Section
205  {
206  switch ($mode) {
207  case self::VIEW_MODE_SORTING:
208  return $this->getViewSectionSorting(
209  $view,
210  $this->lng->txt('dash_' . $this->viewSettings->getViewName($view))
211  );
212  case self::VIEW_MODE_PRESENTATION:
213  default:
214  return $this->getViewSectionPresentation(
215  $view,
216  $this->lng->txt('dash_' . $this->viewSettings->getViewName($view))
217  );
218  }
219  }
This describes section inputs.
Definition: Section.php:28
getViewSectionPresentation(int $view, string $title)
getViewSectionSorting(int $view, string $title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewForm()

ilObjDashboardSettingsGUI::getViewForm ( string  $mode)

Definition at line 144 of file class.ilObjDashboardSettingsGUI.php.

References ILIAS\Repository\ctrl(), and getViewByMode().

Referenced by editPresentation(), editSorting(), savePresentation(), and saveSorting().

144  : ?StandardForm
145  {
146  switch ($mode) {
147  case self::VIEW_MODE_PRESENTATION:
148  case self::VIEW_MODE_SORTING:
149  return $this->ui_factory->input()->container()->form()->standard(
150  $this->ctrl->getFormAction($this, 'save' . $mode),
151  array_map(
152  fn(int $view): Section => $this->getViewByMode($mode, $view),
153  $this->viewSettings->getPresentationViews()
154  )
155  );
156  }
157  return null;
158  }
This describes section inputs.
Definition: Section.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewSectionPresentation()

ilObjDashboardSettingsGUI::getViewSectionPresentation ( int  $view,
string  $title 
)

Definition at line 294 of file class.ilObjDashboardSettingsGUI.php.

References ilObjectGUI\$lng, maybeDisable(), ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by getViewByMode().

294  : Section
295  {
296  $lng = $this->lng;
297  $ops = $this->viewSettings->getAvailablePresentationsByView($view);
298  $pres_options = array_column(
299  array_map(
300  static fn(int $k, string $v): array => [$v, $lng->txt('dash_' . $v)],
301  array_keys($ops),
302  $ops
303  ),
304  1,
305  0
306  );
307  $avail_pres = $this->ui_factory->input()->field()->multiSelect(
308  $lng->txt('dash_avail_presentation'),
309  $pres_options
310  )
311  ->withValue($this->viewSettings->getActivePresentationsByView($view));
312  $default_pres = $this->ui_factory->input()->field()->radio($lng->txt('dash_default_presentation'))
313  ->withOption('list', $lng->txt('dash_list'))
314  ->withOption('tile', $lng->txt('dash_tile'));
315  $default_pres = $default_pres->withValue($this->viewSettings->getDefaultPresentationByView($view));
316  return $this->ui_factory->input()->field()->section(
317  $this->maybeDisable(['avail_pres' => $avail_pres, 'default_pres' => $default_pres]),
318  $title
319  );
320  }
This describes section inputs.
Definition: Section.php:28
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewSectionSorting()

ilObjDashboardSettingsGUI::getViewSectionSorting ( int  $view,
string  $title 
)

Definition at line 160 of file class.ilObjDashboardSettingsGUI.php.

References ilObjectGUI\$id, ilObjectGUI\$lng, canWrite(), ILIAS\Repository\lng(), maybeDisable(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by getViewByMode().

160  : Section
161  {
162  if ($this->canWrite()) {
163  $this->tpl->addJavaScript('Services/Dashboard/Administration/js/SortationUserInputHandler.js');
164  }
165  $lng = $this->lng;
166  $availabe_sort_options = $this->viewSettings->getAvailableSortOptionsByView($view);
167  $options = array_reduce(
168  $availabe_sort_options,
169  static function (array $options, string $option) use ($lng): array {
170  $options[$option] = $lng->txt(self::DASH_SORT_PREFIX . $option);
171  return $options;
172  },
173  []
174  );
175 
176  $available_sorting = $this->ui_factory
177  ->input()
178  ->field()
179  ->multiSelect($this->lng->txt('dash_avail_sortation'), $options)
180  ->withValue(
181  $this->viewSettings->getActiveSortingsByView($view)
182  )
184  static fn(string $id) => "document.getElementById('$id').setAttribute('data-checkbox', 'activeSorting$view');
185  document.addEventListener('DOMContentLoaded', function () {
186  il.Dashboard.handleUserInputForSortationsByView($view);
187  });"
188  );
189  $default_sorting = $this->ui_factory
190  ->input()
191  ->field()
192  ->select($this->lng->txt('dash_default_sortation'), $options)
193  ->withValue($this->viewSettings->getDefaultSortingByView($view))
194  ->withRequired(true)
195  ->withAdditionalOnLoadCode(
196  static fn(string $id) => "document.getElementById('$id').setAttribute('data-select', 'sorting$view');"
197  );
198  return $this->ui_factory->input()->field()->section(
199  $this->maybeDisable(['avail_sorting' => $available_sorting, 'default_sorting' => $default_sorting]),
200  $title
201  );
202  }
This describes section inputs.
Definition: Section.php:28
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maybeDisable()

ilObjDashboardSettingsGUI::maybeDisable ( array  $fields)
private
Parameters
FormInput[]$fields
Returns
FormInput[]

Definition at line 369 of file class.ilObjDashboardSettingsGUI.php.

References canWrite(), and ILIAS\UI\Implementation\Component\Input\Field\FormInput\withDisabled().

Referenced by getViewSectionPresentation(), and getViewSectionSorting().

369  : array
370  {
371  if ($this->canWrite()) {
372  return $fields;
373  }
374 
375  return array_map(static fn(FormInput $field): FormInput => $field->withDisabled(true), $fields);
376  }
withDisabled(bool $is_disabled)
Get an input like this, but set it to a disabled state.static
Definition: FormInput.php:139
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePresentation()

ilObjDashboardSettingsGUI::savePresentation ( )
protected

Definition at line 322 of file class.ilObjDashboardSettingsGUI.php.

References ilObjectGUI\$data, canWrite(), editPresentation(), getViewForm(), and ILIAS\Repository\lng().

322  : void
323  {
324  if ($this->canWrite()) {
325  $data = $this->getViewForm(self::VIEW_MODE_PRESENTATION)->withRequest($this->request)->getData();
326 
327  foreach ($data as $view => $view_data) {
328  $this->viewSettings->storeViewPresentation(
329  $view,
330  $view_data['default_pres'],
331  $view_data['avail_pres'] ?? []
332  );
333  }
334  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->lng->txt('msg_obj_modified'), true);
335  } else {
336  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('no_permission'), true);
337  }
338  $this->editPresentation();
339  }
+ Here is the call graph for this function:

◆ saveSettings()

ilObjDashboardSettingsGUI::saveSettings ( )

Definition at line 221 of file class.ilObjDashboardSettingsGUI.php.

References canWrite(), editSettings(), ILIAS\Repository\lng(), and ilPDSelectedItemsBlockConstants\VIEW_RECOMMENDED_CONTENT.

221  : void
222  {
223  if ($this->canWrite()) {
224  $form_data = $this->request->getParsedBody();
225  foreach ($this->viewSettings->getPresentationViews() as $presentation_view) {
226  if (isset($form_data['main_panel']['enable'][$presentation_view])) {
227  $this->viewSettings->enableView(
228  $presentation_view,
229  (bool) $form_data['main_panel']['enable'][$presentation_view]
230  );
231  } elseif ($presentation_view !== ilPDSelectedItemsBlockConstants::VIEW_RECOMMENDED_CONTENT) {
232  $this->viewSettings->enableView($presentation_view, false);
233  }
234  }
235 
236  $positions = $form_data['main_panel']['position'];
237  asort($positions);
238  $this->viewSettings->setViewPositions(array_keys($positions));
239 
240  foreach ($this->side_panel_settings->getValidModules() as $mod) {
241  $this->side_panel_settings->enable($mod, (bool) ($form_data['side_panel']['enable'][$mod] ?? false));
242  }
243 
244  $positions = $form_data['side_panel']['position'];
245  asort($positions);
246  $this->side_panel_settings->setPositions(array_keys($positions));
247 
248  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->lng->txt('settings_saved'), true);
249  } else {
250  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('no_permission'), true);
251  }
252  $this->editSettings();
253  }
+ Here is the call graph for this function:

◆ saveSorting()

ilObjDashboardSettingsGUI::saveSorting ( )

Definition at line 341 of file class.ilObjDashboardSettingsGUI.php.

References ilObjectGUI\$data, canWrite(), editSorting(), getViewForm(), and ILIAS\Repository\lng().

341  : void
342  {
343  if ($this->canWrite()) {
344  $data = $this->getViewForm(self::VIEW_MODE_SORTING)->withRequest($this->request)->getData();
345 
346  foreach ($data as $view => $view_data) {
347  if (isset($view_data['default_sorting'])) {
348  if (!is_array($view_data['avail_sorting'] ?? null)) {
349  $view_data['avail_sorting'] = [$view_data['default_sorting']];
350  }
351  $this->viewSettings->storeViewSorting(
352  $view,
353  $view_data['default_sorting'],
354  $view_data['avail_sorting']
355  );
356  }
357  }
358  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->lng->txt('msg_obj_modified'), true);
359  } else {
360  $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_FAILURE, $this->lng->txt('no_permission'), true);
361  }
362  $this->editSorting();
363  }
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjDashboardSettingsGUI::setSettingsSubTabs ( string  $a_active)

Definition at line 255 of file class.ilObjDashboardSettingsGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tabs_gui, ilCtrl\getLinkTarget(), and ilLanguage\txt().

Referenced by editPresentation(), editSettings(), and editSorting().

255  : void
256  {
257  $tabs = $this->tabs_gui;
258  $ctrl = $this->ctrl;
259  $lng = $this->lng;
260 
261  if ($this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
262  $tabs->addSubTab(
263  'general',
264  $lng->txt('general_settings'),
265  $ctrl->getLinkTarget($this, 'editSettings')
266  );
267 
268  $tabs->addSubTab(
269  'presentation',
270  $lng->txt('dash_presentation'),
271  $ctrl->getLinkTarget($this, 'editPresentation')
272  );
273 
274  $tabs->addSubTab(
275  'sorting',
276  $lng->txt('dash_sortation'),
277  $ctrl->getLinkTarget($this, 'editSorting')
278  );
279  }
280 
281  $tabs->activateSubTab($a_active);
282  }
ilTabsGUI $tabs_gui
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $side_panel_settings

ilDashboardSidePanelSettingsRepository ilObjDashboardSettingsGUI::$side_panel_settings
protected

Definition at line 44 of file class.ilObjDashboardSettingsGUI.php.

◆ $ui

UIServices ilObjDashboardSettingsGUI::$ui
protected

Definition at line 43 of file class.ilObjDashboardSettingsGUI.php.

◆ $ui_factory

Factory ilObjDashboardSettingsGUI::$ui_factory
protected

Definition at line 40 of file class.ilObjDashboardSettingsGUI.php.

◆ $ui_renderer

Renderer ilObjDashboardSettingsGUI::$ui_renderer
protected

Definition at line 41 of file class.ilObjDashboardSettingsGUI.php.

◆ $viewSettings

ilPDSelectedItemsBlockViewSettings ilObjDashboardSettingsGUI::$viewSettings
protected

Definition at line 42 of file class.ilObjDashboardSettingsGUI.php.

◆ DASH_ENABLE_PREFIX

const ilObjDashboardSettingsGUI::DASH_ENABLE_PREFIX = 'dash_enable_'

Definition at line 38 of file class.ilObjDashboardSettingsGUI.php.

◆ DASH_SORT_PREFIX

const ilObjDashboardSettingsGUI::DASH_SORT_PREFIX = 'dash_sort_by_'

◆ VIEW_MODE_PRESENTATION

const ilObjDashboardSettingsGUI::VIEW_MODE_PRESENTATION = 'Presentation'

Definition at line 35 of file class.ilObjDashboardSettingsGUI.php.

◆ VIEW_MODE_SETTINGS

const ilObjDashboardSettingsGUI::VIEW_MODE_SETTINGS = 'Settings'

Definition at line 34 of file class.ilObjDashboardSettingsGUI.php.

◆ VIEW_MODE_SORTING

const ilObjDashboardSettingsGUI::VIEW_MODE_SORTING = 'Sorting'

Definition at line 36 of file class.ilObjDashboardSettingsGUI.php.


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