ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailGUI Class Reference
+ Collaboration diagram for ilMailGUI:

Public Member Functions

 __construct ()
 executeCommand ()
 refresh ()

Private Member Functions

 setViewMode ()
 showHeader ()
 showMenu ()

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 34 of file class.ilMailGUI.php.

Constructor & Destructor Documentation

ilMailGUI::__construct ( )

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

References $_GET, $ilCtrl, $ilErr, $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'];
}
$this->ctrl->saveParameter($this, "mobj_id");
$this->lng->loadLanguageModule("mail");
$this->umail = new ilMail($ilUser->getId());
// CHECK HACK
if (!$rbacsystem->checkAccess("mail_visible", $this->umail->getMailObjectReferenceId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
}
}

Member Function Documentation

ilMailGUI::executeCommand ( )

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

References $_GET, $_SESSION, $cmd, ilUtil\redirect(), ilUtil\sendInfo(), and showHeader().

{
global $ilUser;
// Check for incomplete profile
if($ilUser->getProfileIncomplete())
{
ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
}
// check whether password of user have to be changed due to first login
if( $ilUser->isPasswordChangeDemanded() )
{
ilUtil::sendInfo( $this->lng->txt('password_change_on_first_login_demand'), true );
ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
}
// check whether password of user is expired
if( $ilUser->isPasswordExpired() )
{
$msg = $this->lng->txt('password_expired');
$password_age = $ilUser->getPasswordAge();
ilUtil::sendInfo( sprintf($msg,$password_age), true );
ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
}
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"]))
{
$_SESSION["viewmode"] = $_GET["viewmode"];
$this->ctrl->setCmd("setViewMode");
}
$this->forwardClass = $this->ctrl->getNextClass($this);
if ($this->ctrl->getCmd() != "showMenu" && $this->ctrl->getCmd() != "refresh")
{
$this->showHeader();
}
switch($this->forwardClass)
{
case 'ilmailmenugui':
include_once 'Services/Mail/classes/class.ilMailMenuGUI.php';
$this->ctrl->forwardCommand(new ilMailMenuGUI());
break;
case 'ilmailformgui':
include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
$this->ctrl->forwardCommand(new ilMailFormGUI());
break;
case 'ilmailaddressbookgui':
include_once 'Services/Mail/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::refresh ( )

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

References showMenu().

{
$this->showMenu();
}

+ Here is the call graph for this function:

ilMailGUI::setViewMode ( )
private

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

References $_GET, and $_SESSION.

{
if ($_GET["target"] == "")
{
$_GET["target"] = "ilmailfoldergui";
}
if ($_SESSION["viewmode"] == "tree")
{
include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
$fs_gui = new ilFramesetGUI();
$fs_gui->setFramesetTitle($this->lng->txt("mail"));
$fs_gui->setMainFrameName("content");
$fs_gui->setSideFrameName("tree");
$this->ctrl->setParameter($this, "cmd", "showMenu");
$this->ctrl->setParameter($this, "mexpand", 1);
$fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
$this->ctrl->clearParameters($this);
if ($_GET["type"] == "add_subfolder")
{
$fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass($_GET["target"], "addSubFolder"));
}
else if ($_GET["type"] == "enter_folderdata")
{
$fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass($_GET["target"], "enterFolderData"));
}
else if ($_GET["type"] == "confirmdelete_folderdata")
{
$fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass($_GET["target"], "confirmDeleteFolder"));
}
else
{
$fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass($_GET["target"]));
}
$fs_gui->show();
}
else
{
$this->ctrl->redirectByClass($_GET["target"]);
}
}
ilMailGUI::showHeader ( )
private

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

References $_GET, $_SESSION, ilUtil\getImagePath(), and ilUtil\infoPanel().

Referenced by executeCommand().

{
global $ilMainMenu, $ilTabs;
$ilMainMenu->setActive("mail");
$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_mail_b.gif"));
// 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');
// FLATVIEW <-> TREEVIEW
if (!isset($_SESSION["viewmode"]) or $_SESSION["viewmode"] == "flat")
{
$this->ctrl->setParameter($this, "viewmode", "tree");
$this->tpl->setTreeFlatIcon(
$this->ctrl->getLinkTarget($this),
"tree");
//$this->tpl->setVariable("IMG_TREE", ilUtil::getImagePath("ic_treeview.gif"));
//$this->tpl->parseCurrentBlock();
}
else
{
$this->ctrl->setParameter($this, "viewmode", "flat");
$this->tpl->setTreeFlatIcon(
$this->ctrl->getLinkTarget($this),
"flat");
//$this->tpl->parseCurrentBlock();
}
$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:

ilMailGUI::showMenu ( )
private

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

References $_GET, ilUtil\getImagePath(), ilTree\setTableNames(), and ilExplorer\setTargetGet().

Referenced by refresh().

{
global $ilUser;
require_once "Services/Mail/classes/class.ilMailExplorer.php";
$this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
$this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.gif", false));
$this->exp = new ilMailExplorer($this->ctrl->getLinkTargetByClass("ilmailfoldergui"),$ilUser->getId());
$this->exp->setTargetGet("mobj_id");
if ($_GET["mexpand"] == "")
{
$this->mtree = new ilTree($ilUser->getId());
$this->mtree->setTableNames('mail_tree','mail_obj_data');
$expanded = $this->mtree->readRootId();
}
else
$expanded = $_GET["mexpand"];
$this->exp->setExpand($expanded);
//build html-output
$this->exp->setOutput(0);
$this->output = $this->exp->getOutput();
$this->tpl->setCurrentBlock("content");
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("mail_folders"));
$this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
$this->tpl->setVariable("EXPLORER",$this->output);
$this->ctrl->setParameter($this, "mexpand", $_GET["mexpand"]);
$this->tpl->setVariable("ACTION", $this->ctrl->getFormAction($this, 'showMenu'));
$this->tpl->parseCurrentBlock();
$this->tpl->show(false);
}

+ 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 37 of file class.ilMailGUI.php.

ilMailGUI::$exp = null
private

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

ilMailGUI::$forwardClass = null
private

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

ilMailGUI::$lng = null
private

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

Referenced by __construct().

ilMailGUI::$mtree = null
private

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

ilMailGUI::$output = null
private

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

ilMailGUI::$tabs_gui = null
private

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

ilMailGUI::$tpl = null
private

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

Referenced by __construct().

ilMailGUI::$umail = null
private

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


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