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" 60 if (!is_array($a_ctrl_path)) {
61 $a_ctrl_path = array($a_ctrl_path);
64 if (!($return_as_array = is_array($a_user_id))) {
65 $a_user_id = array($a_user_id);
74 b.value public_profile, 80 (a.usr_id = b.usr_id AND 84 (a.usr_id = c.usr_id AND 86 WHERE ' .
$ilDB->in(
'a.usr_id', $a_user_id,
false,
'integer');
88 $userrow =
$ilDB->queryF($sql, array(
'text',
'text'), array(
'public_profile',
'public_title'));
93 while (
$row =
$ilDB->fetchObject($userrow)) {
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) {
100 if (
$row->public_title ==
"y" &&
$row->title) {
105 $pres =
$row->lastname;
106 if (strlen(
$row->firstname)) {
107 $pres .= (
', ' .
$row->firstname .
' ');
111 if (strlen(
$row->firstname)) {
112 $pres .=
$row->firstname .
' ';
114 $pres .= (
$row->lastname .
' ');
116 $d[
"firstname"] =
$row->firstname;
117 $d[
"lastname"] =
$row->lastname;
119 $d[
"login"] =
$row->login;
120 $d[
"public_profile"] = $has_public_profile;
123 if (!$a_omit_login) {
124 $pres .=
"[" .
$row->login .
"]";
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 !=
"") {
133 rawurlencode($a_profile_back_link)
136 $link =
$ilCtrl->getLinkTargetByClass($a_ctrl_path,
"getHTML");
137 $pres =
'<a href="' . $link .
'">' . $pres .
'</a>';
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;
148 $names[
$row->usr_id] = $pres;
152 foreach ($a_user_id as
$id) {
154 $names[
$id] =
$lng->txt(
'usr_name_undisclosed');
158 if ($a_return_data_array) {
159 if ($return_as_array) {
162 return current(
$data);
165 return $return_as_array ? $names : $names[$a_user_id[0]];
178 $ilDB = $DIC[
'ilDB'];
181 "SELECT value FROM usr_pref " .
182 " WHERE usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
183 " and keyword = " .
$ilDB->quote(
"public_profile",
"text")
185 $rec =
$ilDB->fetchAssoc($set);
187 return in_array($rec[
"value"], array(
"y",
"g"));
200 if ($public_profile !=
'y' and $public_profile !=
'g') {
204 $GLOBALS[
'DIC'][
'ilCtrl']->setParameterByClass(
'ilpublicuserprofilegui',
'user', $a_usr_id);
205 return $GLOBALS[
'DIC'][
'ilCtrl']->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
229 $all[self::START_PD_OVERVIEW] =
'overview';
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';
237 $all[self::START_PD_MYSTAFF] =
'my_staff';
240 if ($a_force_all || !
$ilSetting->get(
"disable_personal_workspace")) {
241 $all[self::START_PD_WORKSPACE] =
'personal_workspace';
244 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
246 if ($a_force_all || $settings->isEnabled()) {
247 $all[self::START_PD_CALENDAR] =
'calendar';
250 $all[self::START_REPOSITORY] =
'repository';
252 foreach ($all as $idx =>
$lang) {
271 $tree = $DIC[
'tree'];
273 if ($a_value == self::START_REPOSITORY_OBJ) {
274 $a_ref_id = (int) $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);
282 $valid = array_keys(self::getPossibleStartingPoints());
283 if (in_array($a_value,
$valid)) {
284 $ilSetting->set(
"usr_starting_point", $a_value);
302 $valid = array_keys(self::getPossibleStartingPoints());
304 if (
$current == self::START_REPOSITORY_OBJ) {
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;
318 if (
$ilUser->getId() == ANONYMOUS_USER_ID ||
334 $tree = $DIC[
'tree'];
336 $rbacreview = $DIC[
'rbacreview'];
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();
349 include_once
'./Services/AccessControl/classes/class.ilStartingPoint.php';
355 $roles_ids = array_keys($roles);
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']
370 $role_point = array_pop($gr);
372 $ref_id = $role_point[
'object'];
377 $current = self::getStartingPoint();
379 if (
$current == self::START_REPOSITORY_OBJ) {
380 $ref_id = self::getStartingObject();
386 case self::START_REPOSITORY:
387 $ref_id =
$tree->readRootId();
390 case self::START_REPOSITORY_OBJ:
393 !
$tree->isDeleted($ref_id)) {
394 include_once(
'./Services/Link/classes/class.ilLink.php');
404 self::START_PD_OVERVIEW =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems',
405 self::START_PD_SUBSCRIPTION =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships',
409 self::START_PD_WORKSPACE =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace',
413 self::START_PD_CALENDAR =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar',
435 return $ilSetting->get(
"usr_starting_point_ref_id");
449 $ilSetting->set(
"usr_starting_point_personal", (
bool) $a_value);
463 return $ilSetting->get(
"usr_starting_point_personal");
477 return (
bool)
$ilUser->getPref(
"usr_starting_point");
491 $valid = array_keys(self::getPossibleStartingPoints());
493 if (
$current == self::START_REPOSITORY_OBJ) {
496 return self::getStartingPoint();
513 $tree = $DIC[
'tree'];
516 $ilUser->setPref(
"usr_starting_point", null);
517 $ilUser->setPref(
"usr_starting_point_ref_id", null);
521 if ($a_value == self::START_REPOSITORY_OBJ) {
522 $a_ref_id = (int) $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);
530 $valid = array_keys(self::getPossibleStartingPoints());
531 if (in_array($a_value,
$valid)) {
532 $ilUser->setPref(
"usr_starting_point", $a_value);
549 $ref_id =
$ilUser->getPref(
"usr_starting_point_ref_id");
551 $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.
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:
static _lookupPref($a_usr_id, $a_keyword)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
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.