myfiles.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @author Juan Carlos Trabado herodoto@telefonica.net
  5. */
  6. $language_file = array('messages','userInfo');
  7. $cidReset=true;
  8. require '../inc/global.inc.php';
  9. api_block_anonymous_users();
  10. if (api_get_setting('allow_social_tool') !='true') {
  11. api_not_allowed();
  12. }
  13. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  14. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  15. require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
  16. $this_section = SECTION_SOCIAL;
  17. $interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
  18. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyFiles'));
  19. //jquery thickbox already called from main/inc/header.inc.php
  20. $htmlHeadXtra[] = '
  21. <script type="text/javascript">
  22. function denied_friend (element_input) {
  23. name_button=$(element_input).attr("id");
  24. name_div_id="id_"+name_button.substring(13);
  25. user_id=name_div_id.split("_");
  26. friend_user_id=user_id[1];
  27. $.ajax({
  28. contentType: "application/x-www-form-urlencoded",
  29. beforeSend: function(objeto) {
  30. $("#id_response").html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
  31. type: "POST",
  32. url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=deny_friend",
  33. data: "denied_friend_id="+friend_user_id,
  34. success: function(datos) {
  35. $("div#"+name_div_id).hide("slow");
  36. $("#id_response").html(datos);
  37. }
  38. });
  39. }
  40. function register_friend(element_input) {
  41. if(confirm("'.get_lang('AddToFriends').'")) {
  42. name_button=$(element_input).attr("id");
  43. name_div_id="id_"+name_button.substring(13);
  44. user_id=name_div_id.split("_");
  45. user_friend_id=user_id[1];
  46. $.ajax({
  47. contentType: "application/x-www-form-urlencoded",
  48. beforeSend: function(objeto) {
  49. $("div#dpending_"+user_friend_id).html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
  50. type: "POST",
  51. url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=add_friend",
  52. data: "friend_id="+user_friend_id+"&is_my_friend="+"friend",
  53. success: function(datos) { $("div#"+name_div_id).hide("slow");
  54. $("form").submit()
  55. }
  56. });
  57. }
  58. }
  59. </script>';
  60. Display :: display_header($tool_name, 'Groups');
  61. // easy links
  62. if (is_array($_GET) && count($_GET)>0) {
  63. foreach($_GET as $key => $value) {
  64. switch ($key) {
  65. case 'accept':
  66. $user_role = GroupPortalManager::get_user_group_role(api_get_user_id(), $value);
  67. if (in_array($user_role , array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER,GROUP_USER_PERMISSION_PENDING_INVITATION))) {
  68. GroupPortalManager::update_user_role(api_get_user_id(), $value, GROUP_USER_PERMISSION_READER);
  69. $show_message = get_lang('UserIsSubscribedToThisGroup');
  70. } elseif (in_array($user_role , array(GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
  71. $show_message = get_lang('UserIsAlreadySubscribedToThisGroup');
  72. } else {
  73. $show_message = get_lang('UserIsNotSubscribedToThisGroup');
  74. }
  75. break 2;
  76. case 'deny':
  77. // delete invitation
  78. GroupPortalManager::delete_user_rel_group(api_get_user_id(), $value);
  79. $show_message = get_lang('GroupInvitationWasDeny');
  80. break 2;
  81. }
  82. }
  83. }
  84. $language_variable = get_lang('PendingInvitations');
  85. $language_comment = get_lang('SocialInvitesComment');
  86. echo '<div id="social-content">';
  87. echo '<div id="social-content-left">';
  88. //this include the social menu div
  89. SocialManager::show_social_menu('myfiles');
  90. echo '</div>';
  91. echo '<div id="social-content-right>';
  92. echo '<a href=""></a>';//TODO: hack and delete this line
  93. echo '<br />';
  94. echo '<table><tr><td><iframe name="fileManager" id="fileManager" src="'.api_get_path(WEB_PATH).'main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php?editor=stand_alone" scrolling="no" noresize="noresize" frameborder="no" style="height:450px; width:710px; float:left"></iframe></td></tr></table>';
  95. echo '</div>';
  96. echo '</div>';
  97. Display::display_footer();