24 require_once
"Services/Mail/classes/class.ilMail.php";
55 if(isset($_POST[
'mobj_id']) && (
int)$_POST[
'mobj_id'])
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);
76 if($ilUser->getProfileIncomplete())
83 if( $ilUser->isPasswordChangeDemanded() )
85 ilUtil::sendInfo( $this->lng->txt(
'password_change_on_first_login_demand'), true );
91 if( $ilUser->isPasswordExpired() )
93 $msg = $this->lng->txt(
'password_expired');
94 $password_age = $ilUser->getPasswordAge();
101 if (
$_GET[
"type"] ==
"search_res")
103 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchResults");
104 $this->ctrl->redirectByClass(
"ilmailformgui");
107 if (
$_GET[
"type"] ==
"attach")
109 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailAttachment");
110 $this->ctrl->redirectByClass(
"ilmailformgui");
113 if (
$_GET[
"type"] ==
"new")
120 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailUser");
121 $this->ctrl->redirectByClass(
"ilmailformgui");
124 if (
$_GET[
"type"] ==
"reply")
127 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"replyMail");
128 $this->ctrl->redirectByClass(
"ilmailformgui");
131 if (
$_GET[
"type"] ==
"read")
134 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"showMail");
135 $this->ctrl->redirectByClass(
"ilmailfoldergui");
138 if (
$_GET[
"type"] ==
"deliverFile")
141 $_SESSION[
'filename'] = ($_POST[
"filename"] ? $_POST[
"filename"] :
$_GET[
"filename"]);
142 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"deliverFile");
143 $this->ctrl->redirectByClass(
"ilmailfoldergui");
146 if (
$_GET[
"type"] ==
"message_sent")
149 $this->ctrl->redirectByClass(
"ilmailfoldergui");
152 if (
$_GET[
"type"] ==
"role")
154 if (is_array($_POST[
'roles']))
156 $_SESSION[
'mail_roles'] = $_POST[
'roles'];
158 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);
181 if ($this->ctrl->getCmd() !=
"showMenu" && $this->ctrl->getCmd() !=
"refresh")
186 switch($this->forwardClass)
188 case 'ilmailmenugui':
189 include_once
'Services/Mail/classes/class.ilMailMenuGUI.php';
191 $this->ctrl->forwardCommand(
new ilMailMenuGUI());
194 case 'ilmailformgui':
195 include_once
'Services/Mail/classes/class.ilMailFormGUI.php';
200 case 'ilmailaddressbookgui':
201 include_once
'Services/Mail/classes/class.ilMailAddressbookGUI.php';
206 case 'ilmailoptionsgui':
207 include_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
212 case 'ilmailfoldergui':
213 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
219 if (!(
$cmd = $this->ctrl->getCmd()))
221 $cmd =
"setViewMode";
233 if (
$_GET[
"target"] ==
"")
235 $_GET[
"target"] =
"ilmailfoldergui";
239 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
241 $fs_gui->setFramesetTitle($this->lng->txt(
"mail"));
242 $fs_gui->setMainFrameName(
"content");
243 $fs_gui->setSideFrameName(
"tree");
245 $this->ctrl->setParameter($this,
"cmd",
"showMenu");
246 $this->ctrl->setParameter($this,
"mexpand", 1);
247 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
248 $this->ctrl->clearParameters($this);
250 if (
$_GET[
"type"] ==
"add_subfolder")
252 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"addSubFolder"));
254 else if (
$_GET[
"type"] ==
"enter_folderdata")
256 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"enterFolderData"));
258 else if (
$_GET[
"type"] ==
"confirmdelete_folderdata")
260 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"],
"confirmDeleteFolder"));
264 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"]));
270 $this->ctrl->redirectByClass(
$_GET[
"target"]);
281 global $ilMainMenu, $ilTabs;
283 $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');
324 $this->ctrl->setParameter($this,
"viewmode",
"tree");
325 $this->tpl->setTreeFlatIcon(
326 $this->ctrl->getLinkTarget($this),
333 $this->ctrl->setParameter($this,
"viewmode",
"flat");
334 $this->tpl->setTreeFlatIcon(
335 $this->ctrl->getLinkTarget($this),
339 $this->ctrl->clearParameters($this);
340 $this->tpl->setCurrentBlock(
"tree_icons");
341 $this->tpl->parseCurrentBlock();
348 require_once
"Services/Mail/classes/class.ilMailExplorer.php";
350 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
353 $this->exp =
new ilMailExplorer($this->ctrl->getLinkTargetByClass(
"ilmailfoldergui"),$ilUser->getId());
356 if (
$_GET[
"mexpand"] ==
"")
358 $this->mtree =
new ilTree($ilUser->getId());
360 $expanded = $this->mtree->readRootId();
363 $expanded =
$_GET[
"mexpand"];
365 $this->exp->setExpand($expanded);
368 $this->exp->setOutput(0);
369 $this->output = $this->exp->getOutput();
371 $this->tpl->setCurrentBlock(
"content");
372 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"mail_folders"));
373 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
374 $this->tpl->setVariable(
"EXPLORER",$this->output);
375 $this->ctrl->setParameter($this,
"mexpand",
$_GET[
"mexpand"]);
376 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this,
'showMenu'));
377 $this->tpl->parseCurrentBlock();
379 $this->tpl->show(
false);