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

usr_agreement.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 
00034 require_once "./include/inc.header.php";
00035 
00036 // catch hack attempts
00037 
00038 if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
00039 {
00040         $ilias->raiseError($lng->txt("msg_not_available_for_anon"),$ilias->error_obj->MESSAGE);
00041 }
00042 
00043 $tpl->addBlockFile("CONTENT", "content", "tpl.usr_agreement.html");
00044 $tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00045 $tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
00046 $tpl->addBlockFile("BUTTONS", "buttons", "tpl.buttons.html");
00047 
00048 
00049 // set locator
00050 $tpl->setVariable("TXT_LOCATOR",$lng->txt("locator"));
00051 $tpl->touchBlock("locator_separator");
00052 $tpl->setCurrentBlock("locator_item");
00053 $tpl->setVariable("ITEM", $lng->txt("personal_desktop"));
00054 $tpl->setVariable("LINK_ITEM", "usr_personaldesktop.php");
00055 $tpl->parseCurrentBlock();
00056 
00057 $tpl->setCurrentBlock("locator_item");
00058 $tpl->setVariable("ITEM", $lng->txt("usr_agreement"));
00059 $tpl->setVariable("LINK_ITEM", "usr_agreement.php");
00060 $tpl->parseCurrentBlock();
00061 
00062 // catch feedback message
00063 sendInfo();
00064 // display infopanel if something happened
00065 infoPanel();
00066 
00067 // display tabs
00068 include "./include/inc.personaldesktop_buttons.php";
00069 
00070 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("personal_desktop"));
00071 //$tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("usr_agreement"));
00072 $tpl->setVariable("TXT_AGREEMENT", $lng->txt("usr_agreement"));
00073 $tpl->setVariable("TXT_USR_AGREEMENT", getUserAgreement());
00074 $tpl->setVariable("TXT_ACCEPT", $lng->txt("accept_usr_agreement"));
00075 $tpl->setVariable("TXT_YES", $lng->txt("yes"));
00076 $tpl->setVariable("TXT_NO", $lng->txt("no"));
00077 $tpl->setVariable("TXT_SUBMIT", $lng->txt("save"));
00078 
00079 $tpl->show();
00080 
00081 function getUserAgreement()
00082 {
00083         global $lng, $ilias;
00084 
00085         $tmpPath = getcwd();
00086         $agrPath = $tmpPath."/agreement";
00087         chdir($agrPath);
00088 
00089         $agreement = "agreement_".$lng->lang_user.".html";
00090 
00091         if ($agreement)
00092         {
00093                 if ($content = file($agreement))
00094                 {
00095                         foreach ($content as $key => $val)
00096                         {
00097                                 $text .= trim(nl2br($val));
00098                         }
00099                         return $text;
00100                 }
00101                 else
00102                 {
00103                         $ilias->raiseError($lng->txt("usr_agreement_empty"),$ilias->error_obj->MESSAGE);
00104                 }
00105         }
00106         else
00107         {
00108                 $ilias->raiseError($lng->txt("file_not_found"),$ilias->error_obj->MESSAGE);
00109         }
00110 }
00111 ?>

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