43 $a_user_image =
false, $a_profile_link =
false, $a_profile_back_link =
"",
44 $a_force_first_lastname =
false, $a_omit_login =
false, $a_sortable =
true, $a_return_data_array =
false)
48 if (!($return_as_array = is_array($a_user_id)))
49 $a_user_id =
array($a_user_id);
57 b.value public_profile, 63 (a.usr_id = b.usr_id AND 67 (a.usr_id = c.usr_id AND 69 WHERE ' . $ilDB->in(
'a.usr_id', $a_user_id,
false,
'integer');
71 $userrow = $ilDB->queryF($sql,
array(
'text',
'text'),
array(
'public_profile',
'public_title'));
76 while (
$row = $ilDB->fetchObject($userrow))
79 $d =
array(
"id" =>
$row->usr_id,
"title" =>
"",
"lastname" =>
"",
"firstname" =>
"",
"img" =>
"",
"link" =>
"",
80 "public_profile" =>
"");
81 $has_public_profile = in_array(
$row->public_profile,
array(
"y",
"g"));
82 if ($a_force_first_lastname || $has_public_profile)
85 if(
$row->public_title ==
"y" &&
$row->title)
92 $pres =
$row->lastname;
93 if(strlen(
$row->firstname))
95 $pres .= (
', '.$row->firstname.
' ');
101 if(strlen(
$row->firstname))
103 $pres .=
$row->firstname.
' ';
105 $pres .= (
$row->lastname.
' ');
107 $d[
"firstname"] =
$row->firstname;
108 $d[
"lastname"] =
$row->lastname;
110 $d[
"login"] =
$row->login;
111 $d[
"public_profile"] = $has_public_profile;
116 $pres.=
"[".$row->login.
"]";
119 if ($a_profile_link && $has_public_profile)
121 $ilCtrl->setParameterByClass(
"ilpublicuserprofilegui",
"user_id",
$row->usr_id);
122 if ($a_profile_back_link !=
"")
124 $ilCtrl->setParameterByClass(
"ilpublicuserprofilegui",
"back_url",
125 rawurlencode($a_profile_back_link));
127 $link = $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML");
128 $pres =
'<a href="'.$link.
'">'.$pres.
'</a>';
135 $pres =
'<img border="0" src="'.$img.
'" alt="'.$lng->txt(
"icon").
136 " ".$lng->txt(
"user_picture").
'" /> '.$pres;
144 foreach($a_user_id as $id)
150 if ($a_return_data_array)
152 if ($return_as_array)
158 return current(
$data);
161 return $return_as_array ?
$names :
$names[$a_user_id[0]];
174 $set = $ilDB->query(
"SELECT value FROM usr_pref ".
175 " WHERE usr_id = ".$ilDB->quote($a_user_id,
"integer").
176 " and keyword = ".$ilDB->quote(
"public_profile",
"text")
178 $rec = $ilDB->fetchAssoc($set);
180 return in_array($rec[
"value"],
array(
"y",
"g"));
193 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))
225 $all[self::START_PD_SUBSCRIPTION] =
'my_courses_groups';
228 if($a_force_all || !$ilSetting->get(
"disable_personal_workspace"))
230 $all[self::START_PD_WORKSPACE] =
'personal_workspace';
233 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
235 if($a_force_all || $settings->isEnabled())
237 $all[self::START_PD_CALENDAR] =
'calendar';
240 $all[self::START_REPOSITORY] =
'repository';
242 foreach($all as $idx =>
$lang)
244 $all[$idx] = $lng->txt(
$lang);
261 if($a_value == self::START_REPOSITORY_OBJ)
263 $a_ref_id = (int)$a_ref_id;
265 !$tree->isDeleted($a_ref_id))
267 $ilSetting->set(
"usr_starting_point", $a_value);
268 $ilSetting->set(
"usr_starting_point_ref_id", $a_ref_id);
272 $valid = array_keys(self::getPossibleStartingPoints());
273 if(in_array($a_value,
$valid))
275 $ilSetting->set(
"usr_starting_point", $a_value);
290 $valid = array_keys(self::getPossibleStartingPoints());
291 $current = $ilSetting->get(
"usr_starting_point");
292 if($current == self::START_REPOSITORY_OBJ)
296 else if(!$current || !in_array($current,
$valid))
298 $current = self::START_PD_OVERVIEW;
301 if($ilSetting->get(
'disable_my_offers') == 0 &&
302 $ilSetting->get(
'disable_my_memberships') == 0 &&
303 $ilSetting->get(
'personal_items_default_view') == 1)
305 $current = self::START_PD_SUBSCRIPTION;
308 self::setStartingPoint($current);
310 if($ilUser->getId() == ANONYMOUS_USER_ID ||
313 $current = self::START_REPOSITORY;
328 if(self::hasPersonalStartingPoint())
330 $current = self::getPersonalStartingPoint();
331 if($current == self::START_REPOSITORY_OBJ)
333 $ref_id = self::getPersonalStartingObject();
338 $current = self::getStartingPoint();
339 if($current == self::START_REPOSITORY_OBJ)
341 $ref_id = self::getStartingObject();
346 case self::START_REPOSITORY:
347 case self::START_REPOSITORY_OBJ:
352 include_once(
'./Services/Link/classes/class.ilLink.php');
356 $current = self::START_PD_OVERVIEW;
361 self::START_PD_OVERVIEW =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems',
362 self::START_PD_SUBSCRIPTION =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships',
366 self::START_PD_WORKSPACE =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace',
370 self::START_PD_CALENDAR =>
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar',
376 return $map[$current];
389 return $ilSetting->get(
"usr_starting_point_ref_id");
401 $ilSetting->set(
"usr_starting_point_personal", (
bool)$a_value);
413 return $ilSetting->get(
"usr_starting_point_personal");
425 return (
bool)$ilUser->getPref(
"usr_starting_point");
437 $valid = array_keys(self::getPossibleStartingPoints());
438 $current = $ilUser->getPref(
"usr_starting_point");
439 if($current == self::START_REPOSITORY_OBJ)
443 else if(!$current || !in_array($current,
$valid))
445 return self::getStartingPoint();
463 $ilUser->setPref(
"usr_starting_point", null);
464 $ilUser->setPref(
"usr_starting_point_ref_id", null);
468 if($a_value == self::START_REPOSITORY_OBJ)
470 $a_ref_id = (int)$a_ref_id;
472 !$tree->isDeleted($a_ref_id))
474 $ilUser->setPref(
"usr_starting_point", $a_value);
475 $ilUser->setPref(
"usr_starting_point_ref_id", $a_ref_id);
479 $valid = array_keys(self::getPossibleStartingPoints());
480 if(in_array($a_value,
$valid))
482 $ilUser->setPref(
"usr_starting_point", $a_value);
497 $ref_id = $ilUser->getPref(
"usr_starting_point_ref_id");
500 $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.
static getStartingPoint()
Get current starting point setting.
static getStartingPointAsUrl()
Get current starting point setting as URL.
for($col=0; $col< 50; $col++) $d
static hasPersonalStartingPoint()
Can starting point be personalized?
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
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)
Default behaviour is:
static hasPublicProfile($a_user_id)
Has public profile.
static _lookupObjId($a_id)
static getStartingObject()
Get ref id of starting object.
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
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.
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.