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
00035 require_once "./include/inc.header.php";
00036 require_once "classes/class.ilObjUser.php";
00037 require_once "classes/class.ilMail.php";
00038
00039
00040 $tpl->addBlockFile("CONTENT", "content", "tpl.usr_pdesktop.html");
00041
00042
00043
00044 $template_path = $ilias->tplPath.$ilias->account->getPref("skin");
00045
00046
00047 if ($_GET["cmd"] == "lvis_le")
00048 {
00049
00050 $tpl->addBlockFile("USR_TEXT", "usr_text", "tpl.usr_text.html");
00051
00052
00053 $login_name = $ilias->account->login;
00054 $greeting = "";
00055
00056 if (date("H:i",time()) > "06:00:00" and date("H:i",time()) < "12:00:00")
00057 {$greeting .= $lng->txt("ingmedia_good_morning");}
00058 elseif (date("H:i",time()) > "12:00:00" and date("H:i",time()) < "18:00:00")
00059 {$greeting .= $lng->txt("ingmedia_good_afternoon");}
00060 elseif (date("H:i",time()) > "18:00:00" or date("H:i",time()) < "22:00:00")
00061 {$greeting .= $lng->txt("ingmedia_good_evening");}
00062 elseif (date("H:i",time()) < "06:00:00" or date("H:i",time()) > "22:00:00")
00063 {$greeting .= $lng->txt("ingmedia_good_night");}
00064 else
00065 {$greeting .= $lng->txt("ingmedia_hello");};
00066 $greeting .= " ".$login_name;
00067
00068 $greeting .= $lng->txt("ingmedia_welcome");
00069
00070
00071 $result = $ilias->account->getLastVisitedLessons();
00072 if (sizeof($result) > 0)
00073 {
00074 $akt_date = ilFormat::formatDate($result[0]["timestamp"],"date");
00075 $info ="";
00076 $info = $lng->txt("ingmedia_info_about_work1");
00077 $info .= " ".$akt_date." ";
00078 $info .= $lng->txt("ingmedia_info_about_work2");
00079 $tpl->setCurrentBlock("link_button");
00080 $tpl->setVariable("TXT_LINK", "content/lm_presentation.php?ref_id=".$result[0]["lm_id"]."&obj_id=".$result[0]["obj_id"]);
00081 $tpl->setVariable("TXT_LINK_IMG", $template_path."/images/layout/open.gif");
00082 $tpl->setVariable("TXT_LINK_TITLE", $result[0]["lm_title"]);
00083 $tpl->parseCurrentBlock();
00084 }
00085 else
00086 {
00087
00088 $info ="";
00089 }
00090 $tpl->setCurrentBlock("using_info");
00091 $tpl->setVariable("TXT_TITLE",$greeting);
00092 $tpl->setVariable("TXT_NOTES",$info);
00093 $tpl->parseCurrentBlock();
00094 }
00095
00096
00097
00098 if ($_GET["cmd"] == "visited")
00099 {
00100
00101 $tpl->addBlockFile("USR_TEXT", "usr_text", "tpl.usr_text.html");
00102
00103
00104 $result = $ilias->account->getLastVisitedLessons();
00105 if (sizeof($result) > 0)
00106 {
00107 for ($i=1;$i<=sizeof($result);$i++)
00108 {
00109 $tpl->setCurrentBlock("link_button");
00110 $tpl->setVariable("TXT_LINK", "content/lm_presentation.php?ref_id=".$result[$i-1]["lm_id"]."&obj_id=".$result[$i-1]["obj_id"]);
00111 $tpl->setVariable("TXT_LINK_TITLE", ilFormat::formatDate($result[$i-1]["timestamp"],"date")." - ".$result[$i-1]["lm_title"]);
00112 $tpl->setVariable("TXT_LINK_IMG", $template_path."/images/layout/open.gif");
00113 $tpl->parseCurrentBlock();
00114 }
00115 }
00116
00117 $tpl->setCurrentBlock("using_info");
00118 $tpl->setVariable("TXT_TITLE",$lng->txt("ingmedia_visited_le"));
00119 $tpl->parseCurrentBlock();
00120 }
00121
00122
00123
00124
00125 if ($_GET["cmd"] == "reg_le")
00126 {
00127
00128 $tpl->addBlockFile("USR_TEXT", "usr_text", "tpl.usr_text.html");
00129
00130
00131 $lo_items = $ilias->account->getDesktopItems("lm");
00132 $i = 0;
00133 foreach ($lo_items as $lo_item)
00134 {
00135 $i++;
00136 $tpl->setCurrentBlock("link_button");
00137 $tpl->setVariable("TXT_LINK", "content/lm_presentation.php?ref_id=".$lo_item["id"].
00138 "&obj_id=".$lo_item["parameters"]);
00139 $tpl->setVariable("TXT_LINK_TITLE", $lo_item["title"]);
00140 $tpl->setVariable("TXT_LINK_IMG", $template_path."/images/layout/open.gif");
00141 $tpl->parseCurrentBlock();
00142 }
00143 if ($i == 0)
00144 {
00145 $tpl->setCurrentBlock("link_button");
00146 $tpl->setVariable("TXT_LINK_TITLE",$lng->txt("no_lo_in_personal_list"));
00147 $tpl->parseCurrentBlock();
00148 }
00149
00150 $tpl->setCurrentBlock("using_info");
00151 $tpl->setVariable("TXT_TITLE",$lng->txt("ingmedia_reg_le"));
00152 $tpl->parseCurrentBlock();
00153 }
00154
00155
00156
00157 if ($_GET["cmd"] == "reg_fo")
00158 {
00159
00160 $frm_obj = ilUtil::getObjectsByOperations('frm','read');
00161 $frmNum = count($frm_obj);
00162 $lastLogin = $ilias->account->getLastLogin();
00163
00164
00165 $tpl->addBlockFile("USR_TEXT", "usr_text", "tpl.usr_text.html");
00166
00167 $frm_items = $ilias->account->getDesktopItems("frm");
00168 $i = 0;
00169 foreach ($frm_items as $frm_item)
00170 {
00171 $i++;
00172 $tpl->setCurrentBlock("link_button");
00173 $tpl->setVariable("TXT_LINK",'repository.php?ref_id='.$frm_item['id']);
00174 $tpl->setVariable("TXT_LINK_TITLE", $frm_item["title"]);
00175 $tpl->setVariable("TXT_LINK_IMG", $template_path."/images/layout/open.gif");
00176 $tpl->parseCurrentBlock();
00177 }
00178 if ($i == 0)
00179 {
00180 $tpl->setCurrentBlock("link_button");
00181 $tpl->setVariable("TXT_LINK_TITLE", $lng->txt("no_frm_in_personal_list"));
00182 $tpl->parseCurrentBlock();
00183 }
00184
00185 $tpl->setCurrentBlock("using_info");
00186 $tpl->setVariable("TXT_TITLE",$lng->txt("ingmedia_reg_fo"));
00187 $tpl->parseCurrentBlock();
00188
00189 $tpl->parseCurrentBlock();
00190 }
00191
00192
00193
00194 $tpl->show();
00195 ?>