view_message.php 3.1 KB

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