friends.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file = array('admin');
  4. require '../inc/global.inc.php';
  5. require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
  6. require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
  7. require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
  8. require_once api_get_path(LIBRARY_PATH).'image.lib.php';
  9. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  10. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  11. $this_section = SECTION_SOCIAL;
  12. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
  13. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.1.3.1.pack.js" type="text/javascript"></script>';
  14. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.history_remote.pack.js" type="text/javascript"></script>';
  15. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.tabs.pack.js" type="text/javascript"></script>';
  16. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
  17. $htmlHeadXtra[] = '<script type="text/javascript">
  18. function add_group (my_action,name_rs) {
  19. if(my_action=="show") {
  20. $("div#div_content_messages").html("");
  21. $("div#div_content_table_data").html("");
  22. $(".confirmation-message").remove();
  23. $(".normal-message").remove();
  24. $(".error-message").remove();
  25. $.ajax({
  26. contentType: "application/x-www-form-urlencoded",
  27. type: "GET",
  28. url: "group_add.php",
  29. data:"rs="+name_rs,
  30. success: function(datos) {
  31. $("div#div_add_group").html(datos);
  32. }
  33. });
  34. }
  35. }
  36. function delete_friend (element_div) {
  37. id_image=$(element_div).attr("id");
  38. user_id=id_image.split("_");
  39. if (confirm("'.get_lang('Delete', '').'")) {
  40. $.ajax({
  41. contentType: "application/x-www-form-urlencoded",
  42. type: "POST",
  43. url: "../social/register_friend.php",
  44. data: "delete_friend_id="+user_id[1],
  45. success: function(datos) {
  46. //alert(datos);
  47. $("div#"+"div_"+user_id[1]).hide("slow");
  48. $("div#"+"div_"+user_id[1]).html("");
  49. clear_form ();
  50. }
  51. });
  52. }
  53. }
  54. function search_image_social(element_html) {
  55. name_search=$(element_html).attr("value");
  56. $.ajax({
  57. contentType: "application/x-www-form-urlencoded",
  58. type: "POST",
  59. url: "../social/show_search_image.inc.php",
  60. data: "search_name_q="+name_search,
  61. success: function(datos) {
  62. $("div#div_content_table").html(datos);
  63. }
  64. });
  65. }
  66. function show_icon_delete(element_html) {
  67. elem_id=$(element_html).attr("id");
  68. id_elem=elem_id.split("_");
  69. ident="#img_"+id_elem[1];
  70. $(ident).attr("src","../img/delete.gif");
  71. $(ident).attr("alt","'.get_lang('Delete', '').'");
  72. $(ident).attr("title","'.get_lang('Delete', '').'");
  73. }
  74. function hide_icon_delete(element_html) {
  75. elem_id=$(element_html).attr("id");
  76. id_elem=elem_id.split("_");
  77. ident="#img_"+id_elem[1];
  78. $(ident).attr("src","../img/blank.gif");
  79. $(ident).attr("alt","");
  80. $(ident).attr("title","");
  81. }
  82. function clear_form () {
  83. $("input[@type=radio]").attr("checked", false);
  84. $("div#div_qualify_image").html("");
  85. $("div#div_info_user").html("");
  86. }
  87. </script>';
  88. $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));
  89. Display :: display_header($tool_name, 'Groups');
  90. SocialManager::show_social_menu();
  91. echo '<div class="actions-title">';
  92. echo get_lang('MyFriends');
  93. echo '</div>';
  94. //$list_path_friends=array();
  95. $request=api_is_xml_http_request();
  96. $language_variable=api_xml_http_response_encode(get_lang('Contacts'));
  97. //api_display_tool_title($language_variable);
  98. $user_id=api_get_user_id();
  99. $image_path = UserManager::get_user_picture_path_by_id ($user_id,'web',false,true);
  100. ?>
  101. <div align="center" >
  102. <table width="100%" border="0" cellpadding="0" cellspacing="0" >
  103. <tr>
  104. <td height="25" valign="top">
  105. <table width="100%" border="0" cellpadding="0" cellspacing="0" >
  106. <tr>
  107. <td width="100%" valign="top" class="social-align-box">&nbsp;&nbsp;<?php echo get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;'; ?>
  108. <input class="social-search-image" type="text" class="search-image" id="id_search_image" name="id_search_image" value="" onkeyup="search_image_social(this)" />
  109. </td>
  110. </tr>
  111. </table></td>
  112. </tr>
  113. <tr>
  114. <td height="175" valign="top">
  115. <table width="100%" border="0" cellpadding="0" cellspacing="0" >
  116. <tr>
  117. <td height="153" valign="top">
  118. <?php
  119. echo '<div id="div_content_table">';
  120. require_once 'show_search_image.inc.php';
  121. echo '</div>';
  122. ?>
  123. </td>
  124. </tr>
  125. </table></td>
  126. </tr>
  127. </table>
  128. </div>
  129. <?php
  130. Display :: display_footer();
  131. ?>