index.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php // $Id: index.php 20962 2009-05-25 03:15:53Z iflorespaz $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2009 Dokeos SPRL
  6. Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com>
  7. Copyright (c) Facultad de Matematicas, UADY (México)
  8. Copyright (c) Evie, Free University of Brussels (Belgium)
  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, rue du Corbeau, 108, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. $language_file= 'messages';
  21. require_once '../inc/global.inc.php';
  22. require_once api_get_path(LIBRARY_PATH).'message.lib.php';
  23. api_block_anonymous_users();
  24. if (api_get_setting('allow_message_tool')!='true'){
  25. api_not_allowed();
  26. }
  27. if(api_get_user_id()!=0) {
  28. echo '<script language="javascript" type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'messages/cookies.js"> </script> ';
  29. echo '<script language="javascript" type="text/javascript">set_url("'.api_get_path(WEB_CODE_PATH).'messages/notify.php") ; notificar()</script> ';
  30. $number_of_new_messages = get_new_messages();
  31. if(is_null($number_of_new_messages)) {
  32. $number_of_new_messages = 0;
  33. }
  34. echo "<a href=inbox.php>".get_lang('Inbox')."(<span id=\"nuevos\" style=\"none\">".$number_of_new_messages."</span>)</a>";
  35. echo " - ";
  36. echo "<a href=new_message.php>".get_lang('ComposeMessage')."</a>";
  37. if($number_of_new_messages > 0)
  38. {
  39. ?>
  40. <div id="box" class="message-content-table">
  41. <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="2" id="table" class="content">
  42. <tr>
  43. <td width="28%" height="16" class="content" id="ref"><a style="color:red;font-size:10px" href="javascript:;" onclick="ocultar_aviso()"><?php echo get_lang('Close');?></a></td>
  44. <td width="72%" rowspan="2" class="content" id="ref"><?php echo '<a href="'.$e.'" style="color:#000000" onclick="ocultar_aviso()">'.get_lang('YouHaveNewMessage').'</a>'; ?></td>
  45. </tr>
  46. <tr>
  47. <td class="content" id="ref"><?php Display::return_icon('message_new.gif',get_lang('NewMessage'));?> </td>
  48. </tr>
  49. </table>
  50. </div>
  51. <?php
  52. }
  53. } else {
  54. echo '<script language="javascript" type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'messages/cookies.js"> </script>';
  55. echo '<script language="javascript" type="text/javascript">Set_Cookie( "nuevos", 0, 0, "/","","")</script> ';
  56. }
  57. ?>