ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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, $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_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 14 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 44 of file class.ilUserUtil.php.

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

Referenced by ilSurveyAppraiseesTableGUI\__construct(), ilMStShowUserGUI\__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(), ilSkillProfileGUI\confirmUserRemoval(), ilExSubmissionTeamGUI\createTeamObject(), ilExerciseManagementGUI\createTeamsFromGroupsObject(), ilContSkillAdminGUI\deassignCompetencesConfirm(), ilObjDataCollection\doUpdate(), ilPageObjectGUI\edit(), ilSharedResourceGUI\executeCommand(), ilExerciseManagementGUI\executeCommand(), ilUserForTagTableGUI\fillRow(), ilExcDeliveredFilesTableGUI\fillRow(), ilHistoryTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilWikiRecentChangesTableGUI\fillRow(), ilExAssignmentListTextTableGUI\fillRow(), ilWikiPagesTableGUI\fillRow(), ilWorkspaceShareTableGUI\fillRow(), ilBookingReservationsTableGUI\fillRow(), ilSkillProfile\getAssignedUsers(), ilAwarenessData\getData(), ILIAS\OnScreenChat\Repository\Subscriber\getDataByUserIds(), ilPublicUserProfileGUI\getEmbeddable(), ilContributorTableGUI\getItems(), ilExAssignmentPeerReviewTableGUI\getItems(), ilExAssignmentTeamTableGUI\getItems(), ilPageLinker\getLinkXML(), ilLMPageObjectGUI\getLinkXML(), ilLMPresentationLinker\getLinkXML(), ilLearningModuleNotification\getMailBody(), ilNoteGUI\getNoteListHTML(), ilAwarenessData\getOnlineUserData(), ilExSubmissionTeamGUI\getOverviewContent(), ilWikiPagesTableGUI\getPages(), ilAbstractUsersGalleryCollectionProvider\getPopulatedGroup(), ilDclBaseRecordModel\getStandardFieldHTML(), ilAppointmentPresentationGUI\getUserName(), ilMailUserHelper\getUsernameMapForIds(), ilInternalLinkGUI\getUserSearchResult(), ilBlogPosting\handleNews(), ilWorkspaceAccessTableGUI\importData(), ilObjSurveyGUI\infoScreen(), ilObjFileGUI\infoScreenForward(), ilLearningProgressBaseGUI\initEditUserForm(), ilSurveyParticipantsGUI\initExternalRaterForm(), ilCalendarCategoryGUI\initFormCategory(), ilExerciseManagementGUI\initGroupForm(), ilExPeerReviewGUI\initPeerReviewItemForm(), ilBookingPreferencesGUI\listBookingResults(), 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(), ilChatroomBanGUI\show(), ilMailingListsGUI\showMembersList(), ilPageObjectGUI\showPage(), ilExAssignmentPeerReviewOverviewTableGUI\translateUserIds(), and ilPageObject\update().

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

Returns
int

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

References $DIC, and $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

535  {
536  global $DIC;
537 
538  $ilUser = $DIC['ilUser'];
539 
540  $ref_id = $ilUser->getPref("usr_starting_point_ref_id");
541  if (!$ref_id) {
542  $ref_id = self::getStartingObject();
543  }
544  return $ref_id;
545  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getPersonalStartingPoint()

static ilUserUtil::getPersonalStartingPoint ( )
static

Get current personal starting point.

Returns
int

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

References $DIC, $ilUser, and $valid.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

477  {
478  global $DIC;
479 
480  $ilUser = $DIC['ilUser'];
481 
482  $valid = array_keys(self::getPossibleStartingPoints());
483  $current = $ilUser->getPref("usr_starting_point");
484  if ($current == self::START_REPOSITORY_OBJ) {
485  return $current;
486  } elseif (!$current || !in_array($current, $valid)) {
487  return self::getStartingPoint();
488  }
489  return $current;
490  }
$valid
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ 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 219 of file class.ilUserUtil.php.

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

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

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

References $GLOBALS, and ilObjUser\_lookupPref().

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

199  {
200  $public_profile = ilObjUser::_lookupPref($a_usr_id, 'public_profile');
201  if ($public_profile != 'y' and $public_profile != 'g') {
202  return '';
203  }
204 
205  $GLOBALS['DIC']['ilCtrl']->setParameterByClass('ilpublicuserprofilegui', 'user', $a_usr_id);
206  return $GLOBALS['DIC']['ilCtrl']->getLinkTargetByClass('ilpublicuserprofilegui', 'getHTML');
207  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _lookupPref($a_usr_id, $a_keyword)
+ 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 420 of file class.ilUserUtil.php.

References $DIC, and $ilSetting.

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

421  {
422  global $DIC;
423 
424  $ilSetting = $DIC['ilSetting'];
425 
426  return $ilSetting->get("usr_starting_point_ref_id");
427  }
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ getStartingPoint()

static ilUserUtil::getStartingPoint ( )
static

Get current starting point setting.

Returns
int

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

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

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

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

◆ getStartingPointAsUrl()

static ilUserUtil::getStartingPointAsUrl ( )
static

Get current starting point setting as URL.

Returns
string

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

References $DIC, $ilUser, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilDashboardGUI\CMD_JUMP_TO_MY_STAFF, ilStartingPoint\getRolesWithStartingPoint(), and ilStartingPoint\ROLE_BASED.

Referenced by ilMainMenuGUI\getHeaderURL(), ILIAS\GlobalScreen\Scope\Layout\Provider\PagePart\StandardPagePartProvider\getStartingPointAsUrl(), and ilInitialisation\redirect().

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

References $DIC, and $ilSetting.

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

449  {
450  global $DIC;
451 
452  $ilSetting = $DIC['ilSetting'];
453 
454  return $ilSetting->get("usr_starting_point_personal");
455  }
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
+ 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 462 of file class.ilUserUtil.php.

References $DIC, and $ilUser.

Referenced by ilPersonalSettingsGUI\initGeneralSettingsForm().

463  {
464  global $DIC;
465 
466  $ilUser = $DIC['ilUser'];
467 
468  return (bool) $ilUser->getPref("usr_starting_point");
469  }
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ hasPublicProfile()

static ilUserUtil::hasPublicProfile (   $a_user_id)
static

Has public profile.

Parameters

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

References $DIC, and $ilDB.

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

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

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

Referenced by ilPersonalSettingsGUI\saveGeneralSettings().

500  {
501  global $DIC;
502 
503  $ilUser = $DIC['ilUser'];
504  $tree = $DIC['tree'];
505 
506  if (!$a_value) {
507  $ilUser->setPref("usr_starting_point", null);
508  $ilUser->setPref("usr_starting_point_ref_id", null);
509  return;
510  }
511 
512  if ($a_value == self::START_REPOSITORY_OBJ) {
513  $a_ref_id = (int) $a_ref_id;
514  if (ilObject::_lookupObjId($a_ref_id) &&
515  !$tree->isDeleted($a_ref_id)) {
516  $ilUser->setPref("usr_starting_point", $a_value);
517  $ilUser->setPref("usr_starting_point_ref_id", $a_ref_id);
518  return true;
519  }
520  }
521  $valid = array_keys(self::getPossibleStartingPoints());
522  if (in_array($a_value, $valid)) {
523  $ilUser->setPref("usr_starting_point", $a_value);
524  return true;
525  }
526  return false;
527  }
$valid
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46
+ 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 267 of file class.ilUserUtil.php.

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

Referenced by ilUserStartingPointGUI\saveStartingPoint().

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

References $DIC, and $ilSetting.

Referenced by ilUserStartingPointGUI\saveUserStartingPoint().

435  {
436  global $DIC;
437 
438  $ilSetting = $DIC['ilSetting'];
439 
440  $ilSetting->set("usr_starting_point_personal", (bool) $a_value);
441  }
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

Field Documentation

◆ START_PD_CALENDAR

const ilUserUtil::START_PD_CALENDAR = 10

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

◆ START_PD_CONTACTS

const ilUserUtil::START_PD_CONTACTS = 12

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

◆ START_PD_LP

const ilUserUtil::START_PD_LP = 9

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

◆ START_PD_MAIL

const ilUserUtil::START_PD_MAIL = 11

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

◆ START_PD_MYSTAFF

const ilUserUtil::START_PD_MYSTAFF = 17

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

◆ START_PD_NEWS

const ilUserUtil::START_PD_NEWS = 5

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

◆ START_PD_NOTES

const ilUserUtil::START_PD_NOTES = 4

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

◆ START_PD_OVERVIEW

const ilUserUtil::START_PD_OVERVIEW = 1

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

◆ START_PD_PORTFOLIO

const ilUserUtil::START_PD_PORTFOLIO = 7

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

◆ START_PD_PROFILE

const ilUserUtil::START_PD_PROFILE = 13

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

◆ START_PD_SETTINGS

const ilUserUtil::START_PD_SETTINGS = 14

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

◆ START_PD_SKILLS

const ilUserUtil::START_PD_SKILLS = 8

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

◆ START_PD_SUBSCRIPTION

const ilUserUtil::START_PD_SUBSCRIPTION = 2

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

◆ START_PD_WORKSPACE

const ilUserUtil::START_PD_WORKSPACE = 6

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

◆ START_REPOSITORY

const ilUserUtil::START_REPOSITORY = 15

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

◆ START_REPOSITORY_OBJ


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