ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPDMailBlockGUI Class Reference

BlockGUI class for Personal Desktop Mail block. More...

+ Inheritance diagram for ilPDMailBlockGUI:
+ Collaboration diagram for ilPDMailBlockGUI:

Public Member Functions

 ilPDMailBlockGUI ()
 Constructor.
executeCommand ()
 execute command
 getHTML ()
 Get HTML.
 getMails ()
 Get Mails.
 fillDataSection ()
 Fill data section.
 fillRow ($mail)
 get flat bookmark list for personal desktop
 getOverview ()
 Get overview.
 showMail ()
 show mail
 deleteMail ()
 delete mail
- 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)
 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)
 Add a footer text/link.
 getFooterLinks ()
 Get footer links.
 clearFooterLinks ()
 Clear footer links.
 handleDetailLevel ()
 Handle read/write current detail level.
 setConfigMode ($a_configmode)
 Handle config status.
 getConfigMode ()
 Get Config Mode (move blocks).
 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.
 fillMoveRow ()
 Fill row for Moving.
 getAllowMove ($a_direction)
 setAllowMove ($a_direction, $a_allow=true)
 fillMoveLink ($a_value, $a_img, $a_txt)

Static Public Member Functions

static getBlockType ()
 Get block type.
static isRepositoryObject ()
 Get block type.
static getScreenMode ()
 Get Screen Mode for current command.

Static Public Attributes

static $block_type = "pdmail"

Protected Member Functions

 getUserInstance ($a_usr_id)
 Caching method for user instances.
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")

Additional Inherited Members

- 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 = ""

Detailed Description

BlockGUI class for Personal Desktop Mail block.

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

ilPDMailBlockGUI: ilColumnGUI

Definition at line 34 of file class.ilPDMailBlockGUI.php.

Member Function Documentation

ilPDMailBlockGUI::deleteMail ( )

delete mail

Definition at line 315 of file class.ilPDMailBlockGUI.php.

References $_GET, $_SESSION, $ilCtrl, $lng, and ilUtil\sendInfo().

{
global $lng, $ilCtrl;
$lng->loadLanguageModule('mail');
$umail = new ilMail($_SESSION['AccountId']);
$mbox = new ilMailBox($_SESSION['AccountId']);
// IF THERE IS NO OBJ_ID GIVEN GET THE ID OF MAIL ROOT NODE
if(!$_GET['mobj_id'])
{
$_GET['mobj_id'] = $mbox->getInboxFolder();
}
if ($umail->moveMailsToFolder(array($_GET['mail_id']),
$mbox->getTrashFolder()))
{
ilUtil::sendInfo($lng->txt('mail_moved_to_trash'), true);
}
else
{
ilUtil::sendInfo($lng->txt('mail_move_error'), true);
}
$ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
}

+ Here is the call graph for this function:

& ilPDMailBlockGUI::executeCommand ( )

execute command

Definition at line 99 of file class.ilPDMailBlockGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
return $this->$cmd();
}
ilPDMailBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 149 of file class.ilPDMailBlockGUI.php.

References ilBlockGUI\getCurrentDetailLevel(), getMails(), getOverview(), ilBlockGUI\setColSpan(), ilBlockGUI\setData(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableDetailRow(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setRowTemplate().

{
$this->getMails();
$this->setData($this->mails);
if ($this->getCurrentDetailLevel() > 1 && count($this->mails) > 0)
{
$this->setRowTemplate("tpl.pd_mail_row.html", "Services/Mail");
if ($this->getCurrentDetailLevel() > 2)
{
$this->setColSpan(2);
}
}
else
{
$this->setEnableNumInfo(false);
if (count($this->mails) == 0)
{
$this->setEnableDetailRow(false);
}
$this->setDataSection($this->getOverview());
}
}

+ Here is the call graph for this function:

ilPDMailBlockGUI::fillRow (   $mail)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 197 of file class.ilPDMailBlockGUI.php.

References $ilCtrl, $lng, ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), getUserInstance(), and IL_CAL_DATE.

{
global $ilUser, $ilCtrl, $lng;
// GET SENDER NAME
$user = $this->getUserInstance($mail['sender_id']);
if ($this->getCurrentDetailLevel() > 2)
{
$this->tpl->setCurrentBlock('image');
$this->tpl->setVariable('IMG_SENDER', $user->getPersonalPicturePath('xxsmall'));
$this->tpl->setVariable('ALT_SENDER', $user->getLogin());
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('long');
if($mail['sender_id'] != ANONYMOUS_USER_ID)
{
if(in_array($user->getPref('public_profile'), array('y', 'g')))
{
if(!($fullname = $user->getFullname()))
{
$fullname = $lng->txt('unknown');
}
$this->tpl->setVariable('NEW_MAIL_FROM', $fullname);
}
$this->tpl->setVariable('NEW_MAIL_FROM_LOGIN', $user->getLogin());
}
else
{
$this->tpl->setVariable('NEW_MAIL_FROM_LOGIN', ilMail::_getIliasMailerName());
}
$this->tpl->setVariable('NEW_MAIL_DATE', ilDatePresentation::formatDate(new ilDate($mail['send_time'],IL_CAL_DATE)));
$this->tpl->setVariable('TXT_FROM', $lng->txt('from'));
$this->tpl->parseCurrentBlock();
}
else
{
if($mail['sender_id'] != ANONYMOUS_USER_ID)
{
$this->tpl->setCurrentBlock('short');
$this->tpl->setVariable('NEW_MAIL_FROM_LOGIN', $user->getLogin());
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock('short');
$this->tpl->setVariable('NEW_MAIL_FROM_LOGIN', ilMail::_getIliasMailerName());
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setVariable('NEW_MAIL_SUBJ', htmlentities($mail['m_subject'],ENT_NOQUOTES,'UTF-8'));
$ilCtrl->setParameter($this, 'mobj_id', $inbox);
$ilCtrl->setParameter($this, 'mail_id', $mail['mail_id']);
$ilCtrl->setParameter($this, 'mail_mode', $this->mail_mode);
$this->tpl->setVariable('NEW_MAIL_LINK_READ',
$ilCtrl->getLinkTarget($this, 'showMail'));
$ilCtrl->clearParameters($this);
}

+ Here is the call graph for this function:

static ilPDMailBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

Definition at line 64 of file class.ilPDMailBlockGUI.php.

References $block_type.

{
}
ilPDMailBlockGUI::getHTML ( )

Get HTML.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

Definition at line 109 of file class.ilPDMailBlockGUI.php.

References ilBlockGUI\getCurrentDetailLevel().

{
global $ilUser, $rbacsystem;
$umail = new ilMail($ilUser->getId());
if(!$rbacsystem->checkAccess('mail_visible', $umail->getMailObjectReferenceId()))
{
return '';
}
if ($this->getCurrentDetailLevel() == 0)
{
return '';
}
else
{
$html = parent::getHTML();
return $html;
}
}

+ Here is the call graph for this function:

ilPDMailBlockGUI::getMails ( )

Get Mails.

Reimplemented in ilPDSysMessageBlockGUI.

Definition at line 133 of file class.ilPDMailBlockGUI.php.

References ilMail\getMailsOfFolder().

Referenced by fillDataSection().

{
global $ilUser;
// BEGIN MAILS
$umail = new ilMail($ilUser->getId());
$mbox = new ilMailBox($ilUser->getId());
$inbox = $mbox->getInboxFolder();
//SHOW MAILS FOR EVERY USER
$this->mails = $umail->getMailsOfFolder($inbox, array('status' => 'unread', 'type' => 'normal'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDMailBlockGUI::getOverview ( )

Get overview.

Reimplemented in ilPDSysMessageBlockGUI.

Definition at line 258 of file class.ilPDMailBlockGUI.php.

References $ilCtrl, and $lng.

Referenced by fillDataSection().

{
global $ilUser, $lng, $ilCtrl;
return '<div class="small">'.((int) count($this->mails))." ".$lng->txt("mails_pl")."</div>";
}

+ Here is the caller graph for this function:

static ilPDMailBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 82 of file class.ilPDMailBlockGUI.php.

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

{
switch($_GET["cmd"])
{
case "showMail":
break;
default:
break;
}
}
ilPDMailBlockGUI::getUserInstance (   $a_usr_id)
protected

Caching method for user instances.

private

Parameters
integer$a_usr_idId of a user instance
Returns
ilObjUser

Definition at line 183 of file class.ilPDMailBlockGUI.php.

Referenced by fillRow().

{
static $userObjectCache = array();
if(isset($userObjectCache[$a_usr_id])) return $userObjectCache[$a_usr_id];
$userObjectCache[$a_usr_id] = new ilObjUser($a_usr_id);
return $userObjectCache[$a_usr_id];
}

+ Here is the caller graph for this function:

ilPDMailBlockGUI::ilPDMailBlockGUI ( )

Constructor.

Definition at line 41 of file class.ilPDMailBlockGUI.php.

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

Referenced by ilPDSysMessageBlockGUI\ilPDSysMessageBlockGUI().

{
global $ilCtrl, $lng, $ilUser;
#include_once "./include/inc.mail.php";
include_once './Services/User/classes/class.ilObjUser.php';
include_once "Services/Mail/classes/class.ilMailbox.php";
include_once "Services/Mail/classes/class.ilMail.php";
$this->setLimit(5);
$this->setImage(ilUtil::getImagePath("icon_mail_s.gif"));
$this->setTitle($lng->txt("mail"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPDMailBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

Definition at line 74 of file class.ilPDMailBlockGUI.php.

{
return false;
}
ilPDMailBlockGUI::showMail ( )

show mail

Definition at line 268 of file class.ilPDMailBlockGUI.php.

References $_GET, $ilCtrl, $lng, and ilUtil\getImagePath().

{
global $lng, $ilCtrl;
include_once("./Services/Mail/classes/class.ilPDMailGUI.php");
$mail_gui = new ilPDMailGUI();
include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
$content_block = new ilPDContentBlockGUI();
$content_block->setContent($mail_gui->getPDMailHTML($_GET["mail_id"],
$_GET["mobj_id"]));
$content_block->setTitle($lng->txt("message"));
$content_block->setColSpan(2);
$content_block->setImage(ilUtil::getImagePath("icon_mail.gif"));
$content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
$lng->txt("selected_items_back"));
if ($_GET["mail_mode"] != "system")
{
$content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=".
$_GET["mail_id"]."&mobj_id".$_GET["mobj_id"]."&type=reply",
$lng->txt("reply"));
$content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=".
$_GET["mail_id"]."&mobj_id".$_GET["mobj_id"]."&type=read",
$lng->txt("inbox"));
$ilCtrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$content_block->addBlockCommand($ilCtrl->getLinkTarget($this, 'deleteMail'), $lng->txt('delete'));
}
else
{
$ilCtrl->setParameter($this, "mail_id", $_GET["mail_id"]);
$ilCtrl->setParameter($this, "mobj_id", $_GET["mobj_id"]);
$content_block->addBlockCommand(
$ilCtrl->getLinkTarget($this, "deleteMail"),
$lng->txt("delete"));
$ilCtrl->clearParameters($this);
}
return $content_block->getHTML();
}

+ Here is the call graph for this function:

Field Documentation

ilPDMailBlockGUI::$block_type = "pdmail"
static

Definition at line 36 of file class.ilPDMailBlockGUI.php.

Referenced by getBlockType().


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