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

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Get block type. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = 'pdmail'
 

Protected Member Functions

 getMails ()
 Get Mails. More...
 
 getOverview ()
 Get overview. More...
 
 showMail ()
 show mail More...
 
 preloadData (array $data)
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

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

◆ __construct()

ilPDMailBlockGUI::__construct ( )

Constructor.

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

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

21  {
22  global $lng;
23 
24  include_once 'Services/User/classes/class.ilObjUser.php';
25  include_once 'Services/Mail/classes/class.ilMailbox.php';
26  include_once 'Services/Mail/classes/class.ilMail.php';
27 
28  parent::__construct();
29 
30  $this->setLimit(5);
31  $this->setImage(ilUtil::getImagePath('icon_mail.svg'));
32  $this->setTitle($lng->txt('mail'));
33  $this->setAvailableDetailLevels(3);
34  }
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteMail()

ilPDMailBlockGUI::deleteMail ( )

delete mail

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

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

272  {
273  global $lng, $ilCtrl;
274 
275  $lng->loadLanguageModule('mail');
276 
277  $umail = new ilMail($_SESSION['AccountId']);
278  $mbox = new ilMailBox($_SESSION['AccountId']);
279 
280  if(!$_GET['mobj_id'])
281  {
282  $_GET['mobj_id'] = $mbox->getInboxFolder();
283  }
284 
285  if($umail->moveMailsToFolder(array($_GET['mail_id']),
286  $mbox->getTrashFolder())
287  )
288  {
289  ilUtil::sendInfo($lng->txt('mail_moved_to_trash'), true);
290  }
291  else
292  {
293  ilUtil::sendInfo($lng->txt('mail_move_error'), true);
294  }
295  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
296  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class Mail this class handles base functions for mail handling.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ executeCommand()

ilPDMailBlockGUI::executeCommand ( )

execute command

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

References $cmd, and $ilCtrl.

75  {
76  global $ilCtrl;
77 
78  $cmd = $ilCtrl->getCmd('getHTML');
79 
80  return $this->$cmd();
81  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilPDMailBlockGUI::fillDataSection ( )

Fill data section.

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().

128  {
129  $this->getMails();
130  $this->setData($this->mails);
131 
132  if($this->getCurrentDetailLevel() > 1 && count($this->mails) > 0)
133  {
134  $this->setRowTemplate("tpl.pd_mail_row.html", "Services/Mail");
135  if($this->getCurrentDetailLevel() > 2)
136  {
137  $this->setColSpan(2);
138  }
139  parent::fillDataSection();
140  }
141  else
142  {
143  $this->setEnableNumInfo(false);
144  if(count($this->mails) == 0)
145  {
146  $this->setEnableDetailRow(false);
147  }
148  $this->setDataSection($this->getOverview());
149  }
150  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
setColSpan($a_colspan)
Set Columns Span.
setData($a_data)
Set Data.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
getCurrentDetailLevel()
Get Current Detail Level.
getOverview()
Get overview.
+ Here is the call graph for this function:

◆ fillRow()

ilPDMailBlockGUI::fillRow (   $mail)

get flat bookmark list for personal desktop

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

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

156  {
157  global $ilCtrl, $lng;
158 
159  $user = ilMailUserCache::getUserObjectById($mail['sender_id']);
160 
161  if($this->getCurrentDetailLevel() > 2)
162  {
163  $this->tpl->touchBlock('usr_image_space');
164  if($user && $user->getId() != ANONYMOUS_USER_ID)
165  {
166  $this->tpl->setVariable('PUBLIC_NAME_LONG', $user->getPublicName());
167  $this->tpl->setVariable('IMG_SENDER', $user->getPersonalPicturePath('xxsmall'));
168  $this->tpl->setVariable('ALT_SENDER', htmlspecialchars($user->getPublicName()));
169  }
170  else if(!$user)
171  {
172  $this->tpl->setVariable('PUBLIC_NAME_LONG', $mail['import_name'] . ' (' . $lng->txt('user_deleted') . ')');
173 
174  $this->tpl->setCurrentBlock('image_container');
175  $this->tpl->touchBlock('image_container');
176  $this->tpl->parseCurrentBlock();
177  }
178  else
179  {
180  $this->tpl->setVariable('PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
181  $this->tpl->setVariable('IMG_SENDER', ilUtil::getImagePath('HeaderIconAvatar.svg'));
182  $this->tpl->setVariable('ALT_SENDER', htmlspecialchars(ilMail::_getIliasMailerName()));
183  }
184 
185  $this->tpl->setVariable('NEW_MAIL_DATE', ilDatePresentation::formatDate(new ilDate($mail['send_time'], IL_CAL_DATE)));
186  }
187  else
188  {
189  if($user && $user->getId() != ANONYMOUS_USER_ID)
190  {
191  $this->tpl->setVariable('PUBLIC_NAME_SHORT', $user->getPublicName());
192  }
193  else if(!$user)
194  {
195  $this->tpl->setVariable('PUBLIC_NAME_SHORT', $mail['import_name'] . ' (' . $lng->txt('user_deleted') . ')');
196  }
197  else
198  {
199  $this->tpl->setVariable('PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
200  }
201  }
202 
203  $this->tpl->setVariable('NEW_MAIL_SUBJ', htmlentities($mail['m_subject'], ENT_NOQUOTES, 'UTF-8'));
204  $ilCtrl->setParameter($this, 'mobj_id', $this->inbox);
205  $ilCtrl->setParameter($this, 'mail_id', $mail['mail_id']);
206  $ilCtrl->setParameter($this, 'mail_mode', $this->mail_mode);
207  $this->tpl->setVariable('NEW_MAIL_LINK_READ', $ilCtrl->getLinkTarget($this, 'showMail'));
208  $ilCtrl->clearParameters($this);
209  }
global $ilCtrl
Definition: ilias.php:18
Class for single dates.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date)
Format a date public.
static getUserObjectById($usr_id)
const IL_CAL_DATE
global $lng
Definition: privfeed.php:40
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getBlockType()

static ilPDMailBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

41  {
42  return self::$block_type;
43  }

◆ getHTML()

ilPDMailBlockGUI::getHTML ( )

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

References $ilUser, and ilBlockGUI\getCurrentDetailLevel().

84  {
85  global $ilUser, $rbacsystem;
86 
87  $umail = new ilMail($ilUser->getId());
88  if(!$rbacsystem->checkAccess('internal_mail', $umail->getMailObjectReferenceId()))
89  {
90  return '';
91  }
92 
93  if($this->getCurrentDetailLevel() == 0)
94  {
95  return '';
96  }
97  else
98  {
99  $html = parent::getHTML();
100  return $html;
101  }
102  }
Class Mail this class handles base functions for mail handling.
global $ilUser
Definition: imgupload.php:15
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getMails()

ilPDMailBlockGUI::getMails ( )
protected

Get Mails.

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

References $ilUser, and ilMail\getMailsOfFolder().

Referenced by fillDataSection().

108  {
109  global $ilUser;
110 
111  $umail = new ilMail($ilUser->getId());
112  $mbox = new ilMailBox($ilUser->getId());
113  $this->inbox = $mbox->getInboxFolder();
114 
115  $this->mails = $umail->getMailsOfFolder(
116  $this->inbox,
117  array(
118  'status' => 'unread',
119  'type' => 'normal'
120  )
121  );
122  }
Class Mail this class handles base functions for mail handling.
getMailsOfFolder($a_folder_id, $filter=array())
get all mails of a specific folder public
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilPDMailBlockGUI::getOverview ( )
protected

Get overview.

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

References $lng.

Referenced by fillDataSection().

215  {
216  global $lng;
217 
218  return '<div class="small">' . ((int)count($this->mails)) . " " . $lng->txt("mails_pl") . "</div>";
219  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDMailBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

58  {
59  switch($_GET['cmd'])
60  {
61  case 'showMail':
62  return IL_SCREEN_CENTER;
63  break;
64 
65  default:
66  return IL_SCREEN_SIDE;
67  break;
68  }
69  }
$_GET["client_id"]
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE

◆ isRepositoryObject()

static ilPDMailBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

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

50  {
51  return false;
52  }

◆ preloadData()

ilPDMailBlockGUI::preloadData ( array  $data)
protected
Parameters
array$data

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

302  {
303  $usr_ids = array();
304 
305  foreach($data as $mail)
306  {
307  if($mail['sender_id'] && $mail['sender_id'] != ANONYMOUS_USER_ID)
308  {
309  $usr_ids[$mail['sender_id']] = $mail['sender_id'];
310  }
311  }
312 
313  ilMailUserCache::preloadUserObjects($usr_ids);
314  }

◆ showMail()

ilPDMailBlockGUI::showMail ( )
protected

show mail

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

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

225  {
226  global $lng, $ilCtrl;
227 
228  include_once("./Services/Mail/classes/class.ilPDMailGUI.php");
229  $mail_gui = new ilPDMailGUI();
230 
231  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
232  $content_block = new ilPDContentBlockGUI();
233  $content_block->setContent($mail_gui->getPDMailHTML($_GET["mail_id"],
234  $_GET["mobj_id"]));
235  $content_block->setTitle($lng->txt("message"));
236  $content_block->setColSpan(2);
237  $content_block->setImage(ilUtil::getImagePath("icon_mail.svg"));
238  $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "show"),
239  $lng->txt("selected_items_back"));
240 
241  if($_GET["mail_mode"] != "system")
242  {
243  $content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=" .
244  $_GET["mail_id"] . "&mobj_id=" . $_GET["mobj_id"] . "&type=reply",
245  $lng->txt("reply"));
246  $content_block->addBlockCommand("ilias.php?baseClass=ilMailGUI&mail_id=" .
247  $_GET["mail_id"] . "&mobj_id=" . $_GET["mobj_id"] . "&type=read",
248  $lng->txt("inbox"));
249 
250  $ilCtrl->setParameter($this, 'mail_id', (int)$_GET['mail_id']);
251  $content_block->addBlockCommand($ilCtrl->getLinkTarget($this, 'deleteMail'), $lng->txt('delete'));
252 
253 
254  }
255  else
256  {
257  $ilCtrl->setParameter($this, "mail_id", $_GET["mail_id"]);
258  $ilCtrl->setParameter($this, "mobj_id", $_GET["mobj_id"]);
259  $content_block->addBlockCommand(
260  $ilCtrl->getLinkTarget($this, "deleteMail"),
261  $lng->txt("delete"));
262  $ilCtrl->clearParameters($this);
263  }
264 
265  return $content_block->getHTML();
266  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Mail User Interface class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $lng
Definition: privfeed.php:40
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilPDMailBlockGUI::$block_type = 'pdmail'
static

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


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