24 require_once
"Services/Mail/classes/class.ilMail.php";
25 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
63 $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
66 $this->ctrl->saveParameter($this,
"mobj_id");
67 $this->lng->loadLanguageModule(
"mail");
69 $this->umail =
new ilMail($ilUser->getId());
72 if (!$rbacsystem->checkAccess(
"mail_visible", $this->umail->getMailObjectReferenceId()))
74 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->WARNING);
83 if($ilUser->getProfileIncomplete())
90 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
95 if (
$_GET[
"type"] ==
"search_res")
97 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchResults");
98 $this->ctrl->redirectByClass(
"ilmailformgui");
101 if (
$_GET[
"type"] ==
"attach")
105 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailAttachment");
106 $this->ctrl->redirectByClass(
"ilmailformgui");
109 if (
$_GET[
"type"] ==
"new")
117 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailUser");
118 $this->ctrl->redirectByClass(
"ilmailformgui");
121 if (
$_GET[
"type"] ==
"reply")
124 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"replyMail");
125 $this->ctrl->redirectByClass(
"ilmailformgui");
128 if (
$_GET[
"type"] ==
"read")
131 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"showMail");
132 $this->ctrl->redirectByClass(
"ilmailfoldergui");
135 if (
$_GET[
"type"] ==
"deliverFile")
139 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"deliverFile");
140 $this->ctrl->redirectByClass(
"ilmailfoldergui");
143 if (
$_GET[
"type"] ==
"message_sent")
146 $this->ctrl->redirectByClass(
"ilmailfoldergui");
149 if (
$_GET[
"type"] ==
"role")
151 if (is_array(
$_POST[
'roles']))
155 else if (
$_GET[
"role"])
162 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailRole");
163 $this->ctrl->redirectByClass(
"ilmailformgui");
166 if (
$_GET[
"view"] ==
"my_courses")
169 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchCoursesTo");
170 $this->ctrl->redirectByClass(
"ilmailformgui");
173 if (isset(
$_GET[
"viewmode"]))
176 $this->ctrl->setCmd(
"setViewMode");
179 $this->forwardClass = $this->ctrl->getNextClass($this);
180 if ($this->ctrl->getCmd() !=
"showMenu" && $this->ctrl->getCmd() !=
"refresh")
185 switch($this->forwardClass)
187 case 'ilmailmenugui':
188 include_once
'Services/Mail/classes/class.ilMailMenuGUI.php';
190 $this->ctrl->forwardCommand(
new ilMailMenuGUI());
193 case 'ilmailformgui':
194 include_once
'Services/Mail/classes/class.ilMailFormGUI.php';
199 case 'ilmailaddressbookgui':
200 include_once
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
205 case 'ilmailoptionsgui':
206 include_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
211 case 'ilmailfoldergui':
212 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
217 if (!(
$cmd = $this->ctrl->getCmd()))
219 $cmd =
"setViewMode";
231 if (
$_GET[
"target"] ==
"")
233 $_GET[
"target"] =
"ilmailfoldergui";
235 if(isset(
$_SESSION[self::VIEWMODE_SESSION_KEY]) &&
'tree' ==
$_SESSION[self::VIEWMODE_SESSION_KEY])
237 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
239 $fs_gui->setFramesetTitle($this->lng->txt(
"mail"));
240 $fs_gui->setMainFrameName(
"content");
241 $fs_gui->setSideFrameName(
"tree");
243 $this->ctrl->setParameter($this,
"cmd",
"showMenu");
244 $this->ctrl->setParameter($this,
"mexpand", 1);
245 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
246 $this->ctrl->clearParameters($this);
248 if (
$_GET[
"type"] ==
"add_subfolder")
250 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"addSubFolder"));
252 else if (
$_GET[
"type"] ==
"enter_folderdata")
254 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"enterFolderData"));
256 else if (
$_GET[
"type"] ==
"confirmdelete_folderdata")
258 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"confirmDeleteFolder"));
262 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"]));
269 $this->ctrl->redirectByClass(
$_GET[
"target"]);
280 global $ilMainMenu, $ilTabs;
282 $ilMainMenu->setActive(
"mail");
285 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
286 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
292 $ilTabs->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));
293 $this->ctrl->setParameterByClass(
'ilmailformgui',
'type',
'new');
294 $ilTabs->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
295 $this->ctrl->clearParametersByClass(
'ilmailformgui');
296 $ilTabs->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilmailaddressbookgui'));
297 $ilTabs->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
299 switch($this->forwardClass)
301 case 'ilmailformgui':
302 $ilTabs->setTabActive(
'compose');
305 case 'ilmailaddressbookgui':
306 $ilTabs->setTabActive(
'mail_addressbook');
309 case 'ilmailoptionsgui':
310 $ilTabs->setTabActive(
'options');
313 case 'ilmailfoldergui':
315 $ilTabs->setTabActive(
'fold');
319 if(isset(
$_GET[
'message_sent'])) $ilTabs->setTabActive(
'fold');
321 if(!isset(
$_SESSION[self::VIEWMODE_SESSION_KEY]) ||
'tree' !=
$_SESSION[self::VIEWMODE_SESSION_KEY])
323 $this->ctrl->setParameter($this,
'viewmode',
'tree');
324 $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this),
'tree');
328 $this->ctrl->setParameter($this,
'viewmode',
'flat');
329 $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this),
'flat');
331 $this->ctrl->clearParameters($this);
332 $this->tpl->setCurrentBlock(
"tree_icons");
333 $this->tpl->parseCurrentBlock();
340 require_once
"Services/Mail/classes/class.ilMailExplorer.php";
342 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
345 $this->exp =
new ilMailExplorer($this->ctrl->getLinkTargetByClass(
"ilmailfoldergui"),$ilUser->getId());
348 if (
$_GET[
"mexpand"] ==
"")
350 $this->mtree =
new ilTree($ilUser->getId());
352 $expanded = $this->mtree->readRootId();
355 $expanded =
$_GET[
"mexpand"];
357 $this->exp->setExpand($expanded);
360 $this->exp->setOutput(0);
361 $this->output = $this->exp->getOutput();
363 $this->tpl->setCurrentBlock(
"content");
364 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"mail_folders"));
365 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
366 $this->tpl->setVariable(
"EXPLORER",$this->output);
367 $this->ctrl->setParameter($this,
"mexpand",
$_GET[
"mexpand"]);
368 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this,
'showMenu'));
369 $this->tpl->parseCurrentBlock();
371 $this->tpl->show(
false);