ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilUserUtil Class Reference

Class ilUserUtil. More...

+ Collaboration diagram for ilUserUtil:

Static Public Member Functions

static getNamePresentation ( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
 Default behaviour is: More...
 
static hasPublicProfile ($a_user_id)
 Has public profile. More...
 
static getProfileLink ($a_usr_id)
 Get link to personal profile Return empty string in case of not public profile. More...
 
static getPossibleStartingPoints ($a_force_all=false)
 Get all valid starting points. More...
 
static setStartingPoint ($a_value, $a_ref_id=null)
 Set starting point setting. More...
 
static getStartingPoint ()
 Get current starting point setting. More...
 
static getStartingPointAsUrl ()
 Get current starting point setting as URL. More...
 
static getStartingObject ()
 Get ref id of starting object. More...
 
static togglePersonalStartingPoint ($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 ($a_value, $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_BOOKMARKS = 3
 
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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ getNamePresentation()

static ilUserUtil::getNamePresentation (   $a_user_id,
  $a_user_image = false,
  $a_profile_link = false,
  $a_profile_back_link = "",
  $a_force_first_lastname = false,
  $a_omit_login = false,
  $a_sortable = true,
  $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
booleansortable should be used in table presentions. output is "Doe, John" title is ommited

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

53 {
54 global $lng, $ilCtrl, $ilDB;
55
56 if (!is_array($a_ctrl_path)) {
57 $a_ctrl_path = array($a_ctrl_path);
58 }
59
60 if (!($return_as_array = is_array($a_user_id))) {
61 $a_user_id = array($a_user_id);
62 }
63
64 $sql = 'SELECT
65 a.usr_id,
66 firstname,
67 lastname,
68 title,
69 login,
70 b.value public_profile,
71 c.value public_title
72 FROM
73 usr_data a
74 LEFT JOIN
75 usr_pref b ON
76 (a.usr_id = b.usr_id AND
77 b.keyword = %s)
78 LEFT JOIN
79 usr_pref c ON
80 (a.usr_id = c.usr_id AND
81 c.keyword = %s)
82 WHERE ' . $ilDB->in('a.usr_id', $a_user_id, false, 'integer');
83
84 $userrow = $ilDB->queryF($sql, array('text', 'text'), array('public_profile', 'public_title'));
85
86 $names = array();
87
88 $data = array();
89 while ($row = $ilDB->fetchObject($userrow)) {
90 $pres = '';
91 $d = array("id" => $row->usr_id, "title" => "", "lastname" => "", "firstname" => "", "img" => "", "link" => "",
92 "public_profile" => "");
93 $has_public_profile = in_array($row->public_profile, array("y", "g"));
94 if ($a_force_first_lastname || $has_public_profile) {
95 $title = "";
96 if ($row->public_title == "y" && $row->title) {
97 $title = $row->title . " ";
98 }
99 $d["title"] = $title;
100 if ($a_sortable) {
101 $pres = $row->lastname;
102 if (strlen($row->firstname)) {
103 $pres .= (', ' . $row->firstname . ' ');
104 }
105 } else {
106 $pres = $title;
107 if (strlen($row->firstname)) {
108 $pres .= $row->firstname . ' ';
109 }
110 $pres .= ($row->lastname . ' ');
111 }
112 $d["firstname"] = $row->firstname;
113 $d["lastname"] = $row->lastname;
114 }
115 $d["login"] = $row->login;
116 $d["public_profile"] = $has_public_profile;
117
118
119 if (!$a_omit_login) {
120 $pres.= "[" . $row->login . "]";
121 }
122
123 if ($a_profile_link && $has_public_profile) {
124 $ilCtrl->setParameterByClass(end($a_ctrl_path), "user_id", $row->usr_id);
125 if ($a_profile_back_link != "") {
126 $ilCtrl->setParameterByClass(
127 end($a_ctrl_path),
128 "back_url",
129 rawurlencode($a_profile_back_link)
130 );
131 }
132 $link = $ilCtrl->getLinkTargetByClass($a_ctrl_path, "getHTML");
133 $pres = '<a href="' . $link . '">' . $pres . '</a>';
134 $d["link"] = $link;
135 }
136
137 if ($a_user_image) {
138 $img = ilObjUser::_getPersonalPicturePath($row->usr_id, "xxsmall");
139 $pres = '<img class="ilUserXXSmall" border="0" src="' . $img . '" alt="' . $lng->txt("icon") .
140 " " . $lng->txt("user_picture") . '" /> ' . $pres;
141 $d["img"] = $img;
142 }
143
144 $names[$row->usr_id] = $pres;
145 $data[$row->usr_id] = $d;
146 }
147
148 foreach ($a_user_id as $id) {
149 if (!$names[$id]) {
150 $names[$id] = $lng->txt('usr_name_undisclosed');
151 }
152 }
153
154 if ($a_return_data_array) {
155 if ($return_as_array) {
156 return $data;
157 } else {
158 return current($data);
159 }
160 }
161 return $return_as_array ? $names : $names[$a_user_id[0]];
162 }
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
global $ilDB

References $d, $data, $id, $ilCtrl, $ilDB, $img, $lng, $names, $row, and $title.

Referenced by ilSurveyAppraiseesTableGUI\__construct(), ilMStShowUserGUI\__construct(), 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(), ilExSubmissionTeamGUI\createTeamObject(), ilExerciseManagementGUI\createTeamsFromGroupsObject(), ilContSkillAdminGUI\deassignCompetencesConfirm(), ilPageObjectGUI\edit(), ilExerciseManagementGUI\executeCommand(), ilSharedResourceGUI\executeCommand(), ilBookingReservationsTableGUI\fillRow(), ilExAssignmentListTextTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilWikiRecentChangesTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilHistoryTableGUI\fillRow(), ilUsersOnlineBlockGUI\fillRow(), ilUserForTagTableGUI\fillRow(), ilExcDeliveredFilesTableGUI\fillRow(), ilWorkspaceShareTableGUI\fillRow(), ilAwarenessData\getData(), ilOnScreenChatUserDataProvider\getDataByUserIds(), ilContributorTableGUI\getItems(), ilExAssignmentPeerReviewTableGUI\getItems(), ilExAssignmentTeamTableGUI\getItems(), ilGlossaryPresentationGUI\getLinkXML(), ilLMPageObjectGUI\getLinkXML(), ilLMPresentationGUI\getLinkXML(), ilNoteGUI\getNoteListHTML(), ilAwarenessData\getOnlineUserData(), ilExSubmissionTeamGUI\getOverviewContent(), ilWikiPagesTableGUI\getPages(), ilAbstractUsersGalleryCollectionProvider\getPopulatedGroup(), ilDclBaseRecordModel\getStandardFieldHTML(), ilAppointmentPresentationGUI\getUserName(), ilChatroomViewGUI\getUserProfileImages(), ilInternalLinkGUI\getUserSearchResult(), ilBlogPosting\handleNews(), ilWorkspaceAccessTableGUI\importData(), ilObjSurveyGUI\infoScreen(), ilObjFileGUI\infoScreenForward(), ilLearningProgressBaseGUI\initEditUserForm(), ilSurveyParticipantsGUI\initExternalRaterForm(), ilCalendarCategoryGUI\initFormCategory(), ilExerciseManagementGUI\initGroupForm(), ilExPeerReviewGUI\initPeerReviewItemForm(), ilSurveyExecutionGUI\outSurveyPage(), ilExAssignmentListTextTableGUI\parse(), ilConsultationHourBookingTableGUI\parse(), ilCronManagerTableGUI\parseJobToData(), ilBuddySystemRelationsTableGUI\populate(), ilBlogPostingGUI\postOutputProcessing(), ilWikiPageGUI\preview(), ilContSkillAdminGUI\publishAssignments(), ilNewsTimelineItemGUI\render(), ilExPeerReviewGUI\renderInfoWidget(), ilObjBlogGUI\renderList(), ilObjBlogGUI\renderNavigationByAuthors(), ilPublicUserProfileGUI\renderTitle(), ilLMMailNotification\send(), ilBuddySystemNotification\send(), ilObjSurvey\send360ReminderToUser(), ilWikiUtil\sendNotification(), ilObjSurvey\sendNotificationMail(), ilNote\sendNotifications(), ilObjSurvey\sendRaterNotification(), ilPageObjectGUI\setDefaultLinkXml(), ilChatroomBanGUI\show(), ilMailingListsGUI\showMembersList(), ilPageObjectGUI\showPage(), ilExAssignmentPeerReviewOverviewTableGUI\translateUserIds(), and ilPageObject\update().

+ Here is the caller graph for this function:

◆ getPersonalStartingObject()

static ilUserUtil::getPersonalStartingObject ( )
static

Get ref id of personal starting object.

Returns
int

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

512 {
513 global $ilUser;
514
515 $ref_id = $ilUser->getPref("usr_starting_point_ref_id");
516 if (!$ref_id) {
517 $ref_id = self::getStartingObject();
518 }
519 return $ref_id;
520 }
static getStartingObject()
Get ref id of starting object.
$ilUser
Definition: imgupload.php:18

References $ilUser, and getStartingObject().

Referenced by getStartingPointAsUrl(), and ilPersonalSettingsGUI\initGeneralSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalStartingPoint()

static ilUserUtil::getPersonalStartingPoint ( )
static

Get current personal starting point.

Returns
int

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

459 {
460 global $ilUser;
461
462 $valid = array_keys(self::getPossibleStartingPoints());
463 $current = $ilUser->getPref("usr_starting_point");
464 if ($current == self::START_REPOSITORY_OBJ) {
465 return $current;
466 } elseif (!$current || !in_array($current, $valid)) {
467 return self::getStartingPoint();
468 }
469 return $current;
470 }
static getStartingPoint()
Get current starting point setting.
$valid

References $current, $ilUser, $valid, and getStartingPoint().

Referenced by getStartingPointAsUrl(), and ilPersonalSettingsGUI\initGeneralSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleStartingPoints()

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

Get all valid starting points.

Returns
array

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

213 {
214 global $ilSetting, $lng;
215
216 // for all conditions: see ilMainMenuGUI
217
218 $all = array();
219
220 $all[self::START_PD_OVERVIEW] = 'overview';
221
222 if ($a_force_all || ($ilSetting->get('disable_my_offers') == 0 &&
223 $ilSetting->get('disable_my_memberships') == 0)) {
224 $all[self::START_PD_SUBSCRIPTION] = 'my_courses_groups';
225 }
226
227 if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToMyStaff()) {
228 $all[self::START_PD_MYSTAFF] = 'my_staff';
229 }
230
231 if ($a_force_all || !$ilSetting->get("disable_personal_workspace")) {
232 $all[self::START_PD_WORKSPACE] = 'personal_workspace';
233 }
234
235 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
237 if ($a_force_all || $settings->isEnabled()) {
238 $all[self::START_PD_CALENDAR] = 'calendar';
239 }
240
241 $all[self::START_REPOSITORY] = 'repository';
242
243 foreach ($all as $idx => $lang) {
244 $all[$idx] = $lng->txt($lang);
245 }
246
247 return $all;
248 }
static _getInstance()
get singleton instance
const START_PD_MYSTAFF
const START_REPOSITORY
const START_PD_WORKSPACE
const START_PD_CALENDAR
const START_PD_OVERVIEW
const START_PD_SUBSCRIPTION
$lang
Definition: consent.php:3
global $ilSetting
Definition: privfeed.php:17

References $ilSetting, $lang, $lng, ilCalendarSettings\_getInstance(), ilMyStaffAccess\getInstance(), START_PD_CALENDAR, START_PD_MYSTAFF, START_PD_OVERVIEW, START_PD_SUBSCRIPTION, START_PD_WORKSPACE, and START_REPOSITORY.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfileLink()

static ilUserUtil::getProfileLink (   $a_usr_id)
static

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

Parameters
type$a_usr_id
Returns
string

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

192 {
193 $public_profile = ilObjUser::_lookupPref($a_usr_id, 'public_profile');
194 if ($public_profile != 'y' and $public_profile != 'g') {
195 return '';
196 }
197
198 $GLOBALS['ilCtrl']->setParameterByClass('ilpublicuserprofilegui', 'user', $a_usr_id);
199 return $GLOBALS['ilCtrl']->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML');
200 }
static _lookupPref($a_usr_id, $a_keyword)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, and ilObjUser\_lookupPref().

+ Here is the call graph for this function:

◆ getStartingObject()

static ilUserUtil::getStartingObject ( )
static

Get ref id of starting object.

Returns
int

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

411 {
412 global $ilSetting;
413
414 return $ilSetting->get("usr_starting_point_ref_id");
415 }

References $ilSetting.

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

+ Here is the caller graph for this function:

◆ getStartingPoint()

static ilUserUtil::getStartingPoint ( )
static

Get current starting point setting.

Returns
int

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

284 {
285 global $ilSetting, $ilUser;
286
287 $valid = array_keys(self::getPossibleStartingPoints());
288 $current = $ilSetting->get("usr_starting_point");
289 if ($current == self::START_REPOSITORY_OBJ) {
290 return $current;
291 } elseif (!$current || !in_array($current, $valid)) {
293
294 // #10715 - if 1 is disabled overview will display the current default
295 if ($ilSetting->get('disable_my_offers') == 0 &&
296 $ilSetting->get('disable_my_memberships') == 0 &&
297 $ilSetting->get('personal_items_default_view') == 1) {
299 }
300
302 }
303 if ($ilUser->getId() == ANONYMOUS_USER_ID ||
304 !$ilUser->getId()) { // #18531
306 }
307 return $current;
308 }
static setStartingPoint($a_value, $a_ref_id=null)
Set starting point setting.

References $current, $ilSetting, $ilUser, $valid, setStartingPoint(), START_PD_OVERVIEW, START_PD_SUBSCRIPTION, and START_REPOSITORY.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartingPointAsUrl()

static ilUserUtil::getStartingPointAsUrl ( )
static

Get current starting point setting as URL.

Returns
string

self::START_PD_LP => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP',

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

316 {
317 global $tree, $ilUser, $rbacreview;
318
319 $ref_id = 1;
320 $by_default = true;
321
322 //configuration by user preference
323 #21782
324 if (self::hasPersonalStartingPoint() && $ilUser->getPref('usr_starting_point') != null) {
326 if ($current == self::START_REPOSITORY_OBJ) {
328 }
329 } else {
330 include_once './Services/AccessControl/classes/class.ilStartingPoint.php';
331
333 //getting all roles with starting points and store them in array
335
336 $roles_ids = array_keys($roles);
337
338 $gr = array();
339 foreach ($rbacreview->getGlobalRoles() as $role_id) {
340 if ($rbacreview->isAssigned($ilUser->getId(), $role_id)) {
341 if (in_array($role_id, $roles_ids)) {
342 $gr[$roles[$role_id]['position']] = array(
343 "point" => $roles[$role_id]['starting_point'],
344 "object" => $roles[$role_id]['starting_object']
345 );
346 }
347 }
348 }
349 if (!empty($gr)) {
350 krsort($gr); // ak: if we use array_pop (last element) we need to reverse sort, since we want the one with the smallest number
351 $role_point = array_pop($gr);
352 $current = $role_point['point'];
353 $ref_id = $role_point['object'];
354 $by_default = false;
355 }
356 }
357 if ($by_default) {
359
360 if ($current == self::START_REPOSITORY_OBJ) {
361 $ref_id = self::getStartingObject();
362 }
363 }
364 }
365
366 switch ($current) {
368 $ref_id = $tree->readRootId();
369
370 // no break
372 if ($ref_id &&
373 ilObject::_lookupObjId($ref_id) &&
374 !$tree->isDeleted($ref_id)) {
375 include_once('./Services/Link/classes/class.ilLink.php');
376 return ilLink::_getStaticLink($ref_id, '', true);
377 }
378 // invalid starting object, overview is fallback
380 // fallthrough
381
382 // no break
383 default:
384 $map = array(
385 self::START_PD_OVERVIEW => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems',
386 self::START_PD_SUBSCRIPTION => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships',
387 // self::START_PD_BOOKMARKS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks',
388 // self::START_PD_NOTES => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNotes',
389 // self::START_PD_NEWS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews',
390 self::START_PD_WORKSPACE => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace',
391 // self::START_PD_PORTFOLIO => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio',
392 // self::START_PD_SKILLS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills',
394 self::START_PD_CALENDAR => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar',
395 // self::START_PD_MAIL => 'ilias.php?baseClass=ilMailGUI',
396 // self::START_PD_CONTACTS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts',
397 // self::START_PD_PROFILE => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile',
398 // self::START_PD_SETTINGS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings'
399 self::START_PD_MYSTAFF => 'ilias.php?baseClass=' . ilPersonalDesktopGUI::class . '&cmd=' . ilPersonalDesktopGUI::CMD_JUMP_TO_MY_STAFF
400 );
401 return $map[$current];
402 }
403 }
static _lookupObjId($a_id)
static getRolesWithStartingPoint()
get array with all roles which have starting point defined.
static getPersonalStartingObject()
Get ref id of personal starting object.
static getPersonalStartingPoint()
Get current personal starting point.
const START_REPOSITORY_OBJ

References $current, $ilUser, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilPersonalDesktopGUI\CMD_JUMP_TO_MY_STAFF, getPersonalStartingObject(), getPersonalStartingPoint(), ilStartingPoint\getRolesWithStartingPoint(), getStartingObject(), getStartingPoint(), ilStartingPoint\ROLE_BASED, START_PD_OVERVIEW, START_REPOSITORY, and START_REPOSITORY_OBJ.

Referenced by ilMainMenuGUI\getHeaderURL().

+ 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?

Returns
bool

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

435 {
436 global $ilSetting;
437
438 return $ilSetting->get("usr_starting_point_personal");
439 }

References $ilSetting.

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

+ Here is the caller graph for this function:

◆ hasPersonalStartPointPref()

static ilUserUtil::hasPersonalStartPointPref ( )
static

Did user set any personal starting point (yet)?

Returns
bool

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

447 {
448 global $ilUser;
449
450 return (bool) $ilUser->getPref("usr_starting_point");
451 }

References $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

+ Here is the caller graph for this function:

◆ hasPublicProfile()

static ilUserUtil::hasPublicProfile (   $a_user_id)
static

Has public profile.

Parameters

return

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

171 {
172 global $ilDB;
173
174 $set = $ilDB->query(
175 "SELECT value FROM usr_pref " .
176 " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
177 " and keyword = " . $ilDB->quote("public_profile", "text")
178 );
179 $rec = $ilDB->fetchAssoc($set);
180
181 return in_array($rec["value"], array("y", "g"));
182 }

References $ilDB.

Referenced by ilGlossaryPresentationGUI\getLinkXML(), ilLMPageObjectGUI\getLinkXML(), ilLMPresentationGUI\getLinkXML(), and ilPageObjectGUI\setDefaultLinkXml().

+ Here is the caller graph for this function:

◆ setPersonalStartingPoint()

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

Set personal starting point setting.

Parameters
int$a_value
int$a_ref_id
Returns
boolean

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

480 {
481 global $ilUser, $tree;
482
483 if (!$a_value) {
484 $ilUser->setPref("usr_starting_point", null);
485 $ilUser->setPref("usr_starting_point_ref_id", null);
486 return;
487 }
488
489 if ($a_value == self::START_REPOSITORY_OBJ) {
490 $a_ref_id = (int) $a_ref_id;
491 if (ilObject::_lookupObjId($a_ref_id) &&
492 !$tree->isDeleted($a_ref_id)) {
493 $ilUser->setPref("usr_starting_point", $a_value);
494 $ilUser->setPref("usr_starting_point_ref_id", $a_ref_id);
495 return true;
496 }
497 }
498 $valid = array_keys(self::getPossibleStartingPoints());
499 if (in_array($a_value, $valid)) {
500 $ilUser->setPref("usr_starting_point", $a_value);
501 return true;
502 }
503 return false;
504 }

References $ilUser, $valid, and ilObject\_lookupObjId().

Referenced by ilPersonalSettingsGUI\saveGeneralSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStartingPoint()

static ilUserUtil::setStartingPoint (   $a_value,
  $a_ref_id = null 
)
static

Set starting point setting.

Parameters
int$a_value
int$a_ref_id
Returns
boolean

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

258 {
259 global $ilSetting, $tree;
260
261 if ($a_value == self::START_REPOSITORY_OBJ) {
262 $a_ref_id = (int) $a_ref_id;
263 if (ilObject::_lookupObjId($a_ref_id) &&
264 !$tree->isDeleted($a_ref_id)) {
265 $ilSetting->set("usr_starting_point", $a_value);
266 $ilSetting->set("usr_starting_point_ref_id", $a_ref_id);
267 return true;
268 }
269 }
270 $valid = array_keys(self::getPossibleStartingPoints());
271 if (in_array($a_value, $valid)) {
272 $ilSetting->set("usr_starting_point", $a_value);
273 return true;
274 }
275 return false;
276 }

References $ilSetting, $valid, and ilObject\_lookupObjId().

Referenced by getStartingPoint(), and ilUserStartingPointGUI\saveStartingPoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ togglePersonalStartingPoint()

static ilUserUtil::togglePersonalStartingPoint (   $a_value)
static

Toggle personal starting point setting.

Parameters
bool$a_value

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

423 {
424 global $ilSetting;
425
426 $ilSetting->set("usr_starting_point_personal", (bool) $a_value);
427 }

References $ilSetting.

Referenced by ilUserStartingPointGUI\saveUserStartingPoint().

+ Here is the caller graph for this function:

Field Documentation

◆ START_PD_BOOKMARKS

const ilUserUtil::START_PD_BOOKMARKS = 3

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

◆ START_PD_CALENDAR

const ilUserUtil::START_PD_CALENDAR = 10

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

Referenced by getPossibleStartingPoints().

◆ START_PD_CONTACTS

const ilUserUtil::START_PD_CONTACTS = 12

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

◆ START_PD_LP

const ilUserUtil::START_PD_LP = 9

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

◆ START_PD_MAIL

const ilUserUtil::START_PD_MAIL = 11

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

◆ START_PD_MYSTAFF

const ilUserUtil::START_PD_MYSTAFF = 17

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

Referenced by getPossibleStartingPoints().

◆ START_PD_NEWS

const ilUserUtil::START_PD_NEWS = 5

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

◆ START_PD_NOTES

const ilUserUtil::START_PD_NOTES = 4

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

◆ START_PD_OVERVIEW

const ilUserUtil::START_PD_OVERVIEW = 1

◆ START_PD_PORTFOLIO

const ilUserUtil::START_PD_PORTFOLIO = 7

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

◆ START_PD_PROFILE

const ilUserUtil::START_PD_PROFILE = 13

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

◆ START_PD_SETTINGS

const ilUserUtil::START_PD_SETTINGS = 14

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

◆ START_PD_SKILLS

const ilUserUtil::START_PD_SKILLS = 8

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

◆ START_PD_SUBSCRIPTION

const ilUserUtil::START_PD_SUBSCRIPTION = 2

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

Referenced by getPossibleStartingPoints(), and getStartingPoint().

◆ START_PD_WORKSPACE

const ilUserUtil::START_PD_WORKSPACE = 6

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

Referenced by getPossibleStartingPoints().

◆ START_REPOSITORY

const ilUserUtil::START_REPOSITORY = 15

◆ START_REPOSITORY_OBJ


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