Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 require_once "./include/inc.header.php";
00035
00036
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
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
00063 sendInfo();
00064
00065 infoPanel();
00066
00067
00068 include "./include/inc.personaldesktop_buttons.php";
00069
00070 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("personal_desktop"));
00071
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 ?>