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. $langFile = array ('courses', 'index');
  58. $cidReset = true; /* Flag forcing the 'current course' reset,
  59. as we're not inside a course anymore */
  60. /*
  61. -----------------------------------------------------------
  62. Included libraries
  63. -----------------------------------------------------------
  64. */
  65. include_once ('./main/inc/global.inc.php');
  66. include_once (api_get_path(LIBRARY_PATH).'course.lib.php');
  67. include_once (api_get_path(LIBRARY_PATH).'debug.lib.inc.php');
  68. include_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php');
  69. include_once (api_get_path(LIBRARY_PATH).'system_announcements.lib.php');
  70. include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
  71. include_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  72. // the section (for the tabs)
  73. $this_section = SECTION_CAMPUS;
  74. /*
  75. -----------------------------------------------------------
  76. Action Handling
  77. -----------------------------------------------------------
  78. */
  79. if ($_GET['logout'])
  80. {
  81. $query_string='';
  82. if(!empty($_SESSION['user_language_choice']))
  83. {
  84. $query_string='?language='.$_SESSION['user_language_choice'];
  85. }
  86. $tbl_track_login = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
  87. $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";
  88. $q_last_connection=mysql_query($sql_last_connection);
  89. $i_id_last_connection=mysql_result($q_last_connection,0,"login_id");
  90. $s_sql_update_logout_date="UPDATE $tbl_track_login SET logout_date=NOW() WHERE login_id='$i_id_last_connection'";
  91. api_sql_query($s_sql_update_logout_date);
  92. //LoginDelete(".$_user['user_id'].", $statsDbName);
  93. LoginDelete($_GET["uid"], $statsDbName);
  94. api_session_destroy();
  95. header("Location: index.php$query_string");
  96. exit();
  97. }
  98. /*
  99. -----------------------------------------------------------
  100. Table definitions
  101. -----------------------------------------------------------
  102. */
  103. $main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
  104. $main_category_table = Database :: get_main_table(MAIN_CATEGORY_TABLE);
  105. $track_login_table = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
  106. /*
  107. -----------------------------------------------------------
  108. Constants and CONFIGURATION parameters
  109. -----------------------------------------------------------
  110. */
  111. // @todo shouldn't these be moved to the config page or made into dokeos config settings?
  112. // ---- Category list options ----
  113. /** defines wether or not anonymous visitors can see a list of the courses on
  114. the Dokeos homepage that are open to the world */
  115. define('DISPLAY_COURSES_TO_ANONYMOUS_USERS', true);
  116. define('CONFVAL_showNodeEmpty', true);
  117. define('CONFVAL_showNumberOfChild', false); // actually count are only for direct children
  118. define('CONFVAL_ShowLinkBackToTopOfTree', false);
  119. // ---- Course list options ----
  120. define("CONFVAL_showCourseLangIfNotSameThatPlatform", TRUE);
  121. // Preview of course content
  122. // to disable all: set CONFVAL_maxTotalByCourse = 0
  123. // to enable all: set e.g. CONFVAL_maxTotalByCourse = 5
  124. // by default disabled since what's new icons are better (see function display_digest() )
  125. define("CONFVAL_maxValvasByCourse", 2); // Maximum number of entries
  126. define("CONFVAL_maxAgendaByCourse", 2); // collected from each course
  127. define("CONFVAL_maxTotalByCourse", 0); // and displayed in summary.
  128. define("CONFVAL_NB_CHAR_FROM_CONTENT", 80);
  129. // Order to sort data
  130. $orderKey = array('keyTools', 'keyTime', 'keyCourse'); // default "best" Choice
  131. //$orderKey = array('keyTools', 'keyCourse', 'keyTime');
  132. //$orderKey = array('keyCourse', 'keyTime', 'keyTools');
  133. //$orderKey = array('keyCourse', 'keyTools', 'keyTime');
  134. define('CONFVAL_showExtractInfo', SCRIPTVAL_UnderCourseList);
  135. // SCRIPTVAL_InCourseList // best choice if $orderKey[0] == 'keyCourse'
  136. // SCRIPTVAL_UnderCourseList // best choice
  137. // SCRIPTVAL_Both // probably only for debug
  138. //$dateFormatForInfosFromCourses = $dateFormatShort;
  139. $dateFormatForInfosFromCourses = $dateFormatLong;
  140. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NewEntriesOfTheDay);
  141. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NoTimeLimit);
  142. define("CONFVAL_limitPreviewTo", SCRIPTVAL_NewEntriesOfTheDayOfLastLogin);
  143. if (isset ($_user['user_id']))
  144. {
  145. $nameTools = api_get_setting('siteName');
  146. }
  147. /*
  148. -----------------------------------------------------------
  149. Check configuration parameters integrity
  150. -----------------------------------------------------------
  151. */
  152. if (CONFVAL_showExtractInfo != SCRIPTVAL_UnderCourseList and $orderKey[0] != "keyCourse")
  153. {
  154. // CONFVAL_showExtractInfo must be SCRIPTVAL_UnderCourseList to accept $orderKey[0] !="keyCourse"
  155. if (DEBUG || api_is_platform_admin()) // Show bug if admin. Else force a new order
  156. die("
  157. <strong>
  158. config error:".__FILE__."</strong>
  159. <br/>
  160. set
  161. <ul>
  162. <li>
  163. CONFVAL_showExtractInfo=SCRIPTVAL_UnderCourseList
  164. (actually : ".CONFVAL_showExtractInfo.")
  165. </li>
  166. </ul>
  167. or
  168. <ul>
  169. <li>
  170. \$orderKey[0] !=\"keyCourse\"
  171. (actually : ".$orderKey[0].")
  172. </li>
  173. </ul>");
  174. else
  175. {
  176. $orderKey = array ("keyCourse", "keyTools", "keyTime");
  177. }
  178. }
  179. /*
  180. ==============================================================================
  181. LOGIN
  182. ==============================================================================
  183. */
  184. if ($_GET["submitAuth"] == 1)
  185. {
  186. // nice lie!!!
  187. echo "Attempted breakin - sysadmins notified.";
  188. session_destroy();
  189. die();
  190. }
  191. if ($_POST["submitAuth"])
  192. {
  193. // To ensure legacy compatibility, we set the following variables.
  194. // But they should be removed at last.
  195. $lastname = $_user['lastName'];
  196. $firstname = $_user['firstName'];
  197. $email = $_user['mail'];
  198. $status = $uData['status'];
  199. if (isset ($_user['user_id']))
  200. {
  201. $sqlLastLogin = "SELECT UNIX_TIMESTAMP(login_date)
  202. FROM $track_login_table
  203. WHERE login_user_id = '".$_user['user_id']."'
  204. ORDER BY login_date DESC LIMIT 1";
  205. $resLastLogin = api_sql_query($sqlLastLogin, __FILE__, __LINE__);
  206. if (!$resLastLogin)
  207. if (mysql_num_rows($resLastLogin) > 0)
  208. {
  209. $user_last_login_datetime = mysql_fetch_array($resLastLogin);
  210. $user_last_login_datetime = $user_last_login_datetime[0];
  211. api_session_register('user_last_login_datetime');
  212. }
  213. mysql_free_result($resLastLogin);
  214. //event_login();
  215. if (api_is_platform_admin())
  216. {
  217. // decode all open event informations and fill the track_c_* tables
  218. include (api_get_path(LIBRARY_PATH)."stats.lib.inc.php");
  219. decodeOpenInfos();
  220. }
  221. }
  222. } // end login -- if($submit)
  223. else
  224. {
  225. // only if login form was not sent because if the form is sent the user was
  226. // already on the page.
  227. event_open();
  228. }
  229. /*
  230. -----------------------------------------------------------
  231. Header
  232. include the HTTP, HTML headers plus the top banner
  233. -----------------------------------------------------------
  234. */
  235. $help = "Clar";
  236. Display :: display_header('', $help);
  237. /*
  238. ==============================================================================
  239. FUNCTIONS
  240. display_anonymous_right_menu()
  241. display_anonymous_course_list()
  242. display_login_form()
  243. handle_login_failed()
  244. display_lost_password_info()
  245. ==============================================================================
  246. */
  247. /*
  248. -----------------------------------------------------------
  249. Display functions
  250. -----------------------------------------------------------
  251. */
  252. /**
  253. * Displays the right-hand menu for anonymous users:
  254. * login form, useful links, help section
  255. * Warning: function defines globals
  256. * @version 1.0.1
  257. * @todo does $_plugins need to be global?
  258. */
  259. function display_anonymous_right_menu()
  260. {
  261. global $loginFailed, $_plugins, $_user;
  262. $platformLanguage = api_get_setting('platformLanguage');
  263. if ( !($_user['user_id']) ) // only display if the user isn't logged in
  264. {
  265. api_display_language_form();
  266. echo '<br />';
  267. display_login_form();
  268. if ($loginFailed)
  269. {
  270. handle_login_failed();
  271. }
  272. if (api_get_setting('allow_lostpassword') == 'true' OR api_get_setting('allow_registration') == 'true')
  273. {
  274. echo '<div class="menusection"><span class="menusectioncaption">'.get_lang('MenuUser').'</span><ul class="menulist">';
  275. if (get_setting('allow_registration') <> 'false')
  276. {
  277. echo '<li><a href="main/auth/inscription.php">'.get_lang('Reg').'</a></li>';
  278. }
  279. if (get_setting('allow_lostpassword') == 'true')
  280. {
  281. display_lost_password_info();
  282. }
  283. echo '</ul></div>';
  284. }
  285. echo '<div class="note" style="background: none">';
  286. api_plugin('loginpage_menu');
  287. echo '</div>';
  288. }
  289. /*** hide right menu "general" and other parts on anonymous right menu *****/
  290. echo "<div class=\"menusection\">", "<span class=\"menusectioncaption\">".get_lang("MenuGeneral")."</span>";
  291. echo "<ul class=\"menulist\">";
  292. $user_selected_language = $_SESSION["user_language_choice"];
  293. if (!isset ($user_selected_language))
  294. $user_selected_language = $platformLanguage;
  295. if(!file_exists('home/home_menu_'.$user_selected_language.'.html'))
  296. {
  297. include ('home/home_menu.html');
  298. }
  299. else
  300. {
  301. include('home/home_menu_'.$user_selected_language.'.html');
  302. }
  303. echo '</ul>';
  304. echo '</div>';
  305. if ($_user['user_id'])
  306. {
  307. echo '<div class="note" style="background: none">';
  308. api_plugin('campushomepage_menu');
  309. echo '</div>';
  310. }
  311. /**** use this comment to hide notice file section from right menu ****
  312. echo '<div class="note">';
  313. // includes for any files to be displayed below anonymous right menu
  314. if(!file_exists('home/home_notice_'.$user_selected_language.'.html'))
  315. {
  316. include ('home/home_notice.html');
  317. }
  318. else
  319. {
  320. include('home/home_notice_'.$user_selected_language.'.html');
  321. }
  322. echo '</div>';
  323. **** end of hide various right menu items on anonymous right menu ****/
  324. }
  325. /**
  326. * Reacts on a failed login:
  327. * displays an explanation with
  328. * a link to the registration form.
  329. *
  330. * @version 1.0.1
  331. */
  332. function handle_login_failed()
  333. {
  334. switch ($_GET['error'])
  335. {
  336. case '':
  337. $message = get_lang("InvalidId");
  338. if (api_is_self_registration_allowed())
  339. {
  340. $message = get_lang("InvalidForSelfRegistration");
  341. }
  342. break;
  343. case 'account_expired':
  344. $message=get_lang('AccountExpired');
  345. break;
  346. case 'account_inactive':
  347. $message=get_lang('AccountInactive');
  348. break;
  349. case 'user_password_incorrect':
  350. $message=get_lang('InvalidId');
  351. break;
  352. }
  353. echo "<div id=\"login_fail\">".$message."</div>";
  354. }
  355. /**
  356. * Adds a form to let users login
  357. * @version 1.1
  358. */
  359. function display_login_form()
  360. {
  361. $form = new FormValidator('formLogin');
  362. $form->addElement('text','login',get_lang('UserName'),array('size'=>15));
  363. $form->addElement('password','password',get_lang('Pass'),array('size'=>15));
  364. $form->addElement('submit','submitAuth',get_lang('Ok'));
  365. $renderer =& $form->defaultRenderer();
  366. $element_template = '<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}<br />
  367. <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}<br />';
  368. $renderer->setElementTemplate($element_template);
  369. $form->display();
  370. }
  371. /**
  372. * Displays a link to the lost password section
  373. */
  374. function display_lost_password_info()
  375. {
  376. echo "<li><a href=\"main/auth/lostPassword.php\">".get_lang("LostPassword")."</a></li>";
  377. }
  378. /**
  379. * Display list of courses in a category.
  380. * (for anonymous users)
  381. *
  382. * Warning: this function defines globals.
  383. * @version 1.0
  384. */
  385. function display_anonymous_course_list()
  386. {
  387. //init
  388. global $coursesRepositoryWeb;
  389. $web_course_path = api_get_path(WEB_COURSE_PATH);
  390. $category = $_GET["category"];
  391. $main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
  392. $main_category_table = Database :: get_main_table(MAIN_CATEGORY_TABLE);
  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(MAIN_COURSE_TABLE);
  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. ?>