Public Member Functions | Private Attributes

ilMailFormGUI Class Reference
[Services/Mail]

Public Member Functions

 __construct ()
 executeCommand ()
 sendMessage ()
 saveDraft ()
 searchRcpTo ()
 searchUsers ($save=true)
 searchCoursesTo ()
 searchGroupsTo ()
 searchRcpCc ()
 searchRcpBc ()
 showSearchForm ()
 search ()
 cancelSearch ()
 editAttachments ()
 returnFromAttachments ()
 searchResults ()
 mailUser ()
 mailRole ()
 replyMail ()
 mailAttachment ()
 showForm ()

Private Attributes

 $tpl = null
 $ctrl = null
 $lng = null
 $umail = null
 $mbox = null
 $mfile = null

Detailed Description

Author:
Jens Conze
Version:
$Id$

ilMailFormGUI: ilMailFolderGUI, ilMailAttachmentGUI, ilMailSearchGUI, ilMailSearchCoursesGUI, ilMailSearchGroupsGUI

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


Constructor & Destructor Documentation

ilMailFormGUI::__construct (  ) 

Definition at line 46 of file class.ilMailFormGUI.php.

References $ilCtrl, $lng, and $tpl.

        {
                global $tpl, $ilCtrl, $lng, $ilUser;

                $this->tpl = $tpl;
                $this->ctrl = $ilCtrl;
                $this->lng = $lng;
                
                $this->ctrl->saveParameter($this, "mobj_id");

                $this->umail = new ilFormatMail($ilUser->getId());
                $this->mfile = new ilFileDataMail($ilUser->getId());
                $this->mbox = new ilMailBox($ilUser->getId());
        }


Member Function Documentation

ilMailFormGUI::cancelSearch (  ) 

Definition at line 382 of file class.ilMailFormGUI.php.

References $_SESSION, and searchResults().

        {
                unset($_SESSION["mail_search"]);

                #$this->showForm();
                $this->searchResults();
        }

Here is the call graph for this function:

ilMailFormGUI::editAttachments (  ) 

Definition at line 390 of file class.ilMailFormGUI.php.

References $_SESSION, and ilUtil::stripSlashes().

        {
                $this->umail->savePostData($_SESSION["AccountId"],$_POST["attachments"],
                                                                        $_POST["rcp_to"],$_POST["rcp_cc"],$_POST["rcp_bcc"],$_POST["m_type"],
                                                                        $_POST["m_email"],
                                                                        ilUtil::stripSlashes($_POST["m_subject"]),
                                                                        ilUtil::stripSlashes($_POST["m_message"]),
                                                                        $_POST['use_placeholders']
                                                                );
                        
                $this->ctrl->redirectByClass("ilmailattachmentgui");
        }

Here is the call graph for this function:

ilMailFormGUI::executeCommand (  ) 

Definition at line 61 of file class.ilMailFormGUI.php.

References $cmd.

        {
                $forward_class = $this->ctrl->getNextClass($this);
                switch($forward_class)
                {
                        case 'ilmailfoldergui':
                                include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';

                                $this->ctrl->forwardCommand(new ilMailFolderGUI());
                                break;

                        case 'ilmailattachmentgui':
                                include_once 'Services/Mail/classes/class.ilMailAttachmentGUI.php';

                                $this->ctrl->setReturn($this, "returnFromAttachments");
                                $this->ctrl->forwardCommand(new ilMailAttachmentGUI());
                                break;

                        case 'ilmailsearchgui':
                                include_once 'Services/Mail/classes/class.ilMailSearchGUI.php';

                                $this->ctrl->setReturn($this, "searchResults");
                                $this->ctrl->forwardCommand(new ilMailSearchGUI());
                                break;

                        case 'ilmailsearchcoursesgui':
                                include_once 'Services/Mail/classes/class.ilMailSearchCoursesGUI.php';

                                $this->ctrl->setReturn($this, "searchResults");
                                $this->ctrl->forwardCommand(new ilMailSearchCoursesGUI());
                                break;

                        case 'ilmailsearchgroupsgui':
                                include_once 'Services/Mail/classes/class.ilMailSearchGroupsGUI.php';

                                $this->ctrl->setReturn($this, "searchResults");
                                $this->ctrl->forwardCommand(new ilMailSearchGroupsGUI());
                                break;

                        default:
                                if (!($cmd = $this->ctrl->getCmd()))
                                {
                                        $cmd = "showForm";
                                }

                                $this->$cmd();
                                break;
                }
                return true;
        }

ilMailFormGUI::mailAttachment (  ) 

Definition at line 433 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

        {
                $_GET["type"] = "attach";
                $this->showForm();              
        }

Here is the call graph for this function:

ilMailFormGUI::mailRole (  ) 

Definition at line 421 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

        {
                $_GET["type"] = "role";
                $this->showForm();              
        }

Here is the call graph for this function:

ilMailFormGUI::mailUser (  ) 

Definition at line 415 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

        {
                $_GET["type"] = "new";
                $this->showForm();              
        }

Here is the call graph for this function:

ilMailFormGUI::replyMail (  ) 

Definition at line 427 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

        {
                $_GET["type"] = "reply";
                $this->showForm();              
        }

Here is the call graph for this function:

ilMailFormGUI::returnFromAttachments (  ) 

Definition at line 403 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

        {
                $_GET["type"] = "attach";
                $this->showForm();
        } 

Here is the call graph for this function:

ilMailFormGUI::saveDraft (  ) 

Definition at line 147 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil::sendInfo(), showForm(), and ilUtil::stripSlashes().

        {       
                if(!$_POST['m_subject'])
                {
                        $_POST['m_subject'] = 'No title';
                }

                $draftsId = $this->mbox->getDraftsFolder();
                
                if(isset($_SESSION["draft"]))
                {
                        $this->umail->updateDraft($draftsId,$_POST["attachments"],
                                ilUtil::stripSlashes($_POST["rcp_to"]),
                                ilUtil::stripSlashes($_POST["rcp_cc"]),
                                ilUtil::stripSlashes($_POST["rcp_bcc"]),
                                $_POST["m_type"],$_POST["m_email"],
                                ilUtil::stripSlashes($_POST["m_subject"]),
                                ilUtil::stripSlashes($_POST["m_message"]),
                                $_SESSION["draft"],
                                $_POST['use_placeholders']
                        );
                        #session_unregister("draft");
                        #ilUtil::sendInfo($this->lng->txt("mail_saved"),true);
                        #ilUtil::redirect("ilias.php?baseClass=ilMailGUI&mobj_id=".$mbox->getInboxFolder());
                        
                        unset($_SESSION["draft"]);
                        ilUtil::sendInfo($this->lng->txt("mail_saved"), true);
                        $this->ctrl->redirectByClass("ilmailfoldergui");
                }
                else
                {
                        if ($this->umail->sendInternalMail($draftsId,$_SESSION["AccountId"],$_POST["attachments"],
                                        ilUtil::stripSlashes($_POST["rcp_to"]),
                                        ilUtil::stripSlashes($_POST["rcp_cc"]),
                                        ilUtil::stripSlashes($_POST["rcp_bcc"]),
                                        'read',$_POST["m_type"],$_POST["m_email"],
                                        ilUtil::stripSlashes($_POST["m_subject"]),
                                        ilUtil::stripSlashes($_POST["m_message"]),
                                        $_SESSION["AccountId"],
                                        $_POST['use_placeholders']
                                        )
                        )
                        {
                                ilUtil::sendInfo($this->lng->txt("mail_saved"),true);
                                #$this->ctrl->setParameterByClass("ilmailfoldergui", "mobj_id", $this->mbox->getDraftsFolder());
                                $this->ctrl->redirectByClass("ilmailfoldergui");
                        }
                        else
                        {
                                ilUtil::sendInfo($this->lng->txt("mail_send_error"));
                        }
                }
                
                $this->showForm();
        }

Here is the call graph for this function:

ilMailFormGUI::search (  ) 

Definition at line 338 of file class.ilMailFormGUI.php.

References $_SESSION, searchUsers(), and ilUtil::sendInfo().

        {
                global $ilUser;
                
                $_SESSION["mail_search_search"] = $_POST["search"];
                $_SESSION["mail_search_type_system"] = $_POST["type_system"];
                $_SESSION["mail_search_type_addressbook"] = $_POST["type_addressbook"];

                // IF NO TYPE IS GIVEN SEARCH IN BOTH 'system' and 'addressbook'
                if(!$_SESSION["mail_search_type_system"] &&
                   !$_SESSION["mail_search_type_addressbook"])
                {
                        $_SESSION["mail_search_type_system"] = 1;
                        $_SESSION["mail_search_type_addressbook"] = 1;
                        $ilUser->writePref("mail_search", "all");
                }
                if (strlen(trim($_SESSION["mail_search_search"])) == 0)
                {
                        ilUtil::sendInfo($this->lng->txt("mail_insert_query"));
                        #$this->showSearchForm();
                        $this->searchUsers(false);
                }
                else if(strlen(trim($_SESSION["mail_search_search"])) < 3)
                {
                        $this->lng->loadLanguageModule('search');
                        ilUtil::sendInfo($this->lng->txt('search_minimum_three'));
                        #$this->showSearchForm();
                        $this->searchUsers(false);
                }
                else
                {                       
                        $this->ctrl->setParameterByClass("ilmailsearchgui", "search", urlencode($_SESSION["mail_search_search"]));
                        if($_SESSION["mail_search_type_system"])
                        {
                                $this->ctrl->setParameterByClass("ilmailsearchgui", "system", 1);
                        }
                        if($_SESSION["mail_search_type_addressbook"])
                        {
                                $this->ctrl->setParameterByClass("ilmailsearchgui", "addressbook", 1);
                        }
                        $this->ctrl->redirectByClass("ilmailsearchgui");
                }
        }

Here is the call graph for this function:

ilMailFormGUI::searchCoursesTo (  ) 

Definition at line 256 of file class.ilMailFormGUI.php.

References $_SESSION, and ilUtil::stripSlashes().

        {
                global $ilUser;

                $this->umail->savePostData($ilUser->getId(),$_POST["attachments"],$_POST["rcp_to"],
                                                                         $_POST["rcp_cc"],$_POST["rcp_bcc"],$_POST["m_type"],
                                                                         $_POST["m_email"],
                                                                         ilUtil::stripSlashes($_POST["m_subject"]),
                                                                         ilUtil::stripSlashes($_POST["m_message"]),
                                                                          $_POST['use_placeholders']
                                                                        );

                if ($_SESSION["search_crs"])
                {
                        $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "cmd", "showMembers");
                }
                $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "mail");
                $this->ctrl->redirectByClass("ilmailsearchcoursesgui");
        }

Here is the call graph for this function:

ilMailFormGUI::searchGroupsTo (  ) 

Definition at line 276 of file class.ilMailFormGUI.php.

References ilUtil::stripSlashes().

        {
                global $ilUser;

                $this->umail->savePostData($ilUser->getId(),$_POST["attachments"],$_POST["rcp_to"],
                                                                         $_POST["rcp_cc"],$_POST["rcp_bcc"],$_POST["m_type"],
                                                                         $_POST["m_email"],
                                                                         ilUtil::stripSlashes($_POST["m_subject"]),
                                                                         ilUtil::stripSlashes($_POST["m_message"]),
                                                                         $_POST['use_placeholders']
                                                                );

                $this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "mail");
                $this->ctrl->redirectByClass("ilmailsearchgroupsgui");
        }

Here is the call graph for this function:

ilMailFormGUI::searchRcpBc (  ) 

Definition at line 300 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil::sendInfo(), and showSearchForm().

        {
                $_SESSION["mail_search"] = 'bc';
                ilUtil::sendInfo($this->lng->txt("mail_insert_query"));

                $this->showSearchForm();
        }

Here is the call graph for this function:

ilMailFormGUI::searchRcpCc (  ) 

Definition at line 292 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil::sendInfo(), and showSearchForm().

        {
                $_SESSION["mail_search"] = 'cc';
                ilUtil::sendInfo($this->lng->txt("mail_insert_query"));

                $this->showSearchForm();
        }

Here is the call graph for this function:

ilMailFormGUI::searchRcpTo (  ) 

Definition at line 203 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil::sendInfo(), and showSearchForm().

        {
                $_SESSION["mail_search"] = 'to';
                ilUtil::sendInfo($this->lng->txt("mail_insert_query"));

                $this->showSearchForm();
        }

Here is the call graph for this function:

ilMailFormGUI::searchResults (  ) 

Definition at line 409 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

Referenced by cancelSearch().

        {
                $_GET["type"] = "search_res";
                $this->showForm();              
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMailFormGUI::searchUsers ( save = true  ) 

Definition at line 211 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil::prepareFormOutput(), and ilUtil::stripSlashes().

Referenced by search().

        {
                global $ilUser;
                
                if ($save)
                {
                        $this->umail->savePostData($ilUser->getId(),$_POST["attachments"],$_POST["rcp_to"],
                                                                                 $_POST["rcp_cc"],$_POST["rcp_bcc"],$_POST["m_type"],
                                                                                 $_POST["m_email"],
                                                                                 ilUtil::stripSlashes($_POST["m_subject"]),
                                                                                 ilUtil::stripSlashes($_POST["m_message"]),
                                                                                 $_POST['use_placeholders']
                                                                        );
                }
                                        
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_add_users.html", "Services/Mail");
                $this->tpl->setVariable("HEADER", $this->lng->txt("mail"));
                                         
                $this->ctrl->setParameter($this, "cmd", "post");
                $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this));
                $this->ctrl->clearParameters($this);            

                $this->tpl->setVariable("TXT_SEARCH_FOR",$this->lng->txt("search_for"));
                $this->tpl->setVariable("TXT_SEARCH_SYSTEM",$this->lng->txt("mail_search_system"));
                $this->tpl->setVariable("TXT_SEARCH_ADDRESS",$this->lng->txt("mail_search_addressbook"));
                $this->tpl->setVariable("BUTTON_SEARCH",$this->lng->txt("search"));
                $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
                if (strlen(trim($_SESSION["mail_search_search"])) > 0)
                {
                        $this->tpl->setVariable("VALUE_SEARCH_FOR", ilUtil::prepareFormOutput(trim($_SESSION["mail_search_search"]), true));
                }
                
                if (!$_SESSION['mail_search_type_system'] && !$_SESSION['mail_search_type_addressbook'])
                {
                        $this->tpl->setVariable('CHECKED_TYPE_SYSTEM', "checked=\"checked\"");
                }
                else
                {
                        if ($_SESSION['mail_search_type_addressbook']) $this->tpl->setVariable('CHECKED_TYPE_ADDRESSBOOK', "checked=\"checked\"");
                        if ($_SESSION['mail_search_type_system'])$this->tpl->setVariable('CHECKED_TYPE_SYSTEM', "checked=\"checked\"");
                }               
                
                $this->tpl->show();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMailFormGUI::sendMessage (  ) 

Definition at line 112 of file class.ilMailFormGUI.php.

References ilUtil::secureString(), ilUtil::sendInfo(), showForm(), and ilUtil::stripSlashes().

        {
                global $ilUser;
                
                if($_POST['m_message'] != ilUtil::secureString($_POST['m_message'], true))
                {                               
                        ilUtil::sendInfo($this->lng->txt('advice_mail_body_secured'));                  
                        return $this->showForm();
                }
                
                $f_message = $this->umail->formatLinebreakMessage(ilUtil::stripSlashes($_POST['m_message']));
                $this->umail->setSaveInSentbox(true);           
                
                if($errorMessage = $this->umail->sendMail(
                                htmlspecialchars_decode(ilUtil::stripSlashes(htmlspecialchars($_POST['rcp_to']))),
                                htmlspecialchars_decode(ilUtil::stripSlashes(htmlspecialchars($_POST['rcp_cc']))),
                                htmlspecialchars_decode(ilUtil::stripSlashes(htmlspecialchars($_POST['rcp_bcc']))),
                                ilUtil::stripSlashes($_POST['m_subject']), $f_message,
                                $_POST['attachments'], $_POST['m_type'], $_POST['use_placeholders'])
                        )
                {
                        ilUtil::sendInfo($errorMessage);
                }
                else
                {                       
                        $this->umail->savePostData($ilUser->getId(), array(), "", "", "", "", "", "", "", "");                  
                        
                        #$this->ctrl->setParameterByClass("ilmailfoldergui", "mobj_id", $this->mbox->getSentFolder());
                        $this->ctrl->setParameterByClass('ilmailgui', 'type', 'message_sent');
                        $this->ctrl->redirectByClass('ilmailgui');
                }

                $this->showForm();
        }

Here is the call graph for this function:

ilMailFormGUI::showForm (  ) 

Definition at line 439 of file class.ilMailFormGUI.php.

References $_GET, $_SESSION, $data, ilUtil::sendInfo(), and ilUtil::stripSlashes().

Referenced by mailAttachment(), mailRole(), mailUser(), replyMail(), returnFromAttachments(), saveDraft(), searchResults(), sendMessage(), and showSearchForm().

        {
                global $rbacsystem, $ilUser;

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_new.html", "Services/Mail");
                $this->tpl->setVariable("HEADER", $this->lng->txt("mail"));
                
                $this->lng->loadLanguageModule("crs");
                $this->tpl->setVariable("BUTTON_TO",$this->lng->txt("search_recipients"));
                $this->tpl->setVariable("BUTTON_COURSES_TO",$this->lng->txt("mail_my_courses"));
                $this->tpl->setVariable("BUTTON_GROUPS_TO",$this->lng->txt("mail_my_groups"));          

                switch($_GET["type"])
                {
                        case 'reply':
                                if($_SESSION['mail_id'])
                                {
                                        $_GET['mail_id'] = $_SESSION['mail_id'];
                                }
                                $mailData = $this->umail->getMail($_GET["mail_id"]);
                                $mailData["m_subject"] = $this->umail->formatReplySubject();
                                $mailData["m_message"] = $this->umail->formatReplyMessage(); 
                                $mailData["m_message"] = $this->umail->appendSignature();
                                // NO ATTACHMENTS FOR REPLIES
                                $mailData["attachments"] = array();
                                //$mailData["rcp_cc"] = $this->umail->formatReplyRecipientsForCC();
                                $mailData["rcp_cc"] = '';
                                $mailData["rcp_to"] = $this->umail->formatReplyRecipient();     
                                $_SESSION["mail_id"] = "";
                                break;
                
                        case 'search_res':
                                $mailData = $this->umail->getSavedData();

                                /*if($_SESSION["mail_search_results"])
                                {
                                        $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results"],$_SESSION["mail_search"]);
                                }
                                unset($_SESSION["mail_search"]);
                                unset($_SESSION["mail_search_results"]);*/

                                if($_SESSION["mail_search_results_to"])
                                {
                                        $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_to"], 'to');
                                }
                                if($_SESSION["mail_search_results_cc"])
                                {
                                        $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_cc"], 'cc');
                                }
                                if($_SESSION["mail_search_results_bcc"])
                                {
                                        $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_bcc"], 'bc');
                                }
                                
                                unset($_SESSION["mail_search_results_to"]);
                                unset($_SESSION["mail_search_results_cc"]);
                                unset($_SESSION["mail_search_results_bcc"]);
                                                                
                                break;
                
                        case 'attach':
                                $mailData = $this->umail->getSavedData();
                                break;
                
                        case 'draft':
                                $_SESSION["draft"] = $_GET["mail_id"];
                                $mailData = $this->umail->getMail($_GET["mail_id"]);
                                break;
                
                        case 'forward':
                                $mailData = $this->umail->getMail($_GET["mail_id"]);
                                $mailData["rcp_to"] = $mailData["rcp_cc"] = $mailData["rcp_bcc"] = '';
                                $mailData["m_subject"] = $this->umail->formatForwardSubject();
                                $mailData["m_message"] = $this->umail->appendSignature();
                                if(count($mailData["attachments"]))
                                {
                                        if($error = $this->mfile->adoptAttachments($mailData["attachments"],$_GET["mail_id"]))
                                        {
                                                ilUtil::sendInfo($error);
                                        }
                                }
                                break;
                
                        case 'new':
                                if($_GET['rcp_to'])
                                {
                                        $mailData["rcp_to"] = ilUtil::stripSlashes($_GET['rcp_to']);
                                }
                                else if($_SESSION['rcp_to'])
                                {
                                        $mailData["rcp_to"] = $_SESSION['rcp_to'];
                                }
                                if($_GET['rcp_cc'])
                                {
                                        $mailData["rcp_cc"] = ilUtil::stripSlashes($_GET['rcp_cc']);
                                }
                                else if($_SESSION['rcp_cc'])
                                {
                                        $mailData["rcp_cc"] = $_SESSION['rcp_cc'];
                                }
                                if($_GET['rcp_bcc'])
                                {
                                        $mailData["rcp_bcc"] = ilUtil::stripSlashes($_GET['rcp_bcc']);
                                }
                                else if($_SESSION['rcp_bcc'])
                                {
                                        $mailData["rcp_bcc"] = $_SESSION['rcp_bcc'];
                                }
                                
                                
                                $mailData["m_message"] = $this->umail->appendSignature();
                                $_SESSION['rcp_to'] = '';
                                $_SESSION['rcp_cc'] = '';
                                $_SESSION['rcp_bcc'] = '';
                                break;
                
                        case 'role':
                
                                if(is_array($_POST['roles']))
                                {
                                        $mailData['rcp_to'] = ilUtil::stripSlashes(implode(',',$_POST['roles']));
                                }
                                elseif(is_array($_SESSION['mail_roles']))
                                {
                                        $mailData['rcp_to'] = implode(',',$_SESSION['mail_roles']);
                                }
                
                                $mailData['m_message'] = $_POST["additional_message_text"].chr(13).chr(10).$this->umail->appendSignature();
                                $_POST["additional_message_text"] = "";
                                $_SESSION['mail_roles'] = "";
                                break;
                
                        case 'address':
                                $mailData["rcp_to"] = urldecode($_GET["rcp"]);
                                break;
                
                        default:
                                // GET DATA FROM POST
                                $mailData = $_POST;

                                // strip slashes
                                foreach ($mailData as $key => $value)
                                {
                                        if (is_string($value))
                                        {
                                                $mailData[$key] = ilUtil::stripSlashes($value);
                                        }
                                }
                                break;
                }
                $this->ctrl->setParameter($this, "cmd", "post");
                $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this));
                $this->ctrl->clearParameters($this);

                // RECIPIENT
                $this->tpl->setVariable("TXT_RECIPIENT", $this->lng->txt("mail_to"));
                $this->tpl->setVariable("TXT_SEARCH_RECIPIENT", $this->lng->txt("search_recipient"));
                                
                // CC
                $this->tpl->setVariable("TXT_CC", $this->lng->txt("cc"));
                $this->tpl->setVariable("TXT_SEARCH_CC_RECIPIENT", $this->lng->txt("search_cc_recipient"));
                // BCC
                $this->tpl->setVariable("TXT_BC", $this->lng->txt("bc"));
                $this->tpl->setVariable("TXT_SEARCH_BC_RECIPIENT", $this->lng->txt("search_bc_recipient"));
                // SUBJECT
                $this->tpl->setVariable("TXT_SUBJECT", $this->lng->txt("subject"));
                
                // TYPE
                $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("type"));
                $this->tpl->setVariable("TXT_NORMAL", $this->lng->txt("mail_intern"));
                if(!is_array($mailData["m_type"]) or (is_array($mailData["m_type"]) and in_array('normal',$mailData["m_type"])))
                {
                        $this->tpl->setVariable("CHECKED_NORMAL",'checked="checked"');
                }
                
                // ONLY IF SYSTEM MAILS ARE ALLOWED
                if($rbacsystem->checkAccess("system_message",$this->umail->getMailObjectReferenceId()))
                {
                        $this->tpl->setCurrentBlock("system_message");
                        $this->tpl->setVariable("SYSTEM_TXT_TYPE", $this->lng->txt("type"));
                        $this->tpl->setVariable("TXT_SYSTEM", $this->lng->txt("system_message"));
                        if(is_array($mailData["m_type"]) and in_array('system',$mailData["m_type"]))
                        {
                                $this->tpl->setVariable("CHECKED_SYSTEM",'checked="checked"');
                        }
                        $this->tpl->parseCurrentBlock();
                }
                        
                // ONLY IF SMTP MAILS ARE ALLOWED
                if($rbacsystem->checkAccess("smtp_mail",$this->umail->getMailObjectReferenceId()))
                {
                        $this->tpl->setCurrentBlock("allow_smtp");
                        $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
                        if(is_array($mailData["m_type"]) and in_array('email',$mailData["m_type"]))
                        {
                                $this->tpl->setVariable("CHECKED_EMAIL",'checked="checked"');
                        }
                        $this->tpl->parseCurrentBlock();
                }
                
                // ATTACHMENT
                $this->tpl->setVariable("TXT_ATTACHMENT",$this->lng->txt("mail_attachments"));
                // SWITCH BUTTON 'add' 'edit'
                if($mailData["attachments"])
                {
                        $this->tpl->setVariable("BUTTON_EDIT",$this->lng->txt("edit"));
                }
                else
                {
                        $this->tpl->setVariable("BUTTON_EDIT",$this->lng->txt("add"));
                }
                
                // MESSAGE
                $this->tpl->setVariable("TXT_MSG_CONTENT", $this->lng->txt("message_content"));
                
                // PLACEHOLDERS         
                $this->tpl->setVariable('TXT_ACTIVATE_PLACEHOLDERS', $this->lng->txt('activate_serial_letter_placeholders'));
                if ($mailData['use_placeholders'])
                {
                        $this->tpl->setVariable('CHECKED_USE_PLACEHOLDERS', ' checked="checked"');                      
                }
                else
                {
                        $this->tpl->touchBlock('hide_placeholders');
                }
                
                // BUTTONS
                $this->tpl->setVariable("TXT_SEND", $this->lng->txt("send"));
                $this->tpl->setVariable("TXT_MSG_SAVE", $this->lng->txt("save_message"));
                
                // MAIL DATA
                $this->tpl->setVariable("RCP_TO", htmlspecialchars(ilUtil::stripSlashes($mailData["rcp_to"])));
                $this->tpl->setVariable("RCP_CC", htmlspecialchars(ilUtil::stripSlashes($mailData["rcp_cc"])));
                $this->tpl->setVariable("RCP_BCC", htmlspecialchars(ilUtil::stripSlashes($mailData["rcp_bcc"])));
                
                $this->tpl->setVariable("M_SUBJECT", htmlspecialchars(ilUtil::stripSlashes($mailData["m_subject"])));
                
                if (is_array($mailData["attachments"]) &&
                        count($mailData["attachments"]))
                {
                        $this->tpl->setCurrentBlock("files");
                        $this->tpl->setCurrentBlock("hidden");
                        foreach($mailData["attachments"] as $key => $data)
                        {
                                $this->tpl->setVariable("ATTACHMENTS",$data);
                                $this->tpl->parseCurrentBlock();

                                $size = round(filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data) / 1024);
                                if ($size < 1) $size = 1;                               
                                $mailData["attachments"][$key] .= " [" . number_format($size, 0, ".", "") . " KByte]";
                        }
                        $this->tpl->setVariable("ROWS",count($mailData["attachments"]));

                        $this->tpl->setVariable("FILES",implode("<br />",$mailData["attachments"]));
                        $this->tpl->parseCurrentBlock();
                }
                $this->tpl->setVariable("M_MESSAGE",ilUtil::stripSlashes($mailData["m_message"]));
                $this->tpl->parseCurrentBlock();
                
                
                $this->tpl->setVariable('TXT_USE_PLACEHOLDERS', $this->lng->txt('mail_nacc_use_placeholder'));
                $this->tpl->setVariable('TXT_PLACEHOLDERS_ADVISE', sprintf($this->lng->txt('placeholders_advise'), '<br />'));          
                $this->tpl->setVariable('TXT_MAIL_SALUTATION', $this->lng->txt('mail_nacc_salutation'));
                $this->tpl->setVariable('TXT_FIRST_NAME', $this->lng->txt('firstname'));
                $this->tpl->setVariable('TXT_LAST_NAME', $this->lng->txt('lastname'));
                $this->tpl->setVariable('TXT_LOGIN', $this->lng->txt('mail_nacc_login'));               
                $this->tpl->setVariable('TXT_ILIAS_URL', $this->lng->txt('mail_nacc_ilias_url'));
                $this->tpl->setVariable('TXT_CLIENT_NAME', $this->lng->txt('mail_nacc_client_name'));           

                $this->tpl->show();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMailFormGUI::showSearchForm (  ) 

Definition at line 308 of file class.ilMailFormGUI.php.

References ilUtil::prepareFormOutput(), and showForm().

Referenced by searchRcpBc(), searchRcpCc(), and searchRcpTo().

        {
                global $ilUser;

                $this->tpl->setCurrentBlock("search");
                $this->tpl->setVariable("TXT_SEARCH_FOR",$this->lng->txt("search_for"));
                $this->tpl->setVariable("TXT_SEARCH_SYSTEM",$this->lng->txt("mail_search_system"));
                $this->tpl->setVariable("TXT_SEARCH_ADDRESS",$this->lng->txt("mail_search_addressbook"));

                if ($pref = $ilUser->getPref("mail_search"))
                {
                                if ($pref == "system" || $pref == "all") $this->tpl->setVariable("SEARCH_SYSTEM_CHECKED", "checked=\"checked\"");
                                if ($pref == "addressbook" || $pref == "all") $this->tpl->setVariable("SEARCH_ADDRESS_CHECKED", "checked=\"checked\"");
                }
                else
                {
                                $this->tpl->setVariable("SEARCH_SYSTEM_CHECKED", "checked=\"checked\"");
                }

                $this->tpl->setVariable("BUTTON_SEARCH",$this->lng->txt("search"));
                $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
                if (strlen(trim($_POST['search'])) > 0)
                {
                        $this->tpl->setVariable("VALUE_SEARCH_FOR", ilUtil::prepareFormOutput(trim($_POST["search"]), true));
                }
                $this->tpl->parseCurrentBlock();

                $this->showForm();
        }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

ilMailFormGUI::$ctrl = null [private]

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

ilMailFormGUI::$lng = null [private]

Definition at line 40 of file class.ilMailFormGUI.php.

Referenced by __construct().

ilMailFormGUI::$mbox = null [private]

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

ilMailFormGUI::$mfile = null [private]

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

ilMailFormGUI::$tpl = null [private]

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

Referenced by __construct().

ilMailFormGUI::$umail = null [private]

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


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