view_message.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/messages/inbox.php','name' => get_lang('Messages'));
  18. $social_right_content = null;
  19. if (isset($_GET['f']) && $_GET['f']=='social') {
  20. $social_parameter = '?f=social';
  21. } else {
  22. if (api_get_setting('extended_profile') == 'true') {
  23. $social_right_content .= '<div class="actions">';
  24. if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
  25. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
  26. }
  27. if (api_get_setting('allow_message_tool') == 'true') {
  28. //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
  29. $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>';
  30. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
  31. $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
  32. }
  33. $social_right_content .= '</div>';
  34. }
  35. }
  36. if (empty($_GET['id'])) {
  37. $id_message = $_GET['id_send'];
  38. $source = 'outbox';
  39. $show_menu = 'messages_outbox';
  40. } else {
  41. $id_message = $_GET['id'];
  42. $source = 'inbox';
  43. $show_menu = 'messages_inbox';
  44. }
  45. $message = MessageManager::show_message_box($id_message, $source);
  46. if (empty($message)) {
  47. api_not_allowed();
  48. }
  49. $tpl = $app['template'];
  50. //$tpl->setTitle(get_lang('Read'));
  51. $tpl->assign('actions', $actions);
  52. $tpl->assign('message', $message);
  53. $tpl->assign('content', $social_right_content);
  54. $tpl->display_one_col_template();