diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/for_fckeditor.js b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/for_fckeditor.js index 2571e0be8a..b5a61f8810 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/for_fckeditor.js +++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/for_fckeditor.js @@ -1,58 +1,23 @@ -//function below added by logan (cailongqun [at] yahoo [dot] com [dot] cn) from www.phpletter.com +// The function below has added by logan (cailongqun [at] yahoo [dot] com [dot] cn) from www.phpletter.com +// Modifications by Juan Carlos Raña and Ivan Tcholakov, 2009 -function selectFile(url) -{ +function selectFile(url) { var selectedFileRowNum = $('#selectedFileRowNum').val(); - if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum)) - { - // insert information now - // var url = $('#fileUrl'+selectedFileRowNum).val(); //comment and replaced for put url into selecFile(url) by Juan Carlos Raña - window.opener.SetUrl( url ) ; - window.close() ; - - }else - { - alert(noFileSelected); - } - - -} - - - -function cancelSelectFile() -{ - // close popup window - window.close() ; -} - - - -/* - -// Alternative configuration. Juan Carlos Raña - -function selectFile() -{ - //juan carlos raña quizá si metemos aquí un while metería todos los marcados y no solo el ultimo?, así se recogerían selecciones múltiples - var selectedFileRowNum = getNum($('input[@type=checkbox][@checked]').attr('id')); - if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum)) - { - // insert information now - var url = files[selectedFileRowNum]['url']; - window.opener.SetUrl(url) ; - window.close() ; - - }else - { - alert(noFileSelected); - } + if(selectedFileRowNum != '' && $('#row' + selectedFileRowNum)) { + if ( window.opener ) { + // The advanced file manager has been opened in a new window. + window.opener.SetUrl( url ) ; + window.close() ; + } else if ( window.parent && typeof (window.parent.ParentDialog) == 'function' ) { + // The file manager is inside a dialog. + window.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( url ) ; + window.parent.CloseDialog() ; + } + } else { + alert(noFileSelected); + } } -function cancelSelectFile() -{ - // close popup window - window.close() ; +function cancelSelectFile() { + window.close() ; } - -*/ \ No newline at end of file