ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailGUI Class Reference
+ Collaboration diagram for ilMailGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Data Fields

const VIEWMODE_SESSION_KEY = 'mail_viewmode'
 

Private Member Functions

 setViewMode ()
 
 showHeader ()
 
 isMailDetailCommand ($cmd)
 
 showExplorer ()
 

Private Attributes

 $tpl = null
 
 $ctrl = null
 
 $lng = null
 
 $tabs_gui = null
 
 $umail = null
 
 $exp = null
 
 $output = null
 
 $mtree = null
 
 $forwardClass = null
 

Detailed Description

Definition at line 15 of file class.ilMailGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailGUI::__construct ( )

Definition at line 33 of file class.ilMailGUI.php.

References $_GET, $_POST, and $DIC.

34  {
35  global $DIC;
36 
37  $this->tpl = $DIC->ui()->mainTemplate();
38  $this->ctrl = $DIC->ctrl();
39  $this->lng = $DIC->language();
40 
41  if (isset($_POST['mobj_id']) && (int) $_POST['mobj_id']) {
42  $_GET['mobj_id'] = $_POST['mobj_id'];
43  }
44  $_GET['mobj_id'] = (int) $_GET['mobj_id'];
45 
46  $this->ctrl->saveParameter($this, "mobj_id");
47  $this->lng->loadLanguageModule("mail");
48 
49  $this->umail = new ilMail($DIC->user()->getId());
50 
51  if (!$DIC->rbac()->system()->checkAccess('internal_mail', $this->umail->getMailObjectReferenceId())) {
52  $DIC['ilErr']->raiseError($this->lng->txt("permission_denied"), $DIC['ilErr']->WARNING);
53  }
54  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
This class handles base functions for mail handling.
$_POST["username"]

Member Function Documentation

◆ executeCommand()

ilMailGUI::executeCommand ( )

Definition at line 56 of file class.ilMailGUI.php.

References $_GET, $_POST, $_SESSION, array, ilSession\get(), ilMailFormCall\getRecipients(), ilUtil\sendInfo(), ilSession\set(), ilMailFormCall\setRecipients(), showExplorer(), showHeader(), and ilMailFormCall\storeReferer().

57  {
58  if ($_GET["type"] == "search_res") {
60 
61  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
62  $this->ctrl->redirectByClass("ilmailformgui");
63  }
64 
65  if ($_GET["type"] == "attach") {
67 
68  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
69  $this->ctrl->redirectByClass("ilmailformgui");
70  }
71 
72  if ($_GET["type"] == "new") {
73  $_SESSION['rcp_to'] = $_GET['rcp_to'];
74  if (!strlen($_SESSION['rcp_to']) && ($recipients = ilMailFormCall::getRecipients())) {
75  $_SESSION['rcp_to'] = implode(',', $recipients);
77  }
78  $_SESSION['rcp_cc'] = $_GET['rcp_cc'];
79  $_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
80 
82 
83  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
84  $this->ctrl->redirectByClass("ilmailformgui");
85  }
86 
87  if ($_GET["type"] == "reply") {
88  $_SESSION['mail_id'] = $_GET['mail_id'];
89  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
90  $this->ctrl->redirectByClass("ilmailformgui");
91  }
92 
93  if ($_GET["type"] == "read") {
94  $_SESSION['mail_id'] = $_GET['mail_id'];
95  $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
96  $this->ctrl->redirectByClass("ilmailfoldergui");
97  }
98 
99  if ($_GET["type"] == "deliverFile") {
100  $_SESSION['mail_id'] = $_GET['mail_id'];
101  $_SESSION['filename'] = ($_POST["filename"] ? $_POST["filename"] : $_GET["filename"]);
102  $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
103  $this->ctrl->redirectByClass("ilmailfoldergui");
104  }
105 
106  if ($_GET["type"] == "message_sent") {
107  ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
108  $this->ctrl->redirectByClass("ilmailfoldergui");
109  }
110 
111  if ($_GET["type"] == "role") {
112  if (is_array($_POST['roles'])) {
113  $_SESSION['mail_roles'] = $_POST['roles'];
114  } elseif ($_GET["role"]) {
115  $_SESSION['mail_roles'] = array($_GET["role"]);
116  }
117 
119 
120  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
121  $this->ctrl->redirectByClass("ilmailformgui");
122  }
123 
124  if ($_GET["view"] == "my_courses") {
125  $_SESSION['search_crs'] = $_GET['search_crs'];
126  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
127  $this->ctrl->redirectByClass("ilmailformgui");
128  }
129 
130  if (isset($_GET["viewmode"])) {
131  ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
132  $this->ctrl->setCmd("setViewMode");
133  }
134 
135  $this->forwardClass = $this->ctrl->getNextClass($this);
136 
137  $this->showHeader();
138 
139  if ('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) &&
140  $this->ctrl->getCmd() != "showExplorer") {
141  $this->showExplorer();
142  }
143 
144  switch ($this->forwardClass) {
145  case 'ilmailformgui':
146  include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
147 
148  $this->ctrl->forwardCommand(new ilMailFormGUI());
149  break;
150 
151  case 'ilcontactgui':
152  require_once 'Services/Contact/classes/class.ilContactGUI.php';
153  $this->tpl->setTitle($this->lng->txt('mail_addressbook'));
154  $this->ctrl->forwardCommand(new ilContactGUI());
155  break;
156 
157  case 'ilmailoptionsgui':
158  $this->tpl->setTitle($this->lng->txt('mail'));
159  include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
160 
161  $this->ctrl->forwardCommand(new ilMailOptionsGUI());
162  break;
163 
164  case 'ilmailfoldergui':
165  include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
166  $this->ctrl->forwardCommand(new ilMailFolderGUI());
167  break;
168 
169  default:
170  if (!($cmd = $this->ctrl->getCmd())) {
171  $cmd = "setViewMode";
172  }
173 
174  $this->$cmd();
175  break;
176 
177  }
178  return true;
179  }
$_SESSION["AccountId"]
$_GET["client_id"]
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
static storeReferer($request_params)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
static setRecipients(array $recipients)
$_POST["username"]
+ Here is the call graph for this function:

◆ isMailDetailCommand()

ilMailGUI::isMailDetailCommand (   $cmd)
private
Parameters
string$cmd
Returns
bool

Definition at line 268 of file class.ilMailGUI.php.

References $_GET, and array.

Referenced by showHeader().

269  {
270  return in_array(strtolower($cmd), array('showmail')) && isset($_GET['mail_id']) && (int) $_GET['mail_id'];
271  }
$_GET["client_id"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setViewMode()

ilMailGUI::setViewMode ( )
private

Definition at line 181 of file class.ilMailGUI.php.

References $_GET.

182  {
183  if ($_GET["target"] == "") {
184  $_GET["target"] = "ilmailfoldergui";
185  }
186 
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");
196  } else {
197  $this->ctrl->redirectByClass($_GET["target"]);
198  }
199  }
$_GET["client_id"]

◆ showExplorer()

ilMailGUI::showExplorer ( )
private

Definition at line 273 of file class.ilMailGUI.php.

References $DIC, and $exp.

Referenced by executeCommand().

274  {
275  global $DIC;
276 
277  require_once "Services/Mail/classes/class.ilMailExplorer.php";
278  $exp = new ilMailExplorer($this, "showExplorer", $DIC->user()->getId());
279  if (!$exp->handleCommand()) {
280  $this->tpl->setLeftNavContent($exp->getHTML());
281  }
282  }
global $DIC
Definition: saml.php:7
Class Mail Explorer class for explorer view for mailboxes.
+ Here is the caller graph for this function:

◆ showHeader()

ilMailGUI::showHeader ( )
private

Definition at line 201 of file class.ilMailGUI.php.

References $_GET, $DIC, ilSession\get(), ilUtil\getImagePath(), ilUtil\infoPanel(), and isMailDetailCommand().

Referenced by executeCommand().

202  {
203  global $DIC;
204 
205  $DIC['ilHelp']->setScreenIdComponent("mail");
206  $DIC['ilMainMenu']->setActive("mail");
207 
208  $this->tpl->getStandardTemplate();
209 
210  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mail.svg"));
211 
212  // display infopanel if something happened
214 
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'));
221 
222  switch ($this->forwardClass) {
223  case 'ilmailformgui':
224  $DIC->tabs()->setTabActive('compose');
225  break;
226 
227  case 'ilcontactgui':
228  $DIC->tabs()->setTabActive('mail_addressbook');
229  break;
230 
231  case 'ilmailoptionsgui':
232  $DIC->tabs()->setTabActive('options');
233  break;
234 
235  case 'ilmailfoldergui':
236  default:
237  $DIC->tabs()->setTabActive('fold');
238  break;
239  }
240 
241  if (isset($_GET['message_sent'])) {
242  $DIC->tabs()->setTabActive('fold');
243  }
244 
245  if ('tree' != ilSession::get(self::VIEWMODE_SESSION_KEY)) {
246  $tree_state = 'tree';
247  } else {
248  $tree_state = 'flat';
249  }
250 
251  if ($this->isMailDetailCommand($this->ctrl->getCmd())) {
252  $this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
253  $this->ctrl->setParameter($this, 'type', 'redirect_to_read');
254  }
255 
256  $this->ctrl->setParameter($this, 'viewmode', $tree_state);
257  $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
258 
259  $this->ctrl->clearParameters($this);
260  $this->tpl->setCurrentBlock("tree_icons");
261  $this->tpl->parseCurrentBlock();
262  }
isMailDetailCommand($cmd)
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static get($a_var)
Get a value.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static infoPanel($a_keep=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilMailGUI::$ctrl = null
private

Definition at line 23 of file class.ilMailGUI.php.

◆ $exp

ilMailGUI::$exp = null
private

Definition at line 28 of file class.ilMailGUI.php.

Referenced by showExplorer().

◆ $forwardClass

ilMailGUI::$forwardClass = null
private

Definition at line 31 of file class.ilMailGUI.php.

◆ $lng

ilMailGUI::$lng = null
private

Definition at line 24 of file class.ilMailGUI.php.

◆ $mtree

ilMailGUI::$mtree = null
private

Definition at line 30 of file class.ilMailGUI.php.

◆ $output

ilMailGUI::$output = null
private

Definition at line 29 of file class.ilMailGUI.php.

◆ $tabs_gui

ilMailGUI::$tabs_gui = null
private

Definition at line 25 of file class.ilMailGUI.php.

◆ $tpl

ilMailGUI::$tpl = null
private

Definition at line 22 of file class.ilMailGUI.php.

◆ $umail

ilMailGUI::$umail = null
private

Definition at line 27 of file class.ilMailGUI.php.

◆ VIEWMODE_SESSION_KEY


The documentation for this class was generated from the following file: