Yannick Warnier 14 years ago
parent
commit
e992f7b57f

+ 37 - 4
main/document/create_document.php

@@ -425,19 +425,35 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $_GET['dir'
 		if (is_array($folders)) {			
 			$escaped_folders = array();			
 			foreach ($folders as $key => & $val) {
-				$escaped_folders[$key] = Database::escape_string($val);
+				//Hide some folders
+				if($val=='/HotPotatoes_files' || $val=='/certificates' || basename($val)=='css'){			
+				 continue;
+				}
+				//Admin setting for Hide/Show the folders of all users		
+				if(api_get_setting('show_users_folders') == 'false' && (strstr($val, '/shared_folder') || strstr($val, 'shared_folder_session_'))){	
+					continue;
+				}
+				//Admin setting for Hide/Show Default folders to all users
+				if(api_get_setting('show_default_folders') == 'false' && ($val=='/images' || $val=='/flash' || $val=='/audio' || $val=='/video' || strstr($val, '/images/gallery') || $val=='/video/flv')){
+					continue;
+				}
+				//Admin setting for Hide/Show chat history folder
+				if(api_get_setting('show_chat_folder') == 'false' && $val=='/chat_files'){
+					continue;
+				}				
+					
+					$escaped_folders[$key] = Database::escape_string($val);
 			}
 			$folder_sql = implode("','", $escaped_folders);
 			$doc_table = Database::get_course_table(TABLE_DOCUMENT);
 			$sql = "SELECT * FROM $doc_table WHERE filetype='folder' AND path IN ('".$folder_sql."')";
 			$res = Database::query($sql);
 			$folder_titles = array();	
-			while ($obj = Database::fetch_object($res)) {
+			while ($obj = Database::fetch_object($res)) {				
 				$folder_titles[$obj->path] = $obj->title;
 			}
 		}
-	} else {
-	
+	} else {	
 		if (is_array($folders)) {
 			foreach ($folders as & $folder) {
 				$folder_titles[$folder] = basename($folder);
@@ -449,6 +465,23 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $_GET['dir'
 		$parent_select -> addOption(get_lang('HomeDirectory'), '/');
 		if (is_array($folders)) {
 			foreach ($folders as & $folder) {
+				//Hide some folders
+				if($folder=='/HotPotatoes_files' || $folder=='/certificates' || basename($folder)=='css'){			
+				 continue;
+				}
+				//Admin setting for Hide/Show the folders of all users		
+				if(api_get_setting('show_users_folders') == 'false' && (strstr($folder, '/shared_folder') || strstr($folder, 'shared_folder_session_'))){	
+					continue;
+				}
+				//Admin setting for Hide/Show Default folders to all users
+				if(api_get_setting('show_default_folders') == 'false' && ($folder=='/images' || $folder=='/flash' || $folder=='/audio' || $folder=='/video' || strstr($folder, '/images/gallery') || $folder=='/video/flv')){
+					continue;
+				}
+				//Admin setting for Hide/Show chat history folder
+				if(api_get_setting('show_chat_folder') == 'false' && $folder=='/chat_files'){
+					continue;
+				}			
+				
 				$selected = (substr($dir,0,-1) == $folder) ? ' selected="selected"' : '';
 				$path_parts = explode('/', $folder);
 				$folder_titles[$folder] = cut($folder_titles[$folder], 80);

+ 39 - 34
main/document/document.inc.php

@@ -146,33 +146,30 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
 	$tooltip_title = $tooltip_title[0];
 
 	$tooltip_title_alt = $tooltip_title;
-	if ($tooltip_title == 'shared_folder') {
+	if ($path == '/shared_folder') {
 		$tooltip_title_alt = get_lang('UserFolders');
-	}elseif(strstr($tooltip_title, 'shared_folder_session_')) {
+	}elseif(strstr($path, 'shared_folder_session_')) {
 		$tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
 	}elseif(strstr($tooltip_title, 'sf_user_')) {
 		$userinfo = Database::get_user_info_from_id(substr($tooltip_title, 8));
 		$tooltip_title_alt = get_lang('UserFolder').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);		
 	}
-	elseif($tooltip_title == 'chat_files') {
+	elseif($path == '/chat_files') {
 		$tooltip_title_alt = get_lang('ChatFiles');		
 	}
-	elseif($tooltip_title == 'certificates') {
-		$tooltip_title_alt = get_lang('CertificatesFiles');
-	}
-	elseif($tooltip_title == 'video') {
+	elseif($path == '/video') {
 		$tooltip_title_alt = get_lang('Video');
 	}
-	elseif($tooltip_title == 'audio') {
+	elseif($path == '/audio') {
 		$tooltip_title_alt = get_lang('Audio');
 	}
-	elseif($tooltip_title == 'flash') {
+	elseif($path == '/flash') {
 		$tooltip_title_alt = get_lang('Flash');
 	}
-	elseif($tooltip_title == 'images') {
+	elseif($path == '/images') {
 		$tooltip_title_alt = get_lang('Images');
 	}
-	elseif($tooltip_title == 'gallery') {
+	elseif($path == '/images/gallery') {
 		$tooltip_title_alt = get_lang('DefaultCourseImages');
 	}
 
@@ -211,10 +208,10 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
 	}
 	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>';
+			return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.build_document_icon_tag($filetype, $path).Display::return_icon('shared.png', get_lang('ResourceShared'), array('hspace' => '5', 'align' => 'middle', 'height' => 22, 'width' => 22)).'</a>';
 		}
 		else{
-			return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.build_document_icon_tag($filetype, $tooltip_title).'</a>';
+			return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.build_document_icon_tag($filetype, $path).'</a>';
 		}
 	}
 }
@@ -234,16 +231,16 @@ function build_document_icon_tag($type, $path) {
 	if ($type == 'file') {
 		$icon = choose_image($basename);
 	} else {
-		if ($basename == 'shared_folder') {
+		if ($path == '/shared_folder') {
 			$icon = 'folder_users.gif';
 			if ($is_allowed_to_edit) {
 				$basename = get_lang('HelpUsersFolder');
 			} else {
 				$basename = get_lang('UserFolders');
 			}
-		}elseif(strstr($basename, 'shared_folder_session_')) {
+		}elseif(strstr($path, 'shared_folder_session_')) {
 			if ($is_allowed_to_edit) {
-				$basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpSharedFolder');
+				$basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
 			} else {
 				$basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
 			}
@@ -259,10 +256,10 @@ function build_document_icon_tag($type, $path) {
 			}
 
 			$basename = get_lang('UserFolder').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
-
 		} else {
 			$icon = 'folder_document.gif';
-			if($basename=='audio'){
+			
+			if($path=='/audio'){
 				$icon = 'folder_audio.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpDefaultDirDocuments');
@@ -270,8 +267,8 @@ function build_document_icon_tag($type, $path) {
 				else{
 					$basename=get_lang('Audio');
 				}				
-			}
-			elseif($basename =='flash'){
+			}			
+			elseif($path =='/flash'){
 				$icon = 'folder_flash.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpDefaultDirDocuments');
@@ -280,7 +277,7 @@ function build_document_icon_tag($type, $path) {
 					$basename=get_lang('Flash');
 				}
 			}
-			elseif($basename =='images'){
+			elseif($path =='/images'){
 				$icon = 'folder_images.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpDefaultDirDocuments');
@@ -289,7 +286,7 @@ function build_document_icon_tag($type, $path) {
 					$basename=get_lang('Images');
 				}
 			}
-			elseif($basename =='video'){
+			elseif($path =='/video'){
 				$icon = 'folder_video.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpDefaultDirDocuments');
@@ -298,7 +295,7 @@ function build_document_icon_tag($type, $path) {
 					$basename=get_lang('Video');
 				}
 			}
-			elseif($basename =='gallery'){
+			elseif($path =='/images/gallery'){
 				$icon = 'folder_gallery.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpDefaultDirDocuments');
@@ -307,7 +304,7 @@ function build_document_icon_tag($type, $path) {
 					$basename=get_lang('Gallery');
 				}
 			}
-			elseif($basename =='chat_files'){
+			elseif($path =='/chat_files'){
 				$icon = 'folder_chat.gif';
 				if(api_is_allowed_to_edit()){
 					$basename=get_lang('HelpFolderChat');
@@ -316,15 +313,6 @@ function build_document_icon_tag($type, $path) {
 					$basename=get_lang('ChatFiles');
 				}
 			}
-			elseif($basename =='certificates'){
-				$icon = 'folder_certificates.gif';
-				if(api_is_allowed_to_edit()){
-					$basename = get_lang('HelpFolderCertificates');
-				}
-				else{
-					$basename = get_lang('Certificates');
-				}
-			}
 		}
 	}
 
@@ -470,6 +458,23 @@ function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir =
 		
 		if (is_array($folders)) {
 			foreach ($folders as & $folder) {
+				//Hide some folders
+				if($folder=='/HotPotatoes_files' || $folder=='/certificates' || basename($folder)=='css'){			
+				 continue;
+				}
+				//Admin setting for Hide/Show the folders of all users		
+				if(api_get_setting('show_users_folders') == 'false' && (strstr($folder, '/shared_folder') || strstr($folder, 'shared_folder_session_'))){	
+					continue;
+				}
+				//Admin setting for Hide/Show Default folders to all users
+				if(api_get_setting('show_default_folders') == 'false' && ($folder=='/images' || $folder=='/flash' || $folder=='/audio' || $folder=='/video' || strstr($folder, '/images/gallery') || $folder=='/video/flv')){
+					continue;
+				}
+				//Admin setting for Hide/Show chat history folder
+				if(api_get_setting('show_chat_folder') == 'false' && $folder=='/chat_files'){
+					continue;
+				}
+				
 				// You cannot move a file to:
 				// 1. current directory
 				// 2. inside the folder you want to move
@@ -489,7 +494,7 @@ function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir =
 			if (($curdirpath != $folder) && ($folder != $move_file) && (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')) { // Cannot copy dir into his own subdir
 				if (api_get_setting('use_document_title')) {
 					$path_displayed = get_titles_of_path($folder);
-				}
+				}				
 				$display_folder = substr($path_displayed,strlen($group_dir));
 				$display_folder = ($display_folder == '') ? get_lang('Documents') : $display_folder;
 				$form .= '<option value="'.$folder.'">'.$display_folder.'</option>'."\n";

+ 18 - 3
main/document/document.php

@@ -823,11 +823,26 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) {
 		// Data for checkbox
 		if (($is_allowed_to_edit || $group_member_with_upload_rights) && count($docs_and_folders) > 1) {
 			$row[] = $id['path'];
+		}			
+		   
+		// Hide HotPotatoes Certificates and all css folders
+		if($id['path']=='/HotPotatoes_files' || $id['path']=='/certificates' || basename($id['path'])=='css'){			
+			 continue;
+		}
+
+		//Admin setting for Hide/Show the folders of all users		
+		if(api_get_setting('show_users_folders') == 'false' && ($id['path']=='/shared_folder' || strstr($id['path'], 'shared_folder_session_'))){	
+			continue;
+		}
+		
+		//Admin setting for Hide/Show Default folders to all users
+		if(api_get_setting('show_default_folders') == 'false' && ($id['path']=='/images' || $id['path']=='/flash' || $id['path']=='/audio' || $id['path']=='/video')){
+			continue;
 		}
 		
-		// Hide HotPotatoes and css folders
-		if(basename($id['path'])=='HotPotatoes_files' || basename($id['path'])=='css'){			
-				break;
+		//Admin setting for Hide/Show chat history folder
+		if(api_get_setting('show_chat_folder') == 'false' && $id['path']=='/chat_files'){
+			continue;
 		}
 
 		// Show the owner of the file only in groups

+ 0 - 4
main/inc/banner.inc.php

@@ -430,10 +430,6 @@ if (isset($interbreadcrumb) && is_array($interbreadcrumb)) {
 		
 			$navigation_item['title'] = get_lang('ChatFiles');
 		}
-		elseif($breadcrumb_step['name'] == 'certificates') {
-		
-			$navigation_item['title'] = get_lang('CertificatesFiles');
-		}
 		elseif($breadcrumb_step['name'] == 'images') {
 		
 			$navigation_item['title'] = get_lang('Images');

+ 3 - 3
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_details_listing.php

@@ -24,13 +24,13 @@
 								///First step for hidden some type of Chamilo files and folders
 								//Juan Carlos Raña
 
-									//hidden files and folders deleted by Chamilo. Hidde folders css, hotpotatoes, chat_files
+									//hidden files and folders deleted by Chamilo. Hidde folders css, hotpotatoes, chat_files, certificates
 									$deleted_by_chamilo_file=' DELETED '; // ' DELETED ' not '_DELETED_' because in $file['name'] _ is replaced with blank see class.manager.php
 									$deleted_by_chamilo_folder='_DELETED_';
 									$css_folder_chamilo='css';
 									$hotpotatoes_folder_chamilo='HotPotatoes_files';
 									$chat_files_chamilo='chat_files';
-
+									$certificates_chamilo='certificates';
 									//show group's directory only if I'm member. Or if I'm a teacher. TODO: check groups not necessary because the student dont have access to main folder documents (only to document/group or document/shared_folder). Teachers can access to all groups ?
 									$group_folder='_groupdocs';
 
@@ -48,7 +48,7 @@
 								///Second step: hiding as the case
 								//Juan Carlos Raña
 
-								if((!ereg($deleted_by_chamilo_file, $file['name']) && !ereg($deleted_by_chamilo_folder, $file['path'])) && !ereg($css_folder_chamilo, $file['path']) && !ereg($hotpotatoes_folder_chamilo, $file['path']) && !ereg($chat_files_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.')
+								if((!ereg($deleted_by_chamilo_file, $file['name']) && !ereg($deleted_by_chamilo_folder, $file['path'])) && !ereg($css_folder_chamilo, $file['path']) && !ereg($hotpotatoes_folder_chamilo, $file['path']) && !ereg($chat_files_chamilo, $file['path']) && !ereg($certificates_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.')
 								{							
 								
 									if($file['type'] == 'file')

+ 3 - 3
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php

@@ -9,14 +9,14 @@
 			///First step for hidden some type of Chamilo files and folders
 			//Juan Carlos Ra�a
 
-			//hidden files and folders deleted by Chamilo. Hidde folders css, hotpotatoes, chat
+			//hidden files and folders deleted by Chamilo. Hidde folders css, hotpotatoes, chat, certificates
 
 			$deleted_by_chamilo_file=' DELETED '; // ' DELETED ' not '_DELETED_' because in $file['name'] _ is replaced with blank see class.manager.php
 			$deleted_by_chamilo_folder='_DELETED_';
 			$css_folder_chamilo='css';
 			$hotpotatoes_folder_chamilo='HotPotatoes_files';
 			$chat_files_chamilo='chat_files';
-
+			$certificates_chamilo='certificates';
 			//hidden directory of the group if the user is not a member of the group
 			$group_folder='_groupdocs';
 
@@ -37,7 +37,7 @@
 			
 			///Second step: hiding as the case
 			//Juan Carlos Ra�a
-			if((!ereg($deleted_by_chamilo_file, $file['name']) && !ereg($deleted_by_chamilo_folder, $file['path'])) && !ereg($css_folder_chamilo, $file['path']) && !ereg($hotpotatoes_folder_chamilo, $file['path']) && !ereg($chat_files_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.')
+			if((!ereg($deleted_by_chamilo_file, $file['name']) && !ereg($deleted_by_chamilo_folder, $file['path'])) && !ereg($css_folder_chamilo, $file['path']) && !ereg($hotpotatoes_folder_chamilo, $file['path']) && !ereg($chat_files_chamilo, $file['path']) && !ereg($certificates_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.')
 			{			
 			
 			?>

+ 2 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_get_file_listing.php

@@ -77,6 +77,7 @@
 			$css_folder_Chamilo='css';
 			$hotpotatoes_folder_Chamilo='HotPotatoes_files';
 			$chat_files_Chamilo='chat_files';
+			$certificates_Chamilo='certificates';
 
 		//end previous fix for count hidden folders
 
@@ -112,7 +113,7 @@
 
 			}
 
-			if((!ereg($deleted_by_Chamilo_file, $file['name']) || !ereg($deleted_by_Chamilo_folder, $file['path'])) || ereg($css_folder_Chamilo, $file['path']) || ereg($hotpotatoes_folder_Chamilo, $file['path']) || ereg($chat_files_Chamilo, $file['path']) || $hide_doc_group || $file['name'][0]=='.')//Chamilo fix for hidden items.
+			if((!ereg($deleted_by_Chamilo_file, $file['name']) || !ereg($deleted_by_Chamilo_folder, $file['path'])) || ereg($css_folder_Chamilo, $file['path']) || ereg($hotpotatoes_folder_Chamilo, $file['path']) || ereg($chat_files_Chamilo, $file['path']) || ereg($certificates_Chamilo, $file['path']) || $hide_doc_group || $file['name'][0]=='.')//Chamilo fix for hidden items.
 			{
 
 				$count_hideItem=$count_hideItem+1;

+ 2 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php

@@ -208,6 +208,7 @@ class manager
 						$css_folder_Chamilo='css';
 						$hotpotatoes_folder_Chamilo='HotPotatoes_files';
 						$chat_files_Chamilo='chat_files';
+						$certificates_Chamilo='certificates';
 						//show group's directory only if I'm member. Or if I'm a teacher. TODO: check groups not necessary because the student dont have access to main folder documents (only to document/group or document/shared_folder). Teachers can access to all groups ?
 						$group_folder='_groupdocs';
 						$hide_doc_group=false;
@@ -221,7 +222,7 @@ class manager
 
 						}
 
-						if(ereg($deleted_by_Chamilo_folder, $path)|| ereg($css_folder_Chamilo, $path) || ereg($hotpotatoes_folder_Chamilo, $path) || ereg($chat_files_Chamilo, $path) || $hide_doc_group || $file[0]=='.')
+						if(ereg($deleted_by_Chamilo_folder, $path)|| ereg($css_folder_Chamilo, $path) || ereg($hotpotatoes_folder_Chamilo, $path) || ereg($chat_files_Chamilo, $path) || ereg($certificates_Chamilo, $path) || $hide_doc_group || $file[0]=='.')
 						{
 							$this->currentFolderInfo['subdir']=$this->currentFolderInfo['subdir']-1;
 						}

+ 3 - 2
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/function.base.php

@@ -1226,7 +1226,7 @@ function getRootPath() {
 * check if a folder is allowed to shown on the search 'look in' list
 * @param string $folderName
 * @return string
-* @author Juan Carlos Raña Trabado
+* @author Juan Carlos Raña Trabado
 */
 function hideFolderName($folderName)
 {
@@ -1236,6 +1236,7 @@ function hideFolderName($folderName)
 	$hotpotatoes_folder_chamilo='HotPotatoes_files';
 	$chat_files_chamilo='chat_files';
 	$thumbs_folder='.thumbs';
+	$certificates_chamilo='certificates';
 
 	//hidden directory of the group if the user is not a member of the group
 	$group_folder='_groupdocs';
@@ -1251,7 +1252,7 @@ function hideFolderName($folderName)
 		}
 	}
 
-	if(!ereg($deleted_by_chamilo, $folderName) && !ereg($css_folder_chamilo, $folderName) && !ereg($hotpotatoes_folder_chamilo, $folderName) && !ereg($chat_files_chamilo, $folderName) && !ereg($thumbs_folder, $folderName) && $show_doc_group==true)
+	if(!ereg($deleted_by_chamilo, $folderName) && !ereg($css_folder_chamilo, $folderName) && !ereg($hotpotatoes_folder_chamilo, $folderName) && !ereg($chat_files_chamilo, $folderName) && !ereg($certificates_chamilo, $folderName) && !ereg($thumbs_folder, $folderName) && $show_doc_group==true)
 	{
 		return substr($folderName,strpos($folderName, '-'),strlen($folderName)); //hide the firsts numbers
 	}

+ 0 - 8
main/inc/lib/fckeditor/editor/plugins/asciisvg/d.svg

@@ -1,8 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
-  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<svg id="root" xml:space="preserve" width="100%" height="100%"
-  preserveAspectRatio="xMidYMid meet"
-  xmlns="http://www.w3.org/2000/svg"
-  xmlns:xlink="http:///www.w3.org/1999/xlink">
-</svg>

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/asciisvg/fck_asciisvg.html

@@ -116,7 +116,7 @@ Graphs: <select id="graphs" onchange="javascript: LoadEquation();"></select>
 
 <hr/>
 
-<div id="preview" style="overflow: auto;">
+<div id="preview">
 <script type="text/javascript">
 //if ( noSVG )
 //{

+ 2 - 2
main/inc/lib/fckeditor/editor/plugins/asciisvg/fckplugin.js

@@ -36,7 +36,7 @@ FCKToolbarItems.RegisterItem( 'asciisvg', oAsciiSvgItem ) ;
 FCK.ContextMenu.RegisterListener( {
     AddItems : function( menu, tag, tagName )
     {
-        if ( FCK.IsAsciiSvg( tag ) )
+        if ( tag.tagName == 'IMG' && tag.getAttribute( '_fckasciisvg' ) )
         {
             menu.AddSeparator() ;
             menu.AddItem( 'asciisvg', FCKLang['DlgAsciiSvg'], oAsciiSvgItem.IconPath ) ;
@@ -48,7 +48,7 @@ FCK.ContextMenu.RegisterListener( {
 FCK.RegisterDoubleClickHandler(
     function ( tag )
     {
-        if ( FCK.IsAsciiSvg( tag ) )
+        if ( tag.tagName == 'IMG' && tag.getAttribute( '_fckasciisvg' ) )
         {
             FCKCommands.GetCommand( 'asciisvg' ).Execute() ;
         }

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/asciisvg/fckplugin_compressed.js

@@ -1 +1 @@
-if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};var notifyIfNoMathML=false;var alertIfNoMathML=false;var notifyIfNoSVG=false;var alertIfNoSVG=false;var translateASCIIMath=false;FCKCommands.RegisterCommand('asciisvg',new FCKDialogCommand(FCKLang['DlgAsciiSvg'],FCKLang['DlgAsciiSvgGraphEditor'],FCKConfig.PluginsPath+'asciisvg/fck_asciisvg.html',700,600));var oAsciiSvgItem=new FCKToolbarButton('asciisvg',FCKLang['DlgAsciiSvg']);oAsciiSvgItem.IconPath=FCKConfig.PluginsPath+'asciisvg/asciisvg.gif';FCKToolbarItems.RegisterItem('asciisvg',oAsciiSvgItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (FCK.IsAsciiSvg(B)){A.AddSeparator();A.AddItem('asciisvg',FCKLang['DlgAsciiSvg'],oAsciiSvgItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (FCK.IsAsciiSvg(A)){FCKCommands.GetCommand('asciisvg').Execute();}},null);
+if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};var notifyIfNoMathML=false;var alertIfNoMathML=false;var notifyIfNoSVG=false;var alertIfNoSVG=false;var translateASCIIMath=false;FCKCommands.RegisterCommand('asciisvg',new FCKDialogCommand(FCKLang['DlgAsciiSvg'],FCKLang['DlgAsciiSvgGraphEditor'],FCKConfig.PluginsPath+'asciisvg/fck_asciisvg.html',700,600));var oAsciiSvgItem=new FCKToolbarButton('asciisvg',FCKLang['DlgAsciiSvg']);oAsciiSvgItem.IconPath=FCKConfig.PluginsPath+'asciisvg/asciisvg.gif';FCKToolbarItems.RegisterItem('asciisvg',oAsciiSvgItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (B.tagName=='IMG'&&B.getAttribute('_fckasciisvg')){A.AddSeparator();A.AddItem('asciisvg',FCKLang['DlgAsciiSvg'],oAsciiSvgItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (A.tagName=='IMG'&&A.getAttribute('_fckasciisvg')){FCKCommands.GetCommand('asciisvg').Execute();}},null);

+ 42 - 97
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@@ -1146,53 +1146,51 @@ FCK.ResizeToFit = function( width, height, max_width, max_height )
 // This is a modification of the original function.
 FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
 {
+    // Premature detection of fake image type is needed here.
+    if ( fakeClass = 'FCK__UnknownObject' )
+    {
+        if ( FCK.IsVideo( realElement ) )
+        {
+            fakeClass = 'FCK__Video' ;
+        }
+        else if ( FCK.IsAsciiSvg( realElement ) )
+        {
+            fakeClass = 'FCK__AsciiSvg' ;
+        }
+    }
+
+    // The original code fragment.
     var oImg = FCKTools.GetElementDocument( realElement ).createElement( 'IMG' ) ;
     oImg.className = fakeClass ;
     oImg.src = FCKConfig.BasePath + 'images/spacer.gif' ;
     oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
     oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
-    if ( fakeClass == 'FCK__Video' )
+
+    // Setting width and height for relevant types of fake images.
+    if ( fakeClass == 'FCK__Video' && realElement.nodeName.IEquals( 'div' ) )
     {
         // Specific to flv player, SWFObject attaching technique.
-        if ( realElement.nodeName.IEquals( 'div' ) )
-        {
-            for ( var i = 0; i < realElement.childNodes.length; i++ )
-            {
-                if ( realElement.childNodes[i].nodeName.IEquals( 'div' ) )
-                {
-                    oImg.style.width = realElement.childNodes[i].style.width ;
-                    oImg.style.height = realElement.childNodes[i].style.height ;
-                    break ;
-                }
-            }
-        }
-        // For embedded video.
-        else
+        for ( var i = 0; i < realElement.childNodes.length; i++ )
         {
-            var width = realElement.width ;
-            var height = realElement.height ;
-            if ( width )
-            {
-                oImg.style.width = width.toString().indexOf('%') != -1 ? width : ( width + 'px' ) ;
-            }
-            if ( height )
+            if ( realElement.childNodes[i].nodeName.IEquals( 'div' ) )
             {
-                oImg.style.height = height.toString().indexOf('%') != -1 ? height : ( height + 'px' ) ;
+                oImg.style.width = realElement.childNodes[i].style.width ;
+                oImg.style.height = realElement.childNodes[i].style.height ;
+                break ;
             }
         }
     }
-    // For AsciiSvg graphs.
-    else if ( fakeClass == 'FCK__AsciiSvg' )
+    else if ( fakeClass == 'FCK__Video' || fakeClass == 'FCK__AsciiSvg' )
     {
         var width = realElement.width ;
         var height = realElement.height ;
         if ( width )
         {
-            oImg.style.width = width.toString().indexOf('%') != -1 ? width : ( width + 'px' ) ;
+            oImg.style.width = FCKTools.ConvertHtmlSizeToStyle( width.toString() ) ;
         }
         if ( height )
         {
-            oImg.style.height = height.toString().indexOf('%') != -1 ? height : ( height + 'px' ) ;
+            oImg.style.height = FCKTools.ConvertHtmlSizeToStyle( height.toString() ) ;
         }
         if ( realElement.style.width ) {
             oImg.style.width = realElement.style.width ;
@@ -1200,13 +1198,22 @@ FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
         if ( realElement.style.height ) {
             oImg.style.height = realElement.style.height ;
         }
-        var sscr = realElement.getAttribute( 'sscr' ) ;
-        oImg.setAttribute( 'sscr', sscr, 0 ) ;
     }
+
+    // Setting attributes for detection purpose.
+    if ( fakeClass == 'FCK__Video' )
+    {
+        oImg.setAttribute( '_fckvideo', 'true', 0 ) ;
+    }
+    else if ( fakeClass == 'FCK__AsciiSvg' )
+    {
+        oImg.setAttribute( '_fckasciisvg', 'true', 0 ) ;
+    }
+
     return oImg ;
 }
 
-// A custom handler for audio files when a new tag has been added.
+// A fake image handler for audio files.
 FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
     {
         if ( !FCK.IsAudio( el ) )
@@ -1218,25 +1225,7 @@ FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
         fakeImg.setAttribute( '_fckmp3', 'true', 0 ) ;
     } ) ;
 
-// Fake images for audio files when the document has been opened.
-FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
-    {
-        var embeds = document.getElementsByTagName( 'embed' ) ;
-        var embed ;
-        var i = embeds.length - 1 ;
-        while ( i >= 0 && ( embed = embeds[i--] ) )
-        {
-            if ( FCK.IsAudio( embed ) )
-            {
-                var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__MP3', embed.cloneNode(true) ) ;
-                oImg.setAttribute( '_fckmp3', 'true', 0 ) ;
-                embed.parentNode.insertBefore( oImg, embed ) ;
-                embed.parentNode.removeChild( embed ) ;
-            }
-        }
-    } ;
-
-// A custom handler for video when a new tag has been added.
+// A fake image handler for video files.
 FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
     {
         if ( !FCK.IsVideo( el ) )
@@ -1248,23 +1237,9 @@ FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
         fakeImg.setAttribute( '_fckvideo', 'true', 0 ) ;
     } ) ;
 
-// Fake images for video when the document has been opened.
+// Fake image support for flv video files.
 FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
     {
-        var embeds = document.getElementsByTagName( 'embed' ) ;
-        var embed;
-        var i = embeds.length - 1 ;
-        while ( i >= 0 && ( embed = embeds[i--] ) )
-        {
-            if ( FCK.IsVideo( embed ) )
-            {
-                var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Video', embed.cloneNode(true) ) ;
-                oImg.setAttribute( '_fckvideo', 'true', 0 ) ;
-                embed.parentNode.insertBefore( oImg, embed ) ;
-                embed.parentNode.removeChild( embed ) ;
-            }
-        }
-
         // For flv player, SWFObject attaching tecnique.
         var divs = document.getElementsByTagName( 'div' ) ;
         var div;
@@ -1281,36 +1256,6 @@ FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
         }
     } ;
 
- // A custom handler for AsciiSvg graphs when a new tag has been added.
-FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
-    {
-        if ( !FCK.IsAsciiSvg( el ) )
-        {
-            return ;
-        }
-
-        fakeImg.className = 'FCK__AsciiSvg' ;
-        fakeImg.setAttribute( '_fckasciisvg', 'true', 0 ) ;
-    } ) ;
-
-// Fake images for AsciiSvg graphs when the document has been opened.
-FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
-    {
-        var embeds = document.getElementsByTagName( 'embed' ) ;
-        var embed ;
-        var i = embeds.length - 1 ;
-        while ( i >= 0 && ( embed = embeds[i--] ) )
-        {
-            if ( FCK.IsAsciiSvg( embed ) )
-            {
-                var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__AsciiSvg', embed.cloneNode(true) ) ;
-                oImg.setAttribute( '_fckasciisvg', 'true', 0 ) ;
-                embed.parentNode.insertBefore( oImg, embed ) ;
-                embed.parentNode.removeChild( embed ) ;
-            }
-        }
-    } ;
-
 
 /*
  **************************************************************************************
@@ -1543,7 +1488,6 @@ FCK.IsRealImage = function ( tag )
             || tag.getAttribute( '_fckmp3' )
             || tag.getAttribute( '_fckvideo' )
             || tag.getAttribute( 'MapNumber' )
-            || FCK.IsAsciiSvg( tag )
             )
         {
             return false ;
@@ -1551,7 +1495,7 @@ FCK.IsRealImage = function ( tag )
 
         if ( tag.getAttribute( 'src' ) )
         {
-            var src = tag.getAttribute( 'src' ).toString() ;
+            var src = tag.getAttribute( 'src' ).toString().toLowerCase() ;
             return ( src.indexOf( 'mimetex?' ) == -1
                     && src.indexOf( 'mimetex.cgi?' ) == -1
                     && src.indexOf( 'mimetex.exe?' ) == -1
@@ -1561,6 +1505,7 @@ FCK.IsRealImage = function ( tag )
                     && src.indexOf( 'mathtran?' ) == -1
                     && src.indexOf( 'google.com/chart?' ) == -1
                     && src.indexOf( 'latex?' ) == -1
+                    && src.indexOf( 'sscr=' ) == -1
                 ) ? true : false ;
         }
         else
@@ -1735,7 +1680,7 @@ FCK.IsAsciiSvg = function ( tag )
         return false ;
     }
 
-    if ( tag.nodeName.IEquals( 'img' ) || tag.nodeName.IEquals( 'embed' ) )
+    if ( tag.nodeName.IEquals( 'embed' ) )
     {
         if ( FCKDomTools.HasAttribute( tag, 'sscr' ) )
         {

File diff suppressed because it is too large
+ 0 - 0
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin_compressed.js


+ 10 - 1
main/install/db_main.sql

@@ -784,6 +784,9 @@ VALUES
 ('students_export2pdf',				NULL,'radio',		'Tools',	'true',	'EnabledStudentExport2PDFTitle',	'EnabledStudentExport2PDFComment',NULL,NULL, 0),
 ('exercise_min_score', 				NULL,'textfield',	'Course',	'',		'ExerciseMinScoreTitle',			'ExerciseMinScoreComment','platform',NULL, 	1),
 ('exercise_max_score', 				NULL,'textfield',	'Course',	'',		'ExerciseMaxScoreTitle',			'ExerciseMaxScoreComment','platform',NULL, 	1),
+('show_users_folders',				NULL,'radio',		'Tools',	'true',	'ShowUsersFoldersTitle','ShowUsersFoldersComment',NULL,NULL, 0),
+('show_default_folders',				NULL,'radio',		'Tools',	'true',	'ShowDefaultFoldersTitle','ShowDefaultFoldersComment',NULL,NULL, 0),
+('show_chat_folder',				NULL,'radio',		'Tools',	'true',	'ShowChatFolderTitle','ShowChatFolderComment',NULL,NULL, 0),
 ('chamilo_database_version', 		NULL,'textfield', 	NULL, '1.8.8.13174','DokeosDatabaseVersion','', NULL, NULL, 0);
  
 
@@ -1026,7 +1029,13 @@ VALUES
 ('enabled_insertHtml','true','Yes'),
 ('enabled_insertHtml','false','No'),
 ('students_export2pdf','true','Yes'),
-('students_export2pdf','false','No');
+('students_export2pdf','false','No'),
+('show_users_folders','true','Yes'),
+('show_users_folders','false','No'),
+('show_default_folders','true','Yes'),
+('show_default_folders','false','No'),
+('show_chat_folder','true','Yes'),
+('show_chat_folder','false','No');
 
 UNLOCK TABLES;
 

+ 17 - 0
main/install/migrate-db-1.8.7-1.8.8-pre.sql

@@ -97,6 +97,23 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('students_e
 INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('exercise_min_score', NULL,'textfield',	'Course',	'',		'ExerciseMinScoreTitle',		'ExerciseMinScoreComment','platform',NULL, 	1);
 INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('exercise_max_score', NULL,'textfield',	'Course',	'',		'ExerciseMaxScoreTitle',		'ExerciseMaxScoreComment','platform',NULL, 	1);
 
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_users_folders',NULL,'radio','Tools','true','ShowUsersFoldersTitle','ShowUsersFoldersComment',NULL,NULL, 0);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_users_folders', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_users_folders', 'false', 'No');
+
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_default_folders',NULL,'radio','Tools','true','ShowDefaultFoldersTitle','ShowDefaultFoldersComment',NULL,NULL, 0);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_default_folders', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_default_folders', 'false', 'No');
+
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_chat_folder',NULL,'radio','Tools','true','ShowChatFolderTitle','ShowChatFolderComment',NULL,NULL, 0);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_chat_folder', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('show_chat_folder', 'false', 'No');
+
+
+
+
+
+
 
 -- xxSTATSxx
 ALTER TABLE track_e_exercices ADD COLUMN orig_lp_item_view_id INT NOT NULL DEFAULT 0;

Some files were not shown because too many files changed in this diff