4 require_once
"Services/Mail/classes/class.ilMail.php";
5 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
37 $this->tpl = $DIC->ui()->mainTemplate();
38 $this->ctrl = $DIC->ctrl();
39 $this->lng = $DIC->language();
41 if (isset(
$_POST[
'mobj_id']) && (
int)
$_POST[
'mobj_id']) {
42 $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
46 $this->ctrl->saveParameter($this,
"mobj_id");
47 $this->lng->loadLanguageModule(
"mail");
49 $this->umail =
new ilMail($DIC->user()->getId());
51 if (!$DIC->rbac()->system()->checkAccess(
'internal_mail', $this->umail->getMailObjectReferenceId())) {
52 $DIC[
'ilErr']->raiseError($this->lng->txt(
"permission_denied"), $DIC[
'ilErr']->WARNING);
58 if (
$_GET[
"type"] ==
"search_res") {
61 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchResults");
62 $this->ctrl->redirectByClass(
"ilmailformgui");
65 if (
$_GET[
"type"] ==
"attach") {
68 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailAttachment");
69 $this->ctrl->redirectByClass(
"ilmailformgui");
72 if (
$_GET[
"type"] ==
"new") {
75 $_SESSION[
'rcp_to'] = implode(
',', $recipients);
83 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailUser");
84 $this->ctrl->redirectByClass(
"ilmailformgui");
87 if (
$_GET[
"type"] ==
"reply") {
89 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"replyMail");
90 $this->ctrl->redirectByClass(
"ilmailformgui");
93 if (
$_GET[
"type"] ==
"read") {
95 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"showMail");
96 $this->ctrl->redirectByClass(
"ilmailfoldergui");
99 if (
$_GET[
"type"] ==
"deliverFile") {
102 $this->ctrl->setParameterByClass(
"ilmailfoldergui",
"cmd",
"deliverFile");
103 $this->ctrl->redirectByClass(
"ilmailfoldergui");
106 if (
$_GET[
"type"] ==
"message_sent") {
108 $this->ctrl->redirectByClass(
"ilmailfoldergui");
111 if (
$_GET[
"type"] ==
"role") {
112 if (is_array(
$_POST[
'roles'])) {
114 } elseif (
$_GET[
"role"]) {
120 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"mailRole");
121 $this->ctrl->redirectByClass(
"ilmailformgui");
124 if (
$_GET[
"view"] ==
"my_courses") {
126 $this->ctrl->setParameterByClass(
"ilmailformgui",
"cmd",
"searchCoursesTo");
127 $this->ctrl->redirectByClass(
"ilmailformgui");
130 if (isset(
$_GET[
"viewmode"])) {
132 $this->ctrl->setCmd(
"setViewMode");
135 $this->forwardClass = $this->ctrl->getNextClass($this);
140 $this->ctrl->getCmd() !=
"showExplorer") {
144 switch ($this->forwardClass) {
145 case 'ilmailformgui':
146 include_once
'Services/Mail/classes/class.ilMailFormGUI.php';
152 require_once
'Services/Contact/classes/class.ilContactGUI.php';
153 $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
157 case 'ilmailoptionsgui':
158 $this->tpl->setTitle($this->lng->txt(
'mail'));
159 include_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
164 case 'ilmailfoldergui':
165 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
170 if (!($cmd = $this->ctrl->getCmd())) {
171 $cmd =
"setViewMode";
183 if (
$_GET[
"target"] ==
"") {
184 $_GET[
"target"] =
"ilmailfoldergui";
187 if (
$_GET[
'type'] ==
'redirect_to_read') {
188 $this->ctrl->setParameterByClass(
'ilMailFolderGUI',
'mail_id', (
int)
$_GET[
'mail_id']);
189 $this->ctrl->redirectByClass(
'ilMailFolderGUI',
'showMail');
190 } elseif (
$_GET[
"type"] ==
"add_subfolder") {
191 $this->ctrl->redirectByClass(
$_GET[
"target"],
"addSubFolder");
192 } elseif (
$_GET[
"type"] ==
"enter_folderdata") {
193 $this->ctrl->redirectByClass(
$_GET[
"target"],
"enterFolderData");
194 } elseif (
$_GET[
"type"] ==
"confirmdelete_folderdata") {
195 $this->ctrl->redirectByClass(
$_GET[
"target"],
"confirmDeleteFolder");
197 $this->ctrl->redirectByClass(
$_GET[
"target"]);
205 $DIC[
'ilHelp']->setScreenIdComponent(
"mail");
206 $DIC[
'ilMainMenu']->setActive(
"mail");
208 $this->tpl->getStandardTemplate();
215 $DIC->tabs()->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));
216 $this->ctrl->setParameterByClass(
'ilmailformgui',
'type',
'new');
217 $DIC->tabs()->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
218 $this->ctrl->clearParametersByClass(
'ilmailformgui');
219 $DIC->tabs()->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilcontactgui'));
220 $DIC->tabs()->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
222 switch ($this->forwardClass) {
223 case 'ilmailformgui':
224 $DIC->tabs()->setTabActive(
'compose');
228 $DIC->tabs()->setTabActive(
'mail_addressbook');
231 case 'ilmailoptionsgui':
232 $DIC->tabs()->setTabActive(
'options');
235 case 'ilmailfoldergui':
237 $DIC->tabs()->setTabActive(
'fold');
241 if (isset(
$_GET[
'message_sent'])) {
242 $DIC->tabs()->setTabActive(
'fold');
246 $tree_state =
'tree';
248 $tree_state =
'flat';
252 $this->ctrl->setParameter($this,
'mail_id', (
int)
$_GET[
'mail_id']);
253 $this->ctrl->setParameter($this,
'type',
'redirect_to_read');
256 $this->ctrl->setParameter($this,
'viewmode', $tree_state);
257 $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
259 $this->ctrl->clearParameters($this);
260 $this->tpl->setCurrentBlock(
"tree_icons");
261 $this->tpl->parseCurrentBlock();
270 return in_array(strtolower($cmd),
array(
'showmail')) && isset(
$_GET[
'mail_id']) && (int)
$_GET[
'mail_id'];
277 require_once
"Services/Mail/classes/class.ilMailExplorer.php";
279 if (!
$exp->handleCommand()) {
280 $this->tpl->setLeftNavContent(
$exp->getHTML());
isMailDetailCommand($cmd)
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
const VIEWMODE_SESSION_KEY
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class Mail Explorer class for explorer view for mailboxes.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class handles base functions for mail handling.
static infoPanel($a_keep=true)
Create styles array
The data for the language used.