From 4513ad86ca4226b8095558e4a322b9890dd68c5c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 9 Jan 2012 14:17:55 +0100 Subject: [PATCH] Minor cosmetic changes --- .../fckeditor/editor/plugins/MP3/fck_mp3.js | 5 +- .../ajaxfilemanager/inc/class.manager.php | 47 +++++++++---------- .../jscripts/ajaxfilemanager.js | 3 +- .../plugins/ajaxfilemanager/jscripts/media.js | 2 +- .../editor/plugins/audio/fck_audio.js | 32 +++++-------- 5 files changed, 39 insertions(+), 50 deletions(-) mode change 100755 => 100644 main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/media.js mode change 100755 => 100644 main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.js diff --git a/main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.js b/main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.js index 4b9e13cb9a..180d2a30b9 100644 --- a/main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.js +++ b/main/inc/lib/fckeditor/editor/plugins/MP3/fck_mp3.js @@ -47,7 +47,7 @@ if ( oFakeImage ) } function window_onload(tab_to_select) -{ +{ // Translate the dialog box texts. oEditor.FCKLanguageManager.TranslatePage(document) ; @@ -199,8 +199,7 @@ function updateMovie(e) } var ePreview ; -function SetPreviewElement( previewEl ) -{ +function SetPreviewElement( previewEl ) { ePreview = previewEl ; if ( GetE('mpUrl').value.length > 0 ) diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php index 63ec68ea47..355b1a3f9b 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php +++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php @@ -82,8 +82,6 @@ class manager { } $this->currentFolderPath = (isUnderRoot($this->getCurrentFolderPath())?backslashToSlash((addTrailingSlash($this->getCurrentFolderPath()))):CONFIG_SYS_DEFAULT_PATH); - - $this->currentFolderPath = base64_encode($this->currentFolderPath); if($this->calculateSubdir) { @@ -94,7 +92,7 @@ class manager { if (is_dir($this->getCurrentFolderPath())) { $file = new file($this->getCurrentFolderPath()); $folderInfo = $file->getFileInfo(); - if(sizeof($folderInfo)) { + if (sizeof($folderInfo)) { //for Chamilo in a name folder, replace num user by user names if(preg_match('/sf_user_/',basename($this->getCurrentFolderPath()))) { $userinfo=Database::get_user_info_from_id(substr(basename($this->getCurrentFolderPath()), 8)); @@ -102,11 +100,11 @@ class manager { } else { $this->currentFolderInfo['name']=str_replace('_',' ',basename($this->getCurrentFolderPath()));//for Chamilo. Prevent long directory name } - if(preg_match('/shared_folder/', basename($this->getCurrentFolderPath()))) { + if (preg_match('/shared_folder/', basename($this->getCurrentFolderPath()))) { $this->currentFolderInfo['name']=get_lang('UserFolders'); } - if(preg_match('/shared_folder_session_/',basename($this->getCurrentFolderPath()))) { + if (preg_match('/shared_folder_session_/',basename($this->getCurrentFolderPath()))) { $session = explode('_', basename($this->getCurrentFolderPath())); $session = strtolower($session[sizeof($session) - 1]); $this->currentFolderInfo['name']=get_lang('UserFolders').' ('.api_get_session_name($session).')*'; @@ -120,32 +118,30 @@ class manager { $this->currentFolderInfo['is_readable'] = $folderInfo['is_readable']; $this->currentFolderInfo['is_writable'] = $folderInfo['is_writable']; $this->currentFolderInfo['path'] = $this->getCurrentFolderPath(); - $this->currentFolderInfo['path_base64'] = base64_encode($this->getCurrentFolderPath()); - - $this->currentFolderInfo['friendly_path'] = transformFilePath($this->getCurrentFolderPath()); - $this->currentFolderInfo['type'] = "folder"; - $this->currentFolderInfo['cssClass']='folder'; - + $this->currentFolderInfo['path_base64'] = base64_encode($this->getCurrentFolderPath()); + $this->currentFolderInfo['friendly_path'] = transformFilePath($this->getCurrentFolderPath()); + $this->currentFolderInfo['type'] = 'folder'; + $this->currentFolderInfo['cssClass'] = 'folder'; //$this->currentFolderInfo['flag'] = $folderInfo['flag']; } } - if($calculateSubdir && !file_exists($this->getCurrentFolderPath())) - { + + if ($calculateSubdir && !file_exists($this->getCurrentFolderPath())) { die(ERR_FOLDER_NOT_FOUND . $this->getCurrentFolderPath()); } } - function setSessionAction(&$session) - { + function setSessionAction(&$session) { $this->sessionAction = $session; } + /** * constructor */ - function manager($path = null, $calculateSubdir=true) - { + function manager($path = null, $calculateSubdir=true) { $this->__construct($path, $calculateSubdir); } + /** * get current folder path * @return string @@ -190,17 +186,21 @@ class manager { $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 ? + + //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; - if(ereg($group_folder, $path)) { + + if (ereg($group_folder, $path)) { $hide_doc_group=true; if($is_user_in_group ||( $to_group_id!=0 && api_is_allowed_to_edit())) { $hide_doc_group=false; } } - 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]=='.') { + 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; } //end fix for Chamilo @@ -214,8 +214,7 @@ class manager { } } elseif(is_file($path) && isListingDocument($path)) { $obj = new file($path); - $tem = $obj->getFileInfo(); - + $tem = $obj->getFileInfo(); if (sizeof($tem)) { $fileType = $this->getFileType($file); @@ -241,9 +240,9 @@ class manager { //try my_files $pos = strpos($this->getCurrentFolderPath(), 'main/'); $tem['public_path'] = api_get_path(WEB_PATH).substr($this->getCurrentFolderPath(), $pos, strlen($this->getCurrentFolderPath())).$file; - //var_dump($this->getCurrentFolderPath()); + } else { - $tem['public_path'] = api_get_path(WEB_PATH).substr($this->getCurrentFolderPath(), $pos, strlen($this->getCurrentFolderPath())).$file; + $tem['public_path'] = api_get_path(WEB_PATH).substr($this->getCurrentFolderPath(), $pos, strlen($this->getCurrentFolderPath())).$file; } //error_log($tem['public_path'] ); diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager.js b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager.js index 32c2961767..a53f666399 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager.js +++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager.js @@ -103,8 +103,7 @@ $(elem).each( case 'fileFlash': $('#playGround').html('
 this is mine
'); $('#playGround' + num).html(''); - $('#playGround' + num).media({ width: 255, height: 210, autoplay: true }); - //alert($('#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; default: diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/media.js b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/media.js old mode 100755 new mode 100644 index 60a153290d..8443a415cd --- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/media.js +++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/media.js @@ -340,7 +340,7 @@ $.fn.media.swf = function(el, opts) { // map flv and mp3 files to the swf player by default $.fn.media.flv = $.fn.media.mp3 = function(el, opts) { var src = opts.src; - var player = /\.mp3\b/i.test(src) ? $.fn.media.defaults.mp3Player : $.fn.media.defaults.flvPlayer; + var player = /\.mp3\b/i.test(src) ? $.fn.media.defaults.mp3Player : $.fn.media.defaults.flvPlayer; opts.src = player; opts.src = opts.src + '?file=' + src; opts.flashvars = $.extend({}, { file: src }, opts.flashvars ); diff --git a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.js b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.js old mode 100755 new mode 100644 index 5fb2ee425b..7103d39360 --- a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.js +++ b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.js @@ -32,13 +32,13 @@ var FCKTools = oEditor.FCKTools ; window.document.dir = FCKLang.Dir ; // We have to avoid javascript errors if some language variables have not been defined. -FCKLang['UploadSelectFileFirst'] = FCKLang['UploadSelectFileFirst'] ? FCKLang['UploadSelectFileFirst'] : 'Please, select a file before pressing the upload button.' ; +FCKLang['UploadSelectFileFirst'] = FCKLang['UploadSelectFileFirst'] ? FCKLang['UploadSelectFileFirst'] : 'Please, select a file before pressing the upload button.' ; FCKLang['FileSuccessfullyUploaded'] = FCKLang['FileSuccessfullyUploaded'] ? FCKLang['FileSuccessfullyUploaded'] : 'Your file has been successfully uploaded.' ; -FCKLang['FileRenamed'] = FCKLang['FileRenamed'] ? FCKLang['FileRenamed'] : 'A file with the same name is already available. The uploaded file has been renamed to ' ; -FCKLang['InvalidFileType'] = FCKLang['InvalidFileType'] ? FCKLang['InvalidFileType'] : 'Invalid file type.' ; -FCKLang['SecurityError'] = FCKLang['SecurityError'] ? FCKLang['SecurityError'] : 'Security error. You probably don\'t have enough permissions to upload. Please check your server.' ; -FCKLang['ConnectorDisabled'] = FCKLang['ConnectorDisabled'] ? FCKLang['ConnectorDisabled'] : 'The upload feature (connector) is disabled.' ; -FCKLang['UploadError'] = FCKLang['UploadError'] ? FCKLang['UploadError'] : 'Error on file upload. Error number: ' ; +FCKLang['FileRenamed'] = FCKLang['FileRenamed'] ? FCKLang['FileRenamed'] : 'A file with the same name is already available. The uploaded file has been renamed to ' ; +FCKLang['InvalidFileType'] = FCKLang['InvalidFileType'] ? FCKLang['InvalidFileType'] : 'Invalid file type.' ; +FCKLang['SecurityError'] = FCKLang['SecurityError'] ? FCKLang['SecurityError'] : 'Security error. You probably don\'t have enough permissions to upload. Please check your server.' ; +FCKLang['ConnectorDisabled'] = FCKLang['ConnectorDisabled'] ? FCKLang['ConnectorDisabled'] : 'The upload feature (connector) is disabled.' ; +FCKLang['UploadError'] = FCKLang['UploadError'] ? FCKLang['UploadError'] : 'Error on file upload. Error number: ' ; //#### Dialog Tabs @@ -65,21 +65,18 @@ lib_path = FCK.GetUrl( lib_path, FCK.SEMI_ABSOLUTE_URL ) ; // This is the semi-absolute URL of the audio player. var player = lib_path + 'mediaplayer/player.swf' ; - // Get the selected audio (if available). var oFakeImage = dialog.Selection.GetSelectedElement() ; var oEmbed ; -if ( oFakeImage ) -{ +if ( oFakeImage ) { if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckmp3') ) oEmbed = FCK.GetRealElement( oFakeImage ) ; else oFakeImage = null ; } -window.onload = function() -{ +window.onload = function() { // Translate the dialog box texts. oEditor.FCKLanguageManager.TranslatePage(document) ; @@ -101,8 +98,7 @@ window.onload = function() SelectField( 'txtUrl' ) ; } -function LoadSelection() -{ +function LoadSelection() { if ( ! oEmbed ) return ; var flashvars = GetAttribute( oEmbed, 'flashvars', '' ).toString() ; @@ -134,8 +130,7 @@ function LoadSelection() } //#### The OK button was hit. -function Ok() -{ +function Ok() { if ( GetE('txtUrl').value.length == 0 ) { dialog.SetSelectedTab( 'Info' ) ; @@ -181,16 +176,13 @@ function UpdateEmbed( e ) var ePreview ; -function SetPreviewElement( previewEl ) -{ +function SetPreviewElement( previewEl ) { ePreview = previewEl ; - if ( GetE( 'txtUrl' ).value.length > 0 ) UpdatePreview() ; } -function UpdatePreview() -{ +function UpdatePreview() { if ( !ePreview ) return;