Feature #1853 (first send)

skala
Juan Carlos Raña 15 years ago
parent b0365a7981
commit e7ad4556e4
  1. 7
      main/document/document.inc.php
  2. 20
      main/document/document.php
  3. BIN
      main/img/briefcase.png
  4. 22
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php
  5. 28
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager_c.js
  6. 1116
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/theme/default/css/stand_alone.css
  7. 16
      main/inc/lib/social.lib.php
  8. 3
      main/install/db_main.sql
  9. 125
      main/social/myfiles.php

@ -173,7 +173,12 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
} else {
$force_download_html = ($size==0)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'), array('height'=>'16', 'width' => '16')).'</a>';
}
return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.$title.'</a>'.$force_download_html;
//copy files to users myfiles
$copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&amp;action=copytomyfiles&amp;id='.$url_path.$req_gid :api_get_self().'?'.api_get_cidreq();
$copy_myfiles_icon = ($filetype == 'file') ? 'briefcase.png' : '';
$copy_to_myfiles='<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($copy_myfiles_icon, get_lang('CopyToMyFiles'), array('height'=>'16', 'width' => '16')).'&nbsp;&nbsp;</a>';
return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.$title.'</a>'.$force_download_html.$copy_to_myfiles;
//end copy files to users myfiles
} else {
if(preg_match('/shared_folder/', urldecode($url)) && preg_match('/shared_folder$/', urldecode($url))==false && preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url))==false){
return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.build_document_icon_tag($filetype, $tooltip_title).Display::return_icon('shared.png', get_lang('ResourceShared'), array('hspace' => '5', 'align' => 'middle', 'height' => 22, 'width' => 22)).'</a>';

@ -317,6 +317,26 @@ if (isset($_GET['action']) && $_GET['action'] == 'downloadfolder' && (api_get_se
}
// Copy a file to general my files user's
if (isset($_GET['action']) && $_GET['action'] == 'copytomyfiles' && (api_get_setting('students_copy_folders') == 'true')) {
$clean_get_id = Security::remove_XSS($_GET['id']);
$user_folder = api_get_path(SYS_CODE_PATH).'upload/users/'.api_get_user_id().'/my_files/';
if (!file_exists($user_folder)) {
@mkdir($user_folder, $permissions_for_new_directories, true);
}
$file = $sys_course_path.$_course['path'].'/document'.$clean_get_id;
$copyfile = $user_folder.basename($clean_get_id);
if (file_exists($copyfile)) {
//Display::display_error_message(get_lang('Overwrite. Warning already copy'));//TODO: fix message and show acept or cancel
}
if (!copy($file, $copyfile)) {
//Display::display_error_message(get_lang('Copy Failled'));//TODO: fix message
}
}
// Slideshow inititalisation
$_SESSION['image_files_only'] = '';
$image_files_only = '';

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@ -77,14 +77,18 @@
<script type="text/javascript" src="jscripts/ajaxfileupload.js"></script>
<script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
<script type="text/javascript">
// Added by Ivan Tcholakov, 22-JUL-2009.
// For integration with the editor's dialig system.
var oEditor = null ;
if ( !window.opener && window.parent ) {
// The file manager is inside a dialog.
oEditor = window.parent.InnerDialogLoaded() ;
var mode_editor = '<?php echo Security::remove_XSS($_GET['editor']);?>';<!-- Chamilo hack for general my files users -->
if (!mode_editor){
// Added by Ivan Tcholakov, 22-JUL-2009.
// For integration with the editor's dialig system.
var oEditor = null ;
if ( !window.opener && window.parent ) {
// The file manager is inside a dialog.
oEditor = window.parent.InnerDialogLoaded() ;
}
//end hack
}
//end hack
var globalSettings = {'upload_init':false};
var queryString = '<?php echo makeQueryString(array('path')); ?>';
var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
@ -435,7 +439,7 @@ $(document).ready(
<p class="searchButtons" id="returnCurrentUrl">
<span class="right" id="linkSelect">
<input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="button">
<input type="button" value="<?php echo MENU_SELECT; ?>" id="selectCurrentUrl" class="select_button"><!-- Change button class by Chamilo select_button class -->
</span>
</p>
@ -743,7 +747,7 @@ $(document).ready(
<ul>
<li><a href="#" class="contentMenuItem" id="menuSelect"><?php echo MENU_SELECT; ?></a></li>
<li><a href="#" class="contentMenuItem" id="menuPreview"><?php echo MENU_PREVIEW; ?></a></li>
<!-- <li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li> Chamilo temporarily disable contextual menu download -->
<li><a href="#" class="contentMenuItem" id="menuDownload"><?php echo MENU_DOWNLOAD; ?></a></li>
<li><a href="#" class="contentMenuItem" id="menuRename"><?php echo MENU_RENAME; ?></a></li>
<li><a href="#" class="contentMenuItem" id="menuEdit"><?php echo MENU_EDIT; ?></a></li>
<li><a href="#" class="contentMenuItem" id="menuCut"><?php echo MENU_CUT; ?></a></li>

@ -108,16 +108,26 @@ d=new Date();savEvtTime=d.getTime();savTO=setTimeout(function()
{var ext=getFileExtension(path);var supportedExts=supporedPreviewExts.split(",");var isSupportedExt=false;for(i in supportedExts)
{var typeOf=typeof(supportedExts[i]);if(typeOf.toLowerCase()=='string'&&supportedExts[i].toLowerCase()==ext.toLowerCase())
{isSupportedExt=true;break;}}
if(isSupportedExt)
{switch(files[num].cssClass)
{ case 'fileVideo':
case 'fileMusic':
case 'fileFlash':
$('#playGround').html('<a id="playGround' + num + '" href="' + '../'+files[num].path + '"><div id="player">&nbsp;this is mine</div></a> '); $('#playGround' + num).html(''); $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=256' + '&inlineId=winPlay&modal=true')); break; //Juan Carlos Raña added for Chamilo '../'+ for preview video and flash on href="' + '../'+files[num].path +
default:
showThickBox(linkElem, appendQueryString('../'+path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width));}
/////start hack for Chamilo
if(isSupportedExt){
switch(files[num].cssClass){
case 'fileVideo':
case 'fileMusic':
case 'fileFlash':
if(mode_editor==='stand_alone'){// Juan Carlos Raña add swich for mode editor. default is fckeditor
$('#playGround').html('<a id="playGround' + num + '" href="' + files[num].path + '"><div id="player">&nbsp;this is mine</div></a> '); $('#playGround' + num).html(''); $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=256' + '&inlineId=winPlay&modal=true')); break;
}else{
$('#playGround').html('<a id="playGround' + num + '" href="' + '../'+files[num].path + '"><div id="player">&nbsp;this is mine</div></a> '); $('#playGround' + num).html(''); $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); showThickBox($('#a' + num).get(0), appendQueryString('#TB_inline', 'height=250' + '&width=256' + '&inlineId=winPlay&modal=true')); break; //Juan Carlos Raña added for Chamilo '../'+ for preview video and flash on href="' + '../'+files[num].path +
}
default:
if(mode_editor==='stand_alone'){
showThickBox(linkElem, appendQueryString(path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width));
}else{
showThickBox(linkElem, appendQueryString('../'+path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width)); //Juan Carlos Raña (line above added '../'+ to line for preview and don't go to main showThickBox(linkElem, appendQueryString('../'+path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width));
}
}
}
//Juan Carlos Raña (line above added '../'+ to line for preview and don't go to main showThickBox(linkElem, appendQueryString('../'+path, 'KeepThis=true&TB_iframe=true&height=' + thickbox.height + '&width=' + thickbox.width));}
/////end hack for Chamilo
}
return false;},dcTime);return false;});$(this).dblclick(function()
{var d=new Date();dcAt=d.getTime();if(savTO!=null){clearTimeout(savTO);savTO=null;}

@ -656,18 +656,26 @@ class SocialManager extends UserManager {
//Invitations
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('invitation.png',get_lang('Invitations'),array('hspace'=>'6')).'<span class="'.($show=='invitations'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Invitations').$total_invitations.'</span></a></li>';
//Shared profile
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('my_shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6')).'<span class="'.($show=='shared_profile'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('ViewMySharedProfile').'</span></a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('friend.png',get_lang('Friends'),array('hspace'=>'6')).'<span class="'.($show=='friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Friends').'</span></a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.png',get_lang('Groups'),array('hspace'=>'6')).'<span class="'.($show=='groups'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Groups').'</span></a></li>';
//Show groups
if (in_array($show,$show_groups)) {
echo '<li><ul>';
echo $create_group_item;
echo '<li class="social-menu-sub-level" style="background:none;padding:0px"><a href="'.api_get_path(WEB_PATH).'main/social/groups.php?view=mygroups">'.Display::return_icon('group.png',get_lang('MyGroups'),array('hspace'=>'6')).'<span class="'.($show=='mygroups'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MyGroups').'</span></a></li>';
echo '</ul></li>';
}
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('zoom.png',get_lang('Search'),array('hspace'=>'6')).'<span class="'.($show=='search'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Search').'</span></a></li>
</ul>
//Search users and groups
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('zoom.png',get_lang('Search'),array('hspace'=>'6')).'<span class="'.($show=='search'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Search').'</span></a></li>';
//My files
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/myfiles.php">'.Display::return_icon('briefcase.png',get_lang('MyFiles'),array('hspace'=>'6')).'<span class="'.($show=='myfiles'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MyFiles').'</span></a></li>';
echo'</ul>
</div>';
if (in_array($show, $show_groups) && !empty($group_id)) {
@ -690,7 +698,7 @@ class SocialManager extends UserManager {
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('my_shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6','style'=>'float:left')).'<span class="social-menu-text-active" >'.get_lang('ViewMySharedProfile').'</span></a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('friend.png',get_lang('Friends'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Friends').'</span></a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.png',get_lang('Groups'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Groups').'</span></a></li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/myfiles.php">'.Display::return_icon('briefcase.png',get_lang('MyFiles'),array('hspace'=>'6')).'<span class="'.($show=='myfiles'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MyFiles').'</span></a></li>';
}

@ -753,6 +753,7 @@ VALUES
('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
('more_buttons_maximized_mode',NULL,'radio','Editor','false','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0),
('students_copy_folders',NULL,'radio','Tools','true','AllowStudentsCopyFoldersTitle','AllowStudentsCopyFoldersComment',NULL,NULL, 0),
('show_tabs', 'social', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsSocial', 0),
('allow_students_to_create_groups_in_social',NULL,'radio','Tools','false','AllowStudentsToCreateGroupsInSocialTitle','AllowStudentsToCreateGroupsInSocialComment',NULL,NULL, 0),
('allow_send_message_to_all_platform_users',NULL,'radio','Tools','false','AllowSendMessageToAllPlatformUsersTitle','AllowSendMessageToAllPlatformUsersComment',NULL,NULL, 0),
@ -967,6 +968,8 @@ VALUES
('more_buttons_maximized_mode','false','No'),
('students_download_folders','true','Yes'),
('students_download_folders','false','No'),
('students_copy_folders','true','Yes'),
('students_copy_folders','false','No'),
('allow_students_to_create_groups_in_social','true','Yes'),
('allow_students_to_create_groups_in_social','false','No'),
('allow_send_message_to_all_platform_users','true','Yes'),

@ -0,0 +1,125 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/**
* @author Juan Carlos Raña Trabado herodoto@telefonica.net
*/
$language_file = array('messages','userInfo');
$cidReset=true;
require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'image.lib.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyFiles'));
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
$htmlHeadXtra[] = '
<script type="text/javascript">
function denied_friend (element_input) {
name_button=$(element_input).attr("id");
name_div_id="id_"+name_button.substring(13);
user_id=name_div_id.split("_");
friend_user_id=user_id[1];
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
type: "POST",
url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=deny_friend",
data: "denied_friend_id="+friend_user_id,
success: function(datos) {
$("div#"+name_div_id).hide("slow");
$("#id_response").html(datos);
}
});
}
function register_friend(element_input) {
if(confirm("'.get_lang('AddToFriends').'")) {
name_button=$(element_input).attr("id");
name_div_id="id_"+name_button.substring(13);
user_id=name_div_id.split("_");
user_friend_id=user_id[1];
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("div#dpending_"+user_friend_id).html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
type: "POST",
url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=add_friend",
data: "friend_id="+user_friend_id+"&is_my_friend="+"friend",
success: function(datos) { $("div#"+name_div_id).hide("slow");
$("form").submit()
}
});
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
api_block_anonymous_users();
Display :: display_header($tool_name, 'Groups');
// easy links
if (is_array($_GET) && count($_GET)>0) {
foreach($_GET as $key => $value) {
switch ($key) {
case 'accept':
$user_role = GroupPortalManager::get_user_group_role(api_get_user_id(), $value);
if (in_array($user_role , array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER,GROUP_USER_PERMISSION_PENDING_INVITATION))) {
GroupPortalManager::update_user_role(api_get_user_id(), $value, GROUP_USER_PERMISSION_READER);
$show_message = get_lang('UserIsSubscribedToThisGroup');
} elseif (in_array($user_role , array(GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
$show_message = get_lang('UserIsAlreadySubscribedToThisGroup');
} else {
$show_message = get_lang('UserIsNotSubscribedToThisGroup');
}
break 2;
case 'deny':
// delete invitation
GroupPortalManager::delete_user_rel_group(api_get_user_id(), $value);
$show_message = get_lang('GroupInvitationWasDeny');
break 2;
}
}
}
$language_variable = get_lang('PendingInvitations');
$language_comment = get_lang('SocialInvitesComment');
echo '<div id="social-content">';
echo '<div id="social-content-left">';
//this include the social menu div
SocialManager::show_social_menu('myfiles');
echo '</div>';
echo '<div id="social-content-right>';
echo '<a href=""></a>';//TODO: hack and delete this line
echo '<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:80%; border: 0px; padding: 0px; float:left"></iframe>';
echo '</div>';
echo '</div>';
Display::display_footer();
?>
Loading…
Cancel
Save