ILIAS  release_4-3 Revision
 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

 __construct ()
 Constructor.
 executeCommand ()
 execute command
 getHTML ()
 Handle config status.
 fillDataSection ()
 Fill data section.
 fillRow ($mail)
 get flat bookmark list for personal desktop
 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, $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 ()
 Get block type.
static getScreenMode ()
 Get Screen Mode for current command.

Static Public Attributes

static $block_type = 'pdmail'

Protected Member Functions

 getMails ()
 Get Mails.
 getOverview ()
 Get overview.
 showMail ()
 show mail
 preloadData (array $data)
- 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 = ""
 $dropdown

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 13 of file class.ilPDMailBlockGUI.php.

Constructor & Destructor Documentation

ilPDMailBlockGUI::__construct ( )

Constructor.

Reimplemented in ilPDSysMessageBlockGUI.

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

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

{
global $lng;
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.png'));
$this->setTitle($lng->txt('mail'));
}

+ Here is the call graph for this function:

Member Function Documentation

ilPDMailBlockGUI::deleteMail ( )

delete mail

Definition at line 271 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(!$_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 74 of file class.ilPDMailBlockGUI.php.

References $cmd, and $ilCtrl.

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

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 127 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 155 of file class.ilPDMailBlockGUI.php.

References $ilCtrl, $lng, ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), ilUtil\getImagePath(), ilMailUserCache\getUserObjectById(), and IL_CAL_DATE.

{
global $ilCtrl, $lng;
$user = ilMailUserCache::getUserObjectById($mail['sender_id']);
if($this->getCurrentDetailLevel() > 2)
{
$this->tpl->touchBlock('usr_image_space');
if($user && $user->getId() != ANONYMOUS_USER_ID)
{
$this->tpl->setVariable('PUBLIC_NAME_LONG', $user->getPublicName());
$this->tpl->setVariable('IMG_SENDER', $user->getPersonalPicturePath('xxsmall'));
$this->tpl->setVariable('ALT_SENDER', $user->getPublicName());
}
else if(!$user)
{
$this->tpl->setVariable('PUBLIC_NAME_LONG', $mail['import_name'] . ' (' . $lng->txt('user_deleted') . ')');
$this->tpl->setCurrentBlock('image_container');
$this->tpl->touchBlock('image_container');
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setVariable('PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
$this->tpl->setVariable('IMG_SENDER', ilUtil::getImagePath('HeaderIconAvatar.png'));
$this->tpl->setVariable('ALT_SENDER', ilMail::_getIliasMailerName());
}
$this->tpl->setVariable('NEW_MAIL_DATE', ilDatePresentation::formatDate(new ilDate($mail['send_time'], IL_CAL_DATE)));
}
else
{
if($user && $user->getId() != ANONYMOUS_USER_ID)
{
$this->tpl->setVariable('PUBLIC_NAME_SHORT', $user->getPublicName());
}
else if(!$user)
{
$this->tpl->setVariable('PUBLIC_NAME_SHORT', $mail['import_name'] . ' (' . $lng->txt('user_deleted') . ')');
}
else
{
$this->tpl->setVariable('PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
}
}
$this->tpl->setVariable('NEW_MAIL_SUBJ', htmlentities($mail['m_subject'], ENT_NOQUOTES, 'UTF-8'));
$ilCtrl->setParameter($this, 'mobj_id', $this->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 40 of file class.ilPDMailBlockGUI.php.

References $block_type.

{
}
ilPDMailBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

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

References $ilUser, and ilBlockGUI\getCurrentDetailLevel().

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

+ Here is the call graph for this function:

ilPDMailBlockGUI::getMails ( )
protected

Get Mails.

Reimplemented in ilPDSysMessageBlockGUI.

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

References $ilUser, and ilMail\getMailsOfFolder().

Referenced by fillDataSection().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDMailBlockGUI::getOverview ( )
protected

Get overview.

Reimplemented in ilPDSysMessageBlockGUI.

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

References $lng.

Referenced by fillDataSection().

{
global $lng;
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 57 of file class.ilPDMailBlockGUI.php.

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

{
switch($_GET['cmd'])
{
case 'showMail':
break;
default:
break;
}
}
static ilPDMailBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

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

{
return false;
}
ilPDMailBlockGUI::preloadData ( array  $data)
protected
Parameters
array$data

Reimplemented from ilBlockGUI.

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

{
$usr_ids = array();
foreach($data as $mail)
{
if($mail['sender_id'] && $mail['sender_id'] != ANONYMOUS_USER_ID)
{
$usr_ids[$mail['sender_id']] = $mail['sender_id'];
}
}
ilMailUserCache::preloadUserObjects($usr_ids);
}
ilPDMailBlockGUI::showMail ( )
protected

show mail

Definition at line 224 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.png"));
$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 15 of file class.ilPDMailBlockGUI.php.

Referenced by getBlockType().


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