ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMailGUI Class Reference
+ Collaboration diagram for ilMailGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Data Fields

const VIEWMODE_SESSION_KEY = 'mail_viewmode'
 

Private Member Functions

 setViewMode ()
 
 showHeader ()
 
 isMailDetailCommand ($cmd)
 
 showExplorer ()
 

Private Attributes

 $tpl = null
 
 $ctrl = null
 
 $lng = null
 
 $tabs_gui = null
 
 $umail = null
 
 $exp = null
 
 $output = null
 
 $mtree = null
 
 $forwardClass = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMailGUI::__construct ( )

Definition at line 33 of file class.ilMailGUI.php.

34 {
35 global $tpl, $ilCtrl, $lng, $rbacsystem, $ilErr, $ilUser;
36
37 $this->tpl = $tpl;
38 $this->ctrl = $ilCtrl;
39 $this->lng = $lng;
40
41 if(isset($_POST['mobj_id']) && (int)$_POST['mobj_id'])
42 {
43 $_GET['mobj_id'] = $_POST['mobj_id'];
44 }
45 $_GET['mobj_id'] = (int)$_GET['mobj_id'];
46
47 $this->ctrl->saveParameter($this, "mobj_id");
48 $this->lng->loadLanguageModule("mail");
49
50 $this->umail = new ilMail($ilUser->getId());
51
52 // CHECK HACK
53 if (!$rbacsystem->checkAccess('internal_mail', $this->umail->getMailObjectReferenceId()))
54 {
55 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
56 }
57 }
$_GET["client_id"]
Class Mail this class handles base functions for mail handling.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

References $_GET, $_POST, $ilCtrl, $ilErr, $ilUser, $lng, and $tpl.

Member Function Documentation

◆ executeCommand()

ilMailGUI::executeCommand ( )

Definition at line 59 of file class.ilMailGUI.php.

60 {
61 if ($_GET["type"] == "search_res")
62 {
64
65 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
66 $this->ctrl->redirectByClass("ilmailformgui");
67 }
68
69 if ($_GET["type"] == "attach")
70 {
72
73 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
74 $this->ctrl->redirectByClass("ilmailformgui");
75 }
76
77 if ($_GET["type"] == "new")
78 {
79 $_SESSION['rcp_to'] = $_GET['rcp_to'];
80 if(!strlen($_SESSION['rcp_to']) && ($recipients = ilMailFormCall::getRecipients()))
81 {
82 $_SESSION['rcp_to'] = implode(',', $recipients);
84 }
85 $_SESSION['rcp_cc'] = $_GET['rcp_cc'];
86 $_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
87
89
90 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
91 $this->ctrl->redirectByClass("ilmailformgui");
92 }
93
94 if ($_GET["type"] == "reply")
95 {
96 $_SESSION['mail_id'] = $_GET['mail_id'];
97 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
98 $this->ctrl->redirectByClass("ilmailformgui");
99 }
100
101 if ($_GET["type"] == "read")
102 {
103 $_SESSION['mail_id'] = $_GET['mail_id'];
104 $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
105 $this->ctrl->redirectByClass("ilmailfoldergui");
106 }
107
108 if ($_GET["type"] == "deliverFile")
109 {
110 $_SESSION['mail_id'] = $_GET['mail_id'];
111 $_SESSION['filename'] = ($_POST["filename"] ? $_POST["filename"] : $_GET["filename"]);
112 $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
113 $this->ctrl->redirectByClass("ilmailfoldergui");
114 }
115
116 if ($_GET["type"] == "message_sent")
117 {
118 ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
119 $this->ctrl->redirectByClass("ilmailfoldergui");
120 }
121
122 if ($_GET["type"] == "role")
123 {
124 if (is_array($_POST['roles']))
125 {
126 $_SESSION['mail_roles'] = $_POST['roles'];
127 }
128 else if ($_GET["role"])
129 {
130 $_SESSION['mail_roles'] = array($_GET["role"]);
131 }
132
134
135 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
136 $this->ctrl->redirectByClass("ilmailformgui");
137 }
138
139 if ($_GET["view"] == "my_courses")
140 {
141 $_SESSION['search_crs'] = $_GET['search_crs'];
142 $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
143 $this->ctrl->redirectByClass("ilmailformgui");
144 }
145
146 if (isset($_GET["viewmode"]))
147 {
148 ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
149 $this->ctrl->setCmd("setViewMode");
150 }
151
152 $this->forwardClass = $this->ctrl->getNextClass($this);
153
154 $this->showHeader();
155
156 if('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) &&
157 $this->ctrl->getCmd() != "showExplorer")
158 {
159 $this->showExplorer();
160 }
161
162 include_once "Services/jQuery/classes/class.iljQueryUtil.php";
164
165 // always load ui framework
166 include_once("./Services/UICore/classes/class.ilUIFramework.php");
168
169 switch($this->forwardClass)
170 {
171 case 'ilmailformgui':
172 include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
173
174 $this->ctrl->forwardCommand(new ilMailFormGUI());
175 break;
176
177 case 'ilcontactgui':
178 require_once 'Services/Contact/classes/class.ilContactGUI.php';
179 $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
180 $this->ctrl->forwardCommand(new ilContactGUI());
181 break;
182
183 case 'ilmailoptionsgui':
184 include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
185
186 $this->ctrl->forwardCommand(new ilMailOptionsGUI());
187 break;
188
189 case 'ilmailfoldergui':
190 include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
191 $this->ctrl->forwardCommand(new ilMailFolderGUI());
192 break;
193
194 default:
195 if (!($cmd = $this->ctrl->getCmd()))
196 {
197 $cmd = "setViewMode";
198 }
199
200 $this->$cmd();
201 break;
202
203 }
204 return true;
205 }
$_SESSION["AccountId"]
static storeReferer($request_params)
static setRecipients(array $recipients)
static set($a_var, $a_val)
Set a value.
static get($a_var)
Get a value.
init($a_tpl=null)
Init.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static initjQuery($a_tpl=null)
Init jQuery.
$cmd
Definition: sahs_server.php:35

References $_GET, $_POST, $_SESSION, $cmd, ilSession\get(), ilMailFormCall\getRecipients(), ilUIFramework\init(), iljQueryUtil\initjQuery(), ilUtil\sendInfo(), ilSession\set(), ilMailFormCall\setRecipients(), showExplorer(), showHeader(), and ilMailFormCall\storeReferer().

+ Here is the call graph for this function:

◆ isMailDetailCommand()

ilMailGUI::isMailDetailCommand (   $cmd)
private
Parameters
string$cmd
Returns
bool

Definition at line 309 of file class.ilMailGUI.php.

310 {
311 return in_array(strtolower($cmd), array('showmail')) && isset($_GET['mail_id']) && (int)$_GET['mail_id'];
312 }

References $_GET, and $cmd.

Referenced by showHeader().

+ Here is the caller graph for this function:

◆ setViewMode()

ilMailGUI::setViewMode ( )
private

Definition at line 207 of file class.ilMailGUI.php.

208 {
209 if ($_GET["target"] == "")
210 {
211 $_GET["target"] = "ilmailfoldergui";
212 }
213
214 if($_GET['type'] == 'redirect_to_read')
215 {
216 $this->ctrl->setParameterByClass('ilMailFolderGUI', 'mail_id', (int)$_GET['mail_id']);
217 $this->ctrl->redirectByClass('ilMailFolderGUI', 'showMail');
218 }
219 else if ($_GET["type"] == "add_subfolder")
220 {
221 $this->ctrl->redirectByClass($_GET["target"], "addSubFolder");
222 }
223 else if ($_GET["type"] == "enter_folderdata")
224 {
225 $this->ctrl->redirectByClass($_GET["target"], "enterFolderData");
226 }
227 else if ($_GET["type"] == "confirmdelete_folderdata")
228 {
229 $this->ctrl->redirectByClass($_GET["target"], "confirmDeleteFolder");
230 }
231 else
232 {
233 $this->ctrl->redirectByClass($_GET["target"]);
234 }
235 }

References $_GET.

◆ showExplorer()

ilMailGUI::showExplorer ( )
private

Definition at line 314 of file class.ilMailGUI.php.

315 {
316 global $ilUser;
317
318 require_once "Services/Mail/classes/class.ilMailExplorer.php";
319 $exp = new ilMailExplorer($this, "showExplorer", $ilUser->getId());
320 if (!$exp->handleCommand())
321 {
322 $this->tpl->setLeftNavContent($exp->getHTML());
323 }
324 }
Class Mail Explorer class for explorer view for mailboxes.

References $exp, and $ilUser.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ showHeader()

ilMailGUI::showHeader ( )
private

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

238 {
239 global $ilMainMenu, $ilTabs, $ilHelp;
240
241 $ilHelp->setScreenIdComponent("mail");
242
243 $ilMainMenu->setActive("mail");
244
245// $this->tpl->getStandardTemplate();
246 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
247 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
248 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mail.svg"));
249
250 // display infopanel if something happened
252
253 $ilTabs->addTarget('fold', $this->ctrl->getLinkTargetByClass('ilmailfoldergui'));
254 $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'new');
255 $ilTabs->addTarget('compose', $this->ctrl->getLinkTargetByClass('ilmailformgui'));
256 $this->ctrl->clearParametersByClass('ilmailformgui');
257 $ilTabs->addTarget('mail_addressbook', $this->ctrl->getLinkTargetByClass('ilcontactgui'));
258 $ilTabs->addTarget('options', $this->ctrl->getLinkTargetByClass('ilmailoptionsgui'));
259
260 switch($this->forwardClass)
261 {
262 case 'ilmailformgui':
263 $ilTabs->setTabActive('compose');
264 break;
265
266 case 'ilcontactgui':
267 $ilTabs->setTabActive('mail_addressbook');
268 break;
269
270 case 'ilmailoptionsgui':
271 $ilTabs->setTabActive('options');
272 break;
273
274 case 'ilmailfoldergui':
275 default:
276 $ilTabs->setTabActive('fold');
277 break;
278
279 }
280 if(isset($_GET['message_sent'])) $ilTabs->setTabActive('fold');
281
282 if('tree' != ilSession::get(self::VIEWMODE_SESSION_KEY))
283 {
284 $tree_state = 'tree';
285 }
286 else
287 {
288 $tree_state = 'flat';
289 }
290
291 if($this->isMailDetailCommand($this->ctrl->getCmd()))
292 {
293 $this->ctrl->setParameter($this, 'mail_id', (int)$_GET['mail_id']);
294 $this->ctrl->setParameter($this, 'type', 'redirect_to_read');
295 }
296
297 $this->ctrl->setParameter($this, 'viewmode', $tree_state);
298 $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
299
300 $this->ctrl->clearParameters($this);
301 $this->tpl->setCurrentBlock("tree_icons");
302 $this->tpl->parseCurrentBlock();
303 }
isMailDetailCommand($cmd)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static infoPanel($a_keep=true)

References $_GET, ilSession\get(), ilUtil\getImagePath(), ilUtil\infoPanel(), and isMailDetailCommand().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilMailGUI::$ctrl = null
private

Definition at line 23 of file class.ilMailGUI.php.

◆ $exp

ilMailGUI::$exp = null
private

Definition at line 28 of file class.ilMailGUI.php.

Referenced by showExplorer().

◆ $forwardClass

ilMailGUI::$forwardClass = null
private

Definition at line 31 of file class.ilMailGUI.php.

◆ $lng

ilMailGUI::$lng = null
private

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

Referenced by __construct().

◆ $mtree

ilMailGUI::$mtree = null
private

Definition at line 30 of file class.ilMailGUI.php.

◆ $output

ilMailGUI::$output = null
private

Definition at line 29 of file class.ilMailGUI.php.

◆ $tabs_gui

ilMailGUI::$tabs_gui = null
private

Definition at line 25 of file class.ilMailGUI.php.

◆ $tpl

ilMailGUI::$tpl = null
private

Definition at line 22 of file class.ilMailGUI.php.

Referenced by __construct().

◆ $umail

ilMailGUI::$umail = null
private

Definition at line 27 of file class.ilMailGUI.php.

◆ VIEWMODE_SESSION_KEY

const ilMailGUI::VIEWMODE_SESSION_KEY = 'mail_viewmode'

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