view_message.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /* For licensing terms, see /chamilo_license.txt */
  3. /**
  4. * @package dokeos.messages
  5. */
  6. $language_file = array('registration','messages','userInfo');
  7. $cidReset= true;
  8. require_once '../inc/global.inc.php';
  9. api_block_anonymous_users();
  10. if (api_get_setting('allow_message_tool')!='true'){
  11. api_not_allowed();
  12. }
  13. require_once api_get_path(LIBRARY_PATH).'message.lib.php';
  14. /*
  15. ==============================================================================
  16. HEADER
  17. ==============================================================================
  18. */
  19. if ($_REQUEST['f']=='social') {
  20. $this_section = SECTION_SOCIAL;
  21. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/profile.php','name' => get_lang('Social'));
  22. $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
  23. } else {
  24. $this_section = SECTION_MYPROFILE;
  25. $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
  26. $interbreadcrumb[]= array ('url' => 'inbox.php','name' => get_lang('Inbox'));
  27. }
  28. $interbreadcrumb[]= array ('url' => '#','name' => get_lang('View'));
  29. Display::display_header('');
  30. if ($_GET['f']=='social') {
  31. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  32. SocialManager::show_social_menu();
  33. echo '<div class="actions-title">';
  34. echo get_lang('Messages');
  35. echo '</div>';
  36. $social_parameter = '?f=social';
  37. } else {
  38. if (api_get_setting('extended_profile') == 'true') {
  39. echo '<div class="actions">';
  40. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  41. echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
  42. }
  43. if (api_get_setting('allow_message_tool') == 'true') {
  44. echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
  45. }
  46. echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
  47. echo '</div>';
  48. }
  49. }
  50. echo '<div id="inbox-wrapper">';
  51. //LEFT COLUMN
  52. echo '<div id="inbox-menu">';
  53. echo '<ul>';
  54. echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$social_parameter.'">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
  55. echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$social_parameter.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
  56. echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php'.$social_parameter.'">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
  57. echo '</ul>';
  58. echo '</div>';
  59. echo '<div id="inbox">';
  60. //MAIN CONTENT
  61. if (empty($_GET['id'])) {
  62. $id_message = $_GET['id_send'];
  63. $source = 'outbox';
  64. } else {
  65. $id_message = $_GET['id'];
  66. $source = 'inbox';
  67. }
  68. $message = MessageManager::show_message_box($id_message,$source);
  69. if (!empty($message)) {
  70. echo $message;
  71. } else {
  72. api_not_allowed();
  73. }
  74. echo '</div>';
  75. echo '</div>';
  76. /*
  77. ==============================================================================
  78. FOOTER
  79. ==============================================================================
  80. */
  81. Display::display_footer();
  82. ?>