index.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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;
  262. $platformLanguage = api_get_setting('platformLanguage');
  263. if ( !(api_get_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. api_plugin('loginpage_menu');
  286. }
  287. /*** hide right menu "general" and other parts on anonymous right menu *****/
  288. echo "<div class=\"menusection\">", "<span class=\"menusectioncaption\">".get_lang("MenuGeneral")."</span>";
  289. echo "<ul class=\"menulist\">";
  290. $user_selected_language = $_SESSION["user_language_choice"];
  291. if (!isset ($user_selected_language))
  292. $user_selected_language = $platformLanguage;
  293. if(!file_exists('home/home_menu_'.$user_selected_language.'.html'))
  294. {
  295. include ('home/home_menu.html');
  296. }
  297. else
  298. {
  299. include('home/home_menu_'.$user_selected_language.'.html');
  300. }
  301. echo '</ul>';
  302. echo '</div>';
  303. if (api_get_user_id())
  304. {
  305. api_plugin('campushomepage_menu');
  306. }
  307. /**** use this comment to hide notice file section from right menu ****
  308. echo '<div class="note">';
  309. // includes for any files to be displayed below anonymous right menu
  310. if(!file_exists('home/home_notice_'.$user_selected_language.'.html'))
  311. {
  312. include ('home/home_notice.html');
  313. }
  314. else
  315. {
  316. include('home/home_notice_'.$user_selected_language.'.html');
  317. }
  318. echo '</div>';
  319. **** end of hide various right menu items on anonymous right menu ****/
  320. }
  321. /**
  322. * Reacts on a failed login:
  323. * displays an explanation with
  324. * a link to the registration form.
  325. *
  326. * @version 1.0.1
  327. */
  328. function handle_login_failed()
  329. {
  330. switch ($_GET['error'])
  331. {
  332. case '':
  333. $message = get_lang("InvalidId");
  334. if (api_is_self_registration_allowed())
  335. {
  336. $message = get_lang("InvalidForSelfRegistration");
  337. }
  338. break;
  339. case 'account_expired':
  340. $message=get_lang('AccountExpired');
  341. break;
  342. case 'account_inactive':
  343. $message=get_lang('AccountInactive');
  344. break;
  345. case 'user_password_incorrect':
  346. $message=get_lang('InvalidId');
  347. break;
  348. }
  349. echo "<div id=\"login_fail\">".$message."</div>";
  350. }
  351. /**
  352. * Adds a form to let users login
  353. * @version 1.1
  354. */
  355. function display_login_form()
  356. {
  357. $form = new FormValidator('formLogin');
  358. $form->addElement('text','login',get_lang('UserName'),array('size'=>15));
  359. $form->addElement('password','password',get_lang('Pass'),array('size'=>15));
  360. $form->addElement('submit','submitAuth',get_lang('Ok'));
  361. $renderer =& $form->defaultRenderer();
  362. $element_template = '<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}<br />
  363. <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}<br />';
  364. $renderer->setElementTemplate($element_template);
  365. $form->display();
  366. }
  367. /**
  368. * Displays a link to the lost password section
  369. */
  370. function display_lost_password_info()
  371. {
  372. echo "<li><a href=\"main/auth/lostPassword.php\">".get_lang("LostPassword")."</a></li>";
  373. }
  374. /**
  375. * Display list of courses in a category.
  376. * (for anonymous users)
  377. *
  378. * Warning: this function defines globals.
  379. * @version 1.0
  380. */
  381. function display_anonymous_course_list()
  382. {
  383. //init
  384. global $coursesRepositoryWeb;
  385. $web_course_path = api_get_path(WEB_COURSE_PATH);
  386. $category = $_GET["category"];
  387. $main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
  388. $main_category_table = Database :: get_main_table(MAIN_CATEGORY_TABLE);
  389. $platformLanguage = api_get_setting('platformLanguage');
  390. //get list of courses in category $category
  391. $sql_get_course_list = "SELECT * FROM $main_course_table cours
  392. WHERE category_code = '".$category."'
  393. ORDER BY UPPER(visual_code)";
  394. //removed: AND cours.visibility='".COURSE_VISIBILITY_OPEN_WORLD."'
  395. $sql_result_courses = api_sql_query($sql_get_course_list, __FILE__, __LINE__);
  396. while ($course_result = mysql_fetch_array($sql_result_courses))
  397. {
  398. $course_list[] = $course_result;
  399. }
  400. $sqlGetSubCatList = "
  401. SELECT t1.name,t1.code,t1.parent_id,t1.children_count,COUNT(DISTINCT t3.code) AS nbCourse
  402. FROM $main_category_table t1
  403. LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
  404. LEFT JOIN $main_course_table t3 ON (t3.category_code=t1.code AND t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."')
  405. WHERE t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
  406. GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count ORDER BY t1.tree_pos";
  407. $resCats = api_sql_query($sqlGetSubCatList, __FILE__, __LINE__);
  408. $thereIsSubCat = FALSE;
  409. if (mysql_num_rows($resCats) > 0)
  410. {
  411. $htmlListCat = "<h4 style=\"margin-top: 0px;\">".get_lang("CatList")."</h4>"."<ul>";
  412. while ($catLine = mysql_fetch_array($resCats))
  413. {
  414. if ($catLine['code'] != $category)
  415. {
  416. $htmlListCat .= "<li>";
  417. $category_has_open_courses = category_has_open_courses($catLine['code']);
  418. if ($category_has_open_courses)
  419. {
  420. //the category contains courses accessible to anonymous visitors
  421. $htmlListCat .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['code']."\">".$catLine['name']."</a>";
  422. if (CONFVAL_showNumberOfChild)
  423. {
  424. $htmlListCat .= " (".$catLine['nbCourse']." ".get_lang("Courses").")";
  425. }
  426. }
  427. elseif ($catLine['children_count'] > 0)
  428. {
  429. //the category has children, subcategories
  430. $htmlListCat .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['code']."\">".$catLine['name']."</a>";
  431. }
  432. /************************************************************************
  433. end changed code to eliminate the (0 courses) after empty categories
  434. ************************************************************************/
  435. elseif (CONFVAL_showNodeEmpty)
  436. {
  437. $htmlListCat .= $catLine['name'];
  438. }
  439. $htmlListCat .= "</li>\n";
  440. $thereIsSubCat = true;
  441. }
  442. else
  443. {
  444. $htmlTitre = "<p>";
  445. if (CONFVAL_ShowLinkBackToTopOfTree)
  446. {
  447. $htmlTitre .= "<a href=\"".$_SERVER['PHP_SELF']."\">"."&lt;&lt; ".get_lang("BackToHomePage")."</a>";
  448. }
  449. if (!is_null($catLine['parent_id']) || (!CONFVAL_ShowLinkBackToTopOfTree && !is_null($catLine['code'])))
  450. {
  451. $htmlTitre .= "<a href=\"".$_SERVER['PHP_SELF']."?category=".$catLine['parent_id']."\">"."&lt;&lt; ".get_lang("Up")."</a>";
  452. }
  453. $htmlTitre .= "</p>\n";
  454. if ($category != "" && !is_null($catLine['code']))
  455. {
  456. $htmlTitre .= "<h3>".$catLine['name']."</h3>\n";
  457. }
  458. else
  459. {
  460. $htmlTitre .= "<h3>".get_lang("Categories")."</h3>\n";
  461. }
  462. }
  463. }
  464. $htmlListCat .= "</ul>\n";
  465. }
  466. echo $htmlTitre;
  467. if ($thereIsSubCat)
  468. echo $htmlListCat;
  469. while ($categoryName = mysql_fetch_array($resCats))
  470. {
  471. echo "<h3>", $categoryName['name'], "</h3>\n";
  472. }
  473. $numrows = mysql_num_rows($sql_result_courses);
  474. if ($numrows > 0)
  475. {
  476. if ($thereIsSubCat)
  477. echo "<hr size=\"1\" noshade=\"noshade\">\n";
  478. echo "<h4 style=\"margin-top: 0px;\">", get_lang("CourseList"), "</h4>\n", "<ul>\n";
  479. while ($course = mysql_fetch_array($sql_result_courses))
  480. {
  481. 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";
  482. }
  483. echo "</ul>\n";
  484. }
  485. else
  486. {
  487. // echo "<blockquote>",get_lang('_No_course_publicly_available'),"</blockquote>\n";
  488. }
  489. if ($category != "")
  490. {
  491. echo "<p>", "<a href=\"".$_SERVER['PHP_SELF']."\"><b>&lt;&lt;</b> ", get_lang("BackToHomePage"), "</a>", "</p>\n";
  492. }
  493. }
  494. function category_has_open_courses($category)
  495. {
  496. $main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
  497. $sql_query = "SELECT * FROM $main_course_table WHERE category_code='$category'";
  498. $sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
  499. while ($course = mysql_fetch_array($sql_result))
  500. {
  501. if ($is_allowed_anonymous_access)
  502. return true; //at least one open course
  503. }
  504. return false;
  505. }
  506. /*
  507. ==============================================================================
  508. MAIN CODE
  509. ==============================================================================
  510. */
  511. echo '<div class="maincontent">';
  512. /*
  513. -----------------------------------------------------------------------------
  514. Plugins for loginpage_main AND campushomepage_main
  515. -----------------------------------------------------------------------------
  516. */
  517. if (!api_get_user_id())
  518. {
  519. api_plugin('loginpage_main');
  520. }
  521. else
  522. {
  523. api_plugin('campushomepage_main');
  524. }
  525. if (!empty ($_GET['include']) && !strstr($_GET['include'], '/') && strstr($_GET['include'], '.html'))
  526. {
  527. include ('./home/'.$_GET['include']);
  528. $pageIncluded = true;
  529. }
  530. else
  531. {
  532. if(!file_exists('home/home_news_'.$user_selected_language.'.html'))
  533. {
  534. include ('home/home_top.html');
  535. }
  536. else
  537. {
  538. include('home/home_top_'.$user_selected_language.'.html');
  539. }
  540. }
  541. // Display System announcements
  542. $announcement = $_GET['announcement'] ? $_GET['announcement'] : -1;
  543. SystemAnnouncementManager :: display_announcements(VISIBLE_GUEST, $announcement);
  544. // Display courses and category list
  545. if (!$pageIncluded)
  546. {
  547. // echo '<div class="clear">&nbsp;</div>';
  548. echo '<div class="home_cats">';
  549. if (DISPLAY_COURSES_TO_ANONYMOUS_USERS)
  550. {
  551. display_anonymous_course_list();
  552. }
  553. echo '</div>';
  554. /*
  555. echo '<div class="home_news">';
  556. if(!file_exists('home/home_news_'.$user_selected_language.'.html'))
  557. {
  558. include ('home/home_news.html');
  559. }
  560. else
  561. {
  562. include('home/home_news_'.$user_selected_language.'.html');
  563. }
  564. echo '</div>';
  565. */
  566. }
  567. echo '</div>';
  568. // Right Menu
  569. // language form, login section + useful weblinks
  570. echo '<div class="menu">';
  571. display_anonymous_right_menu();
  572. echo '</div>';
  573. /*
  574. ==============================================================================
  575. FOOTER
  576. ==============================================================================
  577. */
  578. Display :: display_footer();
  579. ?>