45 $a_user_image =
false,
46 $a_profile_link =
false,
47 $a_profile_back_link =
"",
48 $a_force_first_lastname =
false,
49 $a_omit_login =
false,
51 $a_return_data_array =
false,
52 $a_ctrl_path =
"ilpublicuserprofilegui" 56 if (!is_array($a_ctrl_path)) {
57 $a_ctrl_path =
array($a_ctrl_path);
60 if (!($return_as_array = is_array($a_user_id))) {
61 $a_user_id =
array($a_user_id);
70 b.value public_profile, 76 (a.usr_id = b.usr_id AND 80 (a.usr_id = c.usr_id AND 82 WHERE ' . $ilDB->in(
'a.usr_id', $a_user_id,
false,
'integer');
84 $userrow = $ilDB->queryF($sql,
array(
'text',
'text'),
array(
'public_profile',
'public_title'));
89 while (
$row = $ilDB->fetchObject($userrow)) {
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) {
96 if (
$row->public_title ==
"y" &&
$row->title) {
101 $pres =
$row->lastname;
102 if (strlen(
$row->firstname)) {
103 $pres .= (
', ' .
$row->firstname .
' ');
107 if (strlen(
$row->firstname)) {
108 $pres .=
$row->firstname .
' ';
110 $pres .= (
$row->lastname .
' ');
112 $d[
"firstname"] =
$row->firstname;
113 $d[
"lastname"] =
$row->lastname;
115 $d[
"login"] =
$row->login;
116 $d[
"public_profile"] = $has_public_profile;
119 if (!$a_omit_login) {
120 $pres.=
"[" .
$row->login .
"]";
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(
129 rawurlencode($a_profile_back_link)
132 $link = $ilCtrl->getLinkTargetByClass($a_ctrl_path,
"getHTML");
133 $pres =
'<a href="' . $link .
'">' . $pres .
'</a>';
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;
148 foreach ($a_user_id as
$id) {
150 $names[
$id] = $lng->txt(
'usr_name_undisclosed');
154 if ($a_return_data_array) {
155 if ($return_as_array) {
158 return current(
$data);
161 return $return_as_array ?
$names :
$names[$a_user_id[0]];
175 "SELECT value FROM usr_pref " .
176 " WHERE usr_id = " . $ilDB->quote($a_user_id,
"integer") .
177 " and keyword = " . $ilDB->quote(
"public_profile",
"text")
179 $rec = $ilDB->fetchAssoc($set);
181 return in_array($rec[
"value"],
array(
"y",
"g"));
194 if ($public_profile !=
'y' and $public_profile !=
'g') {
198 $GLOBALS[
'ilCtrl']->setParameterByClass(
'ilpublicuserprofilegui',
'user', $a_usr_id);
199 return $GLOBALS[
'ilCtrl']->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
220 $all[self::START_PD_OVERVIEW] =
'overview';
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';
228 $all[self::START_PD_MYSTAFF] =
'my_staff';
231 if ($a_force_all || !$ilSetting->get(
"disable_personal_workspace")) {
232 $all[self::START_PD_WORKSPACE] =
'personal_workspace';
235 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
237 if ($a_force_all || $settings->isEnabled()) {
238 $all[self::START_PD_CALENDAR] =
'calendar';
241 $all[self::START_REPOSITORY] =
'repository';
243 foreach ($all as $idx =>
$lang) {
244 $all[$idx] = $lng->txt(
$lang);
261 if ($a_value == self::START_REPOSITORY_OBJ) {
262 $a_ref_id = (int) $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);
270 $valid = array_keys(self::getPossibleStartingPoints());
271 if (in_array($a_value,
$valid)) {
272 $ilSetting->set(
"usr_starting_point", $a_value);
287 $valid = array_keys(self::getPossibleStartingPoints());
288 $current = $ilSetting->get(
"usr_starting_point");
289 if (
$current == self::START_REPOSITORY_OBJ) {
295 if ($ilSetting->get(
'disable_my_offers') == 0 &&
296 $ilSetting->get(
'disable_my_memberships') == 0 &&
297 $ilSetting->get(
'personal_items_default_view') == 1) {
298 $current = self::START_PD_SUBSCRIPTION;
303 if ($ilUser->getId() == ANONYMOUS_USER_ID ||
317 global $tree,
$ilUser, $rbacreview;
324 if (self::hasPersonalStartingPoint() && $ilUser->getPref(
'usr_starting_point') != null) {
325 $current = self::getPersonalStartingPoint();
326 if (
$current == self::START_REPOSITORY_OBJ) {
327 $ref_id = self::getPersonalStartingObject();
330 include_once
'./Services/AccessControl/classes/class.ilStartingPoint.php';
336 $roles_ids = array_keys($roles);
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']
351 $role_point = array_pop($gr);
353 $ref_id = $role_point[
'object'];
358 $current = self::getStartingPoint();
360 if (
$current == self::START_REPOSITORY_OBJ) {
361 $ref_id = self::getStartingObject();
367 case self::START_REPOSITORY:
368 $ref_id = $tree->readRootId();
371 case self::START_REPOSITORY_OBJ:
374 !$tree->isDeleted($ref_id)) {
375 include_once(
'./Services/Link/classes/class.ilLink.php');
385 self::START_PD_OVERVIEW =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems',
386 self::START_PD_SUBSCRIPTION =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships',
390 self::START_PD_WORKSPACE =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace',
394 self::START_PD_CALENDAR =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar',
414 return $ilSetting->get(
"usr_starting_point_ref_id");
426 $ilSetting->set(
"usr_starting_point_personal", (
bool) $a_value);
438 return $ilSetting->get(
"usr_starting_point_personal");
450 return (
bool) $ilUser->getPref(
"usr_starting_point");
462 $valid = array_keys(self::getPossibleStartingPoints());
463 $current = $ilUser->getPref(
"usr_starting_point");
464 if (
$current == self::START_REPOSITORY_OBJ) {
467 return self::getStartingPoint();
484 $ilUser->setPref(
"usr_starting_point", null);
485 $ilUser->setPref(
"usr_starting_point_ref_id", null);
489 if ($a_value == self::START_REPOSITORY_OBJ) {
490 $a_ref_id = (int) $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);
498 $valid = array_keys(self::getPossibleStartingPoints());
499 if (in_array($a_value,
$valid)) {
500 $ilUser->setPref(
"usr_starting_point", $a_value);
515 $ref_id = $ilUser->getPref(
"usr_starting_point_ref_id");
517 $ref_id = self::getStartingObject();
static _getInstance()
get singleton instance
static hasPersonalStartPointPref()
Did user set any personal starting point (yet)?
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getPersonalStartingPoint()
Get current personal starting point.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getRolesWithStartingPoint()
get array with all roles which have starting point defined.
static getStartingPoint()
Get current starting point setting.
static getStartingPointAsUrl()
Get current starting point setting as URL.
const CMD_JUMP_TO_MY_STAFF
static hasPersonalStartingPoint()
Can starting point be personalized?
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
static hasPublicProfile($a_user_id)
Has public profile.
static _lookupObjId($a_id)
static getStartingObject()
Get ref id of starting object.
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:
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
const START_PD_SUBSCRIPTION
const START_REPOSITORY_OBJ
static getPersonalStartingObject()
Get ref id of personal starting object.
static setStartingPoint($a_value, $a_ref_id=null)
Set starting point setting.
static togglePersonalStartingPoint($a_value)
Toggle personal starting point setting.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static setPersonalStartingPoint($a_value, $a_ref_id=null)
Set personal starting point setting.
static getProfileLink($a_usr_id)
Get link to personal profile Return empty string in case of not public profile.