4include_once(
"Services/Block/classes/class.ilBlockGUI.php");
 
    5require_once 
'Services/Mail/classes/class.ilMailFormCall.php';
 
    6include_once 
'Services/Mail/classes/class.ilMailGlobalServices.php';
 
   43        $this->ctrl = 
$DIC->ctrl();
 
   44        $this->lng = 
$DIC->language();
 
   45        $this->
user = $DIC->user();
 
   47        $this->db = 
$DIC->database();
 
   48        $this->rbacsystem = 
$DIC->rbac()->system();
 
   51        parent::__construct();
 
   90        if (
$ilCtrl->getCmdClass() == 
"ilpublicuserprofilegui") {
 
   95            case "showUserProfile":
 
  112        $next_class = 
$ilCtrl->getNextClass();
 
  113        $cmd = 
$ilCtrl->getCmd(
"getHTML");
 
  115        switch ($next_class) {
 
  117            case "ilpublicuserprofilegui":
 
  118                include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
 
  120                $profile_gui->setBackUrl(
$ilCtrl->getParentReturn($this));
 
  121                return $ilCtrl->forwardCommand($profile_gui);
 
  125                return $this->$cmd();
 
  133        $this->users_online_pref = 
$ilUser->getPref(
"show_users_online");
 
  135        if ($this->users_online_pref != 
"y" && $this->users_online_pref != 
"associated") {
 
  144            return parent::getHTML();
 
  155        if ($this->users_online_pref == 
"associated") {
 
  158            $this->users = ilObjUser::_getUsersOnline(0, 
true);
 
  161        $this->num_users = 0;
 
  164        if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
 
  166            $this->users[
$ilUser->getId()] =
 
  167                array(
"user_id" => 
$ilUser->getId(),
 
  168                    "firstname" => 
$ilUser->getFirstname(),
 
  169                    "lastname" => 
$ilUser->getLastname(),
 
  170                    "title" => 
$ilUser->getUTitle(),
 
  171                    "login" => 
$ilUser->getLogin());
 
  174        foreach ($this->users as $user_id => 
$user) {
 
  175            if ($user_id != ANONYMOUS_USER_ID) {
 
  178                $this->visitors = 
$user[
"num"];
 
  188        include_once(
"Services/Notes/classes/class.ilNote.php");
 
  191            $this->
setRowTemplate(
"tpl.users_online_row.html", 
"Services/PersonalDesktop");
 
  196            parent::fillDataSection();
 
  214        $this->mail_allowed = (
$ilUser->getId() != ANONYMOUS_USER_ID &&
 
  217        foreach ($this->users as $user_id => 
$user) {
 
  220                "login" => 
$user[
"login"]
 
  226        if (count(
$data) == 0) {
 
  229            $this->enabledetailrow = 
false;
 
  246        $a_set[
"mail_to"] = 
"";
 
  247        if ($this->mail_allowed &&
 
  249            $a_set[
'mail_url'] = 
ilMailFormCall::getLinkTarget($this->topGuiObj, 
'', array(), array(
'type' => 
'new', 
'rcp_to' => urlencode($a_set[
'login'])));
 
  253        $a_set[
"profile"] = in_array(
 
  260            if ($a_set[
"mail_url"] != 
"") {
 
  261                $this->tpl->setCurrentBlock(
"mailto_link");
 
  262                $this->tpl->setVariable(
"TXT_MAIL", 
$lng->txt(
"mail"));
 
  263                $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
 
  264                $this->tpl->parseCurrentBlock();
 
  267            $chatSettings = 
new ilSetting(
'chatroom');
 
  268            if ($chatSettings->get(
'chat_enabled')) {
 
  274                include_once 
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
 
  275                if ($a_set[
"id"] == 
$ilUser->getId() &&
 
  277                    $this->tpl->setCurrentBlock(
'chat_link');
 
  278                    $this->tpl->setVariable(
'TXT_CHAT_INVITE', 
$lng->txt(
'chat_enter_public_room'));
 
  279                    $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', 
$lng->txt(
'chat_enter_public_room_tooltip'));
 
  281                    $this->tpl->parseCurrentBlock();
 
  286            $this->tpl->setCurrentBlock(
"usr_image");
 
  287            $this->tpl->setVariable(
 
  289                ilObjUser::_getPersonalPicturePath($a_set[
"id"], 
"xxsmall")
 
  291            $this->tpl->setVariable(
"USR_ALT", 
$lng->txt(
"personal_picture"));
 
  292            $this->tpl->parseCurrentBlock();
 
  293            $this->tpl->touchBlock(
"usr_image_space");
 
  297        if (!$a_set[
"profile"]) {
 
  298            $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
 
  300            $this->tpl->setVariable(
"USR_LOGIN", 
"<br />" . $a_set[
"login"]);
 
  302            $this->tpl->setVariable(
"USR_LOGIN", 
" [" . $a_set[
"login"] . 
"]");
 
  306        if ($a_set[
"profile"]) {
 
  307            include_once 
"Services/User/classes/class.ilUserUtil.php";
 
  310            $this->tpl->setCurrentBlock(
"profile_link");
 
  311            $this->tpl->setVariable(
"TXT_VIEW", 
$lng->txt(
"profile"));
 
  316                include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
  321                $ilCtrl->setParameter($this, 
"user", $a_set[
"id"]);
 
  322                $this->tpl->setVariable(
 
  324                    $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui", 
"getHTML")
 
  328                include_once 
"Services/Link/classes/class.ilLink.php";
 
  329                $this->tpl->setVariable(
"LINK_PROFILE", 
ilLink::_getLink($a_set[
"id"], 
"usr"));
 
  330                $this->tpl->setVariable(
"LINK_TARGET", 
"_blank");
 
  333            $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
 
  334            $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
 
  335            $this->tpl->parseCurrentBlock();
 
  337            $this->tpl->setVariable(
"USR_FULLNAME", 
"");
 
  349        if (empty($this->visitors) || $this->users_online_pref == 
"associated") {
 
  351        } elseif ($this->visitors == 
"1") {
 
  352            $visitor_text = 
"1 " . 
$lng->txt(
"visitor");
 
  354            $visitor_text = $visitors . 
" " . 
$lng->txt(
"visitors");
 
  358        if ($this->num_users > 0) {
 
  359            $user_kind = ($this->users_online_pref == 
"associated") ? 
"associated_user" : 
"registered_user";
 
  360            if ($this->num_users == 1) {
 
  361                $user_list = $this->num_users . 
" " . 
$lng->txt($user_kind);
 
  363                $user_list = $this->num_users . 
" " . 
$lng->txt($user_kind . 
"s");
 
  366            if (!empty($visitor_text)) {
 
  367                $user_list .= 
" " . 
$lng->txt(
"and") . 
" " . $visitor_text;
 
  370            $user_list = $visitor_text;
 
  373        return '<div class="small">' . $user_list . 
"</div>";
 
  387        include_once 
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
 
  389        if ($a_usr_id == 
$ilUser->getId()) {
 
  395            $this->tpl->setCurrentBlock(
"chat_link");
 
  396            $this->tpl->setVariable(
"TXT_CHAT_INVITE", 
$lng->txt(
'chat_invite_public_room'));
 
  397            $this->tpl->setVariable(
"CHAT_LINK", 
'./ilias.php?baseClass=ilRepositoryGUI&ref_id=' . 
ilObjChatroom::_getPublicRefId() . 
'&usr_id=' . $a_usr_id . 
'&cmd=view-invitePD');
 
  398            $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', 
$lng->txt(
'chat_invite_public_room_tooltip'));
 
  399            $this->tpl->parseCurrentBlock();
 
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setData($a_data)
Set Data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static _lookupPref($a_usr_id, $a_keyword)
GUI class for personal desktop.
GUI class for public user profile presentation.
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:
BlockGUI class for Personal Desktop Users Online block.
getUsers()
Get online users.
getListRowData()
Get list data.
fillDataSection()
Fill data section.
static isRepositoryObject()
Is block used in repository object?
executeCommand()
execute command
static getBlockType()
Get block type.
getOverview()
Get overview.
__showChatInvitation($a_usr_id)
__showActiveChatsOfUser($a_usr_id)
getHTML()
Handle config status.
__construct()
Constructor.
fillRow($a_set)
get flat bookmark list for personal desktop
static getScreenMode()
Get Screen Mode for current command.
static getAssociatedUsersOnline($a_user_id)
reads all active sessions from db and returns users that are online and who have a local role in a gr...