view_message.php 3.1 KB

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