view_message.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
  14. $this_section = SECTION_SOCIAL;
  15. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
  16. $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
  17. } else {
  18. $this_section = SECTION_MYPROFILE;
  19. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
  20. }
  21. $social_right_content = null;
  22. if (isset($_GET['f']) && $_GET['f']=='social') {
  23. $social_parameter = '?f=social';
  24. } else {
  25. if (api_get_setting('extended_profile') == 'true') {
  26. $social_right_content .= '<div class="actions">';
  27. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  28. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
  29. }
  30. if (api_get_setting('allow_message_tool') == 'true') {
  31. $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>';
  32. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
  33. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
  34. }
  35. $social_right_content .= '</div>';
  36. }
  37. }
  38. if (empty($_GET['id'])) {
  39. $id_message = $_GET['id_send'];
  40. $source = 'outbox';
  41. $show_menu = 'messages_outbox';
  42. } else {
  43. $id_message = $_GET['id'];
  44. $source = 'inbox';
  45. $show_menu = 'messages_inbox';
  46. }
  47. $message = '';
  48. //LEFT COLUMN
  49. if (api_get_setting('allow_social_tool') == 'true') {
  50. $social_avatar_block = SocialManager::show_social_avatar_block($show_menu);
  51. $social_menu_block = SocialManager::show_social_menu($show_menu);
  52. $message .='<div class="span9">';
  53. }
  54. //MAIN CONTENT
  55. $message .= MessageManager::show_message_box($id_message,$source);
  56. if (api_get_setting('allow_social_tool') == 'true') {
  57. $message .='</div>';
  58. }
  59. if (!empty($message)) {
  60. $social_right_content .= $message;
  61. } else {
  62. api_not_allowed();
  63. }
  64. $tpl = new Template(get_lang('View'));
  65. if (api_get_setting('allow_social_tool') == 'true') {
  66. $tpl->assign('social_avatar_block', $social_avatar_block);
  67. $tpl->assign('social_menu_block', $social_menu_block);
  68. $tpl->assign('social_right_content', $social_right_content);
  69. $social_layout = $tpl->get_template('layout/social_layout.tpl');
  70. $tpl->display($social_layout);
  71. } else {
  72. $content = $social_right_content;
  73. $tpl->assign('content', $content);
  74. $tpl->display_one_col_template();
  75. }