• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

feedback.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00033 require_once "./include/inc.header.php";
00034 
00035 $tpl->addBlockFile("CONTENT", "content", "tpl.feedback.html");
00036 $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00037 $tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
00038 
00039 // set locator 
00040 $tpl->setVariable("TXT_LOCATOR",$lng->txt("locator"));
00041 $tpl->setCurrentBlock("locator_item");
00042 $tpl->setVariable("ITEM", $lng->txt("feedback"));
00043 $tpl->setVariable("LINK_ITEM", "feedback.php");
00044 $tpl->parseCurrentBlock();
00045 
00046 // display infopanel if something happened
00047 infoPanel();
00048 
00049 $recipient = $ilias->getSetting("feedback_recipient");
00050 
00051 if (empty($recipient))
00052 {
00053         $recipient = $ilias->getSetting("admin_email");
00054 }
00055 
00056 if ($_POST["msg_send"])
00057 {
00058         if (empty($recipient))
00059         {
00060                 $tpl->setVariable("MSG", $lng->txt("no_recipient")."<br/>".$lng->txt("mail_not_sent"));
00061         }
00062         else
00063         {
00064                 $subject = "ILIAS 3 Feedback";
00065                 $from_host = "From: http://".$_SERVER["SERVER_NAME"].dirname($_SERVER["REQUEST_URI"])."\r\n";
00066                 $message = $from_host.$_POST["msg_content"];
00067                 $from_email = $ilias->account->getEmail();
00068                 $from_sender = $ilias->account->getFullname();
00069                 $headers = "From: ".$from_sender."<".$from_email.">\r\n";
00070                 
00071                 if (mail($recipient,$subject,$message,$headers))
00072                 {
00073                         $tpl->setVariable("MSG", $lng->txt("mail_sent"));
00074                 }
00075                 else
00076                 {
00077                         $tpl->setVariable("MSG", $lng->txt("mail_not_sent"));
00078                 }
00079         }
00080 }
00081 
00082 $tpl->setCurrentBlock("content");
00083 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("feedback"));
00084 $tpl->setVariable("TXT_MSG_DEFAULT",  $lng->txt("type_your_message_here"));
00085 $tpl->setVariable("TXT_MSG_TO", $lng->txt("message_to"));
00086 $tpl->setVariable("FEEDBACK_RECIPIENT", $recipient);
00087 $tpl->setVariable("TXT_YOUR_MSG",  $lng->txt("your_message"));
00088 $tpl->setVariable("TXT_SEND",  $lng->txt("send"));
00089 $tpl->parseCurrentBlock();
00090 
00091 // parse message block
00092 $tpl->setCurrentBlock("message");
00093 $tpl->parseCurrentBlock();
00094 
00095 $tpl->show();
00096 ?>

Generated on Fri Dec 13 2013 09:06:36 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1