4 require_once
"Services/Mail/classes/class.ilMail.php";
5 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
43 $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
47 $this->ctrl->saveParameter($this,
"mobj_id");
48 $this->lng->loadLanguageModule(
"mail");
50 $this->umail =
new ilMail($ilUser->getId());
53 if (!$rbacsystem->checkAccess(
'internal_mail', $this->umail->getMailObjectReferenceId()))
55 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->WARNING);
61 if (
$_GET[
"type"] ==
"search_res")
63 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchResults");
64 $this->ctrl->redirectByClass(
"ilmailformgui");
67 if (
$_GET[
"type"] ==
"attach")
71 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailAttachment");
72 $this->ctrl->redirectByClass(
"ilmailformgui");
75 if (
$_GET[
"type"] ==
"new")
83 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailUser");
84 $this->ctrl->redirectByClass(
"ilmailformgui");
87 if (
$_GET[
"type"] ==
"reply")
90 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"replyMail");
91 $this->ctrl->redirectByClass(
"ilmailformgui");
94 if (
$_GET[
"type"] ==
"read")
97 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"showMail");
98 $this->ctrl->redirectByClass(
"ilmailfoldergui");
101 if (
$_GET[
"type"] ==
"deliverFile")
105 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"deliverFile");
106 $this->ctrl->redirectByClass(
"ilmailfoldergui");
109 if (
$_GET[
"type"] ==
"message_sent")
112 $this->ctrl->redirectByClass(
"ilmailfoldergui");
115 if (
$_GET[
"type"] ==
"role")
117 if (is_array(
$_POST[
'roles']))
121 else if (
$_GET[
"role"])
128 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailRole");
129 $this->ctrl->redirectByClass(
"ilmailformgui");
132 if (
$_GET[
"view"] ==
"my_courses")
135 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchCoursesTo");
136 $this->ctrl->redirectByClass(
"ilmailformgui");
139 if (isset(
$_GET[
"viewmode"]))
142 $this->ctrl->setCmd(
"setViewMode");
145 $this->forwardClass = $this->ctrl->getNextClass($this);
150 $this->ctrl->getCmd() !=
"showExplorer")
155 include_once
"Services/jQuery/classes/class.iljQueryUtil.php";
158 switch($this->forwardClass)
160 case 'ilmailformgui':
161 include_once
'Services/Mail/classes/class.ilMailFormGUI.php';
166 case 'ilmailaddressbookgui':
167 include_once
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
172 case 'ilmailoptionsgui':
173 include_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
178 case 'ilmailfoldergui':
179 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
184 if (!(
$cmd = $this->ctrl->getCmd()))
186 $cmd =
"setViewMode";
198 if (
$_GET[
"target"] ==
"")
200 $_GET[
"target"] =
"ilmailfoldergui";
203 if(
$_GET[
'type'] ==
'redirect_to_read')
205 $this->ctrl->setParameterByClass(
'ilMailFolderGUI',
'mail_id', (
int)
$_GET[
'mail_id']);
206 $this->ctrl->redirectByClass(
'ilMailFolderGUI',
'showMail');
208 else if (
$_GET[
"type"] ==
"add_subfolder")
210 $this->ctrl->redirectByClass(
$_GET[
"target"],
"addSubFolder");
212 else if (
$_GET[
"type"] ==
"enter_folderdata")
214 $this->ctrl->redirectByClass(
$_GET[
"target"],
"enterFolderData");
216 else if (
$_GET[
"type"] ==
"confirmdelete_folderdata")
218 $this->ctrl->redirectByClass(
$_GET[
"target"],
"confirmDeleteFolder");
222 $this->ctrl->redirectByClass(
$_GET[
"target"]);
228 global $ilMainMenu, $ilTabs, $ilHelp;
230 $ilHelp->setScreenIdComponent(
"mail");
232 $ilMainMenu->setActive(
"mail");
235 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
236 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
242 $ilTabs->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));
243 $this->ctrl->setParameterByClass(
'ilmailformgui',
'type',
'new');
244 $ilTabs->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
245 $this->ctrl->clearParametersByClass(
'ilmailformgui');
246 $ilTabs->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilmailaddressbookgui'));
247 $ilTabs->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
249 switch($this->forwardClass)
251 case 'ilmailformgui':
252 $ilTabs->setTabActive(
'compose');
255 case 'ilmailaddressbookgui':
256 $ilTabs->setTabActive(
'mail_addressbook');
259 case 'ilmailoptionsgui':
260 $ilTabs->setTabActive(
'options');
263 case 'ilmailfoldergui':
265 $ilTabs->setTabActive(
'fold');
269 if(isset(
$_GET[
'message_sent'])) $ilTabs->setTabActive(
'fold');
273 $tree_state =
'tree';
277 $tree_state =
'flat';
282 $this->ctrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
283 $this->ctrl->setParameter($this,
'type',
'redirect_to_read');
286 $this->ctrl->setParameter($this,
'viewmode', $tree_state);
287 $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
289 $this->ctrl->clearParameters($this);
290 $this->tpl->setCurrentBlock(
"tree_icons");
291 $this->tpl->parseCurrentBlock();
300 return in_array(strtolower(
$cmd), array(
'showmail')) && isset(
$_GET[
'mail_id']) && (int)
$_GET[
'mail_id'];
307 require_once
"Services/Mail/classes/class.ilMailExplorer.php";
309 if (!
$exp->handleCommand())
311 $this->tpl->setLeftNavContent(
$exp->getHTML());