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

Services/User/classes/class.ilUserAgreement.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2005 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 
00032 class ilUserAgreement
00033 {
00039         var $ilias;
00040 
00041 
00046         function ilUserAgreement()
00047         {
00048                 global $ilias;
00049 
00050                 $this->ilias = &$ilias;
00051         }
00052 
00058         function _getText()
00059         {
00060                 global $lng, $ilias, $ilLog;
00061         
00062                 
00063                 // 1st try: client specific / user language agreement
00064                 $agreement = "./Customizing/clients/".CLIENT_ID."/agreement/".
00065                         "agreement_".$lng->lang_key.".html";
00066         
00067                 // 2nd try: client specific / default language
00068                 if (!file_exists($agreement))
00069                 {
00070                         $agreement = "./Customizing/clients/".CLIENT_ID."/agreement/".
00071                                 "agreement_".$lng->lang_default.".html";
00072                 }
00073         
00074                 // 3rd try: client specific / english
00075                 if (!file_exists($agreement))
00076                 {
00077                         $agreement = "./Customizing/clients/".CLIENT_ID."/agreement/".
00078                                 "agreement_en.html";
00079                 }
00080                 
00081                 // 4th try: global / user language
00082                 if (!file_exists($agreement))
00083                 {
00084                         $agreement = "./Customizing/global/agreement/".
00085                                 "agreement_".$lng->lang_key.".html";
00086                 }
00087         
00088                 // 5th try: global / default language
00089                 if (!file_exists($agreement))
00090                 {
00091                         $agreement = "./Customizing/global/agreement/".
00092                                 "agreement_".$lng->lang_default.".html";
00093                 }
00094         
00095                 // last try: global / english
00096                 if (!file_exists($agreement))
00097                 {
00098                         $ilLog->write("view_usr_agreement.php: Agreement file "."agreement_".$lng->lang_default.".html"." has not been found (system language).");
00099                         $agreement = "./Customizing/global/agreement/".
00100                                 "agreement_en.html";
00101                 }
00102                 
00103                 if (file_exists($agreement))
00104                 {
00105                         if ($content = file($agreement))
00106                         {
00107                                 foreach ($content as $key => $val)
00108                                 {
00109                                         $text .= trim(nl2br($val));
00110                                 }
00111                                 return $text;
00112                         }
00113                 }
00114                 
00115                 return "<br />".$lng->txt("no_agreement_description")."<br /><br />";
00116         }
00117 }
00118 ?>

Generated on Fri Dec 13 2013 17:57:02 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1