send_message_to_userfriend.inc.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2009 Dokeos SPRL
  6. Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com>
  7. Copyright (c) Facultad de Matematicas, UADY (México)
  8. Copyright (c) Evie, Free University of Brussels (Belgium)
  9. Copyright (c) 2009 Isaac Flores Paz <isaac.flores@dokeos.com>
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. $language_file = array('registration','messages','userInfo','admin');
  22. $cidReset=true;
  23. include_once ('../inc/global.inc.php');
  24. require_once '../messages/message.class.php';
  25. include_once(api_get_path(LIBRARY_PATH).'/usermanager.lib.php');
  26. include_once(api_get_path(LIBRARY_PATH).'/message.lib.php');
  27. include_once(api_get_path(LIBRARY_PATH).'/social.lib.php');
  28. api_block_anonymous_users();
  29. if (api_get_setting('allow_message_tool')<>'true' && api_get_setting('allow_social_tool')<>'true'){
  30. api_not_allowed();
  31. }
  32. ?>
  33. <?php
  34. if ( isset($_REQUEST['user_friend']) ) {
  35. $info_user_friend=array();
  36. $info_path_friend=array();
  37. $userfriend_id=$_REQUEST['user_friend'];
  38. $info_user_friend=api_get_user_info($userfriend_id);
  39. $info_path_friend=UserManager::get_user_picture_path_by_id($userfriend_id,'web',false,true);
  40. }
  41. ?>
  42. <table width="600" border="0" height="220">
  43. <tr height="20">
  44. <td><div class="message-top-title">
  45. <table width="600" border="0" height="20">
  46. <td width="450"><?php echo get_lang('SocialNetwork');?></td>
  47. <?php
  48. if (!isset($_REQUEST['view'])) {
  49. ?>
  50. <td width="150"><a href="javascript:void(0)" onclick="change_panel('3','<?php echo $userfriend_id; ?>')" ><?php echo Display::return_icon('folder_up.gif',get_lang('MoreOptions')).'&nbsp;&nbsp;'.get_lang('MoreOptions')?></a></td>
  51. <?php
  52. }
  53. ?>
  54. </table>
  55. </div></td>
  56. </tr>
  57. <tr height="180">
  58. <td>
  59. <div class="message-content-body-left">
  60. <img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/>
  61. <dl>
  62. <dd><?php echo get_lang('FirstName').' : '.$info_user_friend['firstName'] ?></dd>
  63. <dd><?php echo get_lang('LastName').' : '.$info_user_friend['lastName'] ?></dd>
  64. </dl>
  65. </div>
  66. <div class="message-conten-body-right">
  67. <div id="id_content_panel_init"><!--init content changed -->
  68. <dl>
  69. <?php
  70. if (!isset($_REQUEST['view'])) {
  71. ?>
  72. <dd><a href="javascript:void(0)" onclick="change_panel('2','<?php echo $userfriend_id; ?>')"><?php echo get_lang('SocialAddToContact')?></a></dd>
  73. <?php
  74. }
  75. ?>
  76. <?php
  77. if (api_get_setting('allow_message_tool')=='true') {
  78. ?>
  79. <dd><a href="javascript:void(0)" onclick="change_panel('1','<?php echo $userfriend_id; ?>')"><?php echo get_lang('SocialSendMessage');?></a></dd>
  80. <?php
  81. }
  82. ?>
  83. <?php
  84. if (!isset($_REQUEST['view'])) {
  85. ?>
  86. <dd><a href="main/social/index.php#remote-tab-5"><?php echo get_lang('SocialSeeContacts'); ?></a></dd>
  87. <?php
  88. }
  89. ?>
  90. </dl>
  91. </div><!-- end content changed-->
  92. </td>
  93. </tr>
  94. </div>
  95. <tr height="22">
  96. <td>
  97. <div id="display_response_id" style="position:relative"></div>
  98. <div class="message-bottom-title">&nbsp;Dokeos</div></td>
  99. </tr>
  100. </table>