view_message.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. if ($_GET['f']=='social') {
  26. $social_parameter = '?f=social';
  27. } else {
  28. if (api_get_setting('extended_profile') == 'true') {
  29. $social_right_content .= '<div class="actions">';
  30. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  31. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
  32. }
  33. if (api_get_setting('allow_message_tool') == 'true') {
  34. //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
  35. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
  36. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
  37. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
  38. }
  39. $social_right_content .= '</div>';
  40. }
  41. }
  42. if (empty($_GET['id'])) {
  43. $id_message = $_GET['id_send'];
  44. $source = 'outbox';
  45. $show_menu = 'messages_outbox';
  46. } else {
  47. $id_message = $_GET['id'];
  48. $source = 'inbox';
  49. $show_menu = 'messages_inbox';
  50. }
  51. $message = '';
  52. //LEFT COLUMN
  53. if (api_get_setting('allow_social_tool') == 'true') {
  54. $social_left_content = SocialManager::show_social_menu($show_menu);
  55. $message .='<div class="span9">';
  56. }
  57. //MAIN CONTENT
  58. $message .= MessageManager::show_message_box($id_message,$source);
  59. if (api_get_setting('allow_social_tool') == 'true') {
  60. $message .='</div>';
  61. }
  62. if (!empty($message)) {
  63. $social_right_content .= $message;
  64. } else {
  65. api_not_allowed();
  66. }
  67. $tpl = new Template(get_lang('View'));
  68. if (api_get_setting('allow_social_tool') == 'true') {
  69. $tpl->assign('social_left_content', $social_left_content);
  70. $tpl->assign('social_left_menu', $social_left_menu);
  71. $tpl->assign('social_right_content', $social_right_content);
  72. $social_layout = $tpl->get_template('layout/social_layout.tpl');
  73. $content = $tpl->fetch($social_layout);
  74. } else {
  75. $content = $social_right_content;
  76. }
  77. $tpl->assign('actions', $actions);
  78. $tpl->assign('message', $show_message);
  79. $tpl->assign('content', $content);
  80. $tpl->display_one_col_template();