view_message.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /* HEADER */
  17. if ($_REQUEST['f']=='social') {
  18. $this_section = SECTION_SOCIAL;
  19. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
  20. $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
  21. } else {
  22. $this_section = SECTION_MYPROFILE;
  23. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
  24. }
  25. Display::display_header(get_lang('View'));
  26. if ($_GET['f']=='social') {
  27. $social_parameter = '?f=social';
  28. } else {
  29. if (api_get_setting('extended_profile') == 'true') {
  30. echo '<div class="actions">';
  31. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  32. 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>';
  33. }
  34. if (api_get_setting('allow_message_tool') == 'true') {
  35. //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
  36. 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>';
  37. echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>';
  38. echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>';
  39. }
  40. //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>';
  41. echo '</div>';
  42. }
  43. }
  44. echo '<div id="social-content">';
  45. if (empty($_GET['id'])) {
  46. $id_message = $_GET['id_send'];
  47. $source = 'outbox';
  48. $show_menu = 'messages_outbox';
  49. } else {
  50. $id_message = $_GET['id'];
  51. $source = 'inbox';
  52. $show_menu = 'messages_inbox';
  53. }
  54. $id_content_right = '';
  55. //LEFT COLUMN
  56. if (api_get_setting('allow_social_tool') != 'true') {
  57. $id_content_right = 'inbox';
  58. } else {
  59. $id_content_right = 'social-content-right';
  60. echo '<div id="social-content-left">';
  61. //this include the social menu div
  62. SocialManager::show_social_menu($show_menu);
  63. echo '</div>';
  64. }
  65. echo '<div id="'.$id_content_right.'">';
  66. //MAIN CONTENT
  67. $message = MessageManager::show_message_box($id_message,$source);
  68. if (!empty($message)) {
  69. echo $message;
  70. } else {
  71. api_not_allowed();
  72. }
  73. echo '</div>';
  74. echo '</div>';
  75. /* FOOTER */
  76. Display::display_footer();