ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilUsersOnlineBlockGUI Class Reference

BlockGUI class for Personal Desktop Users Online block. More...

+ Inheritance diagram for ilUsersOnlineBlockGUI:
+ Collaboration diagram for ilUsersOnlineBlockGUI:

Public Member Functions

 ilUsersOnlineBlockGUI ()
 Constructor.
executeCommand ()
 execute command
 getHTML ()
 Handle config status.
 getUsers ()
 Get online users.
 fillDataSection ()
 Fill data section.
 getListRowData ()
 Get list data.
 fillRow ($a_set)
 get flat bookmark list for personal desktop
 getOverview ()
 Get overview.
 __showActiveChatsOfUser ($a_usr_id)
 __showChatInvitation ($a_usr_id)
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor.
 addHeaderLink ($a_href, $a_text, $status=true)
 getHeaderLinks ()
 setData ($a_data)
 Set Data.
 getData ()
 Get Data.
 setBigMode ($a_bigmode)
 Set Big Mode.
 getBigMode ()
 Get Big Mode.
 setBlockId ($a_block_id=0)
 Set Block Id.
 getBlockId ()
 Get Block Id.
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels.
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level.
 setGuiObject (&$a_gui_object)
 Set GuiObject.
 getGuiObject ()
 Get GuiObject.
 getCurrentDetailLevel ()
 Get Current Detail Level.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setImage ($a_image)
 Set Image.
 getImage ()
 Get Image.
 setOffset ($a_offset)
 Set Offset.
 getOffset ()
 Get Offset.
 correctOffset ()
 setLimit ($a_limit)
 Set Limit.
 getLimit ()
 Get Limit.
 setEnableEdit ($a_enableedit)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode.
 getRepositoryMode ()
 Get RepositoryMode.
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info.
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info.
 setSubtitle ($a_subtitle)
 Set Subtitle.
 getSubtitle ()
 Get Subtitle.
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true).
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true).
 setAdminCommands ($a_admincommands)
 Set Administration Commmands.
 getAdminCommands ()
 Get Administration Commmands.
 setColSpan ($a_colspan)
 Set Columns Span.
 getColSpan ()
 Get Columns Span.
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow.
 getEnableDetailRow ()
 Get EnableDetailRow.
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info.
 getEnableNumInfo ()
 Get Enable Item Number Info.
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties.
 getProperty ($a_property)
 setProperty ($a_property, $a_value)
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name.
 getNavParameter ()
 getDetailParameter ()
 getConfigParameter ()
 getMoveParameter ()
 getRowTemplateName ()
 Get Row Template Name.
 getRowTemplateDir ()
 Get Row Template Directory.
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
 Add Block Command.
 getBlockCommands ()
 Get Block commands.
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command.
 getHeaderCommands ()
 Get Header Block commands.
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link.
 getFooterLinks ()
 Get footer links.
 clearFooterLinks ()
 Clear footer links.
 handleDetailLevel ()
 Handle read/write current detail level.
 fillHeaderCommands ()
 Fill header commands block.
 fillHeaderTitleBlock ()
 Fill header title block (title and.
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used.
 fillFooter ()
 fillPreviousNext ()
 Fill previous/next row.
 setPreviousNextLinks ()
 Get previous/next linkbar.
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links.
 fillDetailRow ()
 Fill Detail Setting Row.

Static Public Member Functions

static getBlockType ()
 Get block type.
static isRepositoryObject ()
 Is block used in repository object?
static getScreenMode ()
 Get Screen Mode for current command.

Static Public Attributes

static $block_type = "pdusers"

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 preloadData (array $data)
 Can be overwritten in subclasses.
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 $colspan = 1
 $enablenuminfo = true
 $detail_min = 0
 $detail_max = 0
 $bigmode = false
 $footer_links = array()
 $block_id = 0
 $header_commands = array()
 $allow_moving = true
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 $enabledetailrow = true
 $header_links = array()
 $footerinfo = false
 $footerinfo_icon = false
 $block_commands = array()
 $max_count = false
 $close_command = false
 $image = false
 $property = false
 $nav_value = ""
 $css_row = ""
 $dropdown

Detailed Description

BlockGUI class for Personal Desktop Users Online block.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilUsersOnlineBlockGUI: ilColumnGUI ilUsersOnlineBlockGUI: ilPublicUserProfileGUI

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

Member Function Documentation

ilUsersOnlineBlockGUI::__showActiveChatsOfUser (   $a_usr_id)

Definition at line 464 of file class.ilUsersOnlineBlockGUI.php.

References $lng.

Referenced by fillRow().

{
global $rbacsystem, $lng;
// show chat info
/*
$chat_id = ilChatRoom::_isActive($a_usr_id);
foreach(ilObject::_getAllReferences($chat_id) as $ref_id)
{
if($rbacsystem->checkAccess('read',$ref_id))
{
$this->tpl->setCurrentBlock("chat_info");
$this->tpl->setVariable("CHAT_ACTIVE_IN",$lng->txt('chat_active_in'));
$this->tpl->setVariable("CHAT_LINK","./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id."&room_id=0");
$this->tpl->setVariable("CHAT_TITLE",ilObject::_lookupTitle($chat_id));
$this->tpl->parseCurrentBlock();
return true;
}
}*/
return false;
}

+ Here is the caller graph for this function:

ilUsersOnlineBlockGUI::__showChatInvitation (   $a_usr_id)

Definition at line 487 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, $lng, and ilObjChatroom\_getPublicRefId().

Referenced by fillRow().

{
global $rbacsystem,$ilUser,$lng;
include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
if($a_usr_id == $ilUser->getId())
{
return false;
}
//if($rbacsystem->checkAccess('read',ilObjChat::_getPublicChatRefId())
//and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChat::_getPublicChatRefId()))
if($rbacsystem->checkAccess('read',ilObjChatroom::_getPublicRefId())
and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChatroom::_getPublicRefId()))
{
$this->tpl->setCurrentBlock("chat_link");
$this->tpl->setVariable("TXT_CHAT_INVITE",$lng->txt('chat_invite_public_room'));
//$this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId().
//'&usr_id='.$a_usr_id.'&cmd=invitePD');
$this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.ilObjChatroom::_getPublicRefId().'&usr_id='.$a_usr_id.'&cmd=view-invitePD');
$this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_invite_public_room_tooltip'));
$this->tpl->parseCurrentBlock();
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilUsersOnlineBlockGUI::executeCommand ( )

execute command

Definition at line 86 of file class.ilUsersOnlineBlockGUI.php.

References $_GET, $cmd, $ilCtrl, and $tpl.

{
global $ilCtrl, $tpl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
switch($next_class)
{
// profile
case "ilpublicuserprofilegui":
include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
$profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
$profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
return $ilCtrl->forwardCommand($profile_gui);
break;
default:
return $this->$cmd();
}
}
ilUsersOnlineBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 177 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\getCurrentDetailLevel(), getListRowData(), getOverview(), ilBlockGUI\setColSpan(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setRowTemplate().

{
$pd_set = new ilSetting("pd");
include_once("Services/Notes/classes/class.ilNote.php");
if ($this->getCurrentDetailLevel() > 1 && $this->num_users > 0)
{
$this->setRowTemplate("tpl.users_online_row.html", "Services/PersonalDesktop");
$this->getListRowData();
if ($this->getCurrentDetailLevel() > 2)
{
$this->setColSpan(2);
}
}
else
{
$this->setEnableNumInfo(false);
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

ilUsersOnlineBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 237 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilSetting, $ilUser, $lng, __showActiveChatsOfUser(), __showChatInvitation(), ilObjUser\_getPersonalPicturePath(), ilObjChatroom\_getPublicRefId(), ilObjUser\_lookupIm(), ilObjUser\_lookupPref(), ilTooltipGUI\addTooltip(), ilBlockGUI\getCurrentDetailLevel(), ilUtil\getImagePath(), ilMailFormCall\getLinkTarget(), ilMailGlobalServices\getMailObjectRefId(), and ilUserUtil\getNamePresentation().

{
global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
// mail link
$a_set["mail_to"] = "";
if($this->mail_allowed &&
$rbacsystem->checkAccessOfUser($a_set['id'],'internal_mail', ilMailGlobalServices::getMailObjectRefId()))
{
$a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
}
// check for profile
$a_set["profile"] = in_array(
ilObjUser::_lookupPref($a_set["id"], "public_profile"),
array("y", "g"));
// user image
if ($this->getCurrentDetailLevel() > 2)
{
if ($a_set["mail_url"] != "")
{
$this->tpl->setCurrentBlock("mailto_link");
$this->tpl->setVariable("TXT_MAIL", $lng->txt("mail"));
$this->tpl->setVariable("MAIL_URL", $a_set["mail_url"]);
$this->tpl->parseCurrentBlock();
}
$chatSettings = new ilSetting('chatroom');
if(/*ilChatServerConfig::_isActive() && */$chatSettings->get('chat_enabled'))
{
if(!$this->__showActiveChatsOfUser($a_set["id"]))
{
// Show invite to chat
$this->__showChatInvitation($a_set["id"]);
}
global $rbacsystem;
include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
if($a_set["id"] == $ilUser->getId() &&
//$rbacsystem->checkAccess('read', ilObjChat::_getPublicChatRefId()))
$rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId()))
{
$this->tpl->setCurrentBlock('chat_link');
$this->tpl->setVariable('TXT_CHAT_INVITE', $lng->txt('chat_enter_public_room'));
$this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_enter_public_room_tooltip'));
// $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
$this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id='.ilObjChatroom::_getPublicRefId());
$this->tpl->parseCurrentBlock();
}
}
// user image
$this->tpl->setCurrentBlock("usr_image");
$this->tpl->setVariable("USR_IMAGE",
ilObjUser::_getPersonalPicturePath($a_set["id"],"xxsmall"));
$this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("usr_image_space");
$pd_set = new ilSetting("pd");
$osi_server = $pd_set->get("osi_host");
// if (trim($osi_server) != "")
// {
// instant messengers
// 1 indicates to use online status check
$im_arr = array("icq" => 0,
"yahoo" => 1,
"msn" => 0,
"aim" => 0,
"skype" => 1,
"jabber" => 0,
"voip" => 0);
// use onlinestatus.org
// when enabled all instant messengers are checked online and ignores settings above
if (trim($osi_server) != "")
{
$osi_enable = true;
}
// removed calls to external servers due to
// bug 10583, alex 8 Mar 2013
foreach ($im_arr as $im_name => $im_check)
{
if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name))
{
$im_url = "";
switch ($im_name)
{
case "icq":
$im_url = "http://http://www.icq.com/people/".$im_id;
break;
case "yahoo":
$im_url = "http://edit.yahoo.com/config/send_webmesg?target=".$im_id."&src=pg";
break;
case "msn":
$im_url = "http://messenger.live.com";
break;
case "aim":
//$im_url = "aim:GoIM?screenname=".$im_id;
$im_url = "http://aimexpress.aim.com";
break;
case "skype":
$im_url = "skype:".$im_id."?call";
break;
}
$im_img = ilUtil::getImagePath($im_name.'online.png');
if ($im_url != "")
{
$this->tpl->setCurrentBlock("im_link_start");
$this->tpl->setVariable("URL_IM",$im_url);
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("im_link_end");
}
$this->tpl->setCurrentBlock("instant_messengers");
$this->tpl->setVariable("IMG_IM_ICON", $im_img);
$this->tpl->setVariable("TXT_IM_ICON", $lng->txt("im_".$im_name));
$icon_id = "im_".$im_name."_usr_".$a_set["id"];
$this->tpl->setVariable("ICON_ID", $icon_id);
include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_".$im_name).": ".$im_id, "",
"top center", "bottom center");
$this->tpl->parseCurrentBlock();
}
}
// }
}
// username
if(!$a_set["profile"])
{
$this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
}
else if ($this->getCurrentDetailLevel() > 2)
{
$this->tpl->setVariable("USR_LOGIN", "<br />".$a_set["login"]);
}
else
{
$this->tpl->setVariable("USR_LOGIN", " [".$a_set["login"]."]");
}
// profile link
if ($a_set["profile"])
{
include_once "Services/User/classes/class.ilUserUtil.php";
$user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
$this->tpl->setCurrentBlock("profile_link");
$this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
$ilCtrl->setParameter($this, "user", $a_set["id"]);
$this->tpl->setVariable("LINK_PROFILE",
$ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
$this->tpl->setVariable("USR_ID", $a_set["id"]);
$this->tpl->setVariable("LINK_FULLNAME", $user_name);
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setVariable("USR_FULLNAME", "");
}
}

+ Here is the call graph for this function:

static ilUsersOnlineBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 44 of file class.ilUsersOnlineBlockGUI.php.

References $block_type.

{
}
ilUsersOnlineBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Definition at line 108 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, ilBlockGUI\getCurrentDetailLevel(), and getUsers().

{
global $ilUser;
$this->users_online_pref = $ilUser->getPref("show_users_online");
if ($this->users_online_pref != "y" && $this->users_online_pref != "associated")
{
return "";
}
$this->getUsers();
if ($this->getCurrentDetailLevel() == 0)
{
return "";
}
else
{
return parent::getHTML();
}
}

+ Here is the call graph for this function:

ilUsersOnlineBlockGUI::getListRowData ( )

Get list data.

Definition at line 206 of file class.ilUsersOnlineBlockGUI.php.

References ilBlockGUI\$data, $ilCtrl, $ilUser, $lng, ilMailGlobalServices\getMailObjectRefId(), getOverview(), ilBlockGUI\setCurrentDetailLevel(), ilBlockGUI\setData(), ilBlockGUI\setDataSection(), and ilBlockGUI\setEnableNumInfo().

Referenced by fillDataSection().

{
global $ilUser, $lng, $ilCtrl, $ilDB, $rbacsystem;
$data = array();
$this->mail_allowed = ($ilUser->getId() != ANONYMOUS_USER_ID &&
$rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()));
foreach ($this->users as $user_id => $user)
{
$data[] = array(
"id" => $user_id,
"login" => $user["login"]
);
}
$this->setData($data);
// we do not have at least one (non hidden) active user
if (count($data) == 0)
{
$this->setEnableNumInfo(false);
$this->enabledetailrow = false;
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilUsersOnlineBlockGUI::getOverview ( )

Get overview.

Definition at line 419 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection(), and getListRowData().

{
global $ilUser, $lng, $ilCtrl;
// parse visitors text
if (empty($this->visitors) || $this->users_online_pref == "associated")
{
$visitor_text = "";
}
elseif ($this->visitors == "1")
{
$visitor_text = "1 ".$lng->txt("visitor");
}
else
{
$visitor_text = $visitors." ".$lng->txt("visitors");
}
// parse registered users text
if ($this->num_users > 0)
{
$user_kind = ($this->users_online_pref == "associated") ? "associated_user" : "registered_user";
if ($this->num_users == 1)
{
$user_list = $this->num_users." ".$lng->txt($user_kind);
}
else
{
$user_list = $this->num_users." ".$lng->txt($user_kind."s");
}
if (!empty($visitor_text))
{
$user_list .= " ".$lng->txt("and")." ".$visitor_text;
}
}
else
{
$user_list = $visitor_text;
}
return '<div class="small">'.$user_list."</div>";
}

+ Here is the caller graph for this function:

static ilUsersOnlineBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 62 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

{
global $ilCtrl;
if ($ilCtrl->getCmdClass() == "ilpublicuserprofilegui")
{
}
switch($ilCtrl->getCmd())
{
case "showUserProfile":
break;
default:
break;
}
}
ilUsersOnlineBlockGUI::getUsers ( )

Get online users.

Definition at line 134 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, ilObjUser\_lookupPref(), and ilUtil\getAssociatedUsersOnline().

Referenced by getHTML().

{
global $ilUser;
if ($this->users_online_pref == "associated")
{
$this->users = ilUtil::getAssociatedUsersOnline($ilUser->getId(), true);
}
else
{
$this->users = ilObjUser::_getUsersOnline(0, true);
}
$this->num_users = 0;
// add current user always to list
if ($ilUser->getId() != ANONYMOUS_USER_ID &&
ilObjUser::_lookupPref($ilUser->getId(), "hide_own_online_status") != "y")
{
$this->users[$ilUser->getId()] =
array("user_id" => $ilUser->getId(),
"firstname" => $ilUser->getFirstname(),
"lastname" => $ilUser->getLastname(),
"title" => $ilUser->getUTitle(),
"login" => $ilUser->getLogin());
}
foreach ($this->users as $user_id => $user)
{
if ($user_id != ANONYMOUS_USER_ID)
{
$this->num_users++;
}
else
{
$this->visitors = $user["num"];
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilUsersOnlineBlockGUI::ilUsersOnlineBlockGUI ( )

Constructor.

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

References $ilCtrl, $ilUser, $lng, ilUtil\getImagePath(), ilBlockGUI\ilBlockGUI(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

{
global $ilCtrl, $lng, $ilUser;
$this->setLimit(10);
$this->setImage(ilUtil::getImagePath("icon_grp_s.png"));
$this->setTitle($lng->txt("users_online"));
// mjansen: Used for mail referer link (@see fillRow). I don't want to create a new instance in each fillRow call.
$this->topGuiObj = new ilPersonalDesktopGUI();
}

+ Here is the call graph for this function:

static ilUsersOnlineBlockGUI::isRepositoryObject ( )
static

Is block used in repository object?

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 54 of file class.ilUsersOnlineBlockGUI.php.

{
return false;
}

Field Documentation

ilUsersOnlineBlockGUI::$block_type = "pdusers"
static

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

Referenced by getBlockType().


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