view_message.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. $htmlHeadXtra[] = '<script type="text/javascript" src="/main/inc/lib/javascript/jquery.js"></script>';
  20. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
  21. $htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
  22. if ($_REQUEST['f']=='social') {
  23. $this_section = SECTION_SOCIAL;
  24. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
  25. $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
  26. } else {
  27. $this_section = SECTION_MYPROFILE;
  28. $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
  29. $interbreadcrumb[]= array ('url' => 'inbox.php','name' => get_lang('Inbox'));
  30. }
  31. $interbreadcrumb[]= array ('url' => '#','name' => get_lang('View'));
  32. Display::display_header('');
  33. if ($_GET['f']=='social') {
  34. $social_parameter = '?f=social';
  35. } else {
  36. if (api_get_setting('extended_profile') == 'true') {
  37. echo '<div class="actions">';
  38. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  39. 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>';
  40. }
  41. if (api_get_setting('allow_message_tool') == 'true') {
  42. echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
  43. }
  44. 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>';
  45. echo '</div>';
  46. }
  47. }
  48. echo '<div id="social-content">';
  49. if (empty($_GET['id'])) {
  50. $id_message = $_GET['id_send'];
  51. $source = 'outbox';
  52. $show_menu = 'messages_outbox';
  53. } else {
  54. $id_message = $_GET['id'];
  55. $source = 'inbox';
  56. $show_menu = 'messages_inbox';
  57. }
  58. $id_content_right = '';
  59. //LEFT COLUMN
  60. if (api_get_setting('allow_social_tool') != 'true') {
  61. $id_content_right = 'inbox';
  62. echo '<div id="inbox-menu" class="actions">';
  63. echo '<ul>';
  64. echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
  65. echo '<li><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>'.'</li>';
  66. echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
  67. echo '</ul>';
  68. echo '</div>';
  69. } else {
  70. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  71. $id_content_right = 'social-content-right';
  72. echo '<div id="social-content-left">';
  73. //this include the social menu div
  74. SocialManager::show_social_menu($show_menu);
  75. echo '</div>';
  76. }
  77. echo '<div id="'.$id_content_right.'">';
  78. //MAIN CONTENT
  79. $message = MessageManager::show_message_box($id_message,$source);
  80. if (!empty($message)) {
  81. echo $message;
  82. } else {
  83. api_not_allowed();
  84. }
  85. echo '</div>';
  86. echo '</div>';
  87. /*
  88. ==============================================================================
  89. FOOTER
  90. ==============================================================================
  91. */
  92. Display::display_footer();
  93. ?>