ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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

ilMailGUI::__construct ( )

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

References $_GET, $_POST, $ilCtrl, $ilErr, $ilUser, $lng, and $tpl.

{
global $tpl, $ilCtrl, $lng, $rbacsystem, $ilErr, $ilUser;
$this->tpl = $tpl;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
if(isset($_POST['mobj_id']) && (int)$_POST['mobj_id'])
{
$_GET['mobj_id'] = $_POST['mobj_id'];
}
$_GET['mobj_id'] = (int)$_GET['mobj_id'];
$this->ctrl->saveParameter($this, "mobj_id");
$this->lng->loadLanguageModule("mail");
$this->umail = new ilMail($ilUser->getId());
// CHECK HACK
if (!$rbacsystem->checkAccess('internal_mail', $this->umail->getMailObjectReferenceId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
}
}

Member Function Documentation

ilMailGUI::executeCommand ( )

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

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

{
if ($_GET["type"] == "search_res")
{
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
$this->ctrl->redirectByClass("ilmailformgui");
}
if ($_GET["type"] == "attach")
{
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
$this->ctrl->redirectByClass("ilmailformgui");
}
if ($_GET["type"] == "new")
{
$_SESSION['rcp_to'] = $_GET['rcp_to'];
$_SESSION['rcp_cc'] = $_GET['rcp_cc'];
$_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
$this->ctrl->redirectByClass("ilmailformgui");
}
if ($_GET["type"] == "reply")
{
$_SESSION['mail_id'] = $_GET['mail_id'];
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
$this->ctrl->redirectByClass("ilmailformgui");
}
if ($_GET["type"] == "read")
{
$_SESSION['mail_id'] = $_GET['mail_id'];
$this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
$this->ctrl->redirectByClass("ilmailfoldergui");
}
if ($_GET["type"] == "deliverFile")
{
$_SESSION['mail_id'] = $_GET['mail_id'];
$_SESSION['filename'] = ($_POST["filename"] ? $_POST["filename"] : $_GET["filename"]);
$this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
$this->ctrl->redirectByClass("ilmailfoldergui");
}
if ($_GET["type"] == "message_sent")
{
ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
$this->ctrl->redirectByClass("ilmailfoldergui");
}
if ($_GET["type"] == "role")
{
if (is_array($_POST['roles']))
{
$_SESSION['mail_roles'] = $_POST['roles'];
}
else if ($_GET["role"])
{
$_SESSION['mail_roles'] = array($_GET["role"]);
}
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
$this->ctrl->redirectByClass("ilmailformgui");
}
if ($_GET["view"] == "my_courses")
{
$_SESSION['search_crs'] = $_GET['search_crs'];
$this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
$this->ctrl->redirectByClass("ilmailformgui");
}
if (isset($_GET["viewmode"]))
{
ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
$this->ctrl->setCmd("setViewMode");
}
$this->forwardClass = $this->ctrl->getNextClass($this);
$this->showHeader();
if('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) &&
$this->ctrl->getCmd() != "showExplorer")
{
$this->showExplorer();
}
include_once "Services/jQuery/classes/class.iljQueryUtil.php";
switch($this->forwardClass)
{
case 'ilmailformgui':
include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
$this->ctrl->forwardCommand(new ilMailFormGUI());
break;
case 'ilmailaddressbookgui':
include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php';
$this->ctrl->forwardCommand(new ilMailAddressbookGUI());
break;
case 'ilmailoptionsgui':
include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
$this->ctrl->forwardCommand(new ilMailOptionsGUI());
break;
case 'ilmailfoldergui':
include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
$this->ctrl->forwardCommand(new ilMailFolderGUI());
break;
default:
if (!($cmd = $this->ctrl->getCmd()))
{
$cmd = "setViewMode";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

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

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

References $_GET, and $cmd.

Referenced by showHeader().

{
return in_array(strtolower($cmd), array('showmail')) && isset($_GET['mail_id']) && (int)$_GET['mail_id'];
}

+ Here is the caller graph for this function:

ilMailGUI::setViewMode ( )
private

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

References $_GET.

{
if ($_GET["target"] == "")
{
$_GET["target"] = "ilmailfoldergui";
}
if($_GET['type'] == 'redirect_to_read')
{
$this->ctrl->setParameterByClass('ilMailFolderGUI', 'mail_id', (int)$_GET['mail_id']);
$this->ctrl->redirectByClass('ilMailFolderGUI', 'showMail');
}
else if ($_GET["type"] == "add_subfolder")
{
$this->ctrl->redirectByClass($_GET["target"], "addSubFolder");
}
else if ($_GET["type"] == "enter_folderdata")
{
$this->ctrl->redirectByClass($_GET["target"], "enterFolderData");
}
else if ($_GET["type"] == "confirmdelete_folderdata")
{
$this->ctrl->redirectByClass($_GET["target"], "confirmDeleteFolder");
}
else
{
$this->ctrl->redirectByClass($_GET["target"]);
}
}
ilMailGUI::showExplorer ( )
private

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

References $exp, and $ilUser.

Referenced by executeCommand().

{
global $ilUser;
require_once "Services/Mail/classes/class.ilMailExplorer.php";
$exp = new ilMailExplorer($this, "showExplorer", $ilUser->getId());
if (!$exp->handleCommand())
{
$this->tpl->setLeftNavContent($exp->getHTML());
}
}

+ Here is the caller graph for this function:

ilMailGUI::showHeader ( )
private

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

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

Referenced by executeCommand().

{
global $ilMainMenu, $ilTabs, $ilHelp;
$ilHelp->setScreenIdComponent("mail");
$ilMainMenu->setActive("mail");
// $this->tpl->getStandardTemplate();
$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mail_b.png"));
// display infopanel if something happened
$ilTabs->addTarget('fold', $this->ctrl->getLinkTargetByClass('ilmailfoldergui'));
$this->ctrl->setParameterByClass('ilmailformgui', 'type', 'new');
$ilTabs->addTarget('compose', $this->ctrl->getLinkTargetByClass('ilmailformgui'));
$this->ctrl->clearParametersByClass('ilmailformgui');
$ilTabs->addTarget('mail_addressbook', $this->ctrl->getLinkTargetByClass('ilmailaddressbookgui'));
$ilTabs->addTarget('options', $this->ctrl->getLinkTargetByClass('ilmailoptionsgui'));
switch($this->forwardClass)
{
case 'ilmailformgui':
$ilTabs->setTabActive('compose');
break;
case 'ilmailaddressbookgui':
$ilTabs->setTabActive('mail_addressbook');
break;
case 'ilmailoptionsgui':
$ilTabs->setTabActive('options');
break;
case 'ilmailfoldergui':
default:
$ilTabs->setTabActive('fold');
break;
}
if(isset($_GET['message_sent'])) $ilTabs->setTabActive('fold');
if('tree' != ilSession::get(self::VIEWMODE_SESSION_KEY))
{
$tree_state = 'tree';
}
else
{
$tree_state = 'flat';
}
if($this->isMailDetailCommand($this->ctrl->getCmd()))
{
$this->ctrl->setParameter($this, 'mail_id', (int)$_GET['mail_id']);
$this->ctrl->setParameter($this, 'type', 'redirect_to_read');
}
$this->ctrl->setParameter($this, 'viewmode', $tree_state);
$this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), $tree_state);
$this->ctrl->clearParameters($this);
$this->tpl->setCurrentBlock("tree_icons");
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilMailGUI::$ctrl = null
private

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

ilMailGUI::$exp = null
private

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

Referenced by showExplorer().

ilMailGUI::$forwardClass = null
private

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

ilMailGUI::$lng = null
private

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

Referenced by __construct().

ilMailGUI::$mtree = null
private

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

ilMailGUI::$output = null
private

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

ilMailGUI::$tabs_gui = null
private

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

ilMailGUI::$tpl = null
private

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

Referenced by __construct().

ilMailGUI::$umail = null
private

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

const ilMailGUI::VIEWMODE_SESSION_KEY = 'mail_viewmode'

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