ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 Handle config status. More...
 
 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 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$ @ilCtrl_IsCalledBy ilPDMailBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDMailBlockGUI::__construct ( )

Constructor.

Reimplemented in ilPDSysMessageBlockGUI.

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

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'));
34 }
setLimit($a_limit)
Set Limit.
setImage($a_image)
Set Image.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setTitle($a_title)
Set Title.
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

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

+ 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.

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 }
$_GET["client_id"]
$_SESSION["AccountId"]
Class Mail this class handles base functions for mail handling.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPDMailBlockGUI::executeCommand ( )

execute command

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

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

References $cmd, and $ilCtrl.

◆ fillDataSection()

ilPDMailBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

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 }
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
getCurrentDetailLevel()
Get Current Detail Level.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
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.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.

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

+ Here is the call graph for this function:

◆ fillRow()

ilPDMailBlockGUI::fillRow (   $mail)

get flat bookmark list for personal desktop

Reimplemented from ilBlockGUI.

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

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 }
const IL_CAL_DATE
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
static getUserObjectById($usr_id)

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

+ Here is the call graph for this function:

◆ getBlockType()

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.

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

References $block_type.

◆ getHTML()

ilPDMailBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

Reimplemented in ilPDSysMessageBlockGUI.

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

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 }
$html
Definition: example_001.php:87
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ getMails()

ilPDMailBlockGUI::getMails ( )
protected

Get Mails.

Reimplemented in ilPDSysMessageBlockGUI.

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

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 }

References $ilUser.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getOverview()

ilPDMailBlockGUI::getOverview ( )
protected

Get overview.

Reimplemented in ilPDSysMessageBlockGUI.

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

215 {
216 global $lng;
217
218 return '<div class="small">' . ((int)count($this->mails)) . " " . $lng->txt("mails_pl") . "</div>";
219 }

References $lng.

Referenced by fillDataSection().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDMailBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

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 }
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

References $_GET, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

◆ isRepositoryObject()

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.

50 {
51 return false;
52 }

◆ preloadData()

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

Reimplemented from ilBlockGUI.

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 }

References ilBlockGUI\$data.

◆ showMail()

ilPDMailBlockGUI::showMail ( )
protected

show mail

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

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 }
BlockGUI class for (centered) Content on Personal Desktop.
Mail User Interface class.

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

+ 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.

Referenced by getBlockType().


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