myfiles.php 3.9 KB

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