send_message_to_userfriend.inc.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. if ( isset($_REQUEST['user_friend']) ) {
  33. $info_user_friend=array();
  34. $info_path_friend=array();
  35. $userfriend_id=Security::remove_XSS($_REQUEST['user_friend']);
  36. // panel=1 send message
  37. // panel=2 send invitation
  38. $panel=Security::remove_XSS($_REQUEST['view_panel']);
  39. $info_user_friend=api_get_user_info($userfriend_id);
  40. $info_path_friend=UserManager::get_user_picture_path_by_id($userfriend_id,'web',false,true);
  41. }
  42. ?>
  43. <table width="600" border="0" height="220">
  44. <tr height="180">
  45. <td>
  46. <div class="message-content-body-left">
  47. <img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/>
  48. <?php
  49. if ($panel != 1) {
  50. echo '<br /><center>'.mb_convert_encoding($info_user_friend['firstName'].' '.$info_user_friend['lastName'],'UTF-8',$charset).'</center>';
  51. }
  52. ?>
  53. </div>
  54. <div class="message-conten-body-right">
  55. <div id="id_content_panel_init">
  56. <dl>
  57. <?php
  58. /*if ($panel == 1) {
  59. <dd><a href="javascript:void(0)" onclick="change_panel('2','<?php echo $userfriend_id; ?>')"><?php echo mb_convert_encoding(get_lang('SendInviteMessage'),'UTF-8',$charset);?></a></dd>' .
  60. }
  61. <input type="button" value="<?php echo mb_convert_encoding(get_lang('NewMessage'),'UTF-8',$charset); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp;
  62. **/
  63. if (api_get_setting('allow_message_tool')=='true') {
  64. if ($panel == 1) {
  65. $user_info=api_get_user_info($userfriend_id);
  66. echo mb_convert_encoding(get_lang('To'),'UTF-8',$charset); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo mb_convert_encoding($user_info['firstName'].' '.$user_info['lastName'],'UTF-8',$charset); ?>
  67. <br/>
  68. <br/><?php echo mb_convert_encoding(get_lang('Subject'),'UTF-8',$charset); ?> :<br/><input id="txt_subject_id" type="text" style="width:300px;"><br/>
  69. <br/><?php echo mb_convert_encoding(get_lang('Message'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="4" cols="41"></textarea>
  70. <br /><br />
  71. <input type="button" value="<?php echo get_lang('SendMessage'); ?>" onclick="action_database_panel('5','<?php echo $userfriend_id;?>')" />
  72. <?php
  73. } else {
  74. echo mb_convert_encoding(get_lang('AddPersonalMessage'),'UTF-8',$charset); ?> :<br/><br/>
  75. <textarea id="txt_area_invite" rows="5" cols="41"></textarea><br /><br />
  76. <input type="button" value="<?php echo mb_convert_encoding(get_lang('SocialAddToFriends'),'UTF-8',$charset); ?>" onclick="action_database_panel('4','<?php echo $userfriend_id;?>')" />
  77. <?php
  78. }
  79. }
  80. if (!isset($_REQUEST['view'])) {
  81. //<dd><a href="main/social/index.php#remote-tab-5"> echo get_lang('SocialSeeContacts'); </a></dd>
  82. }
  83. ?>
  84. </dl>
  85. </div>
  86. </td>
  87. </tr>
  88. </div>
  89. <tr height="22">
  90. <td>
  91. <div id="display_response_id" style="position:relative"></div>
  92. <div class="message-bottom-title">&nbsp;</div>
  93. </td>
  94. </tr>
  95. </table>