24 require_once
"Services/Mail/classes/class.ilMail.php";
57 $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
60 $this->ctrl->saveParameter($this,
"mobj_id");
61 $this->lng->loadLanguageModule(
"mail");
63 $this->umail =
new ilMail($ilUser->getId());
66 if (!$rbacsystem->checkAccess(
"mail_visible", $this->umail->getMailObjectReferenceId()))
68 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->WARNING);
77 if($ilUser->getProfileIncomplete())
84 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
89 if (
$_GET[
"type"] ==
"search_res")
91 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchResults");
92 $this->ctrl->redirectByClass(
"ilmailformgui");
95 if (
$_GET[
"type"] ==
"attach")
97 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailAttachment");
98 $this->ctrl->redirectByClass(
"ilmailformgui");
101 if (
$_GET[
"type"] ==
"new")
108 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailUser");
109 $this->ctrl->redirectByClass(
"ilmailformgui");
112 if (
$_GET[
"type"] ==
"reply")
115 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"replyMail");
116 $this->ctrl->redirectByClass(
"ilmailformgui");
119 if (
$_GET[
"type"] ==
"read")
122 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"showMail");
123 $this->ctrl->redirectByClass(
"ilmailfoldergui");
126 if (
$_GET[
"type"] ==
"deliverFile")
130 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"deliverFile");
131 $this->ctrl->redirectByClass(
"ilmailfoldergui");
134 if (
$_GET[
"type"] ==
"message_sent")
137 $this->ctrl->redirectByClass(
"ilmailfoldergui");
140 if (
$_GET[
"type"] ==
"role")
142 if (is_array(
$_POST[
'roles']))
146 else if (
$_GET[
"role"])
150 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailRole");
151 $this->ctrl->redirectByClass(
"ilmailformgui");
154 if (
$_GET[
"view"] ==
"my_courses")
157 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchCoursesTo");
158 $this->ctrl->redirectByClass(
"ilmailformgui");
161 if (isset(
$_GET[
"viewmode"]))
164 $this->ctrl->setCmd(
"setViewMode");
167 $this->forwardClass = $this->ctrl->getNextClass($this);
168 if ($this->ctrl->getCmd() !=
"showMenu" && $this->ctrl->getCmd() !=
"refresh")
173 switch($this->forwardClass)
175 case 'ilmailmenugui':
176 include_once
'Services/Mail/classes/class.ilMailMenuGUI.php';
178 $this->ctrl->forwardCommand(
new ilMailMenuGUI());
181 case 'ilmailformgui':
182 include_once
'Services/Mail/classes/class.ilMailFormGUI.php';
187 case 'ilmailaddressbookgui':
188 include_once
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
193 case 'ilmailoptionsgui':
194 include_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
199 case 'ilmailfoldergui':
200 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
205 if (!(
$cmd = $this->ctrl->getCmd()))
207 $cmd =
"setViewMode";
219 if (
$_GET[
"target"] ==
"")
221 $_GET[
"target"] =
"ilmailfoldergui";
225 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
227 $fs_gui->setFramesetTitle($this->lng->txt(
"mail"));
228 $fs_gui->setMainFrameName(
"content");
229 $fs_gui->setSideFrameName(
"tree");
231 $this->ctrl->setParameter($this,
"cmd",
"showMenu");
232 $this->ctrl->setParameter($this,
"mexpand", 1);
233 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
234 $this->ctrl->clearParameters($this);
236 if (
$_GET[
"type"] ==
"add_subfolder")
238 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"addSubFolder"));
240 else if (
$_GET[
"type"] ==
"enter_folderdata")
242 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"enterFolderData"));
244 else if (
$_GET[
"type"] ==
"confirmdelete_folderdata")
246 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"confirmDeleteFolder"));
250 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"]));
257 $this->ctrl->redirectByClass(
$_GET[
"target"]);
268 global $ilMainMenu, $ilTabs;
270 $ilMainMenu->setActive(
"mail");
272 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
273 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
279 $ilTabs->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));
280 $this->ctrl->setParameterByClass(
'ilmailformgui',
'type',
'new');
281 $ilTabs->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
282 $this->ctrl->clearParametersByClass(
'ilmailformgui');
283 $ilTabs->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilmailaddressbookgui'));
284 $ilTabs->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
286 switch($this->forwardClass)
288 case 'ilmailformgui':
289 $ilTabs->setTabActive(
'compose');
292 case 'ilmailaddressbookgui':
293 $ilTabs->setTabActive(
'mail_addressbook');
296 case 'ilmailoptionsgui':
297 $ilTabs->setTabActive(
'options');
300 case 'ilmailfoldergui':
302 $ilTabs->setTabActive(
'fold');
306 if(isset(
$_GET[
'message_sent'])) $ilTabs->setTabActive(
'fold');
311 $this->ctrl->setParameter($this,
"viewmode",
"tree");
312 $this->tpl->setTreeFlatIcon(
313 $this->ctrl->getLinkTarget($this),
320 $this->ctrl->setParameter($this,
"viewmode",
"flat");
321 $this->tpl->setTreeFlatIcon(
322 $this->ctrl->getLinkTarget($this),
326 $this->ctrl->clearParameters($this);
327 $this->tpl->setCurrentBlock(
"tree_icons");
328 $this->tpl->parseCurrentBlock();
335 require_once
"Services/Mail/classes/class.ilMailExplorer.php";
337 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
340 $this->exp =
new ilMailExplorer($this->ctrl->getLinkTargetByClass(
"ilmailfoldergui"),$ilUser->getId());
343 if (
$_GET[
"mexpand"] ==
"")
345 $this->mtree =
new ilTree($ilUser->getId());
347 $expanded = $this->mtree->readRootId();
350 $expanded =
$_GET[
"mexpand"];
352 $this->exp->setExpand($expanded);
355 $this->exp->setOutput(0);
356 $this->output = $this->exp->getOutput();
358 $this->tpl->setCurrentBlock(
"content");
359 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"mail_folders"));
360 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
361 $this->tpl->setVariable(
"EXPLORER",$this->output);
362 $this->ctrl->setParameter($this,
"mexpand",
$_GET[
"mexpand"]);
363 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this,
'showMenu'));
364 $this->tpl->parseCurrentBlock();
366 $this->tpl->show(
false);