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

Class ilUserStartingPointGUI. More...

+ Collaboration diagram for ilUserStartingPointGUI:

Public Member Functions

 executeCommand ()
 
 startingPoints ()
 table form to set up starting points depends of user roles More...
 
 initUserStartingPointForm (ilPropertyFormGUI $form=null)
 
 initRoleStartingPointForm (ilPropertyFormGUI $form=null)
 
 addRoleAutoCompleteObject ()
 
 saveOrder ()
 

Protected Member Functions

 getUserStartingPointForm ()
 
 getRoleStartingPointForm ()
 
 saveUserStartingPoint ()
 
 saveStartingPoint ()
 store starting point from the form More...
 
 deleteStartingPoint ()
 

Private Member Functions

 getCurrentStartingPointOrNullForStartingPointForm (?int $starting_point_id)
 
 getCurrentTypeForStartingPointForm (?ilUserStartingPoint $starting_point)
 
 getFormTypeSpecificStartingPointFormParts (?int $spoint_id, ?int $req_role_id)
 
 getCreateFormSpecificInputs ()
 
 getEditFormSpecificInputs (int $spoint_id, int $req_role_id)
 
 getStartingPointSelectionInput (?ilUserStartingPoint $st_point)
 
 getStartingPointSelectionOption (int $value, string $caption, ?ilUserStartingPoint $st_point, array $valid)
 
 getCalenderSubInputs (?ilUserStartingPoint $st_point)
 
 getRepositoryObjectInput (?ilUserStartingPoint $st_point)
 
 showRoleSelection (string $role, string $role_search, string $start_point, string $start_object)
 

Private Attributes

ilLogger $log
 
ilLanguage $lng
 
ilSetting $settings
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilCtrl $ctrl
 
ilTree $tree
 
ilObjUser $user
 
ilDBInterface $db
 
ilRbacReview $rbac_review
 
ilRbacSystem $rbac_system
 
UIFactory $ui_factory
 
Renderer $ui_renderer
 
UserGUIRequest $user_request
 
ilUserStartingPointRepository $starting_point_repository
 
int $parent_ref_id
 

Detailed Description

Member Function Documentation

◆ addRoleAutoCompleteObject()

ilUserStartingPointGUI::addRoleAutoCompleteObject ( )

Definition at line 376 of file class.ilUserStartingPointGUI.php.

References ilRoleAutoCompleteInputGUI\echoAutoCompleteList().

376  : void
377  {
379  }
static echoAutoCompleteList()
Static asynchronous default auto complete function.
+ Here is the call graph for this function:

◆ deleteStartingPoint()

ilUserStartingPointGUI::deleteStartingPoint ( )
protected

Definition at line 551 of file class.ilUserStartingPointGUI.php.

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

551  : void
552  {
553  if (!$this->rbac_system->checkAccess('write', $this->parent_ref_id)) {
554  throw new ilPermissionException($this->lng->txt('msg_no_perm_read'));
555  }
556 
557  $spoint_id = $this->user_request->getStartingPointId();
558  $req_role_id = $this->user_request->getRoleId();
559 
560  if ($req_role_id && is_numeric($spoint_id)) {
561  $sp = $this->starting_point_repository->getStartingPointById(
562  $spoint_id
563  );
564  $this->starting_point_repository->delete($sp->getId());
565  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
566  } else {
567  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_spoint_not_modified'), true);
568  }
569  $this->ctrl->redirect($this, 'startingPoints');
570  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilUserStartingPointGUI::executeCommand ( )

Definition at line 93 of file class.ilUserStartingPointGUI.php.

References ILIAS\Repository\ctrl().

93  : void
94  {
95  $cmd = $this->ctrl->getCmd();
96  if ($cmd == 'roleStartingPointform' || !$cmd) {
97  $cmd = 'initRoleStartingPointForm';
98  }
99 
100  $this->$cmd();
101  }
+ Here is the call graph for this function:

◆ getCalenderSubInputs()

ilUserStartingPointGUI::getCalenderSubInputs ( ?ilUserStartingPoint  $st_point)
private

Definition at line 320 of file class.ilUserStartingPointGUI.php.

References ilCalendarSettings\DEFAULT_CAL_DAY, ilCalendarSettings\DEFAULT_CAL_LIST, ilCalendarSettings\DEFAULT_CAL_MONTH, ilCalendarSettings\DEFAULT_CAL_WEEK, ilUserStartingPoint\getCalendarPeriod(), ilUserStartingPoint\getCalendarView(), ILIAS\Repository\lng(), ilCalendarAgendaListGUI\PERIOD_DAY, ilCalendarAgendaListGUI\PERIOD_HALF_YEAR, ilCalendarAgendaListGUI\PERIOD_MONTH, ilCalendarAgendaListGUI\PERIOD_WEEK, ilSelectInputGUI\setOptions(), and ilFormPropertyGUI\setRequired().

Referenced by getStartingPointSelectionOption().

321  {
322  $default_cal_view = new ilRadioGroupInputGUI($this->lng->txt('cal_def_view'), 'user_calendar_view');
323  $default_cal_view->setRequired(true);
324 
325  $day = new ilRadioOption($this->lng->txt('day'), (string) ilCalendarSettings::DEFAULT_CAL_DAY);
326  $default_cal_view->addOption($day);
327  $week = new ilRadioOption($this->lng->txt('week'), (string) ilCalendarSettings::DEFAULT_CAL_WEEK);
328  $default_cal_view->addOption($week);
329  $month = new ilRadioOption($this->lng->txt('month'), (string) ilCalendarSettings::DEFAULT_CAL_MONTH);
330  $default_cal_view->addOption($month);
331 
332  $list = new ilRadioOption($this->lng->txt('cal_list'), (string) ilCalendarSettings::DEFAULT_CAL_LIST);
333 
334  $cal_periods = new ilSelectInputGUI($this->lng->txt('cal_list'), 'user_cal_period');
335  $cal_periods->setOptions([
336  ilCalendarAgendaListGUI::PERIOD_DAY => '1 ' . $this->lng->txt('day'),
337  ilCalendarAgendaListGUI::PERIOD_WEEK => '1 ' . $this->lng->txt('week'),
338  ilCalendarAgendaListGUI::PERIOD_MONTH => '1 ' . $this->lng->txt('month'),
339  ilCalendarAgendaListGUI::PERIOD_HALF_YEAR => '6 ' . $this->lng->txt('months')
340  ]);
341  $cal_periods->setRequired(true);
342 
343  if ($st_point !== null) {
344  $default_cal_view->setValue((string) $st_point->getCalendarView());
345  $cal_periods->setValue((string) $st_point->getCalendarPeriod());
346  }
347 
348  $list->addSubItem($cal_periods);
349  $default_cal_view->addOption($list);
350 
351  return $default_cal_view;
352  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
setOptions(array $a_options)
This class represents a property in a property form.
setRequired(bool $a_required)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreateFormSpecificInputs()

ilUserStartingPointGUI::getCreateFormSpecificInputs ( )
private

Definition at line 227 of file class.ilUserStartingPointGUI.php.

References ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), and ilRadioGroupInputGUI\setValue().

Referenced by getFormTypeSpecificStartingPointFormParts().

228  {
229  $roles = $this->starting_point_repository->getGlobalRolesWithoutStartingPoint();
230 
231 
232  // role type
233  $radg = new ilRadioGroupInputGUI($this->lng->txt('role'), 'role_type');
234  $radg->setValue('1');
235  if ($roles !== []) {
236  $radg->setValue('0');
237  $op1 = new ilRadioOption($this->lng->txt('user_global_role'), '0');
238  $radg->addOption($op1);
239 
240  $role_options = [];
241  foreach ($roles as $role) {
242  $role_options[$role['id']] = $role['title'];
243  }
244  $si_roles = new ilSelectInputGUI($this->lng->txt('roles_without_starting_point'), 'role');
245  $si_roles->setOptions($role_options);
246  $op1->addSubItem($si_roles);
247  }
248 
249  $op2 = new ilRadioOption($this->lng->txt('user_local_role'), '1');
250  $radg->addOption($op2);
251  $role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
252  $role_search->setSize(40);
253  $op2->addSubItem($role_search);
254  return $radg;
255  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
setOptions(array $a_options)
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentStartingPointOrNullForStartingPointForm()

ilUserStartingPointGUI::getCurrentStartingPointOrNullForStartingPointForm ( ?int  $starting_point_id)
private

Definition at line 198 of file class.ilUserStartingPointGUI.php.

Referenced by getRoleStartingPointForm().

199  {
200  if ($starting_point_id === null) {
201  return null;
202  }
203 
204  return $this->starting_point_repository->getStartingPointById(
205  $starting_point_id
206  );
207  }
+ Here is the caller graph for this function:

◆ getCurrentTypeForStartingPointForm()

ilUserStartingPointGUI::getCurrentTypeForStartingPointForm ( ?ilUserStartingPoint  $starting_point)
private

Definition at line 209 of file class.ilUserStartingPointGUI.php.

References ilUserStartingPoint\getStartingPointType().

Referenced by getRoleStartingPointForm().

209  : ?int
210  {
211  if ($starting_point === null) {
212  return null;
213  }
214 
215  return $starting_point->getStartingPointType();
216  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditFormSpecificInputs()

ilUserStartingPointGUI::getEditFormSpecificInputs ( int  $spoint_id,
int  $req_role_id 
)
private

Definition at line 257 of file class.ilUserStartingPointGUI.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, and ILIAS\Repository\lng().

Referenced by getFormTypeSpecificStartingPointFormParts().

257  : array
258  {
259  $title = $this->lng->txt('default');
260  if ($spoint_id !== $this->starting_point_repository->getDefaultStartingPointID()) {
261  $role = new ilObjRole($req_role_id);
262  $title = $role->getTitle();
263  }
264 
265  $inputs = [];
266  $inputs[0] = new ilNonEditableValueGUI($this->lng->txt('editing_this_role'), 'role_disabled');
267  $inputs[0]->setValue($title);
268 
269  $inputs[1] = new ilHiddenInputGUI('role');
270  $inputs[1]->setValue((string) $req_role_id);
271 
272  $inputs[2] = new ilHiddenInputGUI('start_point_id');
273  $inputs[2]->setValue((string) $spoint_id);
274 
275  return $inputs;
276  }
Class ilObjRole.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFormTypeSpecificStartingPointFormParts()

ilUserStartingPointGUI::getFormTypeSpecificStartingPointFormParts ( ?int  $spoint_id,
?int  $req_role_id 
)
private

Definition at line 218 of file class.ilUserStartingPointGUI.php.

References ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), getCreateFormSpecificInputs(), and getEditFormSpecificInputs().

Referenced by getRoleStartingPointForm().

218  : Generator
219  { //edit no default
220  if ($spoint_id === null) {
221  yield $this->getCreateFormSpecificInputs();
222  } else {
223  yield from $this->getEditFormSpecificInputs($spoint_id, $req_role_id);
224  }
225  }
getEditFormSpecificInputs(int $spoint_id, int $req_role_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRepositoryObjectInput()

ilUserStartingPointGUI::getRepositoryObjectInput ( ?ilUserStartingPoint  $st_point)
private

Definition at line 354 of file class.ilUserStartingPointGUI.php.

References ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilUserStartingPoint\getStartingObject(), and ILIAS\Repository\lng().

Referenced by getStartingPointSelectionOption().

355  {
356  $repobj_id = new ilTextInputGUI($this->lng->txt('adm_user_starting_point_ref_id'), 'start_object');
357  $repobj_id->setRequired(true);
358  $repobj_id->setSize(5);
359 
360  if ($st_point !== null) {
361  $start_ref_id = $st_point->getStartingObject();
362  $repobj_id->setValue($start_ref_id);
363  }
364 
365  if (isset($start_ref_id)) {
366  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
367  if ($start_obj_id) {
368  $repobj_id->setInfo($this->lng->txt('obj_' . ilObject::_lookupType($start_obj_id)) .
369  ': ' . ilObject::_lookupTitle($start_obj_id));
370  }
371  }
372 
373  return $repobj_id;
374  }
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoleStartingPointForm()

ilUserStartingPointGUI::getRoleStartingPointForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 162 of file class.ilUserStartingPointGUI.php.

References ILIAS\Repository\ctrl(), getCurrentStartingPointOrNullForStartingPointForm(), getCurrentTypeForStartingPointForm(), getFormTypeSpecificStartingPointFormParts(), getStartingPointSelectionInput(), and ILIAS\Repository\lng().

Referenced by initRoleStartingPointForm(), and saveStartingPoint().

163  {
164  if (!$this->rbac_system->checkAccess('write', $this->parent_ref_id)) {
165  $this->error->raiseError(
166  $this->lng->txt('msg_no_perm_read'),
167  $this->error->FATAL
168  );
169  }
170  $form = new ilPropertyFormGUI();
171  $this->ctrl->saveParameter($this, ['spid']);
172 
173  $starting_point_id = $this->user_request->getStartingPointId();
174  $starting_point = $this->getCurrentStartingPointOrNullForStartingPointForm($starting_point_id);
175  $starting_point_type = $this->getCurrentTypeForStartingPointForm($starting_point);
176  $req_role_id = $this->user_request->getRoleId();
177 
178  foreach ($this->getFormTypeSpecificStartingPointFormParts($starting_point_id, $req_role_id) as $input) {
179  $form->addItem(
180  $input
181  );
182  }
183 
184  $si = $this->getStartingPointSelectionInput($starting_point);
185  $si->setValue((string) $starting_point_type);
186  $form->addItem($si);
187 
188  // save and cancel commands
189  $form->addCommandButton('saveStartingPoint', $this->lng->txt('save'));
190  $form->addCommandButton('startingPoints', $this->lng->txt('cancel'));
191 
192  $form->setTitle($this->lng->txt('starting_point_settings'));
193  $form->setFormAction($this->ctrl->getFormAction($this));
194 
195  return $form;
196  }
getCurrentStartingPointOrNullForStartingPointForm(?int $starting_point_id)
getStartingPointSelectionInput(?ilUserStartingPoint $st_point)
getCurrentTypeForStartingPointForm(?ilUserStartingPoint $starting_point)
getFormTypeSpecificStartingPointFormParts(?int $spoint_id, ?int $req_role_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartingPointSelectionInput()

ilUserStartingPointGUI::getStartingPointSelectionInput ( ?ilUserStartingPoint  $st_point)
private

Definition at line 278 of file class.ilUserStartingPointGUI.php.

References $valid, getStartingPointSelectionOption(), ILIAS\Repository\lng(), and ilFormPropertyGUI\setRequired().

Referenced by getRoleStartingPointForm().

279  {
280  $si = new ilRadioGroupInputGUI($this->lng->txt('adm_user_starting_point'), 'start_point');
281  $si->setRequired(true);
282  $si->setInfo($this->lng->txt('adm_user_starting_point_info'));
283  $valid = array_keys($this->starting_point_repository->getPossibleStartingPoints());
284  foreach ($this->starting_point_repository->getPossibleStartingPoints(true) as $value => $caption) {
285  $si->addOption(
286  $this->getStartingPointSelectionOption($value, $caption, $st_point, $valid)
287  );
288  }
289 
290  return $si;
291  }
$valid
This class represents a property in a property form.
setRequired(bool $a_required)
getStartingPointSelectionOption(int $value, string $caption, ?ilUserStartingPoint $st_point, array $valid)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartingPointSelectionOption()

ilUserStartingPointGUI::getStartingPointSelectionOption ( int  $value,
string  $caption,
?ilUserStartingPoint  $st_point,
array  $valid 
)
private

Definition at line 293 of file class.ilUserStartingPointGUI.php.

References getCalenderSubInputs(), getRepositoryObjectInput(), ILIAS\Repository\lng(), ilUserStartingPointRepository\START_PD_CALENDAR, and ilUserStartingPointRepository\START_REPOSITORY_OBJ.

Referenced by getStartingPointSelectionInput().

298  : ilRadioOption {
299  $opt = new ilRadioOption($this->lng->txt($caption), (string) $value);
300 
302  $opt->addSubItem(
303  $this->getCalenderSubInputs($st_point)
304  );
305  }
306 
308  $opt->addSubItem(
309  $this->getRepositoryObjectInput($st_point)
310  );
311  }
312 
313  if (!in_array($value, $valid)) {
314  $opt->setInfo($this->lng->txt('adm_user_starting_point_invalid_info'));
315  }
316 
317  return $opt;
318  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCalenderSubInputs(?ilUserStartingPoint $st_point)
getRepositoryObjectInput(?ilUserStartingPoint $st_point)
$valid
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserStartingPointForm()

ilUserStartingPointGUI::getUserStartingPointForm ( )
protected

Definition at line 142 of file class.ilUserStartingPointGUI.php.

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

Referenced by initUserStartingPointForm(), and saveUserStartingPoint().

143  {
144  $form = new ilPropertyFormGUI();
145 
146  // starting point: personal
147  $startp = new ilCheckboxInputGUI($this->lng->txt('user_chooses_starting_page'), 'usr_start_pers');
148  $startp->setInfo($this->lng->txt('adm_user_starting_point_personal_info'));
149  $startp->setChecked($this->starting_point_repository->isPersonalStartingPointEnabled());
150 
151  $form->addItem($startp);
152 
153  $form->addCommandButton('saveUserStartingPoint', $this->lng->txt('save'));
154  $form->setFormAction($this->ctrl->getFormAction($this));
155 
156  return $form;
157  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRoleStartingPointForm()

ilUserStartingPointGUI::initRoleStartingPointForm ( ilPropertyFormGUI  $form = null)

Definition at line 134 of file class.ilUserStartingPointGUI.php.

References getRoleStartingPointForm().

134  : void
135  {
136  if (!($form instanceof ilPropertyFormGUI)) {
137  $form = $this->getRoleStartingPointForm();
138  }
139  $this->tpl->setContent($form->getHTML());
140  }
+ Here is the call graph for this function:

◆ initUserStartingPointForm()

ilUserStartingPointGUI::initUserStartingPointForm ( ilPropertyFormGUI  $form = null)

Definition at line 126 of file class.ilUserStartingPointGUI.php.

References getUserStartingPointForm().

126  : void
127  {
128  if (!($form instanceof ilPropertyFormGUI)) {
129  $form = $this->getUserStartingPointForm();
130  }
131  $this->tpl->setContent($form->getHTML());
132  }
+ Here is the call graph for this function:

◆ saveOrder()

ilUserStartingPointGUI::saveOrder ( )

Definition at line 536 of file class.ilUserStartingPointGUI.php.

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

536  : void
537  {
538  if (!$this->rbac_system->checkAccess('write', $this->parent_ref_id)) {
539  throw new ilPermissionException($this->lng->txt('msg_no_perm_read'));
540  }
541 
542  $positions = $this->user_request->getPositions();
543  if (count($positions) > 0) {
544  $this->starting_point_repository->saveOrder($positions);
545  }
546 
547  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
548  $this->ctrl->redirect($this, 'startingPoints');
549  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveStartingPoint()

ilUserStartingPointGUI::saveStartingPoint ( )
protected

store starting point from the form

Definition at line 401 of file class.ilUserStartingPointGUI.php.

References $res, ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), getRoleStartingPointForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilQueryParser\QP_COMBINATION_AND, ilQueryParser\setMinWordLength(), showRoleSelection(), ilUserStartingPointRepository\START_PD_CALENDAR, and ilUserStartingPointRepository\START_REPOSITORY_OBJ.

401  : void
402  {
403  if (!$this->rbac_system->checkAccess('write', $this->parent_ref_id)) {
404  $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->FATAL);
405  }
406 
407  $start_point_id = $this->user_request->getStartingPointId();
408 
409  //add from form
410  $form = $this->getRoleStartingPointForm();
411 
412  if (!$form->checkInput()) {
413  $form->setValuesByPost();
414  $this->tpl->setContent($form->getHTML());
415  return;
416  }
417 
418  $starting_point = $this->starting_point_repository->getStartingPointById(
419  $start_point_id
420  );
421 
422 
423  $role_id = $this->user_request->getRoleId();
424 
425  if ($form->getInput('role_type') === '1'
426  && ($role_id === null || $role_id < 1)) {
427  $parser = new ilQueryParser($form->getInput('role_search'));
428 
429  // TODO: Handle minWordLength
430  $parser->setMinWordLength(1);
431  $parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
432  $parser->parse();
433 
434  $object_search = new ilLikeObjectSearch($parser);
435  $object_search->setFilter(['role']);
436  $res = $object_search->performSearch();
437 
438  $entries = $res->getEntries();
439 
440  if ($entries === []) {
441  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_corresponding_roles'), true);
442  $form->setValuesByPost();
443  $this->tpl->setContent($form->getHTML());
444  return;
445  }
446 
447  if (count($entries) > 1) {
448  $this->showRoleSelection(
449  $form->getInput('role'),
450  $form->getInput('role_search'),
451  $form->getInput('start_point'),
452  $form->getInput('start_object')
453  );
454  return;
455  }
456 
457  if (count($entries) === 1) {
458  $role = current($entries);
459  $role_id = $role['obj_id'];
460  }
461  }
462 
463  if ($role_id === 0) {
464  $role_id = $form->getInput('role');
465  }
466 
467  if ($role_id !== 0) {
468  $starting_point->setRuleTypeRoleBased();
469  $rules = ['role_id' => $role_id];
470  $starting_point->setRuleOptions(serialize($rules));
471  }
472 
473  $starting_point->setStartingPointType((int) $form->getInput('start_point'));
474 
475  $obj_id = (int) $form->getInput('start_object');
476  $cal_view = (int) $form->getInput('user_calendar_view');
477  $cal_period = (int) $form->getInput('user_cal_period');
478 
479 
480  if ($starting_point->getStartingPointType() === ilUserStartingPointRepository::START_REPOSITORY_OBJ
481  && (ilObject::_lookupObjId($obj_id) === 0 || $this->tree->isDeleted($obj_id))) {
482  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('obj_ref_id_not_exist'), true);
483  $form->setValuesByPost();
484  $this->tpl->setContent($form->getHTML());
485  return;
486  }
487  $starting_point->setStartingObject($obj_id);
488 
489  if ($starting_point->getStartingPointType() === ilUserStartingPointRepository::START_PD_CALENDAR) {
490  $starting_point->setCalendarView($cal_view);
491  $starting_point->setCalendarPeriod($cal_period);
492  }
493 
494  if ($start_point_id !== null) {
495  $this->starting_point_repository->update($starting_point);
496  } else {
497  $this->starting_point_repository->save($starting_point);
498  }
499 
500  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
501  $this->ctrl->redirect($this, 'startingPoints');
502  }
$res
Definition: ltiservices.php:69
showRoleSelection(string $role, string $role_search, string $start_point, string $start_object)
static _lookupObjId(int $ref_id)
setMinWordLength(int $a_length)
+ Here is the call graph for this function:

◆ saveUserStartingPoint()

ilUserStartingPointGUI::saveUserStartingPoint ( )
protected

Definition at line 381 of file class.ilUserStartingPointGUI.php.

References ILIAS\Repository\ctrl(), getUserStartingPointForm(), and ILIAS\Repository\lng().

381  : void
382  {
383  if (!$this->rbac_system->checkAccess('write', $this->parent_ref_id)) {
384  $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->FATAL);
385  }
386 
387  $form = $this->getUserStartingPointForm();
388 
389  if ($form->checkInput()) {
390  $this->starting_point_repository->togglePersonalStartingPointActivation((bool) $form->getInput('usr_start_pers'));
391  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
392  $this->ctrl->redirect($this, 'startingPoints');
393  }
394  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_error'), true);
395  $this->ctrl->redirect($this, 'startingPoints');
396  }
+ Here is the call graph for this function:

◆ showRoleSelection()

ilUserStartingPointGUI::showRoleSelection ( string  $role,
string  $role_search,
string  $start_point,
string  $start_object 
)
private

Definition at line 504 of file class.ilUserStartingPointGUI.php.

References $res, ILIAS\Repository\lng(), and ilQueryParser\QP_COMBINATION_AND.

Referenced by saveStartingPoint().

509  : void {
510  $parser = new ilQueryParser($role_search);
511  $parser->setMinWordLength(1);
512  $parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
513  $parser->parse();
514 
515  $object_search = new ilLikeObjectSearch($parser);
516  $object_search->setFilter(['role']);
517  $res = $object_search->performSearch();
518 
519  $entries = $res->getEntries();
520 
521  $table = new ilRoleSelectionTableGUI($this, 'saveStartingPoint');
522  $table->setLimit(9999);
523  $table->disable('sort');
524  $table->addHiddenInput('role_search', $role_search);
525  $table->addHiddenInput('start_point', $start_point);
526  $table->addHiddenInput('start_object', $start_object);
527  $table->addHiddenInput('role', $role);
528  $table->addHiddenInput('role_type', '1');
529  $table->setTitle($this->lng->txt('user_role_selection'));
530  $table->addMultiCommand('saveStartingPoint', $this->lng->txt('select'));
531  $table->parse($entries);
532 
533  $this->tpl->setContent($table->getHTML());
534  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startingPoints()

ilUserStartingPointGUI::startingPoints ( )

table form to set up starting points depends of user roles

Definition at line 106 of file class.ilUserStartingPointGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

106  : void
107  {
108  $this->toolbar->addComponent(
109  $this->ui_factory->link()->standard(
110  $this->lng->txt('create_starting_point'),
111  $this->ctrl->getLinkTarget($this, "roleStartingPointform")
112  )
113  );
114 
116  $this,
117  $this->starting_point_repository,
118  $this->rbac_review,
119  $this->ui_factory,
120  $this->ui_renderer,
121  );
122 
123  $this->tpl->setContent($tbl->getHTML());
124  }
TableGUI class for LTI consumer listing.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilUserStartingPointGUI::$ctrl
private

Definition at line 39 of file class.ilUserStartingPointGUI.php.

◆ $db

ilDBInterface ilUserStartingPointGUI::$db
private

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

◆ $lng

ilLanguage ilUserStartingPointGUI::$lng
private

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

◆ $log

ilLogger ilUserStartingPointGUI::$log
private

Definition at line 33 of file class.ilUserStartingPointGUI.php.

◆ $parent_ref_id

int ilUserStartingPointGUI::$parent_ref_id
private

Definition at line 50 of file class.ilUserStartingPointGUI.php.

◆ $rbac_review

ilRbacReview ilUserStartingPointGUI::$rbac_review
private

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

◆ $rbac_system

ilRbacSystem ilUserStartingPointGUI::$rbac_system
private

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

◆ $settings

ilSetting ilUserStartingPointGUI::$settings
private

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

◆ $starting_point_repository

ilUserStartingPointRepository ilUserStartingPointGUI::$starting_point_repository
private

Definition at line 48 of file class.ilUserStartingPointGUI.php.

◆ $tabs

ilTabsGUI ilUserStartingPointGUI::$tabs
private

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

◆ $toolbar

ilToolbarGUI ilUserStartingPointGUI::$toolbar
private

Definition at line 37 of file class.ilUserStartingPointGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilUserStartingPointGUI::$tpl
private

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

◆ $tree

ilTree ilUserStartingPointGUI::$tree
private

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

◆ $ui_factory

UIFactory ilUserStartingPointGUI::$ui_factory
private

Definition at line 45 of file class.ilUserStartingPointGUI.php.

◆ $ui_renderer

Renderer ilUserStartingPointGUI::$ui_renderer
private

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

◆ $user

ilObjUser ilUserStartingPointGUI::$user
private

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

◆ $user_request

UserGUIRequest ilUserStartingPointGUI::$user_request
private

Definition at line 47 of file class.ilUserStartingPointGUI.php.


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