ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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

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

References $DIC, and $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

544  {
545  global $DIC;
546 
547  $ilUser = $DIC['ilUser'];
548 
549  $ref_id = $ilUser->getPref("usr_starting_point_ref_id");
550  if (!$ref_id) {
551  $ref_id = self::getStartingObject();
552  }
553  return $ref_id;
554  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ getPersonalStartingPoint()

static ilUserUtil::getPersonalStartingPoint ( )
static

Get current personal starting point.

Returns
int

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

References $current, $DIC, $ilUser, and $valid.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

486  {
487  global $DIC;
488 
489  $ilUser = $DIC['ilUser'];
490 
491  $valid = array_keys(self::getPossibleStartingPoints());
492  $current = $ilUser->getPref("usr_starting_point");
493  if ($current == self::START_REPOSITORY_OBJ) {
494  return $current;
495  } elseif (!$current || !in_array($current, $valid)) {
496  return self::getStartingPoint();
497  }
498  return $current;
499  }
global $DIC
Definition: saml.php:7
$valid
$ilUser
Definition: imgupload.php:18
+ 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 218 of file class.ilUserUtil.php.

References $DIC, $ilSetting, $lang, $lng, ilCalendarSettings\_getInstance(), and ilMyStaffAccess\getInstance().

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

219  {
220  global $DIC;
221 
222  $ilSetting = $DIC['ilSetting'];
223  $lng = $DIC['lng'];
224 
225  // for all conditions: see ilMainMenuGUI
226 
227  $all = array();
228 
229  $all[self::START_PD_OVERVIEW] = 'overview';
230 
231  if ($a_force_all || ($ilSetting->get('disable_my_offers') == 0 &&
232  $ilSetting->get('disable_my_memberships') == 0)) {
233  $all[self::START_PD_SUBSCRIPTION] = 'my_courses_groups';
234  }
235 
236  if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToMyStaff()) {
237  $all[self::START_PD_MYSTAFF] = 'my_staff';
238  }
239 
240  if ($a_force_all || !$ilSetting->get("disable_personal_workspace")) {
241  $all[self::START_PD_WORKSPACE] = 'personal_workspace';
242  }
243 
244  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
245  $settings = ilCalendarSettings::_getInstance();
246  if ($a_force_all || $settings->isEnabled()) {
247  $all[self::START_PD_CALENDAR] = 'calendar';
248  }
249 
250  $all[self::START_REPOSITORY] = 'repository';
251 
252  foreach ($all as $idx => $lang) {
253  $all[$idx] = $lng->txt($lang);
254  }
255 
256  return $all;
257  }
static _getInstance()
get singleton instance
global $DIC
Definition: saml.php:7
$lng
global $ilSetting
Definition: privfeed.php:17
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
+ 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 197 of file class.ilUserUtil.php.

References $GLOBALS, and ilObjUser\_lookupPref().

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

198  {
199  $public_profile = ilObjUser::_lookupPref($a_usr_id, 'public_profile');
200  if ($public_profile != 'y' and $public_profile != 'g') {
201  return '';
202  }
203 
204  $GLOBALS['DIC']['ilCtrl']->setParameterByClass('ilpublicuserprofilegui', 'user', $a_usr_id);
205  return $GLOBALS['DIC']['ilCtrl']->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML');
206  }
static _lookupPref($a_usr_id, $a_keyword)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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.

Returns
int

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

References $DIC, and $ilSetting.

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

430  {
431  global $DIC;
432 
433  $ilSetting = $DIC['ilSetting'];
434 
435  return $ilSetting->get("usr_starting_point_ref_id");
436  }
global $DIC
Definition: saml.php:7
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getStartingPoint()

static ilUserUtil::getStartingPoint ( )
static

Get current starting point setting.

Returns
int

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

References $current, $DIC, $ilSetting, $ilUser, and $valid.

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

296  {
297  global $DIC;
298 
299  $ilSetting = $DIC['ilSetting'];
300  $ilUser = $DIC['ilUser'];
301 
302  $valid = array_keys(self::getPossibleStartingPoints());
303  $current = $ilSetting->get("usr_starting_point");
304  if ($current == self::START_REPOSITORY_OBJ) {
305  return $current;
306  } elseif (!$current || !in_array($current, $valid)) {
307  $current = self::START_PD_OVERVIEW;
308 
309  // #10715 - if 1 is disabled overview will display the current default
310  if ($ilSetting->get('disable_my_offers') == 0 &&
311  $ilSetting->get('disable_my_memberships') == 0 &&
312  $ilSetting->get('personal_items_default_view') == 1) {
313  $current = self::START_PD_SUBSCRIPTION;
314  }
315 
316  self::setStartingPoint($current);
317  }
318  if ($ilUser->getId() == ANONYMOUS_USER_ID ||
319  !$ilUser->getId()) { // #18531
320  $current = self::START_REPOSITORY;
321  }
322  return $current;
323  }
global $DIC
Definition: saml.php:7
$valid
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
+ 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 330 of file class.ilUserUtil.php.

References $current, $DIC, $ilUser, $map, $tree, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilPersonalDesktopGUI\CMD_JUMP_TO_MY_STAFF, ilStartingPoint\getRolesWithStartingPoint(), and ilStartingPoint\ROLE_BASED.

Referenced by ilMainMenuGUI\getHeaderURL(), and ilInitialisation\redirect().

331  {
332  global $DIC;
333 
334  $tree = $DIC['tree'];
335  $ilUser = $DIC['ilUser'];
336  $rbacreview = $DIC['rbacreview'];
337 
338  $ref_id = 1;
339  $by_default = true;
340 
341  //configuration by user preference
342  #21782
343  if (self::hasPersonalStartingPoint() && $ilUser->getPref('usr_starting_point') != null) {
344  $current = self::getPersonalStartingPoint();
345  if ($current == self::START_REPOSITORY_OBJ) {
346  $ref_id = self::getPersonalStartingObject();
347  }
348  } else {
349  include_once './Services/AccessControl/classes/class.ilStartingPoint.php';
350 
352  //getting all roles with starting points and store them in array
354 
355  $roles_ids = array_keys($roles);
356 
357  $gr = array();
358  foreach ($rbacreview->getGlobalRoles() as $role_id) {
359  if ($rbacreview->isAssigned($ilUser->getId(), $role_id)) {
360  if (in_array($role_id, $roles_ids)) {
361  $gr[$roles[$role_id]['position']] = array(
362  "point" => $roles[$role_id]['starting_point'],
363  "object" => $roles[$role_id]['starting_object']
364  );
365  }
366  }
367  }
368  if (!empty($gr)) {
369  krsort($gr); // ak: if we use array_pop (last element) we need to reverse sort, since we want the one with the smallest number
370  $role_point = array_pop($gr);
371  $current = $role_point['point'];
372  $ref_id = $role_point['object'];
373  $by_default = false;
374  }
375  }
376  if ($by_default) {
377  $current = self::getStartingPoint();
378 
379  if ($current == self::START_REPOSITORY_OBJ) {
380  $ref_id = self::getStartingObject();
381  }
382  }
383  }
384 
385  switch ($current) {
386  case self::START_REPOSITORY:
387  $ref_id = $tree->readRootId();
388 
389  // no break
390  case self::START_REPOSITORY_OBJ:
391  if ($ref_id &&
392  ilObject::_lookupObjId($ref_id) &&
393  !$tree->isDeleted($ref_id)) {
394  include_once('./Services/Link/classes/class.ilLink.php');
395  return ilLink::_getStaticLink($ref_id, '', true);
396  }
397  // invalid starting object, overview is fallback
398  $current = self::START_PD_OVERVIEW;
399  // fallthrough
400 
401  // no break
402  default:
403  $map = array(
404  self::START_PD_OVERVIEW => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems',
405  self::START_PD_SUBSCRIPTION => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships',
406  // self::START_PD_BOOKMARKS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks',
407  // self::START_PD_NOTES => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNotes',
408  // self::START_PD_NEWS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews',
409  self::START_PD_WORKSPACE => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace',
410  // self::START_PD_PORTFOLIO => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio',
411  // self::START_PD_SKILLS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills',
413  self::START_PD_CALENDAR => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar',
414  // self::START_PD_MAIL => 'ilias.php?baseClass=ilMailGUI',
415  // self::START_PD_CONTACTS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts',
416  // self::START_PD_PROFILE => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile',
417  // self::START_PD_SETTINGS => 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings'
418  self::START_PD_MYSTAFF => 'ilias.php?baseClass=' . ilPersonalDesktopGUI::class . '&cmd=' . ilPersonalDesktopGUI::CMD_JUMP_TO_MY_STAFF
419  );
420  return $map[$current];
421  }
422  }
global $DIC
Definition: saml.php:7
static getRolesWithStartingPoint()
get array with all roles which have starting point defined.
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
+ 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 457 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

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

458  {
459  global $DIC;
460 
461  $ilSetting = $DIC['ilSetting'];
462 
463  return $ilSetting->get("usr_starting_point_personal");
464  }
global $DIC
Definition: saml.php:7
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)?

Returns
bool

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

References $DIC, and $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

472  {
473  global $DIC;
474 
475  $ilUser = $DIC['ilUser'];
476 
477  return (bool) $ilUser->getPref("usr_starting_point");
478  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ hasPublicProfile()

static ilUserUtil::hasPublicProfile (   $a_user_id)
static

Has public profile.

Parameters

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

References $DIC, and $ilDB.

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

175  {
176  global $DIC;
177 
178  $ilDB = $DIC['ilDB'];
179 
180  $set = $ilDB->query(
181  "SELECT value FROM usr_pref " .
182  " WHERE usr_id = " . $ilDB->quote($a_user_id, "integer") .
183  " and keyword = " . $ilDB->quote("public_profile", "text")
184  );
185  $rec = $ilDB->fetchAssoc($set);
186 
187  return in_array($rec["value"], array("y", "g"));
188  }
global $DIC
Definition: saml.php:7
global $ilDB
+ 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 508 of file class.ilUserUtil.php.

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

Referenced by ilPersonalSettingsGUI\saveGeneralSettings().

509  {
510  global $DIC;
511 
512  $ilUser = $DIC['ilUser'];
513  $tree = $DIC['tree'];
514 
515  if (!$a_value) {
516  $ilUser->setPref("usr_starting_point", null);
517  $ilUser->setPref("usr_starting_point_ref_id", null);
518  return;
519  }
520 
521  if ($a_value == self::START_REPOSITORY_OBJ) {
522  $a_ref_id = (int) $a_ref_id;
523  if (ilObject::_lookupObjId($a_ref_id) &&
524  !$tree->isDeleted($a_ref_id)) {
525  $ilUser->setPref("usr_starting_point", $a_value);
526  $ilUser->setPref("usr_starting_point_ref_id", $a_ref_id);
527  return true;
528  }
529  }
530  $valid = array_keys(self::getPossibleStartingPoints());
531  if (in_array($a_value, $valid)) {
532  $ilUser->setPref("usr_starting_point", $a_value);
533  return true;
534  }
535  return false;
536  }
global $DIC
Definition: saml.php:7
$valid
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
+ 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 266 of file class.ilUserUtil.php.

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

Referenced by ilUserStartingPointGUI\saveStartingPoint().

267  {
268  global $DIC;
269 
270  $ilSetting = $DIC['ilSetting'];
271  $tree = $DIC['tree'];
272 
273  if ($a_value == self::START_REPOSITORY_OBJ) {
274  $a_ref_id = (int) $a_ref_id;
275  if (ilObject::_lookupObjId($a_ref_id) &&
276  !$tree->isDeleted($a_ref_id)) {
277  $ilSetting->set("usr_starting_point", $a_value);
278  $ilSetting->set("usr_starting_point_ref_id", $a_ref_id);
279  return true;
280  }
281  }
282  $valid = array_keys(self::getPossibleStartingPoints());
283  if (in_array($a_value, $valid)) {
284  $ilSetting->set("usr_starting_point", $a_value);
285  return true;
286  }
287  return false;
288  }
global $DIC
Definition: saml.php:7
$valid
static _lookupObjId($a_id)
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 (   $a_value)
static

Toggle personal starting point setting.

Parameters
bool$a_value

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

References $DIC, and $ilSetting.

Referenced by ilUserStartingPointGUI\saveUserStartingPoint().

444  {
445  global $DIC;
446 
447  $ilSetting = $DIC['ilSetting'];
448 
449  $ilSetting->set("usr_starting_point_personal", (bool) $a_value);
450  }
global $DIC
Definition: saml.php:7
global $ilSetting
Definition: privfeed.php:17
+ 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.

◆ 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.

◆ 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

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

◆ 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.

◆ START_PD_WORKSPACE

const ilUserUtil::START_PD_WORKSPACE = 6

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

◆ START_REPOSITORY

const ilUserUtil::START_REPOSITORY = 15

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

◆ START_REPOSITORY_OBJ


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