ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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, $ilCtrl, $ilErr, $ilUser, $lng, and $tpl.

34  {
35  global $tpl, $ilCtrl, $lng, $rbacsystem, $ilErr, $ilUser;
36 
37  $this->tpl = $tpl;
38  $this->ctrl = $ilCtrl;
39  $this->lng = $lng;
40 
41  if(isset($_POST['mobj_id']) && (int)$_POST['mobj_id'])
42  {
43  $_GET['mobj_id'] = $_POST['mobj_id'];
44  }
45  $_GET['mobj_id'] = (int)$_GET['mobj_id'];
46 
47  $this->ctrl->saveParameter($this, "mobj_id");
48  $this->lng->loadLanguageModule("mail");
49 
50  $this->umail = new ilMail($ilUser->getId());
51 
52  // CHECK HACK
53  if (!$rbacsystem->checkAccess('internal_mail', $this->umail->getMailObjectReferenceId()))
54  {
55  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
56  }
57  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Class Mail this class handles base functions for mail handling.
global $ilUser
Definition: imgupload.php:15

Member Function Documentation

◆ executeCommand()

ilMailGUI::executeCommand ( )

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

References $_GET, $_POST, $_SESSION, $cmd, ilSession\get(), ilMailFormCall\getRecipients(), ilUIFramework\init(), iljQueryUtil\initjQuery(), ilUtil\sendInfo(), ilSession\set(), ilMailFormCall\setRecipients(), showExplorer(), showHeader(), and ilMailFormCall\storeReferer().

60  {
61  if ($_GET["type"] == "search_res")
62  {
63  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
64  $this->ctrl->redirectByClass("ilmailformgui");
65  }
66 
67  if ($_GET["type"] == "attach")
68  {
70 
71  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
72  $this->ctrl->redirectByClass("ilmailformgui");
73  }
74 
75  if ($_GET["type"] == "new")
76  {
77  $_SESSION['rcp_to'] = $_GET['rcp_to'];
78  if(!strlen($_SESSION['rcp_to']) && ($recipients = ilMailFormCall::getRecipients()))
79  {
80  $_SESSION['rcp_to'] = implode(',', $recipients);
82  }
83  $_SESSION['rcp_cc'] = $_GET['rcp_cc'];
84  $_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
85 
87 
88  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
89  $this->ctrl->redirectByClass("ilmailformgui");
90  }
91 
92  if ($_GET["type"] == "reply")
93  {
94  $_SESSION['mail_id'] = $_GET['mail_id'];
95  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
96  $this->ctrl->redirectByClass("ilmailformgui");
97  }
98 
99  if ($_GET["type"] == "read")
100  {
101  $_SESSION['mail_id'] = $_GET['mail_id'];
102  $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
103  $this->ctrl->redirectByClass("ilmailfoldergui");
104  }
105 
106  if ($_GET["type"] == "deliverFile")
107  {
108  $_SESSION['mail_id'] = $_GET['mail_id'];
109  $_SESSION['filename'] = ($_POST["filename"] ? $_POST["filename"] : $_GET["filename"]);
110  $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
111  $this->ctrl->redirectByClass("ilmailfoldergui");
112  }
113 
114  if ($_GET["type"] == "message_sent")
115  {
116  ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
117  $this->ctrl->redirectByClass("ilmailfoldergui");
118  }
119 
120  if ($_GET["type"] == "role")
121  {
122  if (is_array($_POST['roles']))
123  {
124  $_SESSION['mail_roles'] = $_POST['roles'];
125  }
126  else if ($_GET["role"])
127  {
128  $_SESSION['mail_roles'] = array($_GET["role"]);
129  }
130 
132 
133  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
134  $this->ctrl->redirectByClass("ilmailformgui");
135  }
136 
137  if ($_GET["view"] == "my_courses")
138  {
139  $_SESSION['search_crs'] = $_GET['search_crs'];
140  $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
141  $this->ctrl->redirectByClass("ilmailformgui");
142  }
143 
144  if (isset($_GET["viewmode"]))
145  {
146  ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
147  $this->ctrl->setCmd("setViewMode");
148  }
149 
150  $this->forwardClass = $this->ctrl->getNextClass($this);
151 
152  $this->showHeader();
153 
154  if('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) &&
155  $this->ctrl->getCmd() != "showExplorer")
156  {
157  $this->showExplorer();
158  }
159 
160  include_once "Services/jQuery/classes/class.iljQueryUtil.php";
162 
163  // always load ui framework
164  include_once("./Services/UICore/classes/class.ilUIFramework.php");
166 
167  switch($this->forwardClass)
168  {
169  case 'ilmailformgui':
170  include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
171 
172  $this->ctrl->forwardCommand(new ilMailFormGUI());
173  break;
174 
175  case 'ilmailaddressbookgui':
176  include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php';
177 
178  $this->ctrl->forwardCommand(new ilMailAddressbookGUI());
179  break;
180 
181  case 'ilmailoptionsgui':
182  include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
183 
184  $this->ctrl->forwardCommand(new ilMailOptionsGUI());
185  break;
186 
187  case 'ilmailfoldergui':
188  include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
189  $this->ctrl->forwardCommand(new ilMailFolderGUI());
190  break;
191 
192  default:
193  if (!($cmd = $this->ctrl->getCmd()))
194  {
195  $cmd = "setViewMode";
196  }
197 
198  $this->$cmd();
199  break;
200 
201  }
202  return true;
203  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
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.
static initjQuery($a_tpl=null)
Init jQuery.
static setRecipients(array $recipients)
init($a_tpl=null)
Init.
+ Here is the call graph for this function:

◆ isMailDetailCommand()

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

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

References $_GET, and $cmd.

Referenced by showHeader().

308  {
309  return in_array(strtolower($cmd), array('showmail')) && isset($_GET['mail_id']) && (int)$_GET['mail_id'];
310  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
+ Here is the caller graph for this function:

◆ setViewMode()

ilMailGUI::setViewMode ( )
private

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

References $_GET.

206  {
207  if ($_GET["target"] == "")
208  {
209  $_GET["target"] = "ilmailfoldergui";
210  }
211 
212  if($_GET['type'] == 'redirect_to_read')
213  {
214  $this->ctrl->setParameterByClass('ilMailFolderGUI', 'mail_id', (int)$_GET['mail_id']);
215  $this->ctrl->redirectByClass('ilMailFolderGUI', 'showMail');
216  }
217  else if ($_GET["type"] == "add_subfolder")
218  {
219  $this->ctrl->redirectByClass($_GET["target"], "addSubFolder");
220  }
221  else if ($_GET["type"] == "enter_folderdata")
222  {
223  $this->ctrl->redirectByClass($_GET["target"], "enterFolderData");
224  }
225  else if ($_GET["type"] == "confirmdelete_folderdata")
226  {
227  $this->ctrl->redirectByClass($_GET["target"], "confirmDeleteFolder");
228  }
229  else
230  {
231  $this->ctrl->redirectByClass($_GET["target"]);
232  }
233  }
$_GET["client_id"]

◆ showExplorer()

ilMailGUI::showExplorer ( )
private

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

References $exp, and $ilUser.

Referenced by executeCommand().

313  {
314  global $ilUser;
315 
316  require_once "Services/Mail/classes/class.ilMailExplorer.php";
317  $exp = new ilMailExplorer($this, "showExplorer", $ilUser->getId());
318  if (!$exp->handleCommand())
319  {
320  $this->tpl->setLeftNavContent($exp->getHTML());
321  }
322  }
Class Mail Explorer class for explorer view for mailboxes.
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ showHeader()

ilMailGUI::showHeader ( )
private

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

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

Referenced by executeCommand().

236  {
237  global $ilMainMenu, $ilTabs, $ilHelp;
238 
239  $ilHelp->setScreenIdComponent("mail");
240 
241  $ilMainMenu->setActive("mail");
242 
243 // $this->tpl->getStandardTemplate();
244  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
245  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
246  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mail.svg"));
247 
248  // display infopanel if something happened
250 
251  $ilTabs->addTarget('fold', $this->ctrl->getLinkTargetByClass('ilmailfoldergui'));
252  $this->ctrl->setParameterByClass('ilmailformgui', 'type', 'new');
253  $ilTabs->addTarget('compose', $this->ctrl->getLinkTargetByClass('ilmailformgui'));
254  $this->ctrl->clearParametersByClass('ilmailformgui');
255  $ilTabs->addTarget('mail_addressbook', $this->ctrl->getLinkTargetByClass('ilmailaddressbookgui'));
256  $ilTabs->addTarget('options', $this->ctrl->getLinkTargetByClass('ilmailoptionsgui'));
257 
258  switch($this->forwardClass)
259  {
260  case 'ilmailformgui':
261  $ilTabs->setTabActive('compose');
262  break;
263 
264  case 'ilmailaddressbookgui':
265  $ilTabs->setTabActive('mail_addressbook');
266  break;
267 
268  case 'ilmailoptionsgui':
269  $ilTabs->setTabActive('options');
270  break;
271 
272  case 'ilmailfoldergui':
273  default:
274  $ilTabs->setTabActive('fold');
275  break;
276 
277  }
278  if(isset($_GET['message_sent'])) $ilTabs->setTabActive('fold');
279 
280  if('tree' != ilSession::get(self::VIEWMODE_SESSION_KEY))
281  {
282  $tree_state = 'tree';
283  }
284  else
285  {
286  $tree_state = 'flat';
287  }
288 
289  if($this->isMailDetailCommand($this->ctrl->getCmd()))
290  {
291  $this->ctrl->setParameter($this, 'mail_id', (int)$_GET['mail_id']);
292  $this->ctrl->setParameter($this, 'type', 'redirect_to_read');
293  }
294 
295  $this->ctrl->setParameter($this, 'viewmode', $tree_state);
296  $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
297 
298  $this->ctrl->clearParameters($this);
299  $this->tpl->setCurrentBlock("tree_icons");
300  $this->tpl->parseCurrentBlock();
301  }
isMailDetailCommand($cmd)
$_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.

Referenced by __construct().

◆ $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.

Referenced by __construct().

◆ $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: