myfiles.php 4.4 KB

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