index.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <?php
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2005 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) various contributors
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. /**
  21. ==============================================================================
  22. * This is the index file displayed when a user arrives at Dokeos.
  23. *
  24. * It dispalys:
  25. * - tree of courses and categories
  26. * - login form
  27. * - public menu
  28. *
  29. * Search for
  30. * CONFIGURATION parameters
  31. * to modify settings
  32. *
  33. * @todo rewrite code to separate display, logic, database code
  34. * @package dokeos.main
  35. ==============================================================================
  36. */
  37. /**
  38. * @todo shouldn't the SCRIPTVAL_ and CONFVAL_ constant be moved to the config page? Has anybody any idea what the are used for?
  39. * if these are really configuration settings then we can add those to the dokeos config settings
  40. */
  41. /*
  42. ==============================================================================
  43. INIT SECTION
  44. ==============================================================================
  45. */
  46. // only this script should have this constant defined
  47. define('DOKEOS_HOMEPAGE', true);
  48. // Don't change these settings
  49. define("SCRIPTVAL_No", 0);
  50. define("SCRIPTVAL_InCourseList", 1);
  51. define("SCRIPTVAL_UnderCourseList", 2);
  52. define("SCRIPTVAL_Both", 3);
  53. define("SCRIPTVAL_NewEntriesOfTheDay", 4);
  54. define("SCRIPTVAL_NewEntriesOfTheDayOfLastLogin", 5);
  55. define("SCRIPTVAL_NoTimeLimit", 6);
  56. // End 'don't change' section
  57. // name of the language file that needs to be included
  58. $language_file = array ('courses', 'index');
  59. $cidReset = true; /* Flag forcing the 'current course' reset,
  60. as we're not inside a course anymore */
  61. /*
  62. -----------------------------------------------------------
  63. Included libraries
  64. -----------------------------------------------------------
  65. */
  66. include_once ('./main/inc/global.inc.php');
  67. include_once (api_get_path(LIBRARY_PATH).'course.lib.php');
  68. include_once (api_get_path(LIBRARY_PATH).'debug.lib.inc.php');
  69. include_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php');
  70. include_once (api_get_path(LIBRARY_PATH).'system_announcements.lib.php');
  71. include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
  72. include_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  73. // the section (for the tabs)
  74. $this_section = SECTION_CAMPUS;
  75. /*
  76. -----------------------------------------------------------
  77. Action Handling
  78. -----------------------------------------------------------
  79. */
  80. if ($_GET['logout'])
  81. {
  82. $query_string='';
  83. if(!empty($_SESSION['user_language_choice']))
  84. {
  85. $query_string='?language='.$_SESSION['user_language_choice'];
  86. }
  87. $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
  88. $sql_last_connection="SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id='".$_GET["uid"]."' ORDER BY login_date DESC LIMIT 0,1";
  89. $q_last_connection=mysql_query($sql_last_connection);
  90. $i_id_last_connection=mysql_result($q_last_connection,0,"login_id");
  91. $s_sql_update_logout_date="UPDATE $tbl_track_login SET logout_date=NOW() WHERE login_id='$i_id_last_connection'";
  92. api_sql_query($s_sql_update_logout_date);
  93. //LoginDelete(".$_user['user_id'].", $_configuration['statistics_database']);
  94. LoginDelete($_GET["uid"], $_configuration['statistics_database']);
  95. api_session_destroy();
  96. header("Location: index.php$query_string");
  97. exit();
  98. }
  99. /*
  100. -----------------------------------------------------------
  101. Table definitions
  102. -----------------------------------------------------------
  103. */
  104. $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
  105. $main_category_table = Database :: get_main_table(TABLE_MAIN_CATEGORY);
  106. $track_login_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
  107. /*
  108. -----------------------------------------------------------
  109. Constants and CONFIGURATION parameters
  110. -----------------------------------------------------------
  111. */
  112. // @todo shouldn't these be moved to the config page or made into dokeos config settings?
  113. // ---- Category list options ----
  114. /** defines wether or not anonymous visitors can see a list of the courses on
  115. the Dokeos homepage that are open to the world */
  116. define('DISPLAY_COURSES_TO_ANONYMOUS_USERS', true);
  117. define('CONFVAL_showNodeEmpty', true);
  118. define('CONFVAL_showNumberOfChild', false); // actually count are only for direct children
  119. define('CONFVAL_ShowLinkBackToTopOfTree', false);
  120. // ---- Course list options ----
  121. define("CONFVAL_showCourseLangIfNotSameThatPlatform", TRUE);
  122. // Preview of course content
  123. // to disable all: set CONFVAL_maxTotalByCourse = 0
  124. // to enable all: set e.g. CONFVAL_maxTotalByCourse = 5
  125. // by default disabled since what's new icons are better (see function display_digest() )
  126. define("CONFVAL_maxValvasByCourse", 2); // Maximum number of entries
  127. define("CONFVAL_maxAgendaByCourse", 2); // collected from each course
  128. define("CONFVAL_maxTotalByCourse", 0); // and displayed in summary.
  129. define("CONFVAL_NB_CHAR_FROM_CONTENT", 80);
  130. // Order to sort data
  131. $orderKey = array('keyTools', 'keyTime', 'keyCourse'); // default "best" Choice
  132. //$orderKey = array('keyTools', 'keyCourse', 'keyTime');
  133. //$orderKey = array('keyCourse', 'keyTime', 'keyTools');
  134. //$orderKey = array('keyCourse', 'keyTools', 'keyTime');
  135. define('CONFVAL_showExtractInfo', SCRIPTVAL_UnderCourseList);
  136. // SCRIPTVAL_InCourseList // best choice if $orderKey[0] == 'keyCourse'
  137. // SCRIPTVAL_UnderCourseList // best choice
  138. // SCRIPTVAL_Both // probably only for debug
  139. //$dateFormatForInfosFromCourses = $dateFormatShort;
  140. $dateFormatForInfosFromCourses = $dateFormatLong;
  141. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NewEntriesOfTheDay);
  142. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NoTimeLimit);
  143. define("CONFVAL_limitPreviewTo", SCRIPTVAL_NewEntriesOfTheDayOfLastLogin);
  144. if (isset ($_user['user_id']))
  145. {
  146. $nameTools = api_get_setting('siteName');
  147. }
  148. /*
  149. -----------------------------------------------------------
  150. Check configuration parameters integrity
  151. -----------------------------------------------------------
  152. */
  153. if (CONFVAL_showExtractInfo != SCRIPTVAL_UnderCourseList and $orderKey[0] != "keyCourse")
  154. {
  155. // CONFVAL_showExtractInfo must be SCRIPTVAL_UnderCourseList to accept $orderKey[0] !="keyCourse"
  156. if (DEBUG || api_is_platform_admin()) // Show bug if admin. Else force a new order
  157. die("
  158. <strong>
  159. config error:".__FILE__."</strong>
  160. <br/>
  161. set
  162. <ul>
  163. <li>
  164. CONFVAL_showExtractInfo=SCRIPTVAL_UnderCourseList
  165. (actually : ".CONFVAL_showExtractInfo.")
  166. </li>
  167. </ul>
  168. or
  169. <ul>
  170. <li>
  171. \$orderKey[0] !=\"keyCourse\"
  172. (actually : ".$orderKey[0].")
  173. </li>
  174. </ul>");
  175. else
  176. {
  177. $orderKey = array ("keyCourse", "keyTools", "keyTime");
  178. }
  179. }
  180. /*
  181. ==============================================================================
  182. LOGIN
  183. ==============================================================================
  184. */
  185. if ($_GET["submitAuth"] == 1)
  186. {
  187. // nice lie!!!
  188. echo "Attempted breakin - sysadmins notified.";
  189. session_destroy();
  190. die();
  191. }
  192. if ($_POST["submitAuth"])
  193. {
  194. // To ensure legacy compatibility, we set the following variables.
  195. // But they should be removed at last.
  196. $lastname = $_user['lastName'];
  197. $firstname = $_user['firstName'];
  198. $email = $_user['mail'];
  199. $status = $uData['status'];
  200. if (isset ($_user['user_id']))
  201. {
  202. $sqlLastLogin = "SELECT UNIX_TIMESTAMP(login_date)
  203. FROM $track_login_table
  204. WHERE login_user_id = '".$_user['user_id']."'
  205. ORDER BY login_date DESC LIMIT 1";
  206. $resLastLogin = api_sql_query($sqlLastLogin, __FILE__, __LINE__);
  207. if (!$resLastLogin)
  208. if (mysql_num_rows($resLastLogin) > 0)
  209. {
  210. $user_last_login_datetime = mysql_fetch_array($resLastLogin);
  211. $user_last_login_datetime = $user_last_login_datetime[0];
  212. api_session_register('user_last_login_datetime');
  213. }
  214. mysql_free_result($resLastLogin);
  215. //event_login();
  216. if (api_is_platform_admin())
  217. {
  218. // decode all open event informations and fill the track_c_* tables
  219. include (api_get_path(LIBRARY_PATH)."stats.lib.inc.php");
  220. decodeOpenInfos();
  221. }
  222. }
  223. } // end login -- if($submit)
  224. else
  225. {
  226. // only if login form was not sent because if the form is sent the user was
  227. // already on the page.
  228. event_open();
  229. }
  230. /*
  231. -----------------------------------------------------------
  232. Header
  233. include the HTTP, HTML headers plus the top banner
  234. -----------------------------------------------------------
  235. */
  236. $help = "Clar";
  237. Display :: display_header('', $help);
  238. /*
  239. ==============================================================================
  240. FUNCTIONS
  241. display_anonymous_right_menu()
  242. display_anonymous_course_list()
  243. display_login_form()
  244. handle_login_failed()
  245. display_lost_password_info()
  246. ==============================================================================
  247. */
  248. /*
  249. -----------------------------------------------------------
  250. Display functions
  251. -----------------------------------------------------------
  252. */
  253. /**
  254. * Displays the right-hand menu for anonymous users:
  255. * login form, useful links, help section
  256. * Warning: function defines globals
  257. * @version 1.0.1
  258. * @todo does $_plugins need to be global?
  259. */
  260. function display_anonymous_right_menu()
  261. {
  262. global $loginFailed, $_plugins, $_user;
  263. $platformLanguage = api_get_setting('platformLanguage');
  264. if ( !($_user['user_id']) ) // only display if the user isn't logged in
  265. {
  266. api_display_language_form();
  267. echo '<br />';
  268. display_login_form();
  269. if ($loginFailed)
  270. {
  271. handle_login_failed();
  272. }
  273. if (api_get_setting('allow_lostpassword') == 'true' OR api_get_setting('allow_registration') == 'true')
  274. {
  275. echo '<div class="menusection"><span class="menusectioncaption">'.get_lang('MenuUser').'</span><ul class="menulist">';
  276. if (get_setting('allow_registration') <> 'false')
  277. {
  278. echo '<li><a href="main/auth/inscription.php">'.get_lang('Reg').'</a></li>';
  279. }
  280. if (get_setting('allow_lostpassword') == 'true')
  281. {
  282. display_lost_password_info();
  283. }
  284. echo '</ul></div>';
  285. }
  286. echo '<div class="note" style="background: none">';
  287. api_plugin('loginpage_menu');
  288. echo '</div>';
  289. }
  290. /*** hide right menu "general" and other parts on anonymous right menu *****/
  291. echo "<div class=\"menusection\">", "<span class=\"menusectioncaption\">".get_lang("MenuGeneral")."</span>";
  292. echo "<ul class=\"menulist\">";
  293. $user_selected_language = $_SESSION["user_language_choice"];
  294. if (!isset ($user_selected_language))
  295. $user_selected_language = $platformLanguage;
  296. if(!file_exists('home/home_menu_'.$user_selected_language.'.html'))
  297. {
  298. include ('home/home_menu.html');
  299. }
  300. else
  301. {
  302. include('home/home_menu_'.$user_selected_language.'.html');
  303. }
  304. echo '</ul>';
  305. echo '</div>';
  306. if ($_user['user_id'])
  307. {
  308. echo '<div class="note" style="background: none">';
  309. api_plugin('campushomepage_menu');
  310. echo '</div>';
  311. }
  312. /**** use this comment to hide notice file section from right menu ****
  313. echo '<div class="note">';
  314. // includes for any files to be displayed below anonymous right menu
  315. if(!file_exists('home/home_notice_'.$user_selected_language.'.html'))
  316. {
  317. include ('home/home_notice.html');
  318. }
  319. else
  320. {
  321. include('home/home_notice_'.$user_selected_language.'.html');
  322. }
  323. echo '</div>';
  324. **** end of hide various right menu items on anonymous right menu ****/
  325. }
  326. /**
  327. * Reacts on a failed login:
  328. * displays an explanation with
  329. * a link to the registration form.
  330. *
  331. * @version 1.0.1
  332. */
  333. function handle_login_failed()
  334. {
  335. switch ($_GET['error'])
  336. {
  337. case '':
  338. $message = get_lang("InvalidId");
  339. if (api_is_self_registration_allowed())
  340. {
  341. $message = get_lang("InvalidForSelfRegistration");
  342. }
  343. break;
  344. case 'account_expired':
  345. $message=get_lang('AccountExpired');
  346. break;
  347. case 'account_inactive':
  348. $message=get_lang('AccountInactive');
  349. break;
  350. case 'user_password_incorrect':
  351. $message=get_lang('InvalidId');
  352. break;
  353. }
  354. echo "<div id=\"login_fail\">".$message."</div>";
  355. }
  356. /**
  357. * Adds a form to let users login
  358. * @version 1.1
  359. */
  360. function display_login_form()
  361. {
  362. $form = new FormValidator('formLogin');
  363. $form->addElement('text','login',get_lang('UserName'),array('size'=>15));
  364. $form->addElement('password','password',get_lang('Pass'),array('size'=>15));
  365. $form->addElement('submit','submitAuth',get_lang('Ok'));
  366. $renderer =& $form->defaultRenderer();
  367. $element_template = '<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}<br />
  368. <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}<br />';
  369. $renderer->setElementTemplate($element_template);
  370. $form->display();
  371. }
  372. /**
  373. * Displays a link to the lost password section
  374. */
  375. function display_lost_password_info()
  376. {
  377. echo "<li><a href=\"main/auth/lostPassword.php\">".get_lang("LostPassword")."</a></li>";
  378. }
  379. /**
  380. * Display list of courses in a category.
  381. * (for anonymous users)
  382. *
  383. * Warning: this function defines globals.
  384. * @version 1.0
  385. */
  386. function display_anonymous_course_list()
  387. {
  388. //init
  389. $web_course_path = api_get_path(WEB_COURSE_PATH);
  390. $category = $_GET["category"];
  391. $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
  392. $main_category_table = Database :: get_main_table(TABLE_MAIN_CATEGORY);
  393. $platformLanguage = api_get_setting('platformLanguage');
  394. //get list of courses in category $category
  395. $sql_get_course_list = "SELECT * FROM $main_course_table cours
  396. WHERE category_code = '".$category."'
  397. ORDER BY UPPER(visual_code)";
  398. //removed: AND cours.visibility='".COURSE_VISIBILITY_OPEN_WORLD."'
  399. $sql_result_courses = api_sql_query($sql_get_course_list, __FILE__, __LINE__);
  400. while ($course_result = mysql_fetch_array($sql_result_courses))
  401. {
  402. $course_list[] = $course_result;
  403. }
  404. $sqlGetSubCatList = "
  405. SELECT t1.name,t1.code,t1.parent_id,t1.children_count,COUNT(DISTINCT t3.code) AS nbCourse
  406. FROM $main_category_table t1
  407. LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
  408. LEFT JOIN $main_course_table t3 ON (t3.category_code=t1.code AND t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."')
  409. WHERE t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
  410. GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count ORDER BY t1.tree_pos";
  411. $resCats = api_sql_query($sqlGetSubCatList, __FILE__, __LINE__);
  412. $thereIsSubCat = FALSE;
  413. if (mysql_num_rows($resCats) > 0)
  414. {
  415. $htmlListCat = "<h4 style=\"margin-top: 0px;\">".get_lang("CatList")."</h4>"."<ul>";
  416. while ($catLine = mysql_fetch_array($resCats))
  417. {
  418. if ($catLine['code'] != $category)
  419. {
  420. $htmlListCat .= "<li>";
  421. $category_has_open_courses = category_has_open_courses($catLine['code']);
  422. if ($category_has_open_courses)
  423. {
  424. //the category contains courses accessible to anonymous visitors
  425. $htmlListCat .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['code']."\">".$catLine['name']."</a>";
  426. if (CONFVAL_showNumberOfChild)
  427. {
  428. $htmlListCat .= " (".$catLine['nbCourse']." ".get_lang("Courses").")";
  429. }
  430. }
  431. elseif ($catLine['children_count'] > 0)
  432. {
  433. //the category has children, subcategories
  434. $htmlListCat .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['code']."\">".$catLine['name']."</a>";
  435. }
  436. /************************************************************************
  437. end changed code to eliminate the (0 courses) after empty categories
  438. ************************************************************************/
  439. elseif (CONFVAL_showNodeEmpty)
  440. {
  441. $htmlListCat .= $catLine['name'];
  442. }
  443. $htmlListCat .= "</li>\n";
  444. $thereIsSubCat = true;
  445. }
  446. else
  447. {
  448. $htmlTitre = "<p>";
  449. if (CONFVAL_ShowLinkBackToTopOfTree)
  450. {
  451. $htmlTitre .= "<a href=\"".$_SERVER['PHP_SELF']."\">"."&lt;&lt; ".get_lang("BackToHomePage")."</a>";
  452. }
  453. if (!is_null($catLine['parent_id']) || (!CONFVAL_ShowLinkBackToTopOfTree && !is_null($catLine['code'])))
  454. {
  455. $htmlTitre .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['parent_id']."\">"."&lt;&lt; ".get_lang("Up")."</a>";
  456. }
  457. $htmlTitre .= "</p>\n";
  458. if ($category != "" && !is_null($catLine['code']))
  459. {
  460. $htmlTitre .= "<h3>".$catLine['name']."</h3>\n";
  461. }
  462. else
  463. {
  464. $htmlTitre .= "<h3>".get_lang("Categories")."</h3>\n";
  465. }
  466. }
  467. }
  468. $htmlListCat .= "</ul>\n";
  469. }
  470. echo $htmlTitre;
  471. if ($thereIsSubCat)
  472. echo $htmlListCat;
  473. while ($categoryName = mysql_fetch_array($resCats))
  474. {
  475. echo "<h3>", $categoryName['name'], "</h3>\n";
  476. }
  477. $numrows = mysql_num_rows($sql_result_courses);
  478. if ($numrows > 0)
  479. {
  480. if ($thereIsSubCat)
  481. echo "<hr size=\"1\" noshade=\"noshade\">\n";
  482. echo "<h4 style=\"margin-top: 0px;\">", get_lang("CourseList"), "</h4>\n", "<ul>\n";
  483. while ($course = mysql_fetch_array($sql_result_courses))
  484. {
  485. echo "<li>\n", "<a href=\"".$web_course_path.$course['directory'], "/\">", $course['title'], "</a>", "<br/>", $course['visual_code'], " - ", $course['tutor_name'], ((CONFVAL_showCourseLangIfNotSameThatPlatform && $course['course_language'] != $platformLanguage) ? " - ".$course['course_language'] : ""), "\n", "</li>\n";
  486. }
  487. echo "</ul>\n";
  488. }
  489. else
  490. {
  491. // echo "<blockquote>",get_lang('_No_course_publicly_available'),"</blockquote>\n";
  492. }
  493. if ($category != "")
  494. {
  495. echo "<p>", "<a href=\"".$_SERVER['PHP_SELF']."\"><b>&lt;&lt;</b> ", get_lang("BackToHomePage"), "</a>", "</p>\n";
  496. }
  497. }
  498. function category_has_open_courses($category)
  499. {
  500. $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
  501. $sql_query = "SELECT * FROM $main_course_table WHERE category_code='$category'";
  502. $sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
  503. while ($course = mysql_fetch_array($sql_result))
  504. {
  505. if ($is_allowed_anonymous_access)
  506. return true; //at least one open course
  507. }
  508. return false;
  509. }
  510. /*
  511. ==============================================================================
  512. MAIN CODE
  513. ==============================================================================
  514. */
  515. echo '<div class="maincontent">';
  516. /*
  517. -----------------------------------------------------------------------------
  518. Plugins for loginpage_main AND campushomepage_main
  519. -----------------------------------------------------------------------------
  520. */
  521. if (!api_get_user_id())
  522. {
  523. api_plugin('loginpage_main');
  524. }
  525. else
  526. {
  527. api_plugin('campushomepage_main');
  528. }
  529. // Including the page for the news
  530. if (!empty ($_GET['include']) && !strstr($_GET['include'], '/') && strstr($_GET['include'], '.html'))
  531. {
  532. include ('./home/'.$_GET['include']);
  533. $pageIncluded = true;
  534. }
  535. else
  536. {
  537. if(!file_exists('home/home_news_'.$user_selected_language.'.html'))
  538. {
  539. include ('home/home_top.html');
  540. }
  541. else
  542. {
  543. include('home/home_top_'.$user_selected_language.'.html');
  544. }
  545. }
  546. // Display System announcements
  547. $announcement = $_GET['announcement'] ? $_GET['announcement'] : -1;
  548. SystemAnnouncementManager :: display_announcements(VISIBLE_GUEST, $announcement);
  549. // Display courses and category list
  550. if (!$pageIncluded)
  551. {
  552. // echo '<div class="clear">&nbsp;</div>';
  553. echo '<div class="home_cats">';
  554. if (DISPLAY_COURSES_TO_ANONYMOUS_USERS)
  555. {
  556. display_anonymous_course_list();
  557. }
  558. echo '</div>';
  559. /*
  560. echo '<div class="home_news">';
  561. if(!file_exists('home/home_news_'.$user_selected_language.'.html'))
  562. {
  563. include ('home/home_news.html');
  564. }
  565. else
  566. {
  567. include('home/home_news_'.$user_selected_language.'.html');
  568. }
  569. echo '</div>';
  570. */
  571. }
  572. echo '</div>';
  573. // Right Menu
  574. // language form, login section + useful weblinks
  575. echo '<div class="menu">';
  576. display_anonymous_right_menu();
  577. echo '</div>';
  578. /*
  579. ==============================================================================
  580. FOOTER
  581. ==============================================================================
  582. */
  583. Display :: display_footer();
  584. ?>