ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserUtil Class Reference

Class ilUserUtil. More...

+ Collaboration diagram for ilUserUtil:

Static Public Member Functions

static getNamePresentation ( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
 Default behaviour is: More...
 
static hasPublicProfile (int $a_user_id)
 
static getProfileLink (int $a_usr_id)
 Get link to personal profile Return empty string in case of not public profile. More...
 
static getPossibleStartingPoints (bool $a_force_all=false)
 Get all valid starting points. More...
 
static setStartingPoint (int $a_value, int $a_ref_id=null, array $a_cal_view=[])
 Set starting point setting. More...
 
static getStartingPoint ()
 Get current starting point setting. More...
 
static getStartingObject ()
 Get ref id of starting object. More...
 
static getCalendarView ()
 Get specific view of calendar starting point. More...
 
static getCalendarPeriod ()
 Get time frame of calendar view. More...
 
static togglePersonalStartingPoint (bool $a_value)
 Toggle personal starting point setting. More...
 
static hasPersonalStartingPoint ()
 Can starting point be personalized? More...
 
static hasPersonalStartPointPref ()
 Did user set any personal starting point (yet)? More...
 
static getPersonalStartingPoint ()
 Get current personal starting point. More...
 
static setPersonalStartingPoint (int $a_value, int $a_ref_id=null)
 Set personal starting point setting. More...
 
static getPersonalStartingObject ()
 Get ref id of personal starting object. More...
 

Data Fields

const START_PD_OVERVIEW = 1
 
const START_PD_SUBSCRIPTION = 2
 
const START_PD_NOTES = 4
 
const START_PD_NEWS = 5
 
const START_PD_WORKSPACE = 6
 
const START_PD_PORTFOLIO = 7
 
const START_PD_SKILLS = 8
 
const START_PD_LP = 9
 
const START_PD_CALENDAR = 10
 
const START_PD_MAIL = 11
 
const START_PD_CONTACTS = 12
 
const START_PD_PROFILE = 13
 
const START_PD_SETTINGS = 14
 
const START_REPOSITORY = 15
 
const START_REPOSITORY_OBJ = 16
 
const START_PD_MYSTAFF = 17
 

Detailed Description

Class ilUserUtil.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilUserUtil.php.

Member Function Documentation

◆ getCalendarPeriod()

static ilUserUtil::getCalendarPeriod ( )
static

Get time frame of calendar view.

Definition at line 488 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

Referenced by ilUserStartingPointGUI\getRoleStartingPointForm().

488  : int
489  {
490  global $DIC;
491 
492  $ilSetting = $DIC['ilSetting'];
493 
494  return (int) $ilSetting->get("user_cal_period");
495  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getCalendarView()

static ilUserUtil::getCalendarView ( )
static

Get specific view of calendar starting point.

Definition at line 476 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

Referenced by ilUserStartingPointGUI\getRoleStartingPointForm().

476  : int
477  {
478  global $DIC;
479 
480  $ilSetting = $DIC['ilSetting'];
481 
482  return (int) $ilSetting->get("user_calendar_view");
483  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getNamePresentation()

static ilUserUtil::getNamePresentation (   $a_user_id,
bool  $a_user_image = false,
bool  $a_profile_link = false,
string  $a_profile_back_link = "",
bool  $a_force_first_lastname = false,
bool  $a_omit_login = false,
bool  $a_sortable = true,
bool  $a_return_data_array = false,
  $a_ctrl_path = "ilpublicuserprofilegui" 
)
static

Default behaviour is:

  • lastname, firstname if public profile enabled
  • [loginname] (always) modifications by jposselt at databay . de : if $a_user_id is an array of user ids the method returns an array of "id" => "NamePresentation" pairs.
    Parameters
    int|int[]$a_user_id
    string | array$a_ctrl_path
    Returns
    array|false|mixed
    Exceptions
    ilWACException

Definition at line 57 of file class.ilUserUtil.php.

References $d, $data, $DIC, $id, $ilDB, $img, $lng, and ilObjUser\_getPersonalPicturePath().

Referenced by ilSurveyAppraiseesTableGUI\__construct(), ILIAS\Survey\Mode\AbstractUIModifier\addApprSelectionToToolbar(), ILIAS\Survey\InfoScreen\InfoScreenGUI\addStartResumeSection(), ilMDCopyrightUsageTableGUI\collectData(), ilSystemNotification\compose(), ilGroupAddToGroupActionGUI\confirmAddUser(), ilSurveyParticipantsGUI\confirmAdminAppraiseesCloseObject(), ilGroupAddToGroupActionGUI\confirmCreateGroupAndAddUser(), ilBadgeManagementGUI\confirmDeassignBadge(), ilExerciseManagementGUI\confirmDeassignMembersObject(), ilSurveyParticipantsGUI\confirmDeleteAppraiseesObject(), ilMailingListsGUI\confirmDeleteMembers(), ilSurveyParticipantsGUI\confirmDeleteRatersObject(), ilConsultationHoursGUI\confirmRejectBooking(), ilCourseParticipantsGroupsGUI\confirmRemove(), ilObjBlogGUI\confirmRemoveContributor(), ilExSubmissionTeamGUI\confirmRemoveTeamMemberObject(), ilSkillProfileGUI\confirmUserRemoval(), ilExerciseManagementGUI\createTeamsFromGroupsObject(), ilContSkillAdminGUI\deassignCompetencesConfirm(), ilObjDataCollection\doUpdate(), ilSharedResourceGUI\executeCommand(), ilExerciseManagementGUI\executeCommand(), ilUserForTagTableGUI\fillRow(), ilWikiRecentChangesTableGUI\fillRow(), ilHistoryTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilExcDeliveredFilesTableGUI\fillRow(), ilExAssignmentListTextTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilWorkspaceShareTableGUI\fillRow(), ilBookingReservationsTableGUI\fillRow(), ilCronManagerTableGUI\formatResultInfo(), ilCronManagerTableGUI\formatStatusInfo(), ilExSubmissionTeamGUI\getAdoptForm(), ILIAS\Skill\Profile\SkillProfileUserDBRepository\getAssignedUsers(), ILIAS\OnScreenChat\Repository\Subscriber\getDataByUserIds(), ilPublicUserProfileGUI\getEmbeddable(), ilNoteGUI\getItemForNote(), ilContributorTableGUI\getItems(), ilExAssignmentPeerReviewTableGUI\getItems(), ilExAssignmentTeamTableGUI\getItems(), ilPageLinker\getLinkXML(), ilLMPageObjectGUI\getLinkXML(), ilLMPresentationLinker\getLinkXML(), ILIAS\Awareness\WidgetManager\getListData(), ilLearningModuleNotification\getMailBody(), ilExSubmissionTeamGUI\getOverviewContent(), ilBlogPostingGUI\getPageHeading(), ilWikiPagesTableGUI\getPages(), ilAbstractUsersGalleryCollectionProvider\getPopulatedGroup(), ilDclBaseRecordModel\getStandardFieldHTML(), ILIAS\Notifications\Provider\AwarenessToastProvider\getToasts(), ilAppointmentPresentationGUI\getUserName(), ilMailUserHelper\getUsernameMapForIds(), ilInternalLinkGUI\getUserSearchResult(), ilBlogPosting\handleNews(), ilWorkspaceAccessTableGUI\importData(), ilObjFileGUI\infoScreenForward(), ilLearningProgressBaseGUI\initEditUserForm(), ilSurveyParticipantsGUI\initExternalRaterForm(), ilCalendarCategoryGUI\initFormCategory(), ilExerciseManagementGUI\initGroupForm(), ilExPeerReviewGUI\initPeerReviewItemForm(), ilBookingPreferencesGUI\listBookingResults(), ilChatroomViewGUI\lostConnection(), ilSurveyExecutionGUI\outSurveyPage(), ilExAssignmentListTextTableGUI\parse(), ilConsultationHourBookingTableGUI\parse(), ilMailingListsGUI\performDeleteMembers(), ilBuddySystemRelationsTableGUI\populate(), ilWikiPageGUI\preview(), ilContSkillAdminGUI\publishAssignments(), ilNewsTimelineItemGUI\render(), ilExPeerReviewGUI\renderInfoWidget(), ilObjBlogGUI\renderList(), ilLikeGUI\renderModal(), ilObjBlogGUI\renderNavigationByAuthors(), ilPublicUserProfileGUI\renderTitle(), ilMembershipCronNotifications\run(), ilLMMailNotification\send(), ilBuddySystemNotification\send(), ilObjSurvey\send360ReminderToUser(), ilWikiUtil\sendNotification(), ilObjSurvey\sendNotificationMail(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sendRaterNotification(), ilMStShowUserGUI\setTitleAndIcon(), ilChatroomBanGUI\show(), ilPageObjectGUI\showEditLockInfo(), ilMailingListsGUI\showMembersList(), ilPageObjectGUI\showPage(), ilExAssignmentPeerReviewOverviewTableGUI\translateUserIds(), and ilPageObject\update().

67  {
68  global $DIC;
69 
70  $lng = $DIC['lng'];
71  $ilCtrl = $DIC['ilCtrl'];
72  $ilDB = $DIC['ilDB'];
73 
74  if (!is_array($a_ctrl_path)) {
75  $a_ctrl_path = array($a_ctrl_path);
76  }
77 
78  if (!($return_as_array = is_array($a_user_id))) {
79  $a_user_id = array($a_user_id);
80  }
81 
82  $sql = 'SELECT
83  a.usr_id,
84  firstname,
85  lastname,
86  title,
87  login,
88  b.value public_profile,
89  c.value public_title
90  FROM
91  usr_data a
92  LEFT JOIN
93  usr_pref b ON
94  (a.usr_id = b.usr_id AND
95  b.keyword = %s)
96  LEFT JOIN
97  usr_pref c ON
98  (a.usr_id = c.usr_id AND
99  c.keyword = %s)
100  WHERE ' . $ilDB->in('a.usr_id', $a_user_id, false, 'integer');
101 
102  $userrow = $ilDB->queryF($sql, array('text', 'text'), array('public_profile', 'public_title'));
103 
104  $names = array();
105 
106  $data = array();
107  while ($row = $ilDB->fetchObject($userrow)) {
108  $pres = '';
109  $d = array(
110  "id" => (int) $row->usr_id,
111  "title" => "",
112  "lastname" => "",
113  "firstname" => "",
114  "img" => "",
115  "link" => ""
116  );
117  $has_public_profile = in_array($row->public_profile, array("y", "g"));
118  if ($a_force_first_lastname || $has_public_profile) {
119  $title = "";
120  if ($row->public_title == "y" && $row->title) {
121  $title = $row->title . " ";
122  }
123  $d["title"] = $title;
124  if ($a_sortable) {
125  $pres = $row->lastname;
126  if (strlen($row->firstname)) {
127  $pres .= (', ' . $row->firstname . ' ');
128  }
129  } else {
130  $pres = $title;
131  if (strlen($row->firstname)) {
132  $pres .= $row->firstname . ' ';
133  }
134  $pres .= ($row->lastname . ' ');
135  }
136  $d["firstname"] = $row->firstname;
137  $d["lastname"] = $row->lastname;
138  }
139  $d["login"] = $row->login;
140  $d["public_profile"] = $has_public_profile;
141 
142 
143  if (!$a_omit_login) {
144  $pres .= "[" . $row->login . "]";
145  }
146 
147  if ($a_profile_link && $has_public_profile) {
148  $ilCtrl->setParameterByClass(end($a_ctrl_path), "user_id", $row->usr_id);
149  if ($a_profile_back_link != "") {
150  $ilCtrl->setParameterByClass(
151  end($a_ctrl_path),
152  "back_url",
153  rawurlencode($a_profile_back_link)
154  );
155  }
156  $link = $ilCtrl->getLinkTargetByClass($a_ctrl_path, "getHTML");
157  $pres = '<a href="' . $link . '">' . $pres . '</a>';
158  $d["link"] = $link;
159  }
160 
161  if ($a_user_image) {
162  $img = ilObjUser::_getPersonalPicturePath($row->usr_id, "xxsmall");
163  $pres = '<img class="ilUserXXSmall" src="' . $img . '" alt="' . $lng->txt("icon") .
164  " " . $lng->txt("user_picture") . '" /> ' . $pres;
165  $d["img"] = $img;
166  }
167 
168  $names[$row->usr_id] = $pres;
169  $data[$row->usr_id] = $d;
170  }
171 
172  foreach ($a_user_id as $id) {
173  if (!isset($names[$id]) || !$names[$id]) {
174  $names[$id] = $lng->txt('usr_name_undisclosed');
175  }
176  }
177 
178  if ($a_return_data_array) {
179  if ($return_as_array) {
180  return $data;
181  } else {
182  return current($data);
183  }
184  }
185  return $return_as_array ? $names : $names[$a_user_id[0]];
186  }
$lng
global $DIC
Definition: feed.php:28
$img
Definition: imgupload.php:83
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalStartingObject()

static ilUserUtil::getPersonalStartingObject ( )
static

Get ref id of personal starting object.

Definition at line 590 of file class.ilUserUtil.php.

References $DIC, $ilUser, and $ref_id.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

590  : ?int
591  {
592  global $DIC;
593 
594  $ilUser = $DIC['ilUser'];
595 
596  $ref_id = $ilUser->getPref("usr_starting_point_ref_id");
597  if (!$ref_id) {
598  $ref_id = self::getStartingObject();
599  }
600  return $ref_id;
601  }
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ getPersonalStartingPoint()

static ilUserUtil::getPersonalStartingPoint ( )
static

Get current personal starting point.

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

References $DIC, $ilUser, and $valid.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

536  : int
537  {
538  global $DIC;
539 
540  $ilUser = $DIC['ilUser'];
541 
542  $valid = array_keys(self::getPossibleStartingPoints());
543  $current = $ilUser->getPref("usr_starting_point");
544  if ($current == self::START_REPOSITORY_OBJ) {
545  return $current;
546  } elseif (!$current || !in_array($current, $valid)) {
547  return self::getStartingPoint();
548  }
549  return $current;
550  }
$valid
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ getPossibleStartingPoints()

static ilUserUtil::getPossibleStartingPoints ( bool  $a_force_all = false)
static

Get all valid starting points.

Returns
array<int,string>

Definition at line 229 of file class.ilUserUtil.php.

References $DIC, $ilSetting, $lang, $lng, ILIAS\LTI\ToolProvider\$settings, and ilCalendarSettings\_getInstance().

Referenced by ilUserRoleStartingPointTableGUI\getItems(), ilUserStartingPointGUI\getRoleStartingPointForm(), and ilPersonalSettingsGUI\initGeneralSettingsForm().

229  : array
230  {
231  global $DIC;
232 
233  $ilSetting = $DIC['ilSetting'];
234  $lng = $DIC['lng'];
235 
236  // for all conditions: see ilMainMenuGUI
237 
238  $all = array();
239 
240  $all[self::START_PD_OVERVIEW] = 'mm_dashboard';
241  $all[self::START_PD_SUBSCRIPTION] = 'my_courses_groups';
242 
243  if ((new ilMyStaffCachedAccessDecorator($DIC, ilMyStaffAccess::getInstance()))->hasCurrentUserAccessToMyStaff()) {
244  $all[self::START_PD_MYSTAFF] = 'my_staff';
245  }
246 
247  if ($a_force_all || !$ilSetting->get("disable_personal_workspace")) {
248  $all[self::START_PD_WORKSPACE] = 'mm_personal_and_shared_r';
249  }
251  if ($a_force_all || $settings->isEnabled()) {
252  $all[self::START_PD_CALENDAR] = 'calendar';
253  }
254 
255  $all[self::START_REPOSITORY] = 'obj_root';
256  $all[self::START_REPOSITORY_OBJ] = 'adm_user_starting_point_object';
257 
258  foreach ($all as $idx => $lang) {
259  $all[$idx] = $lng->txt($lang);
260  }
261 
262  return $all;
263  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$lng
global $DIC
Definition: feed.php:28
$lang
Definition: xapiexit.php:26
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfileLink()

static ilUserUtil::getProfileLink ( int  $a_usr_id)
static

Get link to personal profile Return empty string in case of not public profile.

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

References $GLOBALS, and ilObjUser\_lookupPref().

Referenced by ilMDCopyrightUsageTableGUI\collectData(), and ilRepositoryUserResultTableGUI\fillRow().

209  : string
210  {
211  $public_profile = ilObjUser::_lookupPref($a_usr_id, 'public_profile');
212  if ($public_profile != 'y' and $public_profile != 'g') {
213  return '';
214  }
215 
216  $GLOBALS['DIC']['ilCtrl']->setParameterByClass('ilpublicuserprofilegui', 'user', $a_usr_id);
217  return $GLOBALS['DIC']['ilCtrl']->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML');
218  }
static _lookupPref(int $a_usr_id, string $a_keyword)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartingObject()

static ilUserUtil::getStartingObject ( )
static

Get ref id of starting object.

Definition at line 464 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

Referenced by ilUserRoleStartingPointTableGUI\getItems(), and ilUserStartingPointGUI\getRoleStartingPointForm().

464  : ?int
465  {
466  global $DIC;
467 
468  $ilSetting = $DIC['ilSetting'];
469 
470  return $ilSetting->get("usr_starting_point_ref_id");
471  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getStartingPoint()

static ilUserUtil::getStartingPoint ( )
static

Get current starting point setting.

Definition at line 303 of file class.ilUserUtil.php.

References $DIC, $ilSetting, $ilUser, $log, $ref_id, $valid, ilCalendarSettings\_getInstance(), ilLink\_getStaticLink(), ilObject\_lookupObjId(), ANONYMOUS_USER_ID, ilDashboardGUI\CMD_JUMP_TO_MY_STAFF, and ilStartingPoint\getRolesWithStartingPoint().

Referenced by ilUserRoleStartingPointTableGUI\getItems(), and ilUserStartingPointGUI\getRoleStartingPointForm().

303  : int
304  {
305  global $DIC;
306 
307  $ilSetting = $DIC['ilSetting'];
308  $ilUser = $DIC['ilUser'];
309 
310  $valid = array_keys(self::getPossibleStartingPoints());
311  $current = $ilSetting->get("usr_starting_point");
312  if ($current == self::START_REPOSITORY_OBJ) {
313  return $current;
314  } elseif (!$current || !in_array($current, $valid)) {
315  $current = self::START_PD_OVERVIEW;
316 
317  // #10715 - if 1 is disabled overview will display the current default
318  if ($ilSetting->get('disable_my_offers') == 0 &&
319  $ilSetting->get('disable_my_memberships') == 0 &&
320  $ilSetting->get('personal_items_default_view') == 1) {
321  $current = self::START_PD_SUBSCRIPTION;
322  }
323 
324  self::setStartingPoint($current);
325  }
326  if ($ilUser->getId() == ANONYMOUS_USER_ID ||
327  !$ilUser->getId()) { // #18531
328  $current = self::START_REPOSITORY;
329  }
330  return $current;
331  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
$valid
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasPersonalStartingPoint()

static ilUserUtil::hasPersonalStartingPoint ( )
static

Can starting point be personalized?

Definition at line 512 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

Referenced by ilPersonalSettingsGUI\checkPersonalStartingPoint(), ilUserRoleStartingPointTableGUI\getItems(), ilUserStartingPointGUI\getUserStartingPointForm(), ilPersonalSettingsGUI\initGeneralSettingsForm(), and ilPersonalSettingsGUI\saveGeneralSettings().

512  : bool
513  {
514  global $DIC;
515 
516  $ilSetting = $DIC['ilSetting'];
517 
518  return (bool) $ilSetting->get("usr_starting_point_personal");
519  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ hasPersonalStartPointPref()

static ilUserUtil::hasPersonalStartPointPref ( )
static

Did user set any personal starting point (yet)?

Definition at line 524 of file class.ilUserUtil.php.

References $DIC, and $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

524  : bool
525  {
526  global $DIC;
527 
528  $ilUser = $DIC['ilUser'];
529 
530  return (bool) $ilUser->getPref("usr_starting_point");
531  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ hasPublicProfile()

static ilUserUtil::hasPublicProfile ( int  $a_user_id)
static

Definition at line 188 of file class.ilUserUtil.php.

References $DIC, and $ilDB.

Referenced by ilPageLinker\getLinkXML(), ilLMPageObjectGUI\getLinkXML(), and ilLMPresentationLinker\getLinkXML().

188  : bool
189  {
190  global $DIC;
191 
192  $ilDB = $DIC['ilDB'];
193 
194  $set = $ilDB->query(
195  "SELECT value FROM usr_pref " .
196  " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
197  " and keyword = " . $ilDB->quote("public_profile", "text")
198  );
199  $rec = $ilDB->fetchAssoc($set);
200 
201  return in_array($rec["value"] ?? "", array("y", "g"));
202  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ setPersonalStartingPoint()

static ilUserUtil::setPersonalStartingPoint ( int  $a_value,
int  $a_ref_id = null 
)
static

Set personal starting point setting.

Definition at line 555 of file class.ilUserUtil.php.

References $DIC, $ilUser, $valid, ilObject\_lookupObjId(), and ILIAS\Repository\int().

Referenced by ilPersonalSettingsGUI\saveGeneralSettings().

558  : bool {
559  global $DIC;
560 
561  $ilUser = $DIC['ilUser'];
562  $tree = $DIC['tree'];
563 
564  if (!$a_value) {
565  $ilUser->setPref("usr_starting_point", null);
566  $ilUser->setPref("usr_starting_point_ref_id", null);
567  return false;
568  }
569 
570  if ($a_value == self::START_REPOSITORY_OBJ) {
571  $a_ref_id = (int) $a_ref_id;
572  if (ilObject::_lookupObjId($a_ref_id) &&
573  !$tree->isDeleted($a_ref_id)) {
574  $ilUser->setPref("usr_starting_point", $a_value);
575  $ilUser->setPref("usr_starting_point_ref_id", $a_ref_id);
576  return true;
577  }
578  }
579  $valid = array_keys(self::getPossibleStartingPoints());
580  if (in_array($a_value, $valid)) {
581  $ilUser->setPref("usr_starting_point", $a_value);
582  return true;
583  }
584  return false;
585  }
$valid
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStartingPoint()

static ilUserUtil::setStartingPoint ( int  $a_value,
int  $a_ref_id = null,
array  $a_cal_view = [] 
)
static

Set starting point setting.

Definition at line 268 of file class.ilUserUtil.php.

References $DIC, $ilSetting, ILIAS\LTI\ToolProvider\$key, $valid, ilObject\_lookupObjId(), and ILIAS\Repository\int().

Referenced by ilUserStartingPointGUI\saveStartingPoint().

272  : bool {
273  global $DIC;
274 
275  $ilSetting = $DIC['ilSetting'];
276  $tree = $DIC['tree'];
277 
278  if ($a_value == self::START_REPOSITORY_OBJ) {
279  $a_ref_id = (int) $a_ref_id;
280  if (ilObject::_lookupObjId($a_ref_id) &&
281  !$tree->isDeleted($a_ref_id)) {
282  $ilSetting->set("usr_starting_point", $a_value);
283  $ilSetting->set("usr_starting_point_ref_id", $a_ref_id);
284  return true;
285  }
286  }
287  $valid = array_keys(self::getPossibleStartingPoints());
288  if (in_array($a_value, $valid)) {
289  $ilSetting->set("usr_starting_point", $a_value);
290  if ($a_value == self::START_PD_CALENDAR) {
291  foreach ($a_cal_view as $key => $value) {
292  $ilSetting->set($key, $value);
293  }
294  }
295  return true;
296  }
297  return false;
298  }
$valid
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ togglePersonalStartingPoint()

static ilUserUtil::togglePersonalStartingPoint ( bool  $a_value)
static

Toggle personal starting point setting.

Definition at line 500 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

Referenced by ilUserStartingPointGUI\saveUserStartingPoint().

500  : void
501  {
502  global $DIC;
503 
504  $ilSetting = $DIC['ilSetting'];
505 
506  $ilSetting->set("usr_starting_point_personal", (string) $a_value);
507  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

Field Documentation

◆ START_PD_CALENDAR

const ilUserUtil::START_PD_CALENDAR = 10

◆ START_PD_CONTACTS

const ilUserUtil::START_PD_CONTACTS = 12

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

◆ START_PD_LP

const ilUserUtil::START_PD_LP = 9

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

◆ START_PD_MAIL

const ilUserUtil::START_PD_MAIL = 11

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

◆ START_PD_MYSTAFF

const ilUserUtil::START_PD_MYSTAFF = 17

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

◆ START_PD_NEWS

const ilUserUtil::START_PD_NEWS = 5

Definition at line 31 of file class.ilUserUtil.php.

◆ START_PD_NOTES

const ilUserUtil::START_PD_NOTES = 4

Definition at line 30 of file class.ilUserUtil.php.

◆ START_PD_OVERVIEW

const ilUserUtil::START_PD_OVERVIEW = 1

Definition at line 28 of file class.ilUserUtil.php.

◆ START_PD_PORTFOLIO

const ilUserUtil::START_PD_PORTFOLIO = 7

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

◆ START_PD_PROFILE

const ilUserUtil::START_PD_PROFILE = 13

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

◆ START_PD_SETTINGS

const ilUserUtil::START_PD_SETTINGS = 14

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

◆ START_PD_SKILLS

const ilUserUtil::START_PD_SKILLS = 8

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

◆ START_PD_SUBSCRIPTION

const ilUserUtil::START_PD_SUBSCRIPTION = 2

Definition at line 29 of file class.ilUserUtil.php.

◆ START_PD_WORKSPACE

const ilUserUtil::START_PD_WORKSPACE = 6

Definition at line 32 of file class.ilUserUtil.php.

◆ START_REPOSITORY

const ilUserUtil::START_REPOSITORY = 15

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

◆ START_REPOSITORY_OBJ


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