diff --git a/htdocs/includes/fckeditor/editor/css/behaviors/disablehandles.htc b/htdocs/includes/fckeditor/editor/css/behaviors/disablehandles.htc index e12aa5967fa..8dfb661de60 100644 --- a/htdocs/includes/fckeditor/editor/css/behaviors/disablehandles.htc +++ b/htdocs/includes/fckeditor/editor/css/behaviors/disablehandles.htc @@ -1,15 +1,15 @@ - - - - - + + + + + diff --git a/htdocs/includes/fckeditor/editor/css/behaviors/hiddenfield.htc b/htdocs/includes/fckeditor/editor/css/behaviors/hiddenfield.htc index 455484ff39c..745b4a91624 100644 --- a/htdocs/includes/fckeditor/editor/css/behaviors/hiddenfield.htc +++ b/htdocs/includes/fckeditor/editor/css/behaviors/hiddenfield.htc @@ -1,30 +1,30 @@ - - - - - - - - + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/css/behaviors/showtableborders.htc b/htdocs/includes/fckeditor/editor/css/behaviors/showtableborders.htc index bb814065e2e..77418b9ec35 100644 --- a/htdocs/includes/fckeditor/editor/css/behaviors/showtableborders.htc +++ b/htdocs/includes/fckeditor/editor/css/behaviors/showtableborders.htc @@ -1,36 +1,36 @@ - - - - - - - - + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/css/fck_editorarea.css b/htdocs/includes/fckeditor/editor/css/fck_editorarea.css index 84ae56613bf..abaf9de1527 100644 --- a/htdocs/includes/fckeditor/editor/css/fck_editorarea.css +++ b/htdocs/includes/fckeditor/editor/css/fck_editorarea.css @@ -1,87 +1,87 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_editorarea.css - * This is the default CSS file used by the editor area. It defines the - * initial font of the editor and background color. - * - * A user can configure the editor to use another CSS file. Just change - * the value of the FCKConfig.EditorAreaCSS key in the configuration - * file. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -/* - The "body" styles should match your editor web site, mainly regarding - background color and font family and size. -*/ - -body -{ - background-color: #ffffff; - padding: 5px 5px 5px 5px; - margin: 0px; -} - -body, td -{ - font-family: Arial, Verdana, Sans-Serif; - font-size: 12px; -} - -a -{ - color: #0000FF !important; /* For Firefox... mark as important, otherwise it becomes black */ -} - -/* - Just uncomment the following block if you want to avoid spaces between - paragraphs. Remember to apply the same style in your output front end page. -*/ - -/* -P, UL, LI -{ - margin-top: 0px; - margin-bottom: 0px; -} -*/ - -/* - The following are some sample styles used in the "Styles" toolbar command. - You should instead remove them, and include the styles used by the site - you are using the editor in. -*/ - -.Bold -{ - font-weight: bold; -} - -.Title -{ - font-weight: bold; - font-size: 18px; - color: #cc3300; -} - -.Code -{ - border: #8b4513 1px solid; - padding-right: 5px; - padding-left: 5px; - color: #000066; - font-family: 'Courier New' , Monospace; - background-color: #ff9933; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_editorarea.css + * This is the default CSS file used by the editor area. It defines the + * initial font of the editor and background color. + * + * A user can configure the editor to use another CSS file. Just change + * the value of the FCKConfig.EditorAreaCSS key in the configuration + * file. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +/* + The "body" styles should match your editor web site, mainly regarding + background color and font family and size. +*/ + +body +{ + background-color: #ffffff; + padding: 5px 5px 5px 5px; + margin: 0px; +} + +body, td +{ + font-family: Arial, Verdana, Sans-Serif; + font-size: 12px; +} + +a +{ + color: #0000FF !important; /* For Firefox... mark as important, otherwise it becomes black */ +} + +/* + Just uncomment the following block if you want to avoid spaces between + paragraphs. Remember to apply the same style in your output front end page. +*/ + +/* +P, UL, LI +{ + margin-top: 0px; + margin-bottom: 0px; +} +*/ + +/* + The following are some sample styles used in the "Styles" toolbar command. + You should instead remove them, and include the styles used by the site + you are using the editor in. +*/ + +.Bold +{ + font-weight: bold; +} + +.Title +{ + font-weight: bold; + font-size: 18px; + color: #cc3300; +} + +.Code +{ + border: #8b4513 1px solid; + padding-right: 5px; + padding-left: 5px; + color: #000066; + font-family: 'Courier New' , Monospace; + background-color: #ff9933; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/css/fck_internal.css b/htdocs/includes/fckeditor/editor/css/fck_internal.css index 0d8a127d34a..a737b25fff6 100644 --- a/htdocs/includes/fckeditor/editor/css/fck_internal.css +++ b/htdocs/includes/fckeditor/editor/css/fck_internal.css @@ -1,88 +1,88 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_internal.css - * This CSS Style Sheet defines rules used by the editor for its internal use. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -/* Fix to allow putting the caret at the end of the -content in Firefox if clicking below the content */ -html -{ - min-height:100%; -} - - -table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th -{ - border: #d3d3d3 1px solid; -} - -form -{ - border: 1px dotted #FF0000; - padding: 2px; -} - -.FCK__Flash -{ - border: darkgray 1px solid; - background-position: center center; - background-image: url(images/fck_flashlogo.gif); - background-repeat: no-repeat; - width: 80px; - height: 80px; -} - -.FCK__Anchor -{ - background-position: center center; - background-image: url(images/fck_anchor.gif); - background-repeat: no-repeat; - width: 16px; - height: 15px; -} - -.FCK__PageBreak -{ - background-position: center center; - background-image: url(images/fck_pagebreak.gif); - background-repeat: no-repeat; - clear: both; - display: block; - float: none; - width: 100%; - border-top: #999999 1px dotted; - border-bottom: #999999 1px dotted; - border-right: 0px; - border-left: 0px; - height: 5px; -} - -input[type="hidden"] -{ - display: inline; - width:20px; - height:20px; - border:1px dotted #FF0000 ; - background-image: url(behaviors/hiddenfield.gif); - background-repeat: no-repeat; -} - -input[type="hidden"]:after -{ - padding-left: 20px; - content: "" ; -} +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_internal.css + * This CSS Style Sheet defines rules used by the editor for its internal use. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +/* Fix to allow putting the caret at the end of the +content in Firefox if clicking below the content */ +html +{ + min-height:100%; +} + + +table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th +{ + border: #d3d3d3 1px solid; +} + +form +{ + border: 1px dotted #FF0000; + padding: 2px; +} + +.FCK__Flash +{ + border: darkgray 1px solid; + background-position: center center; + background-image: url(images/fck_flashlogo.gif); + background-repeat: no-repeat; + width: 80px; + height: 80px; +} + +.FCK__Anchor +{ + background-position: center center; + background-image: url(images/fck_anchor.gif); + background-repeat: no-repeat; + width: 16px; + height: 15px; +} + +.FCK__PageBreak +{ + background-position: center center; + background-image: url(images/fck_pagebreak.gif); + background-repeat: no-repeat; + clear: both; + display: block; + float: none; + width: 100%; + border-top: #999999 1px dotted; + border-bottom: #999999 1px dotted; + border-right: 0px; + border-left: 0px; + height: 5px; +} + +input[type="hidden"] +{ + display: inline; + width:20px; + height:20px; + border:1px dotted #FF0000 ; + background-image: url(behaviors/hiddenfield.gif); + background-repeat: no-repeat; +} + +input[type="hidden"]:after +{ + padding-left: 20px; + content: "" ; +} diff --git a/htdocs/includes/fckeditor/editor/css/fck_showtableborders_gecko.css b/htdocs/includes/fckeditor/editor/css/fck_showtableborders_gecko.css index 86ff432c8cb..854dd247f00 100644 --- a/htdocs/includes/fckeditor/editor/css/fck_showtableborders_gecko.css +++ b/htdocs/includes/fckeditor/editor/css/fck_showtableborders_gecko.css @@ -1,38 +1,38 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_showtableborders_gecko.css - * This CSS Style Sheet defines the rules to show table borders on Gecko. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -/* For tables with the "border" attribute set to "0" */ -table[border="0"], -table[border="0"] > tr > td, table[border="0"] > tr > th, -table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th, -table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th, -table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th -{ - border: #d3d3d3 1px dotted ; -} - -/* For tables with no "border" attribute set */ -table:not([border]), -table:not([border]) > tr > td, table:not([border]) > tr > th, -table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th, -table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th, -table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th -{ - border: #d3d3d3 1px dotted ; -} +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_showtableborders_gecko.css + * This CSS Style Sheet defines the rules to show table borders on Gecko. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +/* For tables with the "border" attribute set to "0" */ +table[border="0"], +table[border="0"] > tr > td, table[border="0"] > tr > th, +table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th, +table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th, +table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th +{ + border: #d3d3d3 1px dotted ; +} + +/* For tables with no "border" attribute set */ +table:not([border]), +table:not([border]) > tr > td, table:not([border]) > tr > th, +table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th, +table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th, +table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th +{ + border: #d3d3d3 1px dotted ; +} diff --git a/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.css b/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.css index f0821c3590f..4881f863701 100644 --- a/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.css +++ b/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.css @@ -1,79 +1,79 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_dialog_common.css - * This is the CSS file used for interface details in some dialog - * windows. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -.ImagePreviewArea -{ - border: #000000 1px solid; - overflow: auto; - width: 100%; - height: 170px; - background-color: #ffffff; -} - -.FlashPreviewArea -{ - border: #000000 1px solid; - padding: 5px; - overflow: auto; - width: 100%; - height: 170px; - background-color: #ffffff; -} - -.BtnReset -{ - float: left; - background-position: center center; - background-image: url(images/reset.gif); - width: 16px; - height: 16px; - background-repeat: no-repeat; - border: 1px none; - font-size: 1px ; -} - -.BtnLocked, .BtnUnlocked -{ - float: left; - background-position: center center; - background-image: url(images/locked.gif); - width: 16px; - height: 16px; - background-repeat: no-repeat; - border: 1px none; - font-size: 1px ; -} - -.BtnUnlocked -{ - background-image: url(images/unlocked.gif); -} - -.BtnOver -{ - border: 1px outset; - cursor: pointer; - cursor: hand; -} - -.FCK__FieldNumeric -{ - behavior: url(common/fcknumericfield.htc) ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_dialog_common.css + * This is the CSS file used for interface details in some dialog + * windows. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +.ImagePreviewArea +{ + border: #000000 1px solid; + overflow: auto; + width: 100%; + height: 170px; + background-color: #ffffff; +} + +.FlashPreviewArea +{ + border: #000000 1px solid; + padding: 5px; + overflow: auto; + width: 100%; + height: 170px; + background-color: #ffffff; +} + +.BtnReset +{ + float: left; + background-position: center center; + background-image: url(images/reset.gif); + width: 16px; + height: 16px; + background-repeat: no-repeat; + border: 1px none; + font-size: 1px ; +} + +.BtnLocked, .BtnUnlocked +{ + float: left; + background-position: center center; + background-image: url(images/locked.gif); + width: 16px; + height: 16px; + background-repeat: no-repeat; + border: none 1px; + font-size: 1px ; +} + +.BtnUnlocked +{ + background-image: url(images/unlocked.gif); +} + +.BtnOver +{ + border: outset 1px; + cursor: pointer; + cursor: hand; +} + +.FCK__FieldNumeric +{ + behavior: url(common/fcknumericfield.htc) ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.js b/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.js index 44058c98034..667dff77d62 100644 --- a/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.js +++ b/htdocs/includes/fckeditor/editor/dialog/common/fck_dialog_common.js @@ -1,137 +1,137 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_dialog_common.js - * Useful functions used by almost all dialog window pages. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -// Gets a element by its Id. Used for shorter coding. -function GetE( elementId ) -{ - return document.getElementById( elementId ) ; -} - -function ShowE( element, isVisible ) -{ - if ( typeof( element ) == 'string' ) - element = GetE( element ) ; - element.style.display = isVisible ? '' : 'none' ; -} - -function SetAttribute( element, attName, attValue ) -{ - if ( attValue == null || attValue.length == 0 ) - element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive - else - element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive -} - -function GetAttribute( element, attName, valueIfNull ) -{ - var oAtt = element.attributes[attName] ; - - if ( oAtt == null || !oAtt.specified ) - return valueIfNull ? valueIfNull : '' ; - - var oValue ; - - if ( !( oValue = element.getAttribute( attName, 2 ) ) ) - oValue = oAtt.nodeValue ; - - return ( oValue == null ? valueIfNull : oValue ) ; -} - -// Functions used by text fiels to accept numbers only. -function IsDigit( e ) -{ - e = e || event ; - var iCode = ( e.keyCode || e.charCode ) ; - - event.returnValue = - ( - ( iCode >= 48 && iCode <= 57 ) // Numbers - || (iCode >= 37 && iCode <= 40) // Arrows - || iCode == 8 // Backspace - || iCode == 46 // Delete - ) ; - - return event.returnValue ; -} - -String.prototype.trim = function() -{ - return this.replace( /(^\s*)|(\s*$)/g, '' ) ; -} - -String.prototype.startsWith = function( value ) -{ - return ( this.substr( 0, value.length ) == value ) ; -} - -String.prototype.remove = function( start, length ) -{ - var s = '' ; - - if ( start > 0 ) - s = this.substring( 0, start ) ; - - if ( start + length < this.length ) - s += this.substring( start + length , this.length ) ; - - return s ; -} - -function OpenFileBrowser( url, width, height ) -{ - // oEditor must be defined. - - var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ; - var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ; - - var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ; - sOptions += ",width=" + width ; - sOptions += ",height=" + height ; - sOptions += ",left=" + iLeft ; - sOptions += ",top=" + iTop ; - - // The "PreserveSessionOnFileBrowser" because the above code could be - // blocked by popup blockers. - if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE ) - { - // The following change has been made otherwise IE will open the file - // browser on a different server session (on some cases): - // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678 - // by Simone Chiaretta. - var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ; - - if ( oWindow ) - { - // Detect Yahoo popup blocker. - try - { - var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user. - oWindow.opener = window ; - } - catch(e) - { - alert( oEditor.FCKLang.BrowseServerBlocked ) ; - } - } - else - alert( oEditor.FCKLang.BrowseServerBlocked ) ; - } - else - window.open( url, 'FCKBrowseWindow', sOptions ) ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_dialog_common.js + * Useful functions used by almost all dialog window pages. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +// Gets a element by its Id. Used for shorter coding. +function GetE( elementId ) +{ + return document.getElementById( elementId ) ; +} + +function ShowE( element, isVisible ) +{ + if ( typeof( element ) == 'string' ) + element = GetE( element ) ; + element.style.display = isVisible ? '' : 'none' ; +} + +function SetAttribute( element, attName, attValue ) +{ + if ( attValue == null || attValue.length == 0 ) + element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive + else + element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive +} + +function GetAttribute( element, attName, valueIfNull ) +{ + var oAtt = element.attributes[attName] ; + + if ( oAtt == null || !oAtt.specified ) + return valueIfNull ? valueIfNull : '' ; + + var oValue ; + + if ( !( oValue = element.getAttribute( attName, 2 ) ) ) + oValue = oAtt.nodeValue ; + + return ( oValue == null ? valueIfNull : oValue ) ; +} + +// Functions used by text fiels to accept numbers only. +function IsDigit( e ) +{ + e = e || event ; + var iCode = ( e.keyCode || e.charCode ) ; + + event.returnValue = + ( + ( iCode >= 48 && iCode <= 57 ) // Numbers + || (iCode >= 37 && iCode <= 40) // Arrows + || iCode == 8 // Backspace + || iCode == 46 // Delete + ) ; + + return event.returnValue ; +} + +String.prototype.trim = function() +{ + return this.replace( /(^\s*)|(\s*$)/g, '' ) ; +} + +String.prototype.startsWith = function( value ) +{ + return ( this.substr( 0, value.length ) == value ) ; +} + +String.prototype.remove = function( start, length ) +{ + var s = '' ; + + if ( start > 0 ) + s = this.substring( 0, start ) ; + + if ( start + length < this.length ) + s += this.substring( start + length , this.length ) ; + + return s ; +} + +function OpenFileBrowser( url, width, height ) +{ + // oEditor must be defined. + + var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ; + var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ; + + var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ; + sOptions += ",width=" + width ; + sOptions += ",height=" + height ; + sOptions += ",left=" + iLeft ; + sOptions += ",top=" + iTop ; + + // The "PreserveSessionOnFileBrowser" because the above code could be + // blocked by popup blockers. + if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE ) + { + // The following change has been made otherwise IE will open the file + // browser on a different server session (on some cases): + // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678 + // by Simone Chiaretta. + var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ; + + if ( oWindow ) + { + // Detect Yahoo popup blocker. + try + { + var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user. + oWindow.opener = window ; + } + catch(e) + { + alert( oEditor.FCKLang.BrowseServerBlocked ) ; + } + } + else + alert( oEditor.FCKLang.BrowseServerBlocked ) ; + } + else + window.open( url, 'FCKBrowseWindow', sOptions ) ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/common/fcknumericfield.htc b/htdocs/includes/fckeditor/editor/dialog/common/fcknumericfield.htc index 94bb8ba5a22..74f26d0d2c3 100644 --- a/htdocs/includes/fckeditor/editor/dialog/common/fcknumericfield.htc +++ b/htdocs/includes/fckeditor/editor/dialog/common/fcknumericfield.htc @@ -1,24 +1,24 @@ - - - - - + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/common/moz-bindings.xml b/htdocs/includes/fckeditor/editor/dialog/common/moz-bindings.xml index 5beb567817d..69cd03459f1 100644 --- a/htdocs/includes/fckeditor/editor/dialog/common/moz-bindings.xml +++ b/htdocs/includes/fckeditor/editor/dialog/common/moz-bindings.xml @@ -1,30 +1,30 @@ - - - - - - this.keypress = CheckIsDigit ; - - - - = 48 && iCode <= 57 ) // Numbers - || (iCode >= 37 && iCode <= 40) // Arrows - || iCode == 8 // Backspace - || iCode == 46 // Delete - ) ; - - return bAccepted ; - ]]> - - - - - - - + + + + + + this.keypress = CheckIsDigit ; + + + + = 48 && iCode <= 57 ) // Numbers + || (iCode >= 37 && iCode <= 40) // Arrows + || iCode == 8 // Backspace + || iCode == 46 // Delete + ) ; + + return bAccepted ; + ]]> + + + + + + + \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_about.html b/htdocs/includes/fckeditor/editor/dialog/fck_about.html index 2c75436c6e1..f6e993839e2 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_about.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_about.html @@ -1,145 +1,145 @@ - - - - - - - - - - -
- - - - - - - - - - -
- - - - - -
- version -
- 2.3
- Build 1054
-
-  
- Support Open Source software.
- - What about a donation today?
-


- For further information go to - http://www.fckeditor.net/. -
- Copyright © 2003-2006 Frederico Caldeira - Knabben -
- -
-
- - - - + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + +
+ version +
+ 2.3.1
+ Build 1062
+
+  
+ Support Open Source software.
+ + What about a donation today?
+


+ For further information go to + http://www.fckeditor.net/. +
+ Copyright © 2003-2006 Frederico Caldeira + Knabben +
+ +
+
+ + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_about/lgpl.html b/htdocs/includes/fckeditor/editor/dialog/fck_about/lgpl.html index 7dfce1d55b8..30f3cc56d14 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_about/lgpl.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_about/lgpl.html @@ -1,434 +1,434 @@ - - - - GNU Lesser General Public License - - - - -

GNU Lesser General Public License

- -

Version 2.1, February 1999

-
-

Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite - 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute - verbatim copies of this license document, but changing it is not allowed.

-

[This is the first released version of the Lesser GPL. It also counts as the - successor of the GNU Library Public License, version 2, hence the version - number 2.1.]

-
-

Preamble

-

The licenses for most software are designed to take away your freedom to share - and change it. By contrast, the GNU General Public Licenses are intended to - guarantee your freedom to share and change free software--to make sure the - software is free for all its users. -

-

This license, the Lesser General Public License, applies to some specially - designated software packages--typically libraries--of the Free Software - Foundation and other authors who decide to use it. You can use it too, but we - suggest you first think carefully about whether this license or the ordinary - General Public License is the better strategy to use in any particular case, - based on the explanations below. -

-

When we speak of free software, we are referring to freedom of use, not price. - Our General Public Licenses are designed to make sure that you have the freedom - to distribute copies of free software (and charge for this service if you - wish); that you receive source code or can get it if you want it; that you can - change the software and use pieces of it in new free programs; and that you are - informed that you can do these things.

-

To protect your rights, we need to make restrictions that forbid distributors to - deny you these rights or to ask you to surrender these rights. These - restrictions translate to certain responsibilities for you if you distribute - copies of the library or if you modify it. -

-

For example, if you distribute copies of the library, whether gratis or for a - fee, you must give the recipients all the rights that we gave you. You must - make sure that they, too, receive or can get the source code. If you link other - code with the library, you must provide complete object files to the - recipients, so that they can relink them with the library after making changes - to the library and recompiling it. And you must show them these terms so they - know their rights. -

-

We protect your rights with a two-step method: (1) we copyright the library, and - (2) we offer you this license, which gives you legal permission to copy, - distribute and/or modify the library. -

-

To protect each distributor, we want to make it very clear that there is no - warranty for the free library. Also, if the library is modified by someone else - and passed on, the recipients should know that what they have is not the - original version, so that the original author's reputation will not be affected - by problems that might be introduced by others. -

-

Finally, software patents pose a constant threat to the existence of any free - program. We wish to make sure that a company cannot effectively restrict the - users of a free program by obtaining a restrictive license from a patent - holder. Therefore, we insist that any patent license obtained for a version of - the library must be consistent with the full freedom of use specified in this - license. -

-

Most GNU software, including some libraries, is covered by the ordinary GNU - General Public License. This license, the GNU Lesser General Public License, - applies to certain designated libraries, and is quite different from the - ordinary General Public License. We use this license for certain libraries in - order to permit linking those libraries into non-free programs. -

-

When a program is linked with a library, whether statically or using a shared - library, the combination of the two is legally speaking a combined work, a - derivative of the original library. The ordinary General Public License - therefore permits such linking only if the entire combination fits its criteria - of freedom. The Lesser General Public License permits more lax criteria for - linking other code with the library. -

-

We call this license the "Lesser" General Public License because it does Less to - protect the user's freedom than the ordinary General Public License. It also - provides other free software developers Less of an advantage over competing - non-free programs. These disadvantages are the reason we use the ordinary - General Public License for many libraries. However, the Lesser license provides - advantages in certain special circumstances. -

-

For example, on rare occasions, there may be a special need to encourage the - widest possible use of a certain library, so that it becomes a de-facto - standard. To achieve this, non-free programs must be allowed to use the - library. A more frequent case is that a free library does the same job as - widely used non-free libraries. In this case, there is little to gain by - limiting the free library to free software only, so we use the Lesser General - Public License. -

-

In other cases, permission to use a particular library in non-free programs - enables a greater number of people to use a large body of free software. For - example, permission to use the GNU C Library in non-free programs enables many - more people to use the whole GNU operating system, as well as its variant, the - GNU/Linux operating system. -

-

Although the Lesser General Public License is Less protective of the users' - freedom, it does ensure that the user of a program that is linked with the - Library has the freedom and the wherewithal to run that program using a - modified version of the Library. -

-

The precise terms and conditions for copying, distribution and modification - follow. Pay close attention to the difference between a "work based on the - library" and a "work that uses the library". The former contains code derived - from the library, whereas the latter must be combined with the library in order - to run. -

-

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

-

0. This License Agreement applies to any software library or - other program which contains a notice placed by the copyright holder or other - authorized party saying it may be distributed under the terms of this Lesser - General Public License (also called "this License"). Each licensee is addressed - as "you".

-

A "library" means a collection of software functions and/or data prepared so as - to be conveniently linked with application programs (which use some of those - functions and data) to form executables. -

-

The "Library", below, refers to any such software library or work which has been - distributed under these terms. A "work based on the Library" means either the - Library or any derivative work under copyright law: that is to say, a work - containing the Library or a portion of it, either verbatim or with - modifications and/or translated straightforwardly into another language. - (Hereinafter, translation is included without limitation in the term - "modification".) -

-

"Source code" for a work means the preferred form of the work for making - modifications to it. For a library, complete source code means all the source - code for all modules it contains, plus any associated interface definition - files, plus the scripts used to control compilation and installation of the - library.

-

Activities other than copying, distribution and modification are not covered by - this License; they are outside its scope. The act of running a program using - the Library is not restricted, and output from such a program is covered only - if its contents constitute a work based on the Library (independent of the use - of the Library in a tool for writing it). Whether that is true depends on what - the Library does and what the program that uses the Library does. -

-

1. You may copy and distribute verbatim copies of the Library's - complete source code as you receive it, in any medium, provided that you - conspicuously and appropriately publish on each copy an appropriate copyright - notice and disclaimer of warranty; keep intact all the notices that refer to - this License and to the absence of any warranty; and distribute a copy of this - License along with the Library. -

-

You may charge a fee for the physical act of transferring a copy, and you may at - your option offer warranty protection in exchange for a fee. -

-

2. You may modify your copy or copies of the Library or any - portion of it, thus forming a work based on the Library, and copy and - distribute such modifications or work under the terms of Section 1 above, - provided that you also meet all of these conditions: -

-
-

a) The modified work must itself be a software library. -

-

b) You must cause the files modified to carry prominent notices stating that you - changed the files and the date of any change.

-

c) You must cause the whole of the work to be licensed at no charge to all third - parties under the terms of this License. -

-

d) If a facility in the modified Library refers to a function or a table of data - to be supplied by an application program that uses the facility, other than as - an argument passed when the facility is invoked, then you must make a good - faith effort to ensure that, in the event an application does not supply such - function or table, the facility still operates, and performs whatever part of - its purpose remains meaningful. -

-

(For example, a function in a library to compute square roots has a purpose that - is entirely well-defined independent of the application. Therefore, Subsection - 2d requires that any application-supplied function or table used by this - function must be optional: if the application does not supply it, the square - root function must still compute square roots.) -

-

These requirements apply to the modified work as a whole. If identifiable - sections of that work are not derived from the Library, and can be reasonably - considered independent and separate works in themselves, then this License, and - its terms, do not apply to those sections when you distribute them as separate - works. But when you distribute the same sections as part of a whole which is a - work based on the Library, the distribution of the whole must be on the terms - of this License, whose permissions for other licensees extend to the entire - whole, and thus to each and every part regardless of who wrote it. -

-

Thus, it is not the intent of this section to claim rights or contest your - rights to work written entirely by you; rather, the intent is to exercise the - right to control the distribution of derivative or collective works based on - the Library. -

-

In addition, mere aggregation of another work not based on the Library with the - Library (or with a work based on the Library) on a volume of a storage or - distribution medium does not bring the other work under the scope of this - License. -

-
-

3. You may opt to apply the terms of the ordinary GNU General - Public License instead of this License to a given copy of the Library. To do - this, you must alter all the notices that refer to this License, so that they - refer to the ordinary GNU General Public License, version 2, instead of to this - License. (If a newer version than version 2 of the ordinary GNU General Public - License has appeared, then you can specify that version instead if you wish.) - Do not make any other change in these notices. -

-

Once this change is made in a given copy, it is irreversible for that copy, so - the ordinary GNU General Public License applies to all subsequent copies and - derivative works made from that copy. -

-

This option is useful when you wish to copy part of the code of the Library into - a program that is not a library. -

-

4. You may copy and distribute the Library (or a portion or - derivative of it, under Section 2) in object code or executable form under the - terms of Sections 1 and 2 above provided that you accompany it with the - complete corresponding machine-readable source code, which must be distributed - under the terms of Sections 1 and 2 above on a medium customarily used for - software interchange. -

-

If distribution of object code is made by offering access to copy from a - designated place, then offering equivalent access to copy the source code from - the same place satisfies the requirement to distribute the source code, even - though third parties are not compelled to copy the source along with the object - code.

-

5. A program that contains no derivative of any portion of the - Library, but is designed to work with the Library by being compiled or linked - with it, is called a "work that uses the Library". Such a work, in isolation, - is not a derivative work of the Library, and therefore falls outside the scope - of this License. -

-

However, linking a "work that uses the Library" with the Library creates an - executable that is a derivative of the Library (because it contains portions of - the Library), rather than a "work that uses the library". The executable is - therefore covered by this License. Section 6 states terms for distribution of - such executables. -

-

When a "work that uses the Library" uses material from a header file that is - part of the Library, the object code for the work may be a derivative work of - the Library even though the source code is not. Whether this is true is - especially significant if the work can be linked without the Library, or if the - work is itself a library. The threshold for this to be true is not precisely - defined by law. -

-

If such an object file uses only numerical parameters, data structure layouts - and accessors, and small macros and small inline functions (ten lines or less - in length), then the use of the object file is unrestricted, regardless of - whether it is legally a derivative work. (Executables containing this object - code plus portions of the Library will still fall under Section 6.) -

-

Otherwise, if the work is a derivative of the Library, you may distribute the - object code for the work under the terms of Section 6. Any executables - containing that work also fall under Section 6, whether or not they are linked - directly with the Library itself. -

-

6. As an exception to the Sections above, you may also combine - or link a "work that uses the Library" with the Library to produce a work - containing portions of the Library, and distribute that work under terms of - your choice, provided that the terms permit modification of the work for the - customer's own use and reverse engineering for debugging such modifications. -

-

You must give prominent notice with each copy of the work that the Library is - used in it and that the Library and its use are covered by this License. You - must supply a copy of this License. If the work during execution displays - copyright notices, you must include the copyright notice for the Library among - them, as well as a reference directing the user to the copy of this License. - Also, you must do one of these things: -

-
-

a) Accompany the work with the complete corresponding machine-readable source - code for the Library including whatever changes were used in the work (which - must be distributed under Sections 1 and 2 above); and, if the work is an - executable linked with the Library, with the complete machine-readable "work - that uses the Library", as object code and/or source code, so that the user can - modify the Library and then relink to produce a modified executable containing - the modified Library. (It is understood that the user who changes the contents - of definitions files in the Library will not necessarily be able to recompile - the application to use the modified definitions.) -

-

b) Use a suitable shared library mechanism for linking with the Library. A - suitable mechanism is one that (1) uses at run time a copy of the library - already present on the user's computer system, rather than copying library - functions into the executable, and (2) will operate properly with a modified - version of the library, if the user installs one, as long as the modified - version is interface-compatible with the version that the work was made with. -

-

c) Accompany the work with a written offer, valid for at least three years, to - give the same user the materials specified in Subsection 6a, above, for a - charge no more than the cost of performing this distribution. -

-

d) If distribution of the work is made by offering access to copy from a - designated place, offer equivalent access to copy the above specified materials - from the same place. -

-

e) Verify that the user has already received a copy of these materials or that - you have already sent this user a copy.

-
-

For an executable, the required form of the "work that uses the Library" must - include any data and utility programs needed for reproducing the executable - from it. However, as a special exception, the materials to be distributed need - not include anything that is normally distributed (in either source or binary - form) with the major components (compiler, kernel, and so on) of the operating - system on which the executable runs, unless that component itself accompanies - the executable. -

-

It may happen that this requirement contradicts the license restrictions of - other proprietary libraries that do not normally accompany the operating - system. Such a contradiction means you cannot use both them and the Library - together in an executable that you distribute. -

-

7. You may place library facilities that are a work based on - the Library side-by-side in a single library together with other library - facilities not covered by this License, and distribute such a combined library, - provided that the separate distribution of the work based on the Library and of - the other library facilities is otherwise permitted, and provided that you do - these two things: -

-
-

a) Accompany the combined library with a copy of the same work based on the - Library, uncombined with any other library facilities. This must be distributed - under the terms of the Sections above. -

-

b) Give prominent notice with the combined library of the fact that part of it - is a work based on the Library, and explaining where to find the accompanying - uncombined form of the same work.

-
-

8. You may not copy, modify, sublicense, link with, or - distribute the Library except as expressly provided under this License. Any - attempt otherwise to copy, modify, sublicense, link with, or distribute the - Library is void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, from you under - this License will not have their licenses terminated so long as such parties - remain in full compliance. -

-

9. You are not required to accept this License, since you have - not signed it. However, nothing else grants you permission to modify or - distribute the Library or its derivative works. These actions are prohibited by - law if you do not accept this License. Therefore, by modifying or distributing - the Library (or any work based on the Library), you indicate your acceptance of - this License to do so, and all its terms and conditions for copying, - distributing or modifying the Library or works based on it. -

-

10. Each time you redistribute the Library (or any work based - on the Library), the recipient automatically receives a license from the - original licensor to copy, distribute, link with or modify the Library subject - to these terms and conditions. You may not impose any further restrictions on - the recipients' exercise of the rights granted herein. You are not responsible - for enforcing compliance by third parties with this License. -

-

11. If, as a consequence of a court judgment or allegation of - patent infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or otherwise) - that contradict the conditions of this License, they do not excuse you from the - conditions of this License. If you cannot distribute so as to satisfy - simultaneously your obligations under this License and any other pertinent - obligations, then as a consequence you may not distribute the Library at all. - For example, if a patent license would not permit royalty-free redistribution - of the Library by all those who receive copies directly or indirectly through - you, then the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Library. -

-

If any portion of this section is held invalid or unenforceable under any - particular circumstance, the balance of the section is intended to apply, and - the section as a whole is intended to apply in other circumstances. -

-

It is not the purpose of this section to induce you to infringe any patents or - other property right claims or to contest validity of any such claims; this - section has the sole purpose of protecting the integrity of the free software - distribution system which is implemented by public license practices. Many - people have made generous contributions to the wide range of software - distributed through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing to - distribute software through any other system and a licensee cannot impose that - choice. -

-

This section is intended to make thoroughly clear what is believed to be a - consequence of the rest of this License. -

-

12. If the distribution and/or use of the Library is restricted - in certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Library under this License may add an - explicit geographical distribution limitation excluding those countries, so - that distribution is permitted only in or among countries not thus excluded. In - such case, this License incorporates the limitation as if written in the body - of this License. -

-

13. The Free Software Foundation may publish revised and/or new - versions of the Lesser General Public License from time to time. Such new - versions will be similar in spirit to the present version, but may differ in - detail to address new problems or concerns.

-

Each version is given a distinguishing version number. If the Library specifies - a version number of this License which applies to it and "any later version", - you have the option of following the terms and conditions either of that - version or of any later version published by the Free Software Foundation. If - the Library does not specify a license version number, you may choose any - version ever published by the Free Software Foundation. -

-

14. If you wish to incorporate parts of the Library into other - free programs whose distribution conditions are incompatible with these, write - to the author to ask for permission. For software which is copyrighted by the - Free Software Foundation, write to the Free Software Foundation; we sometimes - make exceptions for this. Our decision will be guided by the two goals of - preserving the free status of all derivatives of our free software and of - promoting the sharing and reuse of software generally. -

-

NO WARRANTY -

-

15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO - WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT - WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR - IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE - QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE - DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR - CORRECTION. -

-

16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO - IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT - OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS - OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD - PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN - IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. -

-

END OF TERMS AND CONDITIONS

-
- - + + + + GNU Lesser General Public License + + + + +

GNU Lesser General Public License

+ +

Version 2.1, February 1999

+
+

Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite + 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute + verbatim copies of this license document, but changing it is not allowed.

+

[This is the first released version of the Lesser GPL. It also counts as the + successor of the GNU Library Public License, version 2, hence the version + number 2.1.]

+
+

Preamble

+

The licenses for most software are designed to take away your freedom to share + and change it. By contrast, the GNU General Public Licenses are intended to + guarantee your freedom to share and change free software--to make sure the + software is free for all its users. +

+

This license, the Lesser General Public License, applies to some specially + designated software packages--typically libraries--of the Free Software + Foundation and other authors who decide to use it. You can use it too, but we + suggest you first think carefully about whether this license or the ordinary + General Public License is the better strategy to use in any particular case, + based on the explanations below. +

+

When we speak of free software, we are referring to freedom of use, not price. + Our General Public Licenses are designed to make sure that you have the freedom + to distribute copies of free software (and charge for this service if you + wish); that you receive source code or can get it if you want it; that you can + change the software and use pieces of it in new free programs; and that you are + informed that you can do these things.

+

To protect your rights, we need to make restrictions that forbid distributors to + deny you these rights or to ask you to surrender these rights. These + restrictions translate to certain responsibilities for you if you distribute + copies of the library or if you modify it. +

+

For example, if you distribute copies of the library, whether gratis or for a + fee, you must give the recipients all the rights that we gave you. You must + make sure that they, too, receive or can get the source code. If you link other + code with the library, you must provide complete object files to the + recipients, so that they can relink them with the library after making changes + to the library and recompiling it. And you must show them these terms so they + know their rights. +

+

We protect your rights with a two-step method: (1) we copyright the library, and + (2) we offer you this license, which gives you legal permission to copy, + distribute and/or modify the library. +

+

To protect each distributor, we want to make it very clear that there is no + warranty for the free library. Also, if the library is modified by someone else + and passed on, the recipients should know that what they have is not the + original version, so that the original author's reputation will not be affected + by problems that might be introduced by others. +

+

Finally, software patents pose a constant threat to the existence of any free + program. We wish to make sure that a company cannot effectively restrict the + users of a free program by obtaining a restrictive license from a patent + holder. Therefore, we insist that any patent license obtained for a version of + the library must be consistent with the full freedom of use specified in this + license. +

+

Most GNU software, including some libraries, is covered by the ordinary GNU + General Public License. This license, the GNU Lesser General Public License, + applies to certain designated libraries, and is quite different from the + ordinary General Public License. We use this license for certain libraries in + order to permit linking those libraries into non-free programs. +

+

When a program is linked with a library, whether statically or using a shared + library, the combination of the two is legally speaking a combined work, a + derivative of the original library. The ordinary General Public License + therefore permits such linking only if the entire combination fits its criteria + of freedom. The Lesser General Public License permits more lax criteria for + linking other code with the library. +

+

We call this license the "Lesser" General Public License because it does Less to + protect the user's freedom than the ordinary General Public License. It also + provides other free software developers Less of an advantage over competing + non-free programs. These disadvantages are the reason we use the ordinary + General Public License for many libraries. However, the Lesser license provides + advantages in certain special circumstances. +

+

For example, on rare occasions, there may be a special need to encourage the + widest possible use of a certain library, so that it becomes a de-facto + standard. To achieve this, non-free programs must be allowed to use the + library. A more frequent case is that a free library does the same job as + widely used non-free libraries. In this case, there is little to gain by + limiting the free library to free software only, so we use the Lesser General + Public License. +

+

In other cases, permission to use a particular library in non-free programs + enables a greater number of people to use a large body of free software. For + example, permission to use the GNU C Library in non-free programs enables many + more people to use the whole GNU operating system, as well as its variant, the + GNU/Linux operating system. +

+

Although the Lesser General Public License is Less protective of the users' + freedom, it does ensure that the user of a program that is linked with the + Library has the freedom and the wherewithal to run that program using a + modified version of the Library. +

+

The precise terms and conditions for copying, distribution and modification + follow. Pay close attention to the difference between a "work based on the + library" and a "work that uses the library". The former contains code derived + from the library, whereas the latter must be combined with the library in order + to run. +

+

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

+

0. This License Agreement applies to any software library or + other program which contains a notice placed by the copyright holder or other + authorized party saying it may be distributed under the terms of this Lesser + General Public License (also called "this License"). Each licensee is addressed + as "you".

+

A "library" means a collection of software functions and/or data prepared so as + to be conveniently linked with application programs (which use some of those + functions and data) to form executables. +

+

The "Library", below, refers to any such software library or work which has been + distributed under these terms. A "work based on the Library" means either the + Library or any derivative work under copyright law: that is to say, a work + containing the Library or a portion of it, either verbatim or with + modifications and/or translated straightforwardly into another language. + (Hereinafter, translation is included without limitation in the term + "modification".) +

+

"Source code" for a work means the preferred form of the work for making + modifications to it. For a library, complete source code means all the source + code for all modules it contains, plus any associated interface definition + files, plus the scripts used to control compilation and installation of the + library.

+

Activities other than copying, distribution and modification are not covered by + this License; they are outside its scope. The act of running a program using + the Library is not restricted, and output from such a program is covered only + if its contents constitute a work based on the Library (independent of the use + of the Library in a tool for writing it). Whether that is true depends on what + the Library does and what the program that uses the Library does. +

+

1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate copyright + notice and disclaimer of warranty; keep intact all the notices that refer to + this License and to the absence of any warranty; and distribute a copy of this + License along with the Library. +

+

You may charge a fee for the physical act of transferring a copy, and you may at + your option offer warranty protection in exchange for a fee. +

+

2. You may modify your copy or copies of the Library or any + portion of it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 above, + provided that you also meet all of these conditions: +

+
+

a) The modified work must itself be a software library. +

+

b) You must cause the files modified to carry prominent notices stating that you + changed the files and the date of any change.

+

c) You must cause the whole of the work to be licensed at no charge to all third + parties under the terms of this License. +

+

d) If a facility in the modified Library refers to a function or a table of data + to be supplied by an application program that uses the facility, other than as + an argument passed when the facility is invoked, then you must make a good + faith effort to ensure that, in the event an application does not supply such + function or table, the facility still operates, and performs whatever part of + its purpose remains meaningful. +

+

(For example, a function in a library to compute square roots has a purpose that + is entirely well-defined independent of the application. Therefore, Subsection + 2d requires that any application-supplied function or table used by this + function must be optional: if the application does not supply it, the square + root function must still compute square roots.) +

+

These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Library, and can be reasonably + considered independent and separate works in themselves, then this License, and + its terms, do not apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a whole which is a + work based on the Library, the distribution of the whole must be on the terms + of this License, whose permissions for other licensees extend to the entire + whole, and thus to each and every part regardless of who wrote it. +

+

Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise the + right to control the distribution of derivative or collective works based on + the Library. +

+

In addition, mere aggregation of another work not based on the Library with the + Library (or with a work based on the Library) on a volume of a storage or + distribution medium does not bring the other work under the scope of this + License. +

+
+

3. You may opt to apply the terms of the ordinary GNU General + Public License instead of this License to a given copy of the Library. To do + this, you must alter all the notices that refer to this License, so that they + refer to the ordinary GNU General Public License, version 2, instead of to this + License. (If a newer version than version 2 of the ordinary GNU General Public + License has appeared, then you can specify that version instead if you wish.) + Do not make any other change in these notices. +

+

Once this change is made in a given copy, it is irreversible for that copy, so + the ordinary GNU General Public License applies to all subsequent copies and + derivative works made from that copy. +

+

This option is useful when you wish to copy part of the code of the Library into + a program that is not a library. +

+

4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable form under the + terms of Sections 1 and 2 above provided that you accompany it with the + complete corresponding machine-readable source code, which must be distributed + under the terms of Sections 1 and 2 above on a medium customarily used for + software interchange. +

+

If distribution of object code is made by offering access to copy from a + designated place, then offering equivalent access to copy the source code from + the same place satisfies the requirement to distribute the source code, even + though third parties are not compelled to copy the source along with the object + code.

+

5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled or linked + with it, is called a "work that uses the Library". Such a work, in isolation, + is not a derivative work of the Library, and therefore falls outside the scope + of this License. +

+

However, linking a "work that uses the Library" with the Library creates an + executable that is a derivative of the Library (because it contains portions of + the Library), rather than a "work that uses the library". The executable is + therefore covered by this License. Section 6 states terms for distribution of + such executables. +

+

When a "work that uses the Library" uses material from a header file that is + part of the Library, the object code for the work may be a derivative work of + the Library even though the source code is not. Whether this is true is + especially significant if the work can be linked without the Library, or if the + work is itself a library. The threshold for this to be true is not precisely + defined by law. +

+

If such an object file uses only numerical parameters, data structure layouts + and accessors, and small macros and small inline functions (ten lines or less + in length), then the use of the object file is unrestricted, regardless of + whether it is legally a derivative work. (Executables containing this object + code plus portions of the Library will still fall under Section 6.) +

+

Otherwise, if the work is a derivative of the Library, you may distribute the + object code for the work under the terms of Section 6. Any executables + containing that work also fall under Section 6, whether or not they are linked + directly with the Library itself. +

+

6. As an exception to the Sections above, you may also combine + or link a "work that uses the Library" with the Library to produce a work + containing portions of the Library, and distribute that work under terms of + your choice, provided that the terms permit modification of the work for the + customer's own use and reverse engineering for debugging such modifications. +

+

You must give prominent notice with each copy of the work that the Library is + used in it and that the Library and its use are covered by this License. You + must supply a copy of this License. If the work during execution displays + copyright notices, you must include the copyright notice for the Library among + them, as well as a reference directing the user to the copy of this License. + Also, you must do one of these things: +

+
+

a) Accompany the work with the complete corresponding machine-readable source + code for the Library including whatever changes were used in the work (which + must be distributed under Sections 1 and 2 above); and, if the work is an + executable linked with the Library, with the complete machine-readable "work + that uses the Library", as object code and/or source code, so that the user can + modify the Library and then relink to produce a modified executable containing + the modified Library. (It is understood that the user who changes the contents + of definitions files in the Library will not necessarily be able to recompile + the application to use the modified definitions.) +

+

b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the library + already present on the user's computer system, rather than copying library + functions into the executable, and (2) will operate properly with a modified + version of the library, if the user installs one, as long as the modified + version is interface-compatible with the version that the work was made with. +

+

c) Accompany the work with a written offer, valid for at least three years, to + give the same user the materials specified in Subsection 6a, above, for a + charge no more than the cost of performing this distribution. +

+

d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified materials + from the same place. +

+

e) Verify that the user has already received a copy of these materials or that + you have already sent this user a copy.

+
+

For an executable, the required form of the "work that uses the Library" must + include any data and utility programs needed for reproducing the executable + from it. However, as a special exception, the materials to be distributed need + not include anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the operating + system on which the executable runs, unless that component itself accompanies + the executable. +

+

It may happen that this requirement contradicts the license restrictions of + other proprietary libraries that do not normally accompany the operating + system. Such a contradiction means you cannot use both them and the Library + together in an executable that you distribute. +

+

7. You may place library facilities that are a work based on + the Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a combined library, + provided that the separate distribution of the work based on the Library and of + the other library facilities is otherwise permitted, and provided that you do + these two things: +

+
+

a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be distributed + under the terms of the Sections above. +

+

b) Give prominent notice with the combined library of the fact that part of it + is a work based on the Library, and explaining where to find the accompanying + uncombined form of the same work.

+
+

8. You may not copy, modify, sublicense, link with, or + distribute the Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or distribute the + Library is void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such parties + remain in full compliance. +

+

9. You are not required to accept this License, since you have + not signed it. However, nothing else grants you permission to modify or + distribute the Library or its derivative works. These actions are prohibited by + law if you do not accept this License. Therefore, by modifying or distributing + the Library (or any work based on the Library), you indicate your acceptance of + this License to do so, and all its terms and conditions for copying, + distributing or modifying the Library or works based on it. +

+

10. Each time you redistribute the Library (or any work based + on the Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the Library subject + to these terms and conditions. You may not impose any further restrictions on + the recipients' exercise of the rights granted herein. You are not responsible + for enforcing compliance by third parties with this License. +

+

11. If, as a consequence of a court judgment or allegation of + patent infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or otherwise) + that contradict the conditions of this License, they do not excuse you from the + conditions of this License. If you cannot distribute so as to satisfy + simultaneously your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the Library at all. + For example, if a patent license would not permit royalty-free redistribution + of the Library by all those who receive copies directly or indirectly through + you, then the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Library. +

+

If any portion of this section is held invalid or unenforceable under any + particular circumstance, the balance of the section is intended to apply, and + the section as a whole is intended to apply in other circumstances. +

+

It is not the purpose of this section to induce you to infringe any patents or + other property right claims or to contest validity of any such claims; this + section has the sole purpose of protecting the integrity of the free software + distribution system which is implemented by public license practices. Many + people have made generous contributions to the wide range of software + distributed through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing to + distribute software through any other system and a licensee cannot impose that + choice. +

+

This section is intended to make thoroughly clear what is believed to be a + consequence of the rest of this License. +

+

12. If the distribution and/or use of the Library is restricted + in certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Library under this License may add an + explicit geographical distribution limitation excluding those countries, so + that distribution is permitted only in or among countries not thus excluded. In + such case, this License incorporates the limitation as if written in the body + of this License. +

+

13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. Such new + versions will be similar in spirit to the present version, but may differ in + detail to address new problems or concerns.

+

Each version is given a distinguishing version number. If the Library specifies + a version number of this License which applies to it and "any later version", + you have the option of following the terms and conditions either of that + version or of any later version published by the Free Software Foundation. If + the Library does not specify a license version number, you may choose any + version ever published by the Free Software Foundation. +

+

14. If you wish to incorporate parts of the Library into other + free programs whose distribution conditions are incompatible with these, write + to the author to ask for permission. For software which is copyrighted by the + Free Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals of + preserving the free status of all derivatives of our free software and of + promoting the sharing and reuse of software generally. +

+

NO WARRANTY +

+

15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT + WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR + IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE + QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR + CORRECTION. +

+

16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO + IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT + OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS + OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN + IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGES. +

+

END OF TERMS AND CONDITIONS

+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_anchor.html b/htdocs/includes/fckeditor/editor/dialog/fck_anchor.html index dd05df3d5fa..33c73540be8 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_anchor.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_anchor.html @@ -1,98 +1,98 @@ - - - - - Anchor Properties - - - - - - - - - - -
- - - - -
- Anchor Name
- -
-
- + + + + + Anchor Properties + + + + + + + + + + +
+ + + + +
+ Anchor Name
+ +
+
+ \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_button.html b/htdocs/includes/fckeditor/editor/dialog/fck_button.html index 38285458116..60d41dbf5ca 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_button.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_button.html @@ -1,103 +1,103 @@ - - - - - Button Properties - - - - - - - - - - -
- - - - - - - - - - -
- Name
- -
- Text (Value)
- -
- Type
- -
-
- + + + + + Button Properties + + + + + + + + + + +
+ + + + + + + + + + +
+ Name
+ +
+ Text (Value)
+ +
+ Type
+ +
+
+ \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_checkbox.html b/htdocs/includes/fckeditor/editor/dialog/fck_checkbox.html index 7912df3bc77..2d31489867e 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_checkbox.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_checkbox.html @@ -1,103 +1,103 @@ - - - - - Checkbox Properties - - - - - - - - - - -
- - - - - - - - - - -
- Name
- -
- Value
- -
-
- - + + + + + Checkbox Properties + + + + + + + + + + +
+ + + + + + + + + + +
+ Name
+ +
+ Value
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_colorselector.html b/htdocs/includes/fckeditor/editor/dialog/fck_colorselector.html index ffa6df095d9..ad4dd2ae6a7 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_colorselector.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_colorselector.html @@ -1,167 +1,167 @@ - - - - - - - - - - - - - - -
- - - - - -
- -
-
- Highlight -
-
 
- Selected -
- -
- -
-
- - + + + + + + + + + + + + + + +
+ + + + + +
+ +
+
+ Highlight +
+
 
+ Selected +
+ +
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_docprops.html b/htdocs/includes/fckeditor/editor/dialog/fck_docprops.html index b60b9c4e65c..efdda6af9fa 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_docprops.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_docprops.html @@ -1,570 +1,570 @@ - - - - - Document Properties - - - - - - - - - - - - - -
-
- Page Title
- -
- - - - - - -
- Language Direction
- -
    - Language Code
- -
-
- - - - - - - - - - - - - - -
Character Set Encoding
- -
    - Other Character Set Encoding
- -
 
- Document Type Heading
- -
- Other Document Type Heading
- -
-
- -
- - - -
- + + + + + Document Properties + + + + + + + + + + + + + +
+
+ Page Title
+ +
+ + + + + + +
+ Language Direction
+ +
    + Language Code
+ +
+
+ + + + + + + + + + + + + + +
Character Set Encoding
+ +
    + Other Character Set Encoding
+ +
 
+ Document Type Heading
+ +
+ Other Document Type Heading
+ +
+
+ +
+ + + +
+ \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html b/htdocs/includes/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html index 8da93b66f4b..d4746c22a00 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html @@ -1,109 +1,109 @@ - - - - - Document Properties - Preview - - - - - - - - - - - - - - -
- Normal Text -
- Visited Link - - Active Link -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - + + + + + Document Properties - Preview + + + + + + + + + + + + + + +
+ Normal Text +
+ Visited Link + + Active Link +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_find.html b/htdocs/includes/fckeditor/editor/dialog/fck_find.html index 7af70c60fac..927dd6bb7c8 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_find.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_find.html @@ -1,177 +1,177 @@ - - - - - - - - - - - - - - - - - - - -
-   - - - - -
-   -
- -
- - + + + + + + + + + + + + + + + + + + + +
+   + + + + +
+   +
+ +
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_flash.html b/htdocs/includes/fckeditor/editor/dialog/fck_flash.html index 196e11fa2ec..4d83746d0c0 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_flash.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_flash.html @@ -1,142 +1,142 @@ - - - - - Flash Properties - - - - - - - -
- - - - - - - - - - -
- - - - - - - - -
URL -
-
-
- - - - - - -
- Width
- -
  - Height
- -
-
- - - - -
- - - - - - - -
Preview
-
-
-
- - - - + + + + + Flash Properties + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + +
URL +
+
+
+ + + + + + +
+ Width
+ +
  + Height
+ +
+
+ + + + +
+ + + + + + + +
Preview
+
+
+
+ + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash.js b/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash.js index 51a8c86ea9a..a60c0f33844 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash.js @@ -1,284 +1,284 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_flash.js - * Scripts related to the Flash dialog window (see fck_flash.html). - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -var oEditor = window.parent.InnerDialogLoaded() ; -var FCK = oEditor.FCK ; -var FCKLang = oEditor.FCKLang ; -var FCKConfig = oEditor.FCKConfig ; - -//#### Dialog Tabs - -// Set the dialog tabs. -window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ; - -if ( FCKConfig.FlashUpload ) - window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; - -if ( !FCKConfig.FlashDlgHideAdvanced ) - window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ; - -// Function called when a dialog tag is selected. -function OnDialogTabChange( tabCode ) -{ - ShowE('divInfo' , ( tabCode == 'Info' ) ) ; - ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; - ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; -} - -// Get the selected flash embed (if available). -var oFakeImage = FCK.Selection.GetSelectedElement() ; -var oEmbed ; - -if ( oFakeImage ) -{ - if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') ) - oEmbed = FCK.GetRealElement( oFakeImage ) ; - else - oFakeImage = null ; -} - -window.onload = function() -{ - // Translate the dialog box texts. - oEditor.FCKLanguageManager.TranslatePage(document) ; - - // Load the selected element information (if any). - LoadSelection() ; - - // Show/Hide the "Browse Server" button. - GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ; - - // Set the actual uploader URL. - if ( FCKConfig.FlashUpload ) - GetE('frmUpload').action = FCKConfig.FlashUploadURL ; - - window.parent.SetAutoSize( true ) ; - - // Activate the "OK" button. - window.parent.SetOkButton( true ) ; -} - -function LoadSelection() -{ - if ( ! oEmbed ) return ; - - var sUrl = GetAttribute( oEmbed, 'src', '' ) ; - - GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ; - GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ; - GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ; - - // Get Advances Attributes - GetE('txtAttId').value = oEmbed.id ; - GetE('chkAutoPlay').checked = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ; - GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ; - GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ; - GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ; - - GetE('txtAttTitle').value = oEmbed.title ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - { - GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ; - GetE('txtAttStyle').value = oEmbed.style.cssText ; - } - else - { - GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ; - GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ; - } - - UpdatePreview() ; -} - -//#### The OK button was hit. -function Ok() -{ - if ( GetE('txtUrl').value.length == 0 ) - { - window.parent.SetSelectedTab( 'Info' ) ; - GetE('txtUrl').focus() ; - - alert( oEditor.FCKLang.DlgAlertUrl ) ; - - return false ; - } - - if ( !oEmbed ) - { - oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ; - oFakeImage = null ; - } - UpdateEmbed( oEmbed ) ; - - if ( !oFakeImage ) - { - oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ; - oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ; - oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; - } - else - oEditor.FCKUndo.SaveUndoStep() ; - - oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ; - - return true ; -} - -function UpdateEmbed( e ) -{ - SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ; - SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ; - - e.src = GetE('txtUrl').value ; - SetAttribute( e, "width" , GetE('txtWidth').value ) ; - SetAttribute( e, "height", GetE('txtHeight').value ) ; - - // Advances Attributes - - SetAttribute( e, 'id' , GetE('txtAttId').value ) ; - SetAttribute( e, 'scale', GetE('cmbScale').value ) ; - - SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ; - SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ; - SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ; - - SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - { - SetAttribute( e, 'className', GetE('txtAttClasses').value ) ; - e.style.cssText = GetE('txtAttStyle').value ; - } - else - { - SetAttribute( e, 'class', GetE('txtAttClasses').value ) ; - SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; - } -} - -var ePreview ; - -function SetPreviewElement( previewEl ) -{ - ePreview = previewEl ; - - if ( GetE('txtUrl').value.length > 0 ) - UpdatePreview() ; -} - -function UpdatePreview() -{ - if ( !ePreview ) - return ; - - while ( ePreview.firstChild ) - ePreview.removeChild( ePreview.firstChild ) ; - - if ( GetE('txtUrl').value.length == 0 ) - ePreview.innerHTML = ' ' ; - else - { - var oDoc = ePreview.ownerDocument || ePreview.document ; - var e = oDoc.createElement( 'EMBED' ) ; - - e.src = GetE('txtUrl').value ; - e.type = 'application/x-shockwave-flash' ; - e.width = '100%' ; - e.height = '100%' ; - - ePreview.appendChild( e ) ; - } -} - -// - -function BrowseServer() -{ - OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ; -} - -function SetUrl( url, width, height ) -{ - GetE('txtUrl').value = url ; - - if ( width ) - GetE('txtWidth').value = width ; - - if ( height ) - GetE('txtHeight').value = height ; - - UpdatePreview() ; - - window.parent.SetSelectedTab( 'Info' ) ; -} - -function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) -{ - switch ( errorNumber ) - { - case 0 : // No errors - alert( 'Your file has been successfully uploaded' ) ; - break ; - case 1 : // Custom error - alert( customMsg ) ; - return ; - case 101 : // Custom warning - alert( customMsg ) ; - break ; - case 201 : - alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; - break ; - case 202 : - alert( 'Invalid file type' ) ; - return ; - case 203 : - alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; - return ; - default : - alert( 'Error on file upload. Error number: ' + errorNumber ) ; - return ; - } - - SetUrl( fileUrl ) ; - GetE('frmUpload').reset() ; -} - -var oUploadAllowedExtRegex = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ; -var oUploadDeniedExtRegex = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ; - -function CheckUpload() -{ - var sFile = GetE('txtUploadFile').value ; - - if ( sFile.length == 0 ) - { - alert( 'Please select a file to upload' ) ; - return false ; - } - - if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || - ( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) - { - OnUploadCompleted( 202 ) ; - return false ; - } - - return true ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_flash.js + * Scripts related to the Flash dialog window (see fck_flash.html). + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +var oEditor = window.parent.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; + +//#### Dialog Tabs + +// Set the dialog tabs. +window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ; + +if ( FCKConfig.FlashUpload ) + window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; + +if ( !FCKConfig.FlashDlgHideAdvanced ) + window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; +} + +// Get the selected flash embed (if available). +var oFakeImage = FCK.Selection.GetSelectedElement() ; +var oEmbed ; + +if ( oFakeImage ) +{ + if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') ) + oEmbed = FCK.GetRealElement( oFakeImage ) ; + else + oFakeImage = null ; +} + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + // Load the selected element information (if any). + LoadSelection() ; + + // Show/Hide the "Browse Server" button. + GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ; + + // Set the actual uploader URL. + if ( FCKConfig.FlashUpload ) + GetE('frmUpload').action = FCKConfig.FlashUploadURL ; + + window.parent.SetAutoSize( true ) ; + + // Activate the "OK" button. + window.parent.SetOkButton( true ) ; +} + +function LoadSelection() +{ + if ( ! oEmbed ) return ; + + var sUrl = GetAttribute( oEmbed, 'src', '' ) ; + + GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ; + GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ; + GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ; + + // Get Advances Attributes + GetE('txtAttId').value = oEmbed.id ; + GetE('chkAutoPlay').checked = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ; + GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ; + GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ; + GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ; + + GetE('txtAttTitle').value = oEmbed.title ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ; + GetE('txtAttStyle').value = oEmbed.style.cssText ; + } + else + { + GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ; + GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) ; + } + + UpdatePreview() ; +} + +//#### The OK button was hit. +function Ok() +{ + if ( GetE('txtUrl').value.length == 0 ) + { + window.parent.SetSelectedTab( 'Info' ) ; + GetE('txtUrl').focus() ; + + alert( oEditor.FCKLang.DlgAlertUrl ) ; + + return false ; + } + + if ( !oEmbed ) + { + oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ; + oFakeImage = null ; + } + UpdateEmbed( oEmbed ) ; + + if ( !oFakeImage ) + { + oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ; + oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ; + oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; + } + else + oEditor.FCKUndo.SaveUndoStep() ; + + oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ; + + return true ; +} + +function UpdateEmbed( e ) +{ + SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ; + SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ; + + e.src = GetE('txtUrl').value ; + SetAttribute( e, "width" , GetE('txtWidth').value ) ; + SetAttribute( e, "height", GetE('txtHeight').value ) ; + + // Advances Attributes + + SetAttribute( e, 'id' , GetE('txtAttId').value ) ; + SetAttribute( e, 'scale', GetE('cmbScale').value ) ; + + SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ; + SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ; + SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ; + + SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + SetAttribute( e, 'className', GetE('txtAttClasses').value ) ; + e.style.cssText = GetE('txtAttStyle').value ; + } + else + { + SetAttribute( e, 'class', GetE('txtAttClasses').value ) ; + SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; + } +} + +var ePreview ; + +function SetPreviewElement( previewEl ) +{ + ePreview = previewEl ; + + if ( GetE('txtUrl').value.length > 0 ) + UpdatePreview() ; +} + +function UpdatePreview() +{ + if ( !ePreview ) + return ; + + while ( ePreview.firstChild ) + ePreview.removeChild( ePreview.firstChild ) ; + + if ( GetE('txtUrl').value.length == 0 ) + ePreview.innerHTML = ' ' ; + else + { + var oDoc = ePreview.ownerDocument || ePreview.document ; + var e = oDoc.createElement( 'EMBED' ) ; + + e.src = GetE('txtUrl').value ; + e.type = 'application/x-shockwave-flash' ; + e.width = '100%' ; + e.height = '100%' ; + + ePreview.appendChild( e ) ; + } +} + +// + +function BrowseServer() +{ + OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ; +} + +function SetUrl( url, width, height ) +{ + GetE('txtUrl').value = url ; + + if ( width ) + GetE('txtWidth').value = width ; + + if ( height ) + GetE('txtHeight').value = height ; + + UpdatePreview() ; + + window.parent.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + return true ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html b/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html index 6a1dc65e3dd..caa8d87bbc7 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html @@ -1,42 +1,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_form.html b/htdocs/includes/fckeditor/editor/dialog/fck_form.html index 978c2a7b0a0..28664c46268 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_form.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_form.html @@ -1,101 +1,101 @@ - - - - - Checkbox Properties - - - - - - - - - - -
- - - - - - - - - - -
- Name
- -
- Action
- -
- Method
- -
-
- - + + + + + Checkbox Properties + + + + + + + + + + +
+ + + + + + + + + + +
+ Name
+ +
+ Action
+ +
+ Method
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_hiddenfield.html b/htdocs/includes/fckeditor/editor/dialog/fck_hiddenfield.html index 49391a44e27..bdcf0e82705 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_hiddenfield.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_hiddenfield.html @@ -1,91 +1,91 @@ - - - - - Hidden Field Properties - - - - - - - - - - -
- - - - - - - -
- Name
- -
- Value
- -
-
- - + + + + + Hidden Field Properties + + + + + + + + + + +
+ + + + + + + +
+ Name
+ +
+ Value
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_image.html b/htdocs/includes/fckeditor/editor/dialog/fck_image.html index 9af0d13bab9..bd082162b0e 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_image.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_image.html @@ -1,225 +1,248 @@ - - - - - Image Properties - - - - - - - -
- - - - - - - - - - -
- - - - - - - - -
- URL -
- -
-
- Short Description
-
-
- - - - - - -
-
- - - - - - - - - - -
Width  - -
-
-
Height  -
-
- - - - - - - - - - - - - - - - - -
Border  -
HSpace  -
VSpace  -
Align  -
-
    - - - - - - - -
Preview
- -
-
-
-
- - - - - + + + + + Image Properties + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + +
+ URL +
+ +
+
+ Short Description
+
+
+ + + + + + +
+
+ + + + + + + + + + + +
+ Width  + +
+
+
+
+
+
+ Height  +
+
+ + + + + + + + + + + + + + + + + +
+ Border  +
+ HSpace  +
+ VSpace  +
+ Align  + +
+
+     + + + + + + + +
+ Preview
+ +
+
+
+
+ + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image.js b/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image.js index 7d9a5d166ba..efe220eca5f 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image.js @@ -1,475 +1,481 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_image.js - * Scripts related to the Image dialog window (see fck_image.html). - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -var oEditor = window.parent.InnerDialogLoaded() ; -var FCK = oEditor.FCK ; -var FCKLang = oEditor.FCKLang ; -var FCKConfig = oEditor.FCKConfig ; -var FCKDebug = oEditor.FCKDebug ; - -var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ; - -//#### Dialog Tabs - -// Set the dialog tabs. -window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ; - -if ( !bImageButton && !FCKConfig.ImageDlgHideLink ) - window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ; - -if ( FCKConfig.ImageUpload ) - window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; - -if ( !FCKConfig.ImageDlgHideAdvanced ) - window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; - -// Function called when a dialog tag is selected. -function OnDialogTabChange( tabCode ) -{ - ShowE('divInfo' , ( tabCode == 'Info' ) ) ; - ShowE('divLink' , ( tabCode == 'Link' ) ) ; - ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; - ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; -} - -// Get the selected image (if available). -var oImage = FCK.Selection.GetSelectedElement() ; - -if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) ) - oImage = null ; - -// Get the active link. -var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; - -var oImageOriginal ; - -function UpdateOriginal( resetSize ) -{ - if ( !eImgPreview ) - return ; - - oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ; - - if ( resetSize ) - { - oImageOriginal.onload = function() - { - this.onload = null ; - ResetSizes() ; - } - } - - oImageOriginal.src = eImgPreview.src ; -} - -var bPreviewInitialized ; - -window.onload = function() -{ - // Translate the dialog box texts. - oEditor.FCKLanguageManager.TranslatePage(document) ; - - GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ; - GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ; - - // Load the selected element information (if any). - LoadSelection() ; - - // Show/Hide the "Browse Server" button. - GetE('tdBrowse').style.display = FCKConfig.ImageBrowser ? '' : 'none' ; - GetE('divLnkBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; - - UpdateOriginal() ; - - // Set the actual uploader URL. - if ( FCKConfig.ImageUpload ) - GetE('frmUpload').action = FCKConfig.ImageUploadURL ; - - window.parent.SetAutoSize( true ) ; - - // Activate the "OK" button. - window.parent.SetOkButton( true ) ; -} - -function LoadSelection() -{ - if ( ! oImage ) return ; - - var sUrl = GetAttribute( oImage, '_fcksavedurl', '' ) ; - if ( sUrl.length == 0 ) - sUrl = GetAttribute( oImage, 'src', '' ) ; - - // TODO: Wait stable version and remove the following commented lines. -// if ( sUrl.startsWith( FCK.BaseUrl ) ) -// sUrl = sUrl.remove( 0, FCK.BaseUrl.length ) ; - - GetE('txtUrl').value = sUrl ; - GetE('txtAlt').value = GetAttribute( oImage, 'alt', '' ) ; - GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ; - GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ; - GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ; - GetE('cmbAlign').value = GetAttribute( oImage, 'align', '' ) ; - - var iWidth, iHeight ; - - var regexSize = /^\s*(\d+)px\s*$/i ; - - if ( oImage.style.width ) - { - var aMatch = oImage.style.width.match( regexSize ) ; - if ( aMatch ) - { - iWidth = aMatch[1] ; - oImage.style.width = '' ; - } - } - - if ( oImage.style.height ) - { - var aMatch = oImage.style.height.match( regexSize ) ; - if ( aMatch ) - { - iHeight = aMatch[1] ; - oImage.style.height = '' ; - } - } - - GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ; - GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ; - - // Get Advances Attributes - GetE('txtAttId').value = oImage.id ; - GetE('cmbAttLangDir').value = oImage.dir ; - GetE('txtAttLangCode').value = oImage.lang ; - GetE('txtAttTitle').value = oImage.title ; - GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ; - GetE('txtLongDesc').value = oImage.longDesc ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - GetE('txtAttStyle').value = oImage.style.cssText ; - else - GetE('txtAttStyle').value = oImage.getAttribute('style',2) ; - - if ( oLink ) - { - var sUrl = GetAttribute( oLink, '_fcksavedurl', '' ) ; - if ( sUrl.length == 0 ) - sUrl = oLink.getAttribute('href',2) ; - - GetE('txtLnkUrl').value = sUrl ; - GetE('cmbLnkTarget').value = oLink.target ; - } - - UpdatePreview() ; -} - -//#### The OK button was hit. -function Ok() -{ - if ( GetE('txtUrl').value.length == 0 ) - { - window.parent.SetSelectedTab( 'Info' ) ; - GetE('txtUrl').focus() ; - - alert( FCKLang.DlgImgAlertUrl ) ; - - return false ; - } - - var bHasImage = ( oImage != null ) ; - - if ( bHasImage && bImageButton && oImage.tagName == 'IMG' ) - { - if ( confirm( 'Do you want to transform the selected image on a image button?' ) ) - oImage = null ; - } - else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' ) - { - if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) ) - oImage = null ; - } - - if ( !bHasImage ) - { - if ( bImageButton ) - { - oImage = FCK.EditorDocument.createElement( 'INPUT' ) ; - oImage.type = 'image' ; - oImage = FCK.InsertElementAndGetIt( oImage ) ; - } - else - oImage = FCK.CreateElement( 'IMG' ) ; - } - else - oEditor.FCKUndo.SaveUndoStep() ; - - UpdateImage( oImage ) ; - - var sLnkUrl = GetE('txtLnkUrl').value.trim() ; - - if ( sLnkUrl.length == 0 ) - { - if ( oLink ) - FCK.ExecuteNamedCommand( 'Unlink' ) ; - } - else - { - if ( oLink ) // Modifying an existent link. - oLink.href = sLnkUrl ; - else // Creating a new link. - { - if ( !bHasImage ) - oEditor.FCKSelection.SelectNode( oImage ) ; - - oLink = oEditor.FCK.CreateLink( sLnkUrl ) ; - - if ( !bHasImage ) - { - oEditor.FCKSelection.SelectNode( oLink ) ; - oEditor.FCKSelection.Collapse( false ) ; - } - } - - SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ; - SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ; - } - - return true ; -} - -function UpdateImage( e, skipId ) -{ - e.src = GetE('txtUrl').value ; - SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ; - SetAttribute( e, "alt" , GetE('txtAlt').value ) ; - SetAttribute( e, "width" , GetE('txtWidth').value ) ; - SetAttribute( e, "height", GetE('txtHeight').value ) ; - SetAttribute( e, "vspace", GetE('txtVSpace').value ) ; - SetAttribute( e, "hspace", GetE('txtHSpace').value ) ; - SetAttribute( e, "border", GetE('txtBorder').value ) ; - SetAttribute( e, "align" , GetE('cmbAlign').value ) ; - - // Advances Attributes - - if ( ! skipId ) - SetAttribute( e, 'id', GetE('txtAttId').value ) ; - - SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ; - SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ; - SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; - SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ; - SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - e.style.cssText = GetE('txtAttStyle').value ; - else - SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; -} - -var eImgPreview ; -var eImgPreviewLink ; - -function SetPreviewElements( imageElement, linkElement ) -{ - eImgPreview = imageElement ; - eImgPreviewLink = linkElement ; - - UpdatePreview() ; - UpdateOriginal() ; - - bPreviewInitialized = true ; -} - -function UpdatePreview() -{ - if ( !eImgPreview || !eImgPreviewLink ) - return ; - - if ( GetE('txtUrl').value.length == 0 ) - eImgPreviewLink.style.display = 'none' ; - else - { - UpdateImage( eImgPreview, true ) ; - - if ( GetE('txtLnkUrl').value.trim().length > 0 ) - eImgPreviewLink.href = 'javascript:void(null);' ; - else - SetAttribute( eImgPreviewLink, 'href', '' ) ; - - eImgPreviewLink.style.display = '' ; - } -} - -var bLockRatio = true ; - -function SwitchLock( lockButton ) -{ - bLockRatio = !bLockRatio ; - lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ; - lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ; - - if ( bLockRatio ) - { - if ( GetE('txtWidth').value.length > 0 ) - OnSizeChanged( 'Width', GetE('txtWidth').value ) ; - else - OnSizeChanged( 'Height', GetE('txtHeight').value ) ; - } -} - -// Fired when the width or height input texts change -function OnSizeChanged( dimension, value ) -{ - // Verifies if the aspect ration has to be mantained - if ( oImageOriginal && bLockRatio ) - { - var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ; - - if ( value.length == 0 || isNaN( value ) ) - { - e.value = '' ; - return ; - } - - if ( dimension == 'Width' ) - value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ; - else - value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ; - - if ( !isNaN( value ) ) - e.value = value ; - } - - UpdatePreview() ; -} - -// Fired when the Reset Size button is clicked -function ResetSizes() -{ - if ( ! oImageOriginal ) return ; - - GetE('txtWidth').value = oImageOriginal.width ; - GetE('txtHeight').value = oImageOriginal.height ; - - UpdatePreview() ; -} - -function BrowseServer() -{ - OpenServerBrowser( - 'Image', - FCKConfig.ImageBrowserURL, - FCKConfig.ImageBrowserWindowWidth, - FCKConfig.ImageBrowserWindowHeight ) ; -} - -function LnkBrowseServer() -{ - OpenServerBrowser( - 'Link', - FCKConfig.LinkBrowserURL, - FCKConfig.LinkBrowserWindowWidth, - FCKConfig.LinkBrowserWindowHeight ) ; -} - -function OpenServerBrowser( type, url, width, height ) -{ - sActualBrowser = type ; - OpenFileBrowser( url, width, height ) ; -} - -var sActualBrowser ; - -function SetUrl( url, width, height, alt ) -{ - if ( sActualBrowser == 'Link' ) - { - GetE('txtLnkUrl').value = url ; - UpdatePreview() ; - } - else - { - GetE('txtUrl').value = url ; - GetE('txtWidth').value = width ? width : '' ; - GetE('txtHeight').value = height ? height : '' ; - - if ( alt ) - GetE('txtAlt').value = alt; - - UpdatePreview() ; - UpdateOriginal( true ) ; - } - - window.parent.SetSelectedTab( 'Info' ) ; -} - -function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) -{ - switch ( errorNumber ) - { - case 0 : // No errors - alert( 'Your file has been successfully uploaded' ) ; - break ; - case 1 : // Custom error - alert( customMsg ) ; - return ; - case 101 : // Custom warning - alert( customMsg ) ; - break ; - case 201 : - alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; - break ; - case 202 : - alert( 'Invalid file type' ) ; - return ; - case 203 : - alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; - return ; - default : - alert( 'Error on file upload. Error number: ' + errorNumber ) ; - return ; - } - - sActualBrowser = '' - SetUrl( fileUrl ) ; - GetE('frmUpload').reset() ; -} - -var oUploadAllowedExtRegex = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ; -var oUploadDeniedExtRegex = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ; - -function CheckUpload() -{ - var sFile = GetE('txtUploadFile').value ; - - if ( sFile.length == 0 ) - { - alert( 'Please select a file to upload' ) ; - return false ; - } - - if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || - ( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) - { - OnUploadCompleted( 202 ) ; - return false ; - } - - return true ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_image.js + * Scripts related to the Image dialog window (see fck_image.html). + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +var oEditor = window.parent.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKDebug = oEditor.FCKDebug ; + +var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ; + +//#### Dialog Tabs + +// Set the dialog tabs. +window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ; + +if ( !bImageButton && !FCKConfig.ImageDlgHideLink ) + window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ; + +if ( FCKConfig.ImageUpload ) + window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ; + +if ( !FCKConfig.ImageDlgHideAdvanced ) + window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divLink' , ( tabCode == 'Link' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ; +} + +// Get the selected image (if available). +var oImage = FCK.Selection.GetSelectedElement() ; + +if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) ) + oImage = null ; + +// Get the active link. +var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; + +var oImageOriginal ; + +function UpdateOriginal( resetSize ) +{ + if ( !eImgPreview ) + return ; + + if ( GetE('txtUrl').value.length == 0 ) + { + oImageOriginal = null ; + return ; + } + + oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ; + + if ( resetSize ) + { + oImageOriginal.onload = function() + { + this.onload = null ; + ResetSizes() ; + } + } + + oImageOriginal.src = eImgPreview.src ; +} + +var bPreviewInitialized ; + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ; + GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ; + + // Load the selected element information (if any). + LoadSelection() ; + + // Show/Hide the "Browse Server" button. + GetE('tdBrowse').style.display = FCKConfig.ImageBrowser ? '' : 'none' ; + GetE('divLnkBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; + + UpdateOriginal() ; + + // Set the actual uploader URL. + if ( FCKConfig.ImageUpload ) + GetE('frmUpload').action = FCKConfig.ImageUploadURL ; + + window.parent.SetAutoSize( true ) ; + + // Activate the "OK" button. + window.parent.SetOkButton( true ) ; +} + +function LoadSelection() +{ + if ( ! oImage ) return ; + + var sUrl = GetAttribute( oImage, '_fcksavedurl', '' ) ; + if ( sUrl.length == 0 ) + sUrl = GetAttribute( oImage, 'src', '' ) ; + + // TODO: Wait stable version and remove the following commented lines. +// if ( sUrl.startsWith( FCK.BaseUrl ) ) +// sUrl = sUrl.remove( 0, FCK.BaseUrl.length ) ; + + GetE('txtUrl').value = sUrl ; + GetE('txtAlt').value = GetAttribute( oImage, 'alt', '' ) ; + GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ; + GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ; + GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ; + GetE('cmbAlign').value = GetAttribute( oImage, 'align', '' ) ; + + var iWidth, iHeight ; + + var regexSize = /^\s*(\d+)px\s*$/i ; + + if ( oImage.style.width ) + { + var aMatch = oImage.style.width.match( regexSize ) ; + if ( aMatch ) + { + iWidth = aMatch[1] ; + oImage.style.width = '' ; + } + } + + if ( oImage.style.height ) + { + var aMatch = oImage.style.height.match( regexSize ) ; + if ( aMatch ) + { + iHeight = aMatch[1] ; + oImage.style.height = '' ; + } + } + + GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ; + GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ; + + // Get Advances Attributes + GetE('txtAttId').value = oImage.id ; + GetE('cmbAttLangDir').value = oImage.dir ; + GetE('txtAttLangCode').value = oImage.lang ; + GetE('txtAttTitle').value = oImage.title ; + GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ; + GetE('txtLongDesc').value = oImage.longDesc ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + GetE('txtAttStyle').value = oImage.style.cssText ; + else + GetE('txtAttStyle').value = oImage.getAttribute('style',2) ; + + if ( oLink ) + { + var sUrl = GetAttribute( oLink, '_fcksavedurl', '' ) ; + if ( sUrl.length == 0 ) + sUrl = oLink.getAttribute('href',2) ; + + GetE('txtLnkUrl').value = sUrl ; + GetE('cmbLnkTarget').value = oLink.target ; + } + + UpdatePreview() ; +} + +//#### The OK button was hit. +function Ok() +{ + if ( GetE('txtUrl').value.length == 0 ) + { + window.parent.SetSelectedTab( 'Info' ) ; + GetE('txtUrl').focus() ; + + alert( FCKLang.DlgImgAlertUrl ) ; + + return false ; + } + + var bHasImage = ( oImage != null ) ; + + if ( bHasImage && bImageButton && oImage.tagName == 'IMG' ) + { + if ( confirm( 'Do you want to transform the selected image on a image button?' ) ) + oImage = null ; + } + else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' ) + { + if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) ) + oImage = null ; + } + + if ( !bHasImage ) + { + if ( bImageButton ) + { + oImage = FCK.EditorDocument.createElement( 'INPUT' ) ; + oImage.type = 'image' ; + oImage = FCK.InsertElementAndGetIt( oImage ) ; + } + else + oImage = FCK.CreateElement( 'IMG' ) ; + } + else + oEditor.FCKUndo.SaveUndoStep() ; + + UpdateImage( oImage ) ; + + var sLnkUrl = GetE('txtLnkUrl').value.trim() ; + + if ( sLnkUrl.length == 0 ) + { + if ( oLink ) + FCK.ExecuteNamedCommand( 'Unlink' ) ; + } + else + { + if ( oLink ) // Modifying an existent link. + oLink.href = sLnkUrl ; + else // Creating a new link. + { + if ( !bHasImage ) + oEditor.FCKSelection.SelectNode( oImage ) ; + + oLink = oEditor.FCK.CreateLink( sLnkUrl ) ; + + if ( !bHasImage ) + { + oEditor.FCKSelection.SelectNode( oLink ) ; + oEditor.FCKSelection.Collapse( false ) ; + } + } + + SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ; + SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ; + } + + return true ; +} + +function UpdateImage( e, skipId ) +{ + e.src = GetE('txtUrl').value ; + SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ; + SetAttribute( e, "alt" , GetE('txtAlt').value ) ; + SetAttribute( e, "width" , GetE('txtWidth').value ) ; + SetAttribute( e, "height", GetE('txtHeight').value ) ; + SetAttribute( e, "vspace", GetE('txtVSpace').value ) ; + SetAttribute( e, "hspace", GetE('txtHSpace').value ) ; + SetAttribute( e, "border", GetE('txtBorder').value ) ; + SetAttribute( e, "align" , GetE('cmbAlign').value ) ; + + // Advances Attributes + + if ( ! skipId ) + SetAttribute( e, 'id', GetE('txtAttId').value ) ; + + SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ; + SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ; + SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ; + SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ; + SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + e.style.cssText = GetE('txtAttStyle').value ; + else + SetAttribute( e, 'style', GetE('txtAttStyle').value ) ; +} + +var eImgPreview ; +var eImgPreviewLink ; + +function SetPreviewElements( imageElement, linkElement ) +{ + eImgPreview = imageElement ; + eImgPreviewLink = linkElement ; + + UpdatePreview() ; + UpdateOriginal() ; + + bPreviewInitialized = true ; +} + +function UpdatePreview() +{ + if ( !eImgPreview || !eImgPreviewLink ) + return ; + + if ( GetE('txtUrl').value.length == 0 ) + eImgPreviewLink.style.display = 'none' ; + else + { + UpdateImage( eImgPreview, true ) ; + + if ( GetE('txtLnkUrl').value.trim().length > 0 ) + eImgPreviewLink.href = 'javascript:void(null);' ; + else + SetAttribute( eImgPreviewLink, 'href', '' ) ; + + eImgPreviewLink.style.display = '' ; + } +} + +var bLockRatio = true ; + +function SwitchLock( lockButton ) +{ + bLockRatio = !bLockRatio ; + lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ; + lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ; + + if ( bLockRatio ) + { + if ( GetE('txtWidth').value.length > 0 ) + OnSizeChanged( 'Width', GetE('txtWidth').value ) ; + else + OnSizeChanged( 'Height', GetE('txtHeight').value ) ; + } +} + +// Fired when the width or height input texts change +function OnSizeChanged( dimension, value ) +{ + // Verifies if the aspect ration has to be mantained + if ( oImageOriginal && bLockRatio ) + { + var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ; + + if ( value.length == 0 || isNaN( value ) ) + { + e.value = '' ; + return ; + } + + if ( dimension == 'Width' ) + value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ; + else + value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ; + + if ( !isNaN( value ) ) + e.value = value ; + } + + UpdatePreview() ; +} + +// Fired when the Reset Size button is clicked +function ResetSizes() +{ + if ( ! oImageOriginal ) return ; + + GetE('txtWidth').value = oImageOriginal.width ; + GetE('txtHeight').value = oImageOriginal.height ; + + UpdatePreview() ; +} + +function BrowseServer() +{ + OpenServerBrowser( + 'Image', + FCKConfig.ImageBrowserURL, + FCKConfig.ImageBrowserWindowWidth, + FCKConfig.ImageBrowserWindowHeight ) ; +} + +function LnkBrowseServer() +{ + OpenServerBrowser( + 'Link', + FCKConfig.LinkBrowserURL, + FCKConfig.LinkBrowserWindowWidth, + FCKConfig.LinkBrowserWindowHeight ) ; +} + +function OpenServerBrowser( type, url, width, height ) +{ + sActualBrowser = type ; + OpenFileBrowser( url, width, height ) ; +} + +var sActualBrowser ; + +function SetUrl( url, width, height, alt ) +{ + if ( sActualBrowser == 'Link' ) + { + GetE('txtLnkUrl').value = url ; + UpdatePreview() ; + } + else + { + GetE('txtUrl').value = url ; + GetE('txtWidth').value = width ? width : '' ; + GetE('txtHeight').value = height ? height : '' ; + + if ( alt ) + GetE('txtAlt').value = alt; + + UpdatePreview() ; + UpdateOriginal( true ) ; + } + + window.parent.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + sActualBrowser = '' + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + return true ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image_preview.html b/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image_preview.html index 13197775126..809efb650d2 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image_preview.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_image/fck_image_preview.html @@ -1,47 +1,61 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + Lorem + ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. + Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. + Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis + euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce + mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. + Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque + egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, + in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut + placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy + metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, + ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris + non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas + elementum. Nunc imperdiet gravida mauris. + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_link.html b/htdocs/includes/fckeditor/editor/dialog/fck_link.html index 1d68c1e7fa4..6eac6a175b1 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_link.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_link.html @@ -1,289 +1,289 @@ - - - - - Link Properties - - - - - - - - - - - - + + + + + Link Properties + + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_link/fck_link.js b/htdocs/includes/fckeditor/editor/dialog/fck_link/fck_link.js index dcb6d5463dc..adffbc700e5 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_link/fck_link.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_link/fck_link.js @@ -1,625 +1,625 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_link.js - * Scripts related to the Link dialog window (see fck_link.html). - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - * Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de) - */ - -var oEditor = window.parent.InnerDialogLoaded() ; -var FCK = oEditor.FCK ; -var FCKLang = oEditor.FCKLang ; -var FCKConfig = oEditor.FCKConfig ; - -//#### Dialog Tabs - -// Set the dialog tabs. -window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ; - -if ( !FCKConfig.LinkDlgHideTarget ) - window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ; - -if ( FCKConfig.LinkUpload ) - window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ; - -if ( !FCKConfig.LinkDlgHideAdvanced ) - window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; - -// Function called when a dialog tag is selected. -function OnDialogTabChange( tabCode ) -{ - ShowE('divInfo' , ( tabCode == 'Info' ) ) ; - ShowE('divTarget' , ( tabCode == 'Target' ) ) ; - ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; - ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ; - - window.parent.SetAutoSize( true ) ; -} - -//#### Regular Expressions library. -var oRegex = new Object() ; - -oRegex.UriProtocol = new RegExp('') ; -oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ; - -oRegex.UrlOnChangeProtocol = new RegExp('') ; -oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ; - -oRegex.UrlOnChangeTestOther = new RegExp('') ; -//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ; -oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ; - -oRegex.ReserveTarget = new RegExp('') ; -oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ; - -oRegex.PopupUri = new RegExp('') ; -oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ; - -oRegex.PopupFeatures = new RegExp('') ; -oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ; - -//#### Parser Functions - -var oParser = new Object() ; - -oParser.ParseEMailUrl = function( emailUrl ) -{ - // Initializes the EMailInfo object. - var oEMailInfo = new Object() ; - oEMailInfo.Address = '' ; - oEMailInfo.Subject = '' ; - oEMailInfo.Body = '' ; - - var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; - if ( oParts ) - { - // Set the e-mail address. - oEMailInfo.Address = oParts[1] ; - - // Look for the optional e-mail parameters. - if ( oParts[2] ) - { - var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; - if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ; - - oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; - if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ; - } - } - - return oEMailInfo ; -} - -oParser.CreateEMailUri = function( address, subject, body ) -{ - var sBaseUri = 'mailto:' + address ; - - var sParams = '' ; - - if ( subject.length > 0 ) - sParams = '?subject=' + escape( subject ) ; - - if ( body.length > 0 ) - { - sParams += ( sParams.length == 0 ? '?' : '&' ) ; - sParams += 'body=' + escape( body ) ; - } - - return sBaseUri + sParams ; -} - -//#### Initialization Code - -// oLink: The actual selected link in the editor. -var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; -if ( oLink ) - FCK.Selection.SelectNode( oLink ) ; - -window.onload = function() -{ - // Translate the dialog box texts. - oEditor.FCKLanguageManager.TranslatePage(document) ; - - // Fill the Anchor Names and Ids combos. - LoadAnchorNamesAndIds() ; - - // Load the selected link information (if any). - LoadSelection() ; - - // Update the dialog box. - SetLinkType( GetE('cmbLinkType').value ) ; - - // Show/Hide the "Browse Server" button. - GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; - - // Show the initial dialog content. - GetE('divInfo').style.display = '' ; - - // Set the actual uploader URL. - if ( FCKConfig.LinkUpload ) - GetE('frmUpload').action = FCKConfig.LinkUploadURL ; - - // Activate the "OK" button. - window.parent.SetOkButton( true ) ; -} - -var bHasAnchors ; - -function LoadAnchorNamesAndIds() -{ - // Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon - // to edit them. So, we must look for that images now. - var aAnchors = new Array() ; - - var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ; - for( var i = 0 ; i < oImages.length ; i++ ) - { - if ( oImages[i].getAttribute('_fckanchor') ) - aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ; - } - - var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ; - - bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ; - - for ( var i = 0 ; i < aAnchors.length ; i++ ) - { - var sName = aAnchors[i].name ; - if ( sName && sName.length > 0 ) - oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ; - } - - for ( var i = 0 ; i < aIds.length ; i++ ) - { - oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ; - } - - ShowE( 'divSelAnchor' , bHasAnchors ) ; - ShowE( 'divNoAnchor' , !bHasAnchors ) ; -} - -function LoadSelection() -{ - if ( !oLink ) return ; - - var sType = 'url' ; - - // Get the actual Link href. - var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; - if ( !sHRef || sHRef.length == 0 ) - sHRef = oLink.getAttribute( 'href' , 2 ) + '' ; - - // TODO: Wait stable version and remove the following commented lines. -// if ( sHRef.startsWith( FCK.BaseUrl ) ) -// sHRef = sHRef.remove( 0, FCK.BaseUrl.length ) ; - - // Look for a popup javascript link. - var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ; - if( oPopupMatch ) - { - GetE('cmbTarget').value = 'popup' ; - sHRef = oPopupMatch[1] ; - FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ; - SetTarget( 'popup' ) ; - } - - // Search for the protocol. - var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; - - if ( sProtocol ) - { - sProtocol = sProtocol[0].toLowerCase() ; - GetE('cmbLinkProtocol').value = sProtocol ; - - // Remove the protocol and get the remainig URL. - var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; - - if ( sProtocol == 'mailto:' ) // It is an e-mail link. - { - sType = 'email' ; - - var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ; - GetE('txtEMailAddress').value = oEMailInfo.Address ; - GetE('txtEMailSubject').value = oEMailInfo.Subject ; - GetE('txtEMailBody').value = oEMailInfo.Body ; - } - else // It is a normal link. - { - sType = 'url' ; - GetE('txtUrl').value = sUrl ; - } - } - else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. - { - sType = 'anchor' ; - GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ; - } - else // It is another type of link. - { - sType = 'url' ; - - GetE('cmbLinkProtocol').value = '' ; - GetE('txtUrl').value = sHRef ; - } - - if ( !oPopupMatch ) - { - // Get the target. - var sTarget = oLink.target ; - - if ( sTarget && sTarget.length > 0 ) - { - if ( oRegex.ReserveTarget.test( sTarget ) ) - { - sTarget = sTarget.toLowerCase() ; - GetE('cmbTarget').value = sTarget ; - } - else - GetE('cmbTarget').value = 'frame' ; - GetE('txtTargetFrame').value = sTarget ; - } - } - - // Get Advances Attributes - GetE('txtAttId').value = oLink.id ; - GetE('txtAttName').value = oLink.name ; - GetE('cmbAttLangDir').value = oLink.dir ; - GetE('txtAttLangCode').value = oLink.lang ; - GetE('txtAttAccessKey').value = oLink.accessKey ; - GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ; - GetE('txtAttTitle').value = oLink.title ; - GetE('txtAttContentType').value = oLink.type ; - GetE('txtAttCharSet').value = oLink.charset ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - { - GetE('txtAttClasses').value = oLink.getAttribute('className',2) || '' ; - GetE('txtAttStyle').value = oLink.style.cssText ; - } - else - { - GetE('txtAttClasses').value = oLink.getAttribute('class',2) || '' ; - GetE('txtAttStyle').value = oLink.getAttribute('style',2) ; - } - - // Update the Link type combo. - GetE('cmbLinkType').value = sType ; -} - -//#### Link type selection. -function SetLinkType( linkType ) -{ - ShowE('divLinkTypeUrl' , (linkType == 'url') ) ; - ShowE('divLinkTypeAnchor' , (linkType == 'anchor') ) ; - ShowE('divLinkTypeEMail' , (linkType == 'email') ) ; - - if ( !FCKConfig.LinkDlgHideTarget ) - window.parent.SetTabVisibility( 'Target' , (linkType == 'url') ) ; - - if ( FCKConfig.LinkUpload ) - window.parent.SetTabVisibility( 'Upload' , (linkType == 'url') ) ; - - if ( !FCKConfig.LinkDlgHideAdvanced ) - window.parent.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ; - - if ( linkType == 'email' ) - window.parent.SetAutoSize( true ) ; -} - -//#### Target type selection. -function SetTarget( targetType ) -{ - GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ; - GetE('tdPopupName').style.display = - GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ; - - switch ( targetType ) - { - case "_blank" : - case "_self" : - case "_parent" : - case "_top" : - GetE('txtTargetFrame').value = targetType ; - break ; - case "" : - GetE('txtTargetFrame').value = '' ; - break ; - } - - if ( targetType == 'popup' ) - window.parent.SetAutoSize( true ) ; -} - -//#### Called while the user types the URL. -function OnUrlChange() -{ - var sUrl = GetE('txtUrl').value ; - var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ; - - if ( sProtocol ) - { - sUrl = sUrl.substr( sProtocol[0].length ) ; - GetE('txtUrl').value = sUrl ; - GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ; - } - else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) ) - { - GetE('cmbLinkProtocol').value = '' ; - } -} - -//#### Called while the user types the target name. -function OnTargetNameChange() -{ - var sFrame = GetE('txtTargetFrame').value ; - - if ( sFrame.length == 0 ) - GetE('cmbTarget').value = '' ; - else if ( oRegex.ReserveTarget.test( sFrame ) ) - GetE('cmbTarget').value = sFrame.toLowerCase() ; - else - GetE('cmbTarget').value = 'frame' ; -} - -//#### Builds the javascript URI to open a popup to the specified URI. -function BuildPopupUri( uri ) -{ - var oReg = new RegExp( "'", "g" ) ; - var sWindowName = "'" + GetE('txtPopupName').value.replace(oReg, "\\'") + "'" ; - - var sFeatures = '' ; - var aChkFeatures = document.getElementsByName('chkFeature') ; - for ( var i = 0 ; i < aChkFeatures.length ; i++ ) - { - if ( i > 0 ) sFeatures += ',' ; - sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ; - } - - if ( GetE('txtPopupWidth').value.length > 0 ) sFeatures += ',width=' + GetE('txtPopupWidth').value ; - if ( GetE('txtPopupHeight').value.length > 0 ) sFeatures += ',height=' + GetE('txtPopupHeight').value ; - if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ; - if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ; - - return ( "javascript:void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ; -} - -//#### Fills all Popup related fields. -function FillPopupFields( windowName, features ) -{ - if ( windowName ) - GetE('txtPopupName').value = windowName ; - - var oFeatures = new Object() ; - var oFeaturesMatch ; - while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null ) - { - var sValue = oFeaturesMatch[2] ; - if ( sValue == ( 'yes' || '1' ) ) - oFeatures[ oFeaturesMatch[1] ] = true ; - else if ( ! isNaN( sValue ) && sValue != 0 ) - oFeatures[ oFeaturesMatch[1] ] = sValue ; - } - - // Update all features check boxes. - var aChkFeatures = document.getElementsByName('chkFeature') ; - for ( var i = 0 ; i < aChkFeatures.length ; i++ ) - { - if ( oFeatures[ aChkFeatures[i].value ] ) - aChkFeatures[i].checked = true ; - } - - // Update position and size text boxes. - if ( oFeatures['width'] ) GetE('txtPopupWidth').value = oFeatures['width'] ; - if ( oFeatures['height'] ) GetE('txtPopupHeight').value = oFeatures['height'] ; - if ( oFeatures['left'] ) GetE('txtPopupLeft').value = oFeatures['left'] ; - if ( oFeatures['top'] ) GetE('txtPopupTop').value = oFeatures['top'] ; -} - -//#### The OK button was hit. -function Ok() -{ - var sUri, sInnerHtml ; - - switch ( GetE('cmbLinkType').value ) - { - case 'url' : - sUri = GetE('txtUrl').value ; - - if ( sUri.length == 0 ) - { - alert( FCKLang.DlnLnkMsgNoUrl ) ; - return false ; - } - - sUri = GetE('cmbLinkProtocol').value + sUri ; - - if( GetE('cmbTarget').value == 'popup' ) - sUri = BuildPopupUri( sUri ) ; - - break ; - - case 'email' : - sUri = GetE('txtEMailAddress').value ; - - if ( sUri.length == 0 ) - { - alert( FCKLang.DlnLnkMsgNoEMail ) ; - return false ; - } - - sUri = oParser.CreateEMailUri( - sUri, - GetE('txtEMailSubject').value, - GetE('txtEMailBody').value ) ; - break ; - - case 'anchor' : - var sAnchor = GetE('cmbAnchorName').value ; - if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ; - - if ( sAnchor.length == 0 ) - { - alert( FCKLang.DlnLnkMsgNoAnchor ) ; - return false ; - } - - sUri = '#' + sAnchor ; - break ; - } - - // No link selected, so try to create one. - if ( !oLink ) - oLink = oEditor.FCK.CreateLink( sUri ) ; - - if ( oLink ) - sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like a URL). - else - { - // If no selection, use the uri as the link text (by dom, 2006-05-26) - - sInnerHtml = sUri; - - // try to built better text for empty link - switch (GetE('cmbLinkType').value) - { - // anchor: use old behavior --> return true - case 'anchor': - sInnerHtml = sInnerHtml.replace( /^#/, '' ) ; - break; - - // url: try to get path - case 'url': - var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$"); - var asLinkPath = oLinkPathRegEx.exec( sUri ); - if (asLinkPath != null) - sInnerHtml = asLinkPath[1]; // use matched path - break; - - // mailto: try to get email address - case 'email': - sInnerHtml = GetE('txtEMailAddress').value - break; - } - - // built new anchor and add link text - oLink = oEditor.FCK.CreateElement( 'a' ) ; - } - - oEditor.FCKUndo.SaveUndoStep() ; - - oLink.href = sUri ; - SetAttribute( oLink, '_fcksavedurl', sUri ) ; - - oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML - - // Target - if( GetE('cmbTarget').value != 'popup' ) - SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; - else - SetAttribute( oLink, 'target', null ) ; - - // Advances Attributes - SetAttribute( oLink, 'id' , GetE('txtAttId').value ) ; - SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; // No IE. Set but doesnt't update the outerHTML. - SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ; - SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ; - SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; - SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; - SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ; - SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ; - SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - { - SetAttribute( oLink, 'className', GetE('txtAttClasses').value ) ; - oLink.style.cssText = GetE('txtAttStyle').value ; - } - else - { - SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; - SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; - } - - // Select the link. - oEditor.FCKSelection.SelectNode(oLink); - - return true ; -} - -function BrowseServer() -{ - OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ; -} - -function SetUrl( url ) -{ - document.getElementById('txtUrl').value = url ; - OnUrlChange() ; - window.parent.SetSelectedTab( 'Info' ) ; -} - -function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) -{ - switch ( errorNumber ) - { - case 0 : // No errors - alert( 'Your file has been successfully uploaded' ) ; - break ; - case 1 : // Custom error - alert( customMsg ) ; - return ; - case 101 : // Custom warning - alert( customMsg ) ; - break ; - case 201 : - alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; - break ; - case 202 : - alert( 'Invalid file type' ) ; - return ; - case 203 : - alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; - return ; - default : - alert( 'Error on file upload. Error number: ' + errorNumber ) ; - return ; - } - - SetUrl( fileUrl ) ; - GetE('frmUpload').reset() ; -} - -var oUploadAllowedExtRegex = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ; -var oUploadDeniedExtRegex = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ; - -function CheckUpload() -{ - var sFile = GetE('txtUploadFile').value ; - - if ( sFile.length == 0 ) - { - alert( 'Please select a file to upload' ) ; - return false ; - } - - if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || - ( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) - { - OnUploadCompleted( 202 ) ; - return false ; - } - - return true ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_link.js + * Scripts related to the Link dialog window (see fck_link.html). + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + * Dominik Pesch ?dom? (empty selection patch) (d.pesch@11com7.de) + */ + +var oEditor = window.parent.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; + +//#### Dialog Tabs + +// Set the dialog tabs. +window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ; + +if ( !FCKConfig.LinkDlgHideTarget ) + window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ; + +if ( FCKConfig.LinkUpload ) + window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ; + +if ( !FCKConfig.LinkDlgHideAdvanced ) + window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ShowE('divInfo' , ( tabCode == 'Info' ) ) ; + ShowE('divTarget' , ( tabCode == 'Target' ) ) ; + ShowE('divUpload' , ( tabCode == 'Upload' ) ) ; + ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ; + + window.parent.SetAutoSize( true ) ; +} + +//#### Regular Expressions library. +var oRegex = new Object() ; + +oRegex.UriProtocol = new RegExp('') ; +oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ; + +oRegex.UrlOnChangeProtocol = new RegExp('') ; +oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ; + +oRegex.UrlOnChangeTestOther = new RegExp('') ; +//oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ; +oRegex.UrlOnChangeTestOther.compile( '^((javascript:)|[#/\.])', 'gi' ) ; + +oRegex.ReserveTarget = new RegExp('') ; +oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ; + +oRegex.PopupUri = new RegExp('') ; +oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ; + +oRegex.PopupFeatures = new RegExp('') ; +oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ; + +//#### Parser Functions + +var oParser = new Object() ; + +oParser.ParseEMailUrl = function( emailUrl ) +{ + // Initializes the EMailInfo object. + var oEMailInfo = new Object() ; + oEMailInfo.Address = '' ; + oEMailInfo.Subject = '' ; + oEMailInfo.Body = '' ; + + var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; + if ( oParts ) + { + // Set the e-mail address. + oEMailInfo.Address = oParts[1] ; + + // Look for the optional e-mail parameters. + if ( oParts[2] ) + { + var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; + if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ; + + oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; + if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ; + } + } + + return oEMailInfo ; +} + +oParser.CreateEMailUri = function( address, subject, body ) +{ + var sBaseUri = 'mailto:' + address ; + + var sParams = '' ; + + if ( subject.length > 0 ) + sParams = '?subject=' + escape( subject ) ; + + if ( body.length > 0 ) + { + sParams += ( sParams.length == 0 ? '?' : '&' ) ; + sParams += 'body=' + escape( body ) ; + } + + return sBaseUri + sParams ; +} + +//#### Initialization Code + +// oLink: The actual selected link in the editor. +var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; +if ( oLink ) + FCK.Selection.SelectNode( oLink ) ; + +window.onload = function() +{ + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + + // Fill the Anchor Names and Ids combos. + LoadAnchorNamesAndIds() ; + + // Load the selected link information (if any). + LoadSelection() ; + + // Update the dialog box. + SetLinkType( GetE('cmbLinkType').value ) ; + + // Show/Hide the "Browse Server" button. + GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ; + + // Show the initial dialog content. + GetE('divInfo').style.display = '' ; + + // Set the actual uploader URL. + if ( FCKConfig.LinkUpload ) + GetE('frmUpload').action = FCKConfig.LinkUploadURL ; + + // Activate the "OK" button. + window.parent.SetOkButton( true ) ; +} + +var bHasAnchors ; + +function LoadAnchorNamesAndIds() +{ + // Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon + // to edit them. So, we must look for that images now. + var aAnchors = new Array() ; + + var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ; + for( var i = 0 ; i < oImages.length ; i++ ) + { + if ( oImages[i].getAttribute('_fckanchor') ) + aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ; + } + + var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ; + + bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ; + + for ( var i = 0 ; i < aAnchors.length ; i++ ) + { + var sName = aAnchors[i].name ; + if ( sName && sName.length > 0 ) + oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ; + } + + for ( var i = 0 ; i < aIds.length ; i++ ) + { + oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ; + } + + ShowE( 'divSelAnchor' , bHasAnchors ) ; + ShowE( 'divNoAnchor' , !bHasAnchors ) ; +} + +function LoadSelection() +{ + if ( !oLink ) return ; + + var sType = 'url' ; + + // Get the actual Link href. + var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; + if ( !sHRef || sHRef.length == 0 ) + sHRef = oLink.getAttribute( 'href' , 2 ) + '' ; + + // TODO: Wait stable version and remove the following commented lines. +// if ( sHRef.startsWith( FCK.BaseUrl ) ) +// sHRef = sHRef.remove( 0, FCK.BaseUrl.length ) ; + + // Look for a popup javascript link. + var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ; + if( oPopupMatch ) + { + GetE('cmbTarget').value = 'popup' ; + sHRef = oPopupMatch[1] ; + FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ; + SetTarget( 'popup' ) ; + } + + // Search for the protocol. + var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; + + if ( sProtocol ) + { + sProtocol = sProtocol[0].toLowerCase() ; + GetE('cmbLinkProtocol').value = sProtocol ; + + // Remove the protocol and get the remainig URL. + var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; + + if ( sProtocol == 'mailto:' ) // It is an e-mail link. + { + sType = 'email' ; + + var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ; + GetE('txtEMailAddress').value = oEMailInfo.Address ; + GetE('txtEMailSubject').value = oEMailInfo.Subject ; + GetE('txtEMailBody').value = oEMailInfo.Body ; + } + else // It is a normal link. + { + sType = 'url' ; + GetE('txtUrl').value = sUrl ; + } + } + else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. + { + sType = 'anchor' ; + GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ; + } + else // It is another type of link. + { + sType = 'url' ; + + GetE('cmbLinkProtocol').value = '' ; + GetE('txtUrl').value = sHRef ; + } + + if ( !oPopupMatch ) + { + // Get the target. + var sTarget = oLink.target ; + + if ( sTarget && sTarget.length > 0 ) + { + if ( oRegex.ReserveTarget.test( sTarget ) ) + { + sTarget = sTarget.toLowerCase() ; + GetE('cmbTarget').value = sTarget ; + } + else + GetE('cmbTarget').value = 'frame' ; + GetE('txtTargetFrame').value = sTarget ; + } + } + + // Get Advances Attributes + GetE('txtAttId').value = oLink.id ; + GetE('txtAttName').value = oLink.name ; + GetE('cmbAttLangDir').value = oLink.dir ; + GetE('txtAttLangCode').value = oLink.lang ; + GetE('txtAttAccessKey').value = oLink.accessKey ; + GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ; + GetE('txtAttTitle').value = oLink.title ; + GetE('txtAttContentType').value = oLink.type ; + GetE('txtAttCharSet').value = oLink.charset ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + GetE('txtAttClasses').value = oLink.getAttribute('className',2) || '' ; + GetE('txtAttStyle').value = oLink.style.cssText ; + } + else + { + GetE('txtAttClasses').value = oLink.getAttribute('class',2) || '' ; + GetE('txtAttStyle').value = oLink.getAttribute('style',2) ; + } + + // Update the Link type combo. + GetE('cmbLinkType').value = sType ; +} + +//#### Link type selection. +function SetLinkType( linkType ) +{ + ShowE('divLinkTypeUrl' , (linkType == 'url') ) ; + ShowE('divLinkTypeAnchor' , (linkType == 'anchor') ) ; + ShowE('divLinkTypeEMail' , (linkType == 'email') ) ; + + if ( !FCKConfig.LinkDlgHideTarget ) + window.parent.SetTabVisibility( 'Target' , (linkType == 'url') ) ; + + if ( FCKConfig.LinkUpload ) + window.parent.SetTabVisibility( 'Upload' , (linkType == 'url') ) ; + + if ( !FCKConfig.LinkDlgHideAdvanced ) + window.parent.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ; + + if ( linkType == 'email' ) + window.parent.SetAutoSize( true ) ; +} + +//#### Target type selection. +function SetTarget( targetType ) +{ + GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ; + GetE('tdPopupName').style.display = + GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ; + + switch ( targetType ) + { + case "_blank" : + case "_self" : + case "_parent" : + case "_top" : + GetE('txtTargetFrame').value = targetType ; + break ; + case "" : + GetE('txtTargetFrame').value = '' ; + break ; + } + + if ( targetType == 'popup' ) + window.parent.SetAutoSize( true ) ; +} + +//#### Called while the user types the URL. +function OnUrlChange() +{ + var sUrl = GetE('txtUrl').value ; + var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ; + + if ( sProtocol ) + { + sUrl = sUrl.substr( sProtocol[0].length ) ; + GetE('txtUrl').value = sUrl ; + GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ; + } + else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) ) + { + GetE('cmbLinkProtocol').value = '' ; + } +} + +//#### Called while the user types the target name. +function OnTargetNameChange() +{ + var sFrame = GetE('txtTargetFrame').value ; + + if ( sFrame.length == 0 ) + GetE('cmbTarget').value = '' ; + else if ( oRegex.ReserveTarget.test( sFrame ) ) + GetE('cmbTarget').value = sFrame.toLowerCase() ; + else + GetE('cmbTarget').value = 'frame' ; +} + +//#### Builds the javascript URI to open a popup to the specified URI. +function BuildPopupUri( uri ) +{ + var oReg = new RegExp( "'", "g" ) ; + var sWindowName = "'" + GetE('txtPopupName').value.replace(oReg, "\\'") + "'" ; + + var sFeatures = '' ; + var aChkFeatures = document.getElementsByName('chkFeature') ; + for ( var i = 0 ; i < aChkFeatures.length ; i++ ) + { + if ( i > 0 ) sFeatures += ',' ; + sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ; + } + + if ( GetE('txtPopupWidth').value.length > 0 ) sFeatures += ',width=' + GetE('txtPopupWidth').value ; + if ( GetE('txtPopupHeight').value.length > 0 ) sFeatures += ',height=' + GetE('txtPopupHeight').value ; + if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ; + if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ; + + return ( "javascript:void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ; +} + +//#### Fills all Popup related fields. +function FillPopupFields( windowName, features ) +{ + if ( windowName ) + GetE('txtPopupName').value = windowName ; + + var oFeatures = new Object() ; + var oFeaturesMatch ; + while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null ) + { + var sValue = oFeaturesMatch[2] ; + if ( sValue == ( 'yes' || '1' ) ) + oFeatures[ oFeaturesMatch[1] ] = true ; + else if ( ! isNaN( sValue ) && sValue != 0 ) + oFeatures[ oFeaturesMatch[1] ] = sValue ; + } + + // Update all features check boxes. + var aChkFeatures = document.getElementsByName('chkFeature') ; + for ( var i = 0 ; i < aChkFeatures.length ; i++ ) + { + if ( oFeatures[ aChkFeatures[i].value ] ) + aChkFeatures[i].checked = true ; + } + + // Update position and size text boxes. + if ( oFeatures['width'] ) GetE('txtPopupWidth').value = oFeatures['width'] ; + if ( oFeatures['height'] ) GetE('txtPopupHeight').value = oFeatures['height'] ; + if ( oFeatures['left'] ) GetE('txtPopupLeft').value = oFeatures['left'] ; + if ( oFeatures['top'] ) GetE('txtPopupTop').value = oFeatures['top'] ; +} + +//#### The OK button was hit. +function Ok() +{ + var sUri, sInnerHtml ; + + switch ( GetE('cmbLinkType').value ) + { + case 'url' : + sUri = GetE('txtUrl').value ; + + if ( sUri.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoUrl ) ; + return false ; + } + + sUri = GetE('cmbLinkProtocol').value + sUri ; + + if( GetE('cmbTarget').value == 'popup' ) + sUri = BuildPopupUri( sUri ) ; + + break ; + + case 'email' : + sUri = GetE('txtEMailAddress').value ; + + if ( sUri.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoEMail ) ; + return false ; + } + + sUri = oParser.CreateEMailUri( + sUri, + GetE('txtEMailSubject').value, + GetE('txtEMailBody').value ) ; + break ; + + case 'anchor' : + var sAnchor = GetE('cmbAnchorName').value ; + if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ; + + if ( sAnchor.length == 0 ) + { + alert( FCKLang.DlnLnkMsgNoAnchor ) ; + return false ; + } + + sUri = '#' + sAnchor ; + break ; + } + + // No link selected, so try to create one. + if ( !oLink ) + oLink = oEditor.FCK.CreateLink( sUri ) ; + + if ( oLink ) + sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like a URL). + else + { + // If no selection, use the uri as the link text (by dom, 2006-05-26) + + sInnerHtml = sUri; + + // try to built better text for empty link + switch (GetE('cmbLinkType').value) + { + // anchor: use old behavior --> return true + case 'anchor': + sInnerHtml = sInnerHtml.replace( /^#/, '' ) ; + break; + + // url: try to get path + case 'url': + var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$"); + var asLinkPath = oLinkPathRegEx.exec( sUri ); + if (asLinkPath != null) + sInnerHtml = asLinkPath[1]; // use matched path + break; + + // mailto: try to get email address + case 'email': + sInnerHtml = GetE('txtEMailAddress').value + break; + } + + // built new anchor and add link text + oLink = oEditor.FCK.CreateElement( 'a' ) ; + } + + oEditor.FCKUndo.SaveUndoStep() ; + + oLink.href = sUri ; + SetAttribute( oLink, '_fcksavedurl', sUri ) ; + + oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML + + // Target + if( GetE('cmbTarget').value != 'popup' ) + SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ; + else + SetAttribute( oLink, 'target', null ) ; + + // Advances Attributes + SetAttribute( oLink, 'id' , GetE('txtAttId').value ) ; + SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ; // No IE. Set but doesnt't update the outerHTML. + SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ; + SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ; + SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ; + SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ; + SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ; + SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ; + SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + { + SetAttribute( oLink, 'className', GetE('txtAttClasses').value ) ; + oLink.style.cssText = GetE('txtAttStyle').value ; + } + else + { + SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ; + SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ; + } + + // Select the link. + oEditor.FCKSelection.SelectNode(oLink); + + return true ; +} + +function BrowseServer() +{ + OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ; +} + +function SetUrl( url ) +{ + document.getElementById('txtUrl').value = url ; + OnUrlChange() ; + window.parent.SetSelectedTab( 'Info' ) ; +} + +function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) +{ + switch ( errorNumber ) + { + case 0 : // No errors + alert( 'Your file has been successfully uploaded' ) ; + break ; + case 1 : // Custom error + alert( customMsg ) ; + return ; + case 101 : // Custom warning + alert( customMsg ) ; + break ; + case 201 : + alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ; + break ; + case 202 : + alert( 'Invalid file type' ) ; + return ; + case 203 : + alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ; + return ; + default : + alert( 'Error on file upload. Error number: ' + errorNumber ) ; + return ; + } + + SetUrl( fileUrl ) ; + GetE('frmUpload').reset() ; +} + +var oUploadAllowedExtRegex = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ; +var oUploadDeniedExtRegex = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ; + +function CheckUpload() +{ + var sFile = GetE('txtUploadFile').value ; + + if ( sFile.length == 0 ) + { + alert( 'Please select a file to upload' ) ; + return false ; + } + + if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || + ( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) + { + OnUploadCompleted( 202 ) ; + return false ; + } + + return true ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_listprop.html b/htdocs/includes/fckeditor/editor/dialog/fck_listprop.html index 450363997bc..14374c17b41 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_listprop.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_listprop.html @@ -1,101 +1,101 @@ - - - - - Bulleted List Properties - - - - - - - - - - -
- - - - -
- List Type
- - -   -
-
- - + + + + + Bulleted List Properties + + + + + + + + + + +
+ + + + +
+ List Type
+ + +   +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_paste.html b/htdocs/includes/fckeditor/editor/dialog/fck_paste.html index 85bdd8f395c..8d0147c4701 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_paste.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_paste.html @@ -1,217 +1,217 @@ - - - - - - - - - - - - - - - - - - - -
- Please paste inside the following box using the - keyboard (Ctrl+V) and hit OK. -
-   -
- - -
- - - - - -
- -
- -
- -
-
- - + + + + + + + + + + + + + + + + + + + +
+ Please paste inside the following box using the + keyboard (Ctrl+V) and hit OK. +
+   +
+ + +
+ + + + + +
+ +
+ +
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_radiobutton.html b/htdocs/includes/fckeditor/editor/dialog/fck_radiobutton.html index a3c06728804..5c99ae8501d 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_radiobutton.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_radiobutton.html @@ -1,103 +1,103 @@ - - - - - Radio Button Properties - - - - - - - - - - -
- - - - - - - - - - -
- Name
- -
- Value
- -
-
- - + + + + + Radio Button Properties + + + + + + + + + + +
+ + + + + + + + + + +
+ Name
+ +
+ Value
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_replace.html b/htdocs/includes/fckeditor/editor/dialog/fck_replace.html index fb8eb44afc9..4d12a4640a6 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_replace.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_replace.html @@ -1,133 +1,133 @@ - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
  -
-   -
- - + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
  +
+   +
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_select.html b/htdocs/includes/fckeditor/editor/dialog/fck_select.html index 3d173289cf1..e25e4157175 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_select.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_select.html @@ -1,172 +1,172 @@ - - - - - Select Properties - - - - - - - - - - - -
- - - - - - - - - - - - - - -
Name 
Value 
Size  lines
-
-
-  Available - Options  - - - - - - - - - - - - - - - - - - -
Text
- -
Value
- -
- - -
-
- -
   -
-
- - + + + + + Select Properties + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
Name 
Value 
Size  lines
+
+
+  Available + Options  + + + + + + + + + + + + + + + + + + +
Text
+ +
Value
+ +
+ + +
+
+ +
   +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_select/fck_select.js b/htdocs/includes/fckeditor/editor/dialog/fck_select/fck_select.js index eb64c50d67f..5a120445cdc 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_select/fck_select.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_select/fck_select.js @@ -1,165 +1,165 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_select.js - * Scripts for the fck_select.html page. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -function Select( combo ) -{ - var iIndex = combo.selectedIndex ; - - oListText.selectedIndex = iIndex ; - oListValue.selectedIndex = iIndex ; - - var oTxtText = document.getElementById( "txtText" ) ; - var oTxtValue = document.getElementById( "txtValue" ) ; - - oTxtText.value = oListText.value ; - oTxtValue.value = oListValue.value ; -} - -function Add() -{ - var oTxtText = document.getElementById( "txtText" ) ; - var oTxtValue = document.getElementById( "txtValue" ) ; - - AddComboOption( oListText, oTxtText.value, oTxtText.value ) ; - AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ; - - oListText.selectedIndex = oListText.options.length - 1 ; - oListValue.selectedIndex = oListValue.options.length - 1 ; - - oTxtText.value = '' ; - oTxtValue.value = '' ; - - oTxtText.focus() ; -} - -function Modify() -{ - var iIndex = oListText.selectedIndex ; - - if ( iIndex < 0 ) return ; - - var oTxtText = document.getElementById( "txtText" ) ; - var oTxtValue = document.getElementById( "txtValue" ) ; - - oListText.options[ iIndex ].innerHTML = oTxtText.value ; - oListText.options[ iIndex ].value = oTxtText.value ; - - oListValue.options[ iIndex ].innerHTML = oTxtValue.value ; - oListValue.options[ iIndex ].value = oTxtValue.value ; - - oTxtText.value = '' ; - oTxtValue.value = '' ; - - oTxtText.focus() ; -} - -function Move( steps ) -{ - ChangeOptionPosition( oListText, steps ) ; - ChangeOptionPosition( oListValue, steps ) ; -} - -function Delete() -{ - RemoveSelectedOptions( oListText ) ; - RemoveSelectedOptions( oListValue ) ; -} - -function SetSelectedValue() -{ - var iIndex = oListValue.selectedIndex ; - if ( iIndex < 0 ) return ; - - var oTxtValue = document.getElementById( "txtSelValue" ) ; - - oTxtValue.value = oListValue.options[ iIndex ].value ; -} - -// Moves the selected option by a number of steps (also negative) -function ChangeOptionPosition( combo, steps ) -{ - var iActualIndex = combo.selectedIndex ; - - if ( iActualIndex < 0 ) - return ; - - var iFinalIndex = iActualIndex + steps ; - - if ( iFinalIndex < 0 ) - iFinalIndex = 0 ; - - if ( iFinalIndex > ( combo.options.length - 1 ) ) - iFinalIndex = combo.options.length - 1 ; - - if ( iActualIndex == iFinalIndex ) - return ; - - var oOption = combo.options[ iActualIndex ] ; - var sText = oOption.innerHTML ; - var sValue = oOption.value ; - - combo.remove( iActualIndex ) ; - - oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ; - - oOption.selected = true ; -} - -// Remove all selected options from a SELECT object -function RemoveSelectedOptions(combo) -{ - // Save the selected index - var iSelectedIndex = combo.selectedIndex ; - - var oOptions = combo.options ; - - // Remove all selected options - for ( var i = oOptions.length - 1 ; i >= 0 ; i-- ) - { - if (oOptions[i].selected) combo.remove(i) ; - } - - // Reset the selection based on the original selected index - if ( combo.options.length > 0 ) - { - if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ; - combo.selectedIndex = iSelectedIndex ; - } -} - -// Add a new option to a SELECT object (combo or list) -function AddComboOption( combo, optionText, optionValue, documentObject, index ) -{ - var oOption ; - - if ( documentObject ) - oOption = documentObject.createElement("OPTION") ; - else - oOption = document.createElement("OPTION") ; - - if ( index != null ) - combo.options.add( oOption, index ) ; - else - combo.options.add( oOption ) ; - - oOption.innerHTML = optionText.length > 0 ? optionText : ' ' ; - oOption.value = optionValue ; - - return oOption ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_select.js + * Scripts for the fck_select.html page. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +function Select( combo ) +{ + var iIndex = combo.selectedIndex ; + + oListText.selectedIndex = iIndex ; + oListValue.selectedIndex = iIndex ; + + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + oTxtText.value = oListText.value ; + oTxtValue.value = oListValue.value ; +} + +function Add() +{ + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + AddComboOption( oListText, oTxtText.value, oTxtText.value ) ; + AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ; + + oListText.selectedIndex = oListText.options.length - 1 ; + oListValue.selectedIndex = oListValue.options.length - 1 ; + + oTxtText.value = '' ; + oTxtValue.value = '' ; + + oTxtText.focus() ; +} + +function Modify() +{ + var iIndex = oListText.selectedIndex ; + + if ( iIndex < 0 ) return ; + + var oTxtText = document.getElementById( "txtText" ) ; + var oTxtValue = document.getElementById( "txtValue" ) ; + + oListText.options[ iIndex ].innerHTML = oTxtText.value ; + oListText.options[ iIndex ].value = oTxtText.value ; + + oListValue.options[ iIndex ].innerHTML = oTxtValue.value ; + oListValue.options[ iIndex ].value = oTxtValue.value ; + + oTxtText.value = '' ; + oTxtValue.value = '' ; + + oTxtText.focus() ; +} + +function Move( steps ) +{ + ChangeOptionPosition( oListText, steps ) ; + ChangeOptionPosition( oListValue, steps ) ; +} + +function Delete() +{ + RemoveSelectedOptions( oListText ) ; + RemoveSelectedOptions( oListValue ) ; +} + +function SetSelectedValue() +{ + var iIndex = oListValue.selectedIndex ; + if ( iIndex < 0 ) return ; + + var oTxtValue = document.getElementById( "txtSelValue" ) ; + + oTxtValue.value = oListValue.options[ iIndex ].value ; +} + +// Moves the selected option by a number of steps (also negative) +function ChangeOptionPosition( combo, steps ) +{ + var iActualIndex = combo.selectedIndex ; + + if ( iActualIndex < 0 ) + return ; + + var iFinalIndex = iActualIndex + steps ; + + if ( iFinalIndex < 0 ) + iFinalIndex = 0 ; + + if ( iFinalIndex > ( combo.options.length - 1 ) ) + iFinalIndex = combo.options.length - 1 ; + + if ( iActualIndex == iFinalIndex ) + return ; + + var oOption = combo.options[ iActualIndex ] ; + var sText = oOption.innerHTML ; + var sValue = oOption.value ; + + combo.remove( iActualIndex ) ; + + oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ; + + oOption.selected = true ; +} + +// Remove all selected options from a SELECT object +function RemoveSelectedOptions(combo) +{ + // Save the selected index + var iSelectedIndex = combo.selectedIndex ; + + var oOptions = combo.options ; + + // Remove all selected options + for ( var i = oOptions.length - 1 ; i >= 0 ; i-- ) + { + if (oOptions[i].selected) combo.remove(i) ; + } + + // Reset the selection based on the original selected index + if ( combo.options.length > 0 ) + { + if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ; + combo.selectedIndex = iSelectedIndex ; + } +} + +// Add a new option to a SELECT object (combo or list) +function AddComboOption( combo, optionText, optionValue, documentObject, index ) +{ + var oOption ; + + if ( documentObject ) + oOption = documentObject.createElement("OPTION") ; + else + oOption = document.createElement("OPTION") ; + + if ( index != null ) + combo.options.add( oOption, index ) ; + else + combo.options.add( oOption ) ; + + oOption.innerHTML = optionText.length > 0 ? optionText : ' ' ; + oOption.value = optionValue ; + + return oOption ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_smiley.html b/htdocs/includes/fckeditor/editor/dialog/fck_smiley.html index db72cc221ec..b266fda2ca3 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_smiley.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_smiley.html @@ -1,91 +1,91 @@ - - - - - - - - - - - - -
- - + + + + + + + + + + + + +
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_source.html b/htdocs/includes/fckeditor/editor/dialog/fck_source.html index f228ba059a2..dd3db7e6506 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_source.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_source.html @@ -1,61 +1,61 @@ - - - - - Source - - - - - - - - - - -
- - + + + + + Source + + + + + + + + + + +
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_specialchar.html b/htdocs/includes/fckeditor/editor/dialog/fck_specialchar.html index 6f9b98deb67..1fd8217435c 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_specialchar.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_specialchar.html @@ -1,109 +1,109 @@ - - - - - - - - - - - - - - - - -
- - -
-
     - - - - -
 
-
- + + + + + + + + + + + + + + + + +
+ + +
+
     + + + + +
 
+
+ \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages.html b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages.html index 933c9645733..df4637b3e13 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages.html @@ -1,59 +1,59 @@ - - - - - Spell Check - - - - - - - - - - + + + + + Spell Check + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js index 6ba8cf038b4..80af84995f9 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js @@ -1,87 +1,87 @@ -//////////////////////////////////////////////////// -// controlWindow object -//////////////////////////////////////////////////// -function controlWindow( controlForm ) { - // private properties - this._form = controlForm; - - // public properties - this.windowType = "controlWindow"; -// this.noSuggestionSelection = "- No suggestions -"; // by FredCK - this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ; - // set up the properties for elements of the given control form - this.suggestionList = this._form.sugg; - this.evaluatedText = this._form.misword; - this.replacementText = this._form.txtsugg; - this.undoButton = this._form.btnUndo; - - // public methods - this.addSuggestion = addSuggestion; - this.clearSuggestions = clearSuggestions; - this.selectDefaultSuggestion = selectDefaultSuggestion; - this.resetForm = resetForm; - this.setSuggestedText = setSuggestedText; - this.enableUndo = enableUndo; - this.disableUndo = disableUndo; -} - -function resetForm() { - if( this._form ) { - this._form.reset(); - } -} - -function setSuggestedText() { - var slct = this.suggestionList; - var txt = this.replacementText; - var str = ""; - if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) { - str = slct.options[slct.selectedIndex].text; - } - txt.value = str; -} - -function selectDefaultSuggestion() { - var slct = this.suggestionList; - var txt = this.replacementText; - if( slct.options.length == 0 ) { - this.addSuggestion( this.noSuggestionSelection ); - } else { - slct.options[0].selected = true; - } - this.setSuggestedText(); -} - -function addSuggestion( sugg_text ) { - var slct = this.suggestionList; - if( sugg_text ) { - var i = slct.options.length; - var newOption = new Option( sugg_text, 'sugg_text'+i ); - slct.options[i] = newOption; - } -} - -function clearSuggestions() { - var slct = this.suggestionList; - for( var j = slct.length - 1; j > -1; j-- ) { - if( slct.options[j] ) { - slct.options[j] = null; - } - } -} - -function enableUndo() { - if( this.undoButton ) { - if( this.undoButton.disabled == true ) { - this.undoButton.disabled = false; - } - } -} - -function disableUndo() { - if( this.undoButton ) { - if( this.undoButton.disabled == false ) { - this.undoButton.disabled = true; - } - } -} +//////////////////////////////////////////////////// +// controlWindow object +//////////////////////////////////////////////////// +function controlWindow( controlForm ) { + // private properties + this._form = controlForm; + + // public properties + this.windowType = "controlWindow"; +// this.noSuggestionSelection = "- No suggestions -"; // by FredCK + this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ; + // set up the properties for elements of the given control form + this.suggestionList = this._form.sugg; + this.evaluatedText = this._form.misword; + this.replacementText = this._form.txtsugg; + this.undoButton = this._form.btnUndo; + + // public methods + this.addSuggestion = addSuggestion; + this.clearSuggestions = clearSuggestions; + this.selectDefaultSuggestion = selectDefaultSuggestion; + this.resetForm = resetForm; + this.setSuggestedText = setSuggestedText; + this.enableUndo = enableUndo; + this.disableUndo = disableUndo; +} + +function resetForm() { + if( this._form ) { + this._form.reset(); + } +} + +function setSuggestedText() { + var slct = this.suggestionList; + var txt = this.replacementText; + var str = ""; + if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) { + str = slct.options[slct.selectedIndex].text; + } + txt.value = str; +} + +function selectDefaultSuggestion() { + var slct = this.suggestionList; + var txt = this.replacementText; + if( slct.options.length == 0 ) { + this.addSuggestion( this.noSuggestionSelection ); + } else { + slct.options[0].selected = true; + } + this.setSuggestedText(); +} + +function addSuggestion( sugg_text ) { + var slct = this.suggestionList; + if( sugg_text ) { + var i = slct.options.length; + var newOption = new Option( sugg_text, 'sugg_text'+i ); + slct.options[i] = newOption; + } +} + +function clearSuggestions() { + var slct = this.suggestionList; + for( var j = slct.length - 1; j > -1; j-- ) { + if( slct.options[j] ) { + slct.options[j] = null; + } + } +} + +function enableUndo() { + if( this.undoButton ) { + if( this.undoButton.disabled == true ) { + this.undoButton.disabled = false; + } + } +} + +function disableUndo() { + if( this.undoButton ) { + if( this.undoButton.disabled == false ) { + this.undoButton.disabled = true; + } + } +} diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html index 42d70414fab..a608174c049 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html @@ -1,153 +1,153 @@ - - - - - - - -
- - - - - - - - - - - - - - - - - - -
Not in dictionary:
Change to:
- - - - - - - -
- -
- -
-
   - - - - - - - - - - - - - - - - - - - - - - -
- -    - -
- -    - -
- -    - -
-
-
- - + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
Not in dictionary:
Change to:
+ + + + + + + +
+ +
+ +
+
   + + + + + + + + + + + + + + + + + + + + + + +
+ +    + +
+ +    + +
+ +    + +
+
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm index 9564ed620f8..516c4cd1177 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm @@ -1,132 +1,132 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php index 340ba9be3c7..38fcf6faa23 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php @@ -1,193 +1,193 @@ -$val ) { - # $val = str_replace( "'", "%27", $val ); - echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n"; - } -} - -# make declarations for the text input index -function print_textindex_decl( $text_input_idx ) { - echo "words[$text_input_idx] = [];\n"; - echo "suggs[$text_input_idx] = [];\n"; -} - -# set an element of the JavaScript 'words' array to a misspelled word -function print_words_elem( $word, $index, $text_input_idx ) { - echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n"; -} - - -# set an element of the JavaScript 'suggs' array to a list of suggestions -function print_suggs_elem( $suggs, $index, $text_input_idx ) { - echo "suggs[$text_input_idx][$index] = ["; - foreach( $suggs as $key=>$val ) { - if( $val ) { - echo "'" . escape_quote( $val ) . "'"; - if ( $key+1 < count( $suggs )) { - echo ", "; - } - } - } - echo "];\n"; -} - -# escape single quote -function escape_quote( $str ) { - return preg_replace ( "/'/", "\\'", $str ); -} - - -# handle a server-side error. -function error_handler( $err ) { - echo "error = '" . escape_quote( $err ) . "';\n"; -} - -## get the list of misspelled words. Put the results in the javascript words array -## for each misspelled word, get suggestions and put in the javascript suggs array -function print_checker_results() { - - global $aspell_prog; - global $aspell_opts; - global $tempfiledir; - global $textinputs; - global $input_separator; - $aspell_err = ""; - # create temp file - $tempfile = tempnam( $tempfiledir, 'aspell_data_' ); - - # open temp file, add the submitted text. - if( $fh = fopen( $tempfile, 'w' )) { - for( $i = 0; $i < count( $textinputs ); $i++ ) { - $text = urldecode( $textinputs[$i] ); - $lines = explode( "\n", $text ); - fwrite ( $fh, "%\n" ); # exit terse mode - fwrite ( $fh, "^$input_separator\n" ); - fwrite ( $fh, "!\n" ); # enter terse mode - foreach( $lines as $key=>$value ) { - # use carat on each line to escape possible aspell commands - fwrite( $fh, "^$value\n" ); - } - } - fclose( $fh ); - - # exec aspell command - redirect STDERR to STDOUT - $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1"; - if( $aspellret = shell_exec( $cmd )) { - $linesout = explode( "\n", $aspellret ); - $index = 0; - $text_input_index = -1; - # parse each line of aspell return - foreach( $linesout as $key=>$val ) { - $chardesc = substr( $val, 0, 1 ); - # if '&', then not in dictionary but has suggestions - # if '#', then not in dictionary and no suggestions - # if '*', then it is a delimiter between text inputs - # if '@' then version info - if( $chardesc == '&' || $chardesc == '#' ) { - $line = explode( " ", $val, 5 ); - print_words_elem( $line[1], $index, $text_input_index ); - if( isset( $line[4] )) { - $suggs = explode( ", ", $line[4] ); - } else { - $suggs = array(); - } - print_suggs_elem( $suggs, $index, $text_input_index ); - $index++; - } elseif( $chardesc == '*' ) { - $text_input_index++; - print_textindex_decl( $text_input_index ); - $index = 0; - } elseif( $chardesc != '@' && $chardesc != "" ) { - # assume this is error output - $aspell_err .= $val; - } - } - if( $aspell_err ) { - $aspell_err = "Error executing `$cmd`\\n$aspell_err"; - error_handler( $aspell_err ); - } - } else { - error_handler( "System error: Aspell program execution failed (`$cmd`)" ); - } - } else { - error_handler( "System error: Could not open file '$tempfile' for writing" ); - } - - # close temp file, delete file - unlink( $tempfile ); -} - - -?> - - - - - - - - - - - - - - - - +$val ) { + # $val = str_replace( "'", "%27", $val ); + echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n"; + } +} + +# make declarations for the text input index +function print_textindex_decl( $text_input_idx ) { + echo "words[$text_input_idx] = [];\n"; + echo "suggs[$text_input_idx] = [];\n"; +} + +# set an element of the JavaScript 'words' array to a misspelled word +function print_words_elem( $word, $index, $text_input_idx ) { + echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n"; +} + + +# set an element of the JavaScript 'suggs' array to a list of suggestions +function print_suggs_elem( $suggs, $index, $text_input_idx ) { + echo "suggs[$text_input_idx][$index] = ["; + foreach( $suggs as $key=>$val ) { + if( $val ) { + echo "'" . escape_quote( $val ) . "'"; + if ( $key+1 < count( $suggs )) { + echo ", "; + } + } + } + echo "];\n"; +} + +# escape single quote +function escape_quote( $str ) { + return preg_replace ( "/'/", "\\'", $str ); +} + + +# handle a server-side error. +function error_handler( $err ) { + echo "error = '" . escape_quote( $err ) . "';\n"; +} + +## get the list of misspelled words. Put the results in the javascript words array +## for each misspelled word, get suggestions and put in the javascript suggs array +function print_checker_results() { + + global $aspell_prog; + global $aspell_opts; + global $tempfiledir; + global $textinputs; + global $input_separator; + $aspell_err = ""; + # create temp file + $tempfile = tempnam( $tempfiledir, 'aspell_data_' ); + + # open temp file, add the submitted text. + if( $fh = fopen( $tempfile, 'w' )) { + for( $i = 0; $i < count( $textinputs ); $i++ ) { + $text = urldecode( $textinputs[$i] ); + $lines = explode( "\n", $text ); + fwrite ( $fh, "%\n" ); # exit terse mode + fwrite ( $fh, "^$input_separator\n" ); + fwrite ( $fh, "!\n" ); # enter terse mode + foreach( $lines as $key=>$value ) { + # use carat on each line to escape possible aspell commands + fwrite( $fh, "^$value\n" ); + } + } + fclose( $fh ); + + # exec aspell command - redirect STDERR to STDOUT + $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1"; + if( $aspellret = shell_exec( $cmd )) { + $linesout = explode( "\n", $aspellret ); + $index = 0; + $text_input_index = -1; + # parse each line of aspell return + foreach( $linesout as $key=>$val ) { + $chardesc = substr( $val, 0, 1 ); + # if '&', then not in dictionary but has suggestions + # if '#', then not in dictionary and no suggestions + # if '*', then it is a delimiter between text inputs + # if '@' then version info + if( $chardesc == '&' || $chardesc == '#' ) { + $line = explode( " ", $val, 5 ); + print_words_elem( $line[1], $index, $text_input_index ); + if( isset( $line[4] )) { + $suggs = explode( ", ", $line[4] ); + } else { + $suggs = array(); + } + print_suggs_elem( $suggs, $index, $text_input_index ); + $index++; + } elseif( $chardesc == '*' ) { + $text_input_index++; + print_textindex_decl( $text_input_index ); + $index = 0; + } elseif( $chardesc != '@' && $chardesc != "" ) { + # assume this is error output + $aspell_err .= $val; + } + } + if( $aspell_err ) { + $aspell_err = "Error executing `$cmd`\\n$aspell_err"; + error_handler( $aspell_err ); + } + } else { + error_handler( "System error: Aspell program execution failed (`$cmd`)" ); + } + } else { + error_handler( "System error: Could not open file '$tempfile' for writing" ); + } + + # close temp file, delete file + unlink( $tempfile ); +} + + +?> + + + + + + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl index cf71200572f..ab36c7df881 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl @@ -1,180 +1,180 @@ -#!/usr/bin/perl - -use CGI qw/ :standard /; -use File::Temp qw/ tempfile tempdir /; - -# my $spellercss = '/speller/spellerStyle.css'; # by FredCK -my $spellercss = '../spellerStyle.css'; # by FredCK -# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK -my $wordWindowSrc = '../wordWindow.js'; # by FredCK -my @textinputs = param( 'textinputs[]' ); # array -# my $aspell_cmd = 'aspell'; # by FredCK (for Linux) -my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows) -my $lang = 'en_US'; -# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK -my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; # by FredCK -my $input_separator = "A"; - -# set the 'wordtext' JavaScript variable to the submitted text. -sub printTextVar { - for( my $i = 0; $i <= $#textinputs; $i++ ) { - print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n"; - } -} - -sub printTextIdxDecl { - my $idx = shift; - print "words[$idx] = [];\n"; - print "suggs[$idx] = [];\n"; -} - -sub printWordsElem { - my( $textIdx, $wordIdx, $word ) = @_; - print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n"; -} - -sub printSuggsElem { - my( $textIdx, $wordIdx, @suggs ) = @_; - print "suggs[$textIdx][$wordIdx] = ["; - for my $i ( 0..$#suggs ) { - print "'" . escapeQuote( $suggs[$i] ) . "'"; - if( $i < $#suggs ) { - print ", "; - } - } - print "];\n"; -} - -sub printCheckerResults { - my $textInputIdx = -1; - my $wordIdx = 0; - my $unhandledText; - # create temp file - my $dir = tempdir( CLEANUP => 1 ); - my( $fh, $tmpfilename ) = tempfile( DIR => $dir ); - - # temp file was created properly? - - # open temp file, add the submitted text. - for( my $i = 0; $i <= $#textinputs; $i++ ) { - $text = url_decode( $textinputs[$i] ); - @lines = split( /\n/, $text ); - print $fh "\%\n"; # exit terse mode - print $fh "^$input_separator\n"; - print $fh "!\n"; # enter terse mode - for my $line ( @lines ) { - # use carat on each line to escape possible aspell commands - print $fh "^$line\n"; - } - - } - # exec aspell command - my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1"; - open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return; - # parse each line of aspell return - for my $ret ( ) { - chomp( $ret ); - # if '&', then not in dictionary but has suggestions - # if '#', then not in dictionary and no suggestions - # if '*', then it is a delimiter between text inputs - if( $ret =~ /^\*/ ) { - $textInputIdx++; - printTextIdxDecl( $textInputIdx ); - $wordIdx = 0; - - } elsif( $ret =~ /^(&|#)/ ) { - my @tokens = split( " ", $ret, 5 ); - printWordsElem( $textInputIdx, $wordIdx, $tokens[1] ); - my @suggs = (); - if( $tokens[4] ) { - @suggs = split( ", ", $tokens[4] ); - } - printSuggsElem( $textInputIdx, $wordIdx, @suggs ); - $wordIdx++; - } else { - $unhandledText .= $ret; - } - } - close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return; -} - -sub escapeQuote { - my $str = shift; - $str =~ s/'/\\'/g; - return $str; -} - -sub handleError { - my $err = shift; - print "error = '" . escapeQuote( $err ) . "';\n"; -} - -sub url_decode { - local $_ = @_ ? shift : $_; - defined or return; - # change + signs to spaces - tr/+/ /; - # change hex escapes to the proper characters - s/%([a-fA-F0-9]{2})/pack "H2", $1/eg; - return $_; -} - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# Display HTML -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -print < - - - - - - - - - - - - - -EOF - +#!/usr/bin/perl + +use CGI qw/ :standard /; +use File::Temp qw/ tempfile tempdir /; + +# my $spellercss = '/speller/spellerStyle.css'; # by FredCK +my $spellercss = '../spellerStyle.css'; # by FredCK +# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK +my $wordWindowSrc = '../wordWindow.js'; # by FredCK +my @textinputs = param( 'textinputs[]' ); # array +# my $aspell_cmd = 'aspell'; # by FredCK (for Linux) +my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows) +my $lang = 'en_US'; +# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK +my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; # by FredCK +my $input_separator = "A"; + +# set the 'wordtext' JavaScript variable to the submitted text. +sub printTextVar { + for( my $i = 0; $i <= $#textinputs; $i++ ) { + print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n"; + } +} + +sub printTextIdxDecl { + my $idx = shift; + print "words[$idx] = [];\n"; + print "suggs[$idx] = [];\n"; +} + +sub printWordsElem { + my( $textIdx, $wordIdx, $word ) = @_; + print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n"; +} + +sub printSuggsElem { + my( $textIdx, $wordIdx, @suggs ) = @_; + print "suggs[$textIdx][$wordIdx] = ["; + for my $i ( 0..$#suggs ) { + print "'" . escapeQuote( $suggs[$i] ) . "'"; + if( $i < $#suggs ) { + print ", "; + } + } + print "];\n"; +} + +sub printCheckerResults { + my $textInputIdx = -1; + my $wordIdx = 0; + my $unhandledText; + # create temp file + my $dir = tempdir( CLEANUP => 1 ); + my( $fh, $tmpfilename ) = tempfile( DIR => $dir ); + + # temp file was created properly? + + # open temp file, add the submitted text. + for( my $i = 0; $i <= $#textinputs; $i++ ) { + $text = url_decode( $textinputs[$i] ); + @lines = split( /\n/, $text ); + print $fh "\%\n"; # exit terse mode + print $fh "^$input_separator\n"; + print $fh "!\n"; # enter terse mode + for my $line ( @lines ) { + # use carat on each line to escape possible aspell commands + print $fh "^$line\n"; + } + + } + # exec aspell command + my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1"; + open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return; + # parse each line of aspell return + for my $ret ( ) { + chomp( $ret ); + # if '&', then not in dictionary but has suggestions + # if '#', then not in dictionary and no suggestions + # if '*', then it is a delimiter between text inputs + if( $ret =~ /^\*/ ) { + $textInputIdx++; + printTextIdxDecl( $textInputIdx ); + $wordIdx = 0; + + } elsif( $ret =~ /^(&|#)/ ) { + my @tokens = split( " ", $ret, 5 ); + printWordsElem( $textInputIdx, $wordIdx, $tokens[1] ); + my @suggs = (); + if( $tokens[4] ) { + @suggs = split( ", ", $tokens[4] ); + } + printSuggsElem( $textInputIdx, $wordIdx, @suggs ); + $wordIdx++; + } else { + $unhandledText .= $ret; + } + } + close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return; +} + +sub escapeQuote { + my $str = shift; + $str =~ s/'/\\'/g; + return $str; +} + +sub handleError { + my $err = shift; + print "error = '" . escapeQuote( $err ) . "';\n"; +} + +sub url_decode { + local $_ = @_ ? shift : $_; + defined or return; + # change + signs to spaces + tr/+/ /; + # change hex escapes to the proper characters + s/%([a-fA-F0-9]{2})/pack "H2", $1/eg; + return $_; +} + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# Display HTML +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +print < + + + + + + + + + + + + + +EOF + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js index 11c8d95d45b..90189d69960 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js @@ -1,458 +1,458 @@ -//////////////////////////////////////////////////// -// spellChecker.js -// -// spellChecker object -// -// This file is sourced on web pages that have a textarea object to evaluate -// for spelling. It includes the implementation for the spellCheckObject. -// -//////////////////////////////////////////////////// - - -// constructor -function spellChecker( textObject ) { - - // public properties - configurable -// this.popUpUrl = '/speller/spellchecker.html'; // by FredCK - this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html'; // by FredCK - this.popUpName = 'spellchecker'; -// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK - this.popUpProps = null ; // by FredCK -// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK - this.spellCheckScript = 'server-scripts/spellchecker.php'; // by FredCK - //this.spellCheckScript = '/cgi-bin/spellchecker.pl'; - - // values used to keep track of what happened to a word - this.replWordFlag = "R"; // single replace - this.ignrWordFlag = "I"; // single ignore - this.replAllFlag = "RA"; // replace all occurances - this.ignrAllFlag = "IA"; // ignore all occurances - this.fromReplAll = "~RA"; // an occurance of a "replace all" word - this.fromIgnrAll = "~IA"; // an occurance of a "ignore all" word - // properties set at run time - this.wordFlags = new Array(); - this.currentTextIndex = 0; - this.currentWordIndex = 0; - this.spellCheckerWin = null; - this.controlWin = null; - this.wordWin = null; - this.textArea = textObject; // deprecated - this.textInputs = arguments; - - // private methods - this._spellcheck = _spellcheck; - this._getSuggestions = _getSuggestions; - this._setAsIgnored = _setAsIgnored; - this._getTotalReplaced = _getTotalReplaced; - this._setWordText = _setWordText; - this._getFormInputs = _getFormInputs; - - // public methods - this.openChecker = openChecker; - this.startCheck = startCheck; - this.checkTextBoxes = checkTextBoxes; - this.checkTextAreas = checkTextAreas; - this.spellCheckAll = spellCheckAll; - this.ignoreWord = ignoreWord; - this.ignoreAll = ignoreAll; - this.replaceWord = replaceWord; - this.replaceAll = replaceAll; - this.terminateSpell = terminateSpell; - this.undo = undo; - - // set the current window's "speller" property to the instance of this class. - // this object can now be referenced by child windows/frames. - window.speller = this; -} - -// call this method to check all text boxes (and only text boxes) in the HTML document -function checkTextBoxes() { - this.textInputs = this._getFormInputs( "^text$" ); - this.openChecker(); -} - -// call this method to check all textareas (and only textareas ) in the HTML document -function checkTextAreas() { - this.textInputs = this._getFormInputs( "^textarea$" ); - this.openChecker(); -} - -// call this method to check all text boxes and textareas in the HTML document -function spellCheckAll() { - this.textInputs = this._getFormInputs( "^text(area)?$" ); - this.openChecker(); -} - -// call this method to check text boxe(s) and/or textarea(s) that were passed in to the -// object's constructor or to the textInputs property -function openChecker() { - this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps ); - if( !this.spellCheckerWin.opener ) { - this.spellCheckerWin.opener = window; - } -} - -function startCheck( wordWindowObj, controlWindowObj ) { - - // set properties from args - this.wordWin = wordWindowObj; - this.controlWin = controlWindowObj; - - // reset properties - this.wordWin.resetForm(); - this.controlWin.resetForm(); - this.currentTextIndex = 0; - this.currentWordIndex = 0; - // initialize the flags to an array - one element for each text input - this.wordFlags = new Array( this.wordWin.textInputs.length ); - // each element will be an array that keeps track of each word in the text - for( var i=0; i wi ) || i > ti ) { - // future word: set as "from ignore all" if - // 1) do not already have a flag and - // 2) have the same value as current word - if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) - && ( !this.wordFlags[i][j] )) { - this._setAsIgnored( i, j, this.fromIgnrAll ); - } - } - } - } - - // finally, move on - this.currentWordIndex++; - this._spellcheck(); -} - -function replaceWord() { - var wi = this.currentWordIndex; - var ti = this.currentTextIndex; - if( !this.wordWin ) { - alert( 'Error: Word frame not available.' ); - return false; - } - if( !this.wordWin.getTextVal( ti, wi )) { - alert( 'Error: "Not in dictionary" text is missing' ); - return false; - } - if( !this.controlWin.replacementText ) { - return; - } - var txt = this.controlWin.replacementText; - if( txt.value ) { - var newspell = new String( txt.value ); - if( this._setWordText( ti, wi, newspell, this.replWordFlag )) { - this.currentWordIndex++; - this._spellcheck(); - } - } -} - -function replaceAll() { - var ti = this.currentTextIndex; - var wi = this.currentWordIndex; - if( !this.wordWin ) { - alert( 'Error: Word frame not available.' ); - return false; - } - var s_word_to_repl = this.wordWin.getTextVal( ti, wi ); - if( !s_word_to_repl ) { - alert( 'Error: "Not in dictionary" text is missing' ); - return false; - } - var txt = this.controlWin.replacementText; - if( !txt.value ) return; - var newspell = new String( txt.value ); - - // set this word as a "replace all" word. - this._setWordText( ti, wi, newspell, this.replAllFlag ); - - // loop through all the words after this word - for( var i = ti; i < this.wordWin.textInputs.length; i++ ) { - for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { - if(( i == ti && j > wi ) || i > ti ) { - // future word: set word text to s_word_to_repl if - // 1) do not already have a flag and - // 2) have the same value as s_word_to_repl - if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) - && ( !this.wordFlags[i][j] )) { - this._setWordText( i, j, newspell, this.fromReplAll ); - } - } - } - } - - // finally, move on - this.currentWordIndex++; - this._spellcheck(); -} - -function terminateSpell() { - // called when we have reached the end of the spell checking. - var msg = ""; // by FredCK - var numrepl = this._getTotalReplaced(); - if( numrepl == 0 ) { - // see if there were no misspellings to begin with - if( !this.wordWin ) { - msg = ""; - } else { - if( this.wordWin.totalMisspellings() ) { -// msg += "No words changed."; // by FredCK - msg += FCKLang.DlgSpellNoChanges ; // by FredCK - } else { -// msg += "No misspellings found."; // by FredCK - msg += FCKLang.DlgSpellNoMispell ; // by FredCK - } - } - } else if( numrepl == 1 ) { -// msg += "One word changed."; // by FredCK - msg += FCKLang.DlgSpellOneChange ; // by FredCK - } else { -// msg += numrepl + " words changed."; // by FredCK - msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ; - } - if( msg ) { -// msg += "\n"; // by FredCK - alert( msg ); - } - - if( numrepl > 0 ) { - // update the text field(s) on the opener window - for( var i = 0; i < this.textInputs.length; i++ ) { - // this.textArea.value = this.wordWin.text; - if( this.wordWin ) { - if( this.wordWin.textInputs[i] ) { - this.textInputs[i].value = this.wordWin.textInputs[i]; - } - } - } - } - - // return back to the calling window -// this.spellCheckerWin.close(); // by FredCK - if ( typeof( this.OnFinished ) == 'function' ) // by FredCK - this.OnFinished(numrepl) ; // by FredCK - - return true; -} - -function undo() { - // skip if this is the first word! - var ti = this.currentTextIndex; - var wi = this.currentWordIndex - - if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) { - this.wordWin.removeFocus( ti, wi ); - - // go back to the last word index that was acted upon - do { - // if the current word index is zero then reset the seed - if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) { - this.currentTextIndex--; - this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1; - if( this.currentWordIndex < 0 ) this.currentWordIndex = 0; - } else { - if( this.currentWordIndex > 0 ) { - this.currentWordIndex--; - } - } - } while ( - this.wordWin.totalWords( this.currentTextIndex ) == 0 - || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll - || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll - ); - - var text_idx = this.currentTextIndex; - var idx = this.currentWordIndex; - var preReplSpell = this.wordWin.originalSpellings[text_idx][idx]; - - // if we got back to the first word then set the Undo button back to disabled - if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) { - this.controlWin.disableUndo(); - } - - // examine what happened to this current word. - switch( this.wordFlags[text_idx][idx] ) { - // replace all: go through this and all the future occurances of the word - // and revert them all to the original spelling and clear their flags - case this.replAllFlag : - for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { - for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { - if(( i == text_idx && j >= idx ) || i > text_idx ) { - var origSpell = this.wordWin.originalSpellings[i][j]; - if( origSpell == preReplSpell ) { - this._setWordText ( i, j, origSpell, undefined ); - } - } - } - } - break; - - // ignore all: go through all the future occurances of the word - // and clear their flags - case this.ignrAllFlag : - for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { - for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { - if(( i == text_idx && j >= idx ) || i > text_idx ) { - var origSpell = this.wordWin.originalSpellings[i][j]; - if( origSpell == preReplSpell ) { - this.wordFlags[i][j] = undefined; - } - } - } - } - break; - - // replace: revert the word to its original spelling - case this.replWordFlag : - this._setWordText ( text_idx, idx, preReplSpell, undefined ); - break; - } - - // For all four cases, clear the wordFlag of this word. re-start the process - this.wordFlags[text_idx][idx] = undefined; - this._spellcheck(); - } -} - -function _spellcheck() { - var ww = this.wordWin; - - // check if this is the last word in the current text element - if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) { - this.currentTextIndex++; - this.currentWordIndex = 0; - // keep going if we're not yet past the last text element - if( this.currentTextIndex < this.wordWin.textInputs.length ) { - this._spellcheck(); - return; - } else { - this.terminateSpell(); - return; - } - } - - // if this is after the first one make sure the Undo button is enabled - if( this.currentWordIndex > 0 ) { - this.controlWin.enableUndo(); - } - - // skip the current word if it has already been worked on - if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) { - // increment the global current word index and move on. - this.currentWordIndex++; - this._spellcheck(); - } else { - var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex ); - if( evalText ) { - this.controlWin.evaluatedText.value = evalText; - ww.setFocus( this.currentTextIndex, this.currentWordIndex ); - this._getSuggestions( this.currentTextIndex, this.currentWordIndex ); - } - } -} - -function _getSuggestions( text_num, word_num ) { - this.controlWin.clearSuggestions(); - // add suggestion in list for each suggested word. - // get the array of suggested words out of the - // three-dimensional array containing all suggestions. - var a_suggests = this.wordWin.suggestions[text_num][word_num]; - if( a_suggests ) { - // got an array of suggestions. - for( var ii = 0; ii < a_suggests.length; ii++ ) { - this.controlWin.addSuggestion( a_suggests[ii] ); - } - } - this.controlWin.selectDefaultSuggestion(); -} - -function _setAsIgnored( text_num, word_num, flag ) { - // set the UI - this.wordWin.removeFocus( text_num, word_num ); - // do the bookkeeping - this.wordFlags[text_num][word_num] = flag; - return true; -} - -function _getTotalReplaced() { - var i_replaced = 0; - for( var i = 0; i < this.wordFlags.length; i++ ) { - for( var j = 0; j < this.wordFlags[i].length; j++ ) { - if(( this.wordFlags[i][j] == this.replWordFlag ) - || ( this.wordFlags[i][j] == this.replAllFlag ) - || ( this.wordFlags[i][j] == this.fromReplAll )) { - i_replaced++; - } - } - } - return i_replaced; -} - -function _setWordText( text_num, word_num, newText, flag ) { - // set the UI and form inputs - this.wordWin.setText( text_num, word_num, newText ); - // keep track of what happened to this word: - this.wordFlags[text_num][word_num] = flag; - return true; -} - -function _getFormInputs( inputPattern ) { - var inputs = new Array(); - for( var i = 0; i < document.forms.length; i++ ) { - for( var j = 0; j < document.forms[i].elements.length; j++ ) { - if( document.forms[i].elements[j].type.match( inputPattern )) { - inputs[inputs.length] = document.forms[i].elements[j]; - } - } - } - return inputs; -} - +//////////////////////////////////////////////////// +// spellChecker.js +// +// spellChecker object +// +// This file is sourced on web pages that have a textarea object to evaluate +// for spelling. It includes the implementation for the spellCheckObject. +// +//////////////////////////////////////////////////// + + +// constructor +function spellChecker( textObject ) { + + // public properties - configurable +// this.popUpUrl = '/speller/spellchecker.html'; // by FredCK + this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html'; // by FredCK + this.popUpName = 'spellchecker'; +// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK + this.popUpProps = null ; // by FredCK +// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK + this.spellCheckScript = 'server-scripts/spellchecker.php'; // by FredCK + //this.spellCheckScript = '/cgi-bin/spellchecker.pl'; + + // values used to keep track of what happened to a word + this.replWordFlag = "R"; // single replace + this.ignrWordFlag = "I"; // single ignore + this.replAllFlag = "RA"; // replace all occurances + this.ignrAllFlag = "IA"; // ignore all occurances + this.fromReplAll = "~RA"; // an occurance of a "replace all" word + this.fromIgnrAll = "~IA"; // an occurance of a "ignore all" word + // properties set at run time + this.wordFlags = new Array(); + this.currentTextIndex = 0; + this.currentWordIndex = 0; + this.spellCheckerWin = null; + this.controlWin = null; + this.wordWin = null; + this.textArea = textObject; // deprecated + this.textInputs = arguments; + + // private methods + this._spellcheck = _spellcheck; + this._getSuggestions = _getSuggestions; + this._setAsIgnored = _setAsIgnored; + this._getTotalReplaced = _getTotalReplaced; + this._setWordText = _setWordText; + this._getFormInputs = _getFormInputs; + + // public methods + this.openChecker = openChecker; + this.startCheck = startCheck; + this.checkTextBoxes = checkTextBoxes; + this.checkTextAreas = checkTextAreas; + this.spellCheckAll = spellCheckAll; + this.ignoreWord = ignoreWord; + this.ignoreAll = ignoreAll; + this.replaceWord = replaceWord; + this.replaceAll = replaceAll; + this.terminateSpell = terminateSpell; + this.undo = undo; + + // set the current window's "speller" property to the instance of this class. + // this object can now be referenced by child windows/frames. + window.speller = this; +} + +// call this method to check all text boxes (and only text boxes) in the HTML document +function checkTextBoxes() { + this.textInputs = this._getFormInputs( "^text$" ); + this.openChecker(); +} + +// call this method to check all textareas (and only textareas ) in the HTML document +function checkTextAreas() { + this.textInputs = this._getFormInputs( "^textarea$" ); + this.openChecker(); +} + +// call this method to check all text boxes and textareas in the HTML document +function spellCheckAll() { + this.textInputs = this._getFormInputs( "^text(area)?$" ); + this.openChecker(); +} + +// call this method to check text boxe(s) and/or textarea(s) that were passed in to the +// object's constructor or to the textInputs property +function openChecker() { + this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps ); + if( !this.spellCheckerWin.opener ) { + this.spellCheckerWin.opener = window; + } +} + +function startCheck( wordWindowObj, controlWindowObj ) { + + // set properties from args + this.wordWin = wordWindowObj; + this.controlWin = controlWindowObj; + + // reset properties + this.wordWin.resetForm(); + this.controlWin.resetForm(); + this.currentTextIndex = 0; + this.currentWordIndex = 0; + // initialize the flags to an array - one element for each text input + this.wordFlags = new Array( this.wordWin.textInputs.length ); + // each element will be an array that keeps track of each word in the text + for( var i=0; i wi ) || i > ti ) { + // future word: set as "from ignore all" if + // 1) do not already have a flag and + // 2) have the same value as current word + if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) + && ( !this.wordFlags[i][j] )) { + this._setAsIgnored( i, j, this.fromIgnrAll ); + } + } + } + } + + // finally, move on + this.currentWordIndex++; + this._spellcheck(); +} + +function replaceWord() { + var wi = this.currentWordIndex; + var ti = this.currentTextIndex; + if( !this.wordWin ) { + alert( 'Error: Word frame not available.' ); + return false; + } + if( !this.wordWin.getTextVal( ti, wi )) { + alert( 'Error: "Not in dictionary" text is missing' ); + return false; + } + if( !this.controlWin.replacementText ) { + return; + } + var txt = this.controlWin.replacementText; + if( txt.value ) { + var newspell = new String( txt.value ); + if( this._setWordText( ti, wi, newspell, this.replWordFlag )) { + this.currentWordIndex++; + this._spellcheck(); + } + } +} + +function replaceAll() { + var ti = this.currentTextIndex; + var wi = this.currentWordIndex; + if( !this.wordWin ) { + alert( 'Error: Word frame not available.' ); + return false; + } + var s_word_to_repl = this.wordWin.getTextVal( ti, wi ); + if( !s_word_to_repl ) { + alert( 'Error: "Not in dictionary" text is missing' ); + return false; + } + var txt = this.controlWin.replacementText; + if( !txt.value ) return; + var newspell = new String( txt.value ); + + // set this word as a "replace all" word. + this._setWordText( ti, wi, newspell, this.replAllFlag ); + + // loop through all the words after this word + for( var i = ti; i < this.wordWin.textInputs.length; i++ ) { + for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == ti && j > wi ) || i > ti ) { + // future word: set word text to s_word_to_repl if + // 1) do not already have a flag and + // 2) have the same value as s_word_to_repl + if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl ) + && ( !this.wordFlags[i][j] )) { + this._setWordText( i, j, newspell, this.fromReplAll ); + } + } + } + } + + // finally, move on + this.currentWordIndex++; + this._spellcheck(); +} + +function terminateSpell() { + // called when we have reached the end of the spell checking. + var msg = ""; // by FredCK + var numrepl = this._getTotalReplaced(); + if( numrepl == 0 ) { + // see if there were no misspellings to begin with + if( !this.wordWin ) { + msg = ""; + } else { + if( this.wordWin.totalMisspellings() ) { +// msg += "No words changed."; // by FredCK + msg += FCKLang.DlgSpellNoChanges ; // by FredCK + } else { +// msg += "No misspellings found."; // by FredCK + msg += FCKLang.DlgSpellNoMispell ; // by FredCK + } + } + } else if( numrepl == 1 ) { +// msg += "One word changed."; // by FredCK + msg += FCKLang.DlgSpellOneChange ; // by FredCK + } else { +// msg += numrepl + " words changed."; // by FredCK + msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ; + } + if( msg ) { +// msg += "\n"; // by FredCK + alert( msg ); + } + + if( numrepl > 0 ) { + // update the text field(s) on the opener window + for( var i = 0; i < this.textInputs.length; i++ ) { + // this.textArea.value = this.wordWin.text; + if( this.wordWin ) { + if( this.wordWin.textInputs[i] ) { + this.textInputs[i].value = this.wordWin.textInputs[i]; + } + } + } + } + + // return back to the calling window +// this.spellCheckerWin.close(); // by FredCK + if ( typeof( this.OnFinished ) == 'function' ) // by FredCK + this.OnFinished(numrepl) ; // by FredCK + + return true; +} + +function undo() { + // skip if this is the first word! + var ti = this.currentTextIndex; + var wi = this.currentWordIndex + + if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) { + this.wordWin.removeFocus( ti, wi ); + + // go back to the last word index that was acted upon + do { + // if the current word index is zero then reset the seed + if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) { + this.currentTextIndex--; + this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1; + if( this.currentWordIndex < 0 ) this.currentWordIndex = 0; + } else { + if( this.currentWordIndex > 0 ) { + this.currentWordIndex--; + } + } + } while ( + this.wordWin.totalWords( this.currentTextIndex ) == 0 + || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll + || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll + ); + + var text_idx = this.currentTextIndex; + var idx = this.currentWordIndex; + var preReplSpell = this.wordWin.originalSpellings[text_idx][idx]; + + // if we got back to the first word then set the Undo button back to disabled + if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) { + this.controlWin.disableUndo(); + } + + // examine what happened to this current word. + switch( this.wordFlags[text_idx][idx] ) { + // replace all: go through this and all the future occurances of the word + // and revert them all to the original spelling and clear their flags + case this.replAllFlag : + for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { + for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == text_idx && j >= idx ) || i > text_idx ) { + var origSpell = this.wordWin.originalSpellings[i][j]; + if( origSpell == preReplSpell ) { + this._setWordText ( i, j, origSpell, undefined ); + } + } + } + } + break; + + // ignore all: go through all the future occurances of the word + // and clear their flags + case this.ignrAllFlag : + for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { + for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { + if(( i == text_idx && j >= idx ) || i > text_idx ) { + var origSpell = this.wordWin.originalSpellings[i][j]; + if( origSpell == preReplSpell ) { + this.wordFlags[i][j] = undefined; + } + } + } + } + break; + + // replace: revert the word to its original spelling + case this.replWordFlag : + this._setWordText ( text_idx, idx, preReplSpell, undefined ); + break; + } + + // For all four cases, clear the wordFlag of this word. re-start the process + this.wordFlags[text_idx][idx] = undefined; + this._spellcheck(); + } +} + +function _spellcheck() { + var ww = this.wordWin; + + // check if this is the last word in the current text element + if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) { + this.currentTextIndex++; + this.currentWordIndex = 0; + // keep going if we're not yet past the last text element + if( this.currentTextIndex < this.wordWin.textInputs.length ) { + this._spellcheck(); + return; + } else { + this.terminateSpell(); + return; + } + } + + // if this is after the first one make sure the Undo button is enabled + if( this.currentWordIndex > 0 ) { + this.controlWin.enableUndo(); + } + + // skip the current word if it has already been worked on + if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) { + // increment the global current word index and move on. + this.currentWordIndex++; + this._spellcheck(); + } else { + var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex ); + if( evalText ) { + this.controlWin.evaluatedText.value = evalText; + ww.setFocus( this.currentTextIndex, this.currentWordIndex ); + this._getSuggestions( this.currentTextIndex, this.currentWordIndex ); + } + } +} + +function _getSuggestions( text_num, word_num ) { + this.controlWin.clearSuggestions(); + // add suggestion in list for each suggested word. + // get the array of suggested words out of the + // three-dimensional array containing all suggestions. + var a_suggests = this.wordWin.suggestions[text_num][word_num]; + if( a_suggests ) { + // got an array of suggestions. + for( var ii = 0; ii < a_suggests.length; ii++ ) { + this.controlWin.addSuggestion( a_suggests[ii] ); + } + } + this.controlWin.selectDefaultSuggestion(); +} + +function _setAsIgnored( text_num, word_num, flag ) { + // set the UI + this.wordWin.removeFocus( text_num, word_num ); + // do the bookkeeping + this.wordFlags[text_num][word_num] = flag; + return true; +} + +function _getTotalReplaced() { + var i_replaced = 0; + for( var i = 0; i < this.wordFlags.length; i++ ) { + for( var j = 0; j < this.wordFlags[i].length; j++ ) { + if(( this.wordFlags[i][j] == this.replWordFlag ) + || ( this.wordFlags[i][j] == this.replAllFlag ) + || ( this.wordFlags[i][j] == this.fromReplAll )) { + i_replaced++; + } + } + } + return i_replaced; +} + +function _setWordText( text_num, word_num, newText, flag ) { + // set the UI and form inputs + this.wordWin.setText( text_num, word_num, newText ); + // keep track of what happened to this word: + this.wordFlags[text_num][word_num] = flag; + return true; +} + +function _getFormInputs( inputPattern ) { + var inputs = new Array(); + for( var i = 0; i < document.forms.length; i++ ) { + for( var j = 0; j < document.forms[i].elements.length; j++ ) { + if( document.forms[i].elements[j].type.match( inputPattern )) { + inputs[inputs.length] = document.forms[i].elements[j]; + } + } + } + return inputs; +} + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html index c419d23dcf8..35cb87889f7 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html @@ -1,71 +1,71 @@ - - - - - - -Speller Pages - - - - - - + + + + + + +Speller Pages + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css index 47bc1efbdd0..4df608d8b96 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css @@ -1,49 +1,49 @@ -.blend { - font-family: courier new; - font-size: 10pt; - border: 0; - margin-bottom:-1; -} -.normalLabel { - font-size:8pt; -} -.normalText { - font-family:arial, helvetica, sans-serif; - font-size:10pt; - color:000000; - background-color:FFFFFF; -} -.plainText { - font-family: courier new, courier, monospace; - font-size: 10pt; - color:000000; - background-color:FFFFFF; -} -.controlWindowBody { - font-family:arial, helvetica, sans-serif; - font-size:8pt; - padding: 7px ; /* by FredCK */ - margin: 0px ; /* by FredCK */ - /* color:000000; by FredCK */ - /* background-color:DADADA; by FredCK */ -} -.readonlyInput { - background-color:DADADA; - color:000000; - font-size:8pt; - width:392px; -} -.textDefault { - font-size:8pt; - width: 200px; -} -.buttonDefault { - width:90px; - height:22px; - font-size:8pt; -} -.suggSlct { - width:200px; - margin-top:2; - font-size:8pt; +.blend { + font-family: courier new; + font-size: 10pt; + border: 0; + margin-bottom:-1; +} +.normalLabel { + font-size:8pt; +} +.normalText { + font-family:arial, helvetica, sans-serif; + font-size:10pt; + color:000000; + background-color:FFFFFF; +} +.plainText { + font-family: courier new, courier, monospace; + font-size: 10pt; + color:000000; + background-color:FFFFFF; +} +.controlWindowBody { + font-family:arial, helvetica, sans-serif; + font-size:8pt; + padding: 7px ; /* by FredCK */ + margin: 0px ; /* by FredCK */ + /* color:000000; by FredCK */ + /* background-color:DADADA; by FredCK */ +} +.readonlyInput { + background-color:DADADA; + color:000000; + font-size:8pt; + width:392px; +} +.textDefault { + font-size:8pt; + width: 200px; +} +.buttonDefault { + width:90px; + height:22px; + font-size:8pt; +} +.suggSlct { + width:200px; + margin-top:2; + font-size:8pt; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js index a4d464b1037..ed8c1881987 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js @@ -1,271 +1,271 @@ -//////////////////////////////////////////////////// -// wordWindow object -//////////////////////////////////////////////////// -function wordWindow() { - // private properties - this._forms = []; - - // private methods - this._getWordObject = _getWordObject; - //this._getSpellerObject = _getSpellerObject; - this._wordInputStr = _wordInputStr; - this._adjustIndexes = _adjustIndexes; - this._isWordChar = _isWordChar; - this._lastPos = _lastPos; - - // public properties - this.wordChar = /[a-zA-Z]/; - this.windowType = "wordWindow"; - this.originalSpellings = new Array(); - this.suggestions = new Array(); - this.checkWordBgColor = "pink"; - this.normWordBgColor = "white"; - this.text = ""; - this.textInputs = new Array(); - this.indexes = new Array(); - //this.speller = this._getSpellerObject(); - - // public methods - this.resetForm = resetForm; - this.totalMisspellings = totalMisspellings; - this.totalWords = totalWords; - this.totalPreviousWords = totalPreviousWords; - //this.getTextObjectArray = getTextObjectArray; - this.getTextVal = getTextVal; - this.setFocus = setFocus; - this.removeFocus = removeFocus; - this.setText = setText; - //this.getTotalWords = getTotalWords; - this.writeBody = writeBody; - this.printForHtml = printForHtml; -} - -function resetForm() { - if( this._forms ) { - for( var i = 0; i < this._forms.length; i++ ) { - this._forms[i].reset(); - } - } - return true; -} - -function totalMisspellings() { - var total_words = 0; - for( var i = 0; i < this.textInputs.length; i++ ) { - total_words += this.totalWords( i ); - } - return total_words; -} - -function totalWords( textIndex ) { - return this.originalSpellings[textIndex].length; -} - -function totalPreviousWords( textIndex, wordIndex ) { - var total_words = 0; - for( var i = 0; i <= textIndex; i++ ) { - for( var j = 0; j < this.totalWords( i ); j++ ) { - if( i == textIndex && j == wordIndex ) { - break; - } else { - total_words++; - } - } - } - return total_words; -} - -//function getTextObjectArray() { -// return this._form.elements; -//} - -function getTextVal( textIndex, wordIndex ) { - var word = this._getWordObject( textIndex, wordIndex ); - if( word ) { - return word.value; - } -} - -function setFocus( textIndex, wordIndex ) { - var word = this._getWordObject( textIndex, wordIndex ); - if( word ) { - if( word.type == "text" ) { - word.focus(); - word.style.backgroundColor = this.checkWordBgColor; - } - } -} - -function removeFocus( textIndex, wordIndex ) { - var word = this._getWordObject( textIndex, wordIndex ); - if( word ) { - if( word.type == "text" ) { - word.blur(); - word.style.backgroundColor = this.normWordBgColor; - } - } -} - -function setText( textIndex, wordIndex, newText ) { - var word = this._getWordObject( textIndex, wordIndex ); - var beginStr; - var endStr; - if( word ) { - var pos = this.indexes[textIndex][wordIndex]; - var oldText = word.value; - // update the text given the index of the string - beginStr = this.textInputs[textIndex].substring( 0, pos ); - endStr = this.textInputs[textIndex].substring( - pos + oldText.length, - this.textInputs[textIndex].length - ); - this.textInputs[textIndex] = beginStr + newText + endStr; - - // adjust the indexes on the stack given the differences in - // length between the new word and old word. - var lengthDiff = newText.length - oldText.length; - this._adjustIndexes( textIndex, wordIndex, lengthDiff ); - - word.size = newText.length; - word.value = newText; - this.removeFocus( textIndex, wordIndex ); - } -} - - -function writeBody() { - var d = window.document; - var is_html = false; - - d.open(); - - // iterate through each text input. - for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { - var end_idx = 0; - var begin_idx = 0; - d.writeln( '
' ); - var wordtxt = this.textInputs[txtid]; - this.indexes[txtid] = []; - - if( wordtxt ) { - var orig = this.originalSpellings[txtid]; - if( !orig ) break; - - //!!! plain text, or HTML mode? - d.writeln( '
' ); - // iterate through each occurrence of a misspelled word. - for( var i = 0; i < orig.length; i++ ) { - // find the position of the current misspelled word, - // starting at the last misspelled word. - // and keep looking if it's a substring of another word - do { - begin_idx = wordtxt.indexOf( orig[i], end_idx ); - end_idx = begin_idx + orig[i].length; - // word not found? messed up! - if( begin_idx == -1 ) break; - // look at the characters immediately before and after - // the word. If they are word characters we'll keep looking. - var before_char = wordtxt.charAt( begin_idx - 1 ); - var after_char = wordtxt.charAt( end_idx ); - } while ( - this._isWordChar( before_char ) - || this._isWordChar( after_char ) - ); - - // keep track of its position in the original text. - this.indexes[txtid][i] = begin_idx; - - // write out the characters before the current misspelled word - for( var j = this._lastPos( txtid, i ); j < begin_idx; j++ ) { - // !!! html mode? make it html compatible - d.write( this.printForHtml( wordtxt.charAt( j ))); - } - - // write out the misspelled word. - d.write( this._wordInputStr( orig[i] )); - - // if it's the last word, write out the rest of the text - if( i == orig.length-1 ){ - d.write( printForHtml( wordtxt.substr( end_idx ))); - } - } - - d.writeln( '
' ); - - } - d.writeln( '
' ); - } - //for ( var j = 0; j < d.forms.length; j++ ) { - // alert( d.forms[j].name ); - // for( var k = 0; k < d.forms[j].elements.length; k++ ) { - // alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value ); - // } - //} - - // set the _forms property - this._forms = d.forms; - d.close(); -} - -// return the character index in the full text after the last word we evaluated -function _lastPos( txtid, idx ) { - if( idx > 0 ) - return this.indexes[txtid][idx-1] + this.originalSpellings[txtid][idx-1].length; - else - return 0; -} - -function printForHtml( n ) { - return n ; // by FredCK - - var htmlstr = n; - if( htmlstr.length == 1 ) { - // do simple case statement if it's just one character - switch ( n ) { - case "\n": - htmlstr = '
'; - break; - case "<": - htmlstr = '<'; - break; - case ">": - htmlstr = '>'; - break; - } - return htmlstr; - } else { - htmlstr = htmlstr.replace( //g, '>' ); - htmlstr = htmlstr.replace( /\n/g, '
' ); - return htmlstr; - } -} - -function _isWordChar( letter ) { - if( letter.search( this.wordChar ) == -1 ) { - return false; - } else { - return true; - } -} - -function _getWordObject( textIndex, wordIndex ) { - if( this._forms[textIndex] ) { - if( this._forms[textIndex].elements[wordIndex] ) { - return this._forms[textIndex].elements[wordIndex]; - } - } - return null; -} - -function _wordInputStr( word ) { - var str = ''; - return str; -} - -function _adjustIndexes( textIndex, wordIndex, lengthDiff ) { - for( var i = wordIndex + 1; i < this.originalSpellings[textIndex].length; i++ ) { - this.indexes[textIndex][i] = this.indexes[textIndex][i] + lengthDiff; - } -} +//////////////////////////////////////////////////// +// wordWindow object +//////////////////////////////////////////////////// +function wordWindow() { + // private properties + this._forms = []; + + // private methods + this._getWordObject = _getWordObject; + //this._getSpellerObject = _getSpellerObject; + this._wordInputStr = _wordInputStr; + this._adjustIndexes = _adjustIndexes; + this._isWordChar = _isWordChar; + this._lastPos = _lastPos; + + // public properties + this.wordChar = /[a-zA-Z]/; + this.windowType = "wordWindow"; + this.originalSpellings = new Array(); + this.suggestions = new Array(); + this.checkWordBgColor = "pink"; + this.normWordBgColor = "white"; + this.text = ""; + this.textInputs = new Array(); + this.indexes = new Array(); + //this.speller = this._getSpellerObject(); + + // public methods + this.resetForm = resetForm; + this.totalMisspellings = totalMisspellings; + this.totalWords = totalWords; + this.totalPreviousWords = totalPreviousWords; + //this.getTextObjectArray = getTextObjectArray; + this.getTextVal = getTextVal; + this.setFocus = setFocus; + this.removeFocus = removeFocus; + this.setText = setText; + //this.getTotalWords = getTotalWords; + this.writeBody = writeBody; + this.printForHtml = printForHtml; +} + +function resetForm() { + if( this._forms ) { + for( var i = 0; i < this._forms.length; i++ ) { + this._forms[i].reset(); + } + } + return true; +} + +function totalMisspellings() { + var total_words = 0; + for( var i = 0; i < this.textInputs.length; i++ ) { + total_words += this.totalWords( i ); + } + return total_words; +} + +function totalWords( textIndex ) { + return this.originalSpellings[textIndex].length; +} + +function totalPreviousWords( textIndex, wordIndex ) { + var total_words = 0; + for( var i = 0; i <= textIndex; i++ ) { + for( var j = 0; j < this.totalWords( i ); j++ ) { + if( i == textIndex && j == wordIndex ) { + break; + } else { + total_words++; + } + } + } + return total_words; +} + +//function getTextObjectArray() { +// return this._form.elements; +//} + +function getTextVal( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + return word.value; + } +} + +function setFocus( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + if( word.type == "text" ) { + word.focus(); + word.style.backgroundColor = this.checkWordBgColor; + } + } +} + +function removeFocus( textIndex, wordIndex ) { + var word = this._getWordObject( textIndex, wordIndex ); + if( word ) { + if( word.type == "text" ) { + word.blur(); + word.style.backgroundColor = this.normWordBgColor; + } + } +} + +function setText( textIndex, wordIndex, newText ) { + var word = this._getWordObject( textIndex, wordIndex ); + var beginStr; + var endStr; + if( word ) { + var pos = this.indexes[textIndex][wordIndex]; + var oldText = word.value; + // update the text given the index of the string + beginStr = this.textInputs[textIndex].substring( 0, pos ); + endStr = this.textInputs[textIndex].substring( + pos + oldText.length, + this.textInputs[textIndex].length + ); + this.textInputs[textIndex] = beginStr + newText + endStr; + + // adjust the indexes on the stack given the differences in + // length between the new word and old word. + var lengthDiff = newText.length - oldText.length; + this._adjustIndexes( textIndex, wordIndex, lengthDiff ); + + word.size = newText.length; + word.value = newText; + this.removeFocus( textIndex, wordIndex ); + } +} + + +function writeBody() { + var d = window.document; + var is_html = false; + + d.open(); + + // iterate through each text input. + for( var txtid = 0; txtid < this.textInputs.length; txtid++ ) { + var end_idx = 0; + var begin_idx = 0; + d.writeln( '
' ); + var wordtxt = this.textInputs[txtid]; + this.indexes[txtid] = []; + + if( wordtxt ) { + var orig = this.originalSpellings[txtid]; + if( !orig ) break; + + //!!! plain text, or HTML mode? + d.writeln( '
' ); + // iterate through each occurrence of a misspelled word. + for( var i = 0; i < orig.length; i++ ) { + // find the position of the current misspelled word, + // starting at the last misspelled word. + // and keep looking if it's a substring of another word + do { + begin_idx = wordtxt.indexOf( orig[i], end_idx ); + end_idx = begin_idx + orig[i].length; + // word not found? messed up! + if( begin_idx == -1 ) break; + // look at the characters immediately before and after + // the word. If they are word characters we'll keep looking. + var before_char = wordtxt.charAt( begin_idx - 1 ); + var after_char = wordtxt.charAt( end_idx ); + } while ( + this._isWordChar( before_char ) + || this._isWordChar( after_char ) + ); + + // keep track of its position in the original text. + this.indexes[txtid][i] = begin_idx; + + // write out the characters before the current misspelled word + for( var j = this._lastPos( txtid, i ); j < begin_idx; j++ ) { + // !!! html mode? make it html compatible + d.write( this.printForHtml( wordtxt.charAt( j ))); + } + + // write out the misspelled word. + d.write( this._wordInputStr( orig[i] )); + + // if it's the last word, write out the rest of the text + if( i == orig.length-1 ){ + d.write( printForHtml( wordtxt.substr( end_idx ))); + } + } + + d.writeln( '
' ); + + } + d.writeln( '
' ); + } + //for ( var j = 0; j < d.forms.length; j++ ) { + // alert( d.forms[j].name ); + // for( var k = 0; k < d.forms[j].elements.length; k++ ) { + // alert( d.forms[j].elements[k].name + ": " + d.forms[j].elements[k].value ); + // } + //} + + // set the _forms property + this._forms = d.forms; + d.close(); +} + +// return the character index in the full text after the last word we evaluated +function _lastPos( txtid, idx ) { + if( idx > 0 ) + return this.indexes[txtid][idx-1] + this.originalSpellings[txtid][idx-1].length; + else + return 0; +} + +function printForHtml( n ) { + return n ; // by FredCK + + var htmlstr = n; + if( htmlstr.length == 1 ) { + // do simple case statement if it's just one character + switch ( n ) { + case "\n": + htmlstr = '
'; + break; + case "<": + htmlstr = '<'; + break; + case ">": + htmlstr = '>'; + break; + } + return htmlstr; + } else { + htmlstr = htmlstr.replace( //g, '>' ); + htmlstr = htmlstr.replace( /\n/g, '
' ); + return htmlstr; + } +} + +function _isWordChar( letter ) { + if( letter.search( this.wordChar ) == -1 ) { + return false; + } else { + return true; + } +} + +function _getWordObject( textIndex, wordIndex ) { + if( this._forms[textIndex] ) { + if( this._forms[textIndex].elements[wordIndex] ) { + return this._forms[textIndex].elements[wordIndex]; + } + } + return null; +} + +function _wordInputStr( word ) { + var str = ''; + return str; +} + +function _adjustIndexes( textIndex, wordIndex, lengthDiff ) { + for( var i = wordIndex + 1; i < this.originalSpellings[textIndex].length; i++ ) { + this.indexes[textIndex][i] = this.indexes[textIndex][i] + lengthDiff; + } +} diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_table.html b/htdocs/includes/fckeditor/editor/dialog/fck_table.html index b17e9720111..9e8e0295c14 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_table.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_table.html @@ -1,282 +1,282 @@ - - - - - Table Properties - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
Rows: 
Columns: 
  
Border size: 
Alignment: 
-
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
Width:  
Height:  pixels
   
Cell spacing:  
Cell padding:  
-
- - - - - - - - - - - - -
Caption:   -
Summary:   -
-
- - + + + + + Table Properties + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
Rows: 
Columns: 
  
Border size: 
Alignment: 
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
Width:  
Height:  pixels
   
Cell spacing:  
Cell padding:  
+
+ + + + + + + + + + + + +
Caption:   +
Summary:   +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_tablecell.html b/htdocs/includes/fckeditor/editor/dialog/fck_tablecell.html index c0b301dae18..afb2273dc0d 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_tablecell.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_tablecell.html @@ -1,251 +1,251 @@ - - - - - Table Cell Properties - - - - - - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Width: -   
- Height: -   pixels
-   -  
- Word Wrap: -  
-   -  
- Horizontal Alignment: -  
- Vertical Alignment: -  
-
-     - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Rows Span: -   - -
- Columns Span: -   - -
-   -   -  
- Background Color: -   -   -
- Border Color: -   -   -
-
-
- - + + + + + Table Cell Properties + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Width: +   
+ Height: +   pixels
+   +  
+ Word Wrap: +  
+   +  
+ Horizontal Alignment: +  
+ Vertical Alignment: +  
+
+     + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Rows Span: +   + +
+ Columns Span: +   + +
+   +   +  
+ Background Color: +   +   +
+ Border Color: +   +   +
+
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_template.html b/htdocs/includes/fckeditor/editor/dialog/fck_template.html index b95b68d0a11..f94e8ac13f9 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_template.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_template.html @@ -1,210 +1,210 @@ - - - - - - - - - - - - - - - - - - -
- Please select the template to open in the editor
- (the actual contents will be lost):
-
-
- - -
-
- - + + + + + + + + + + + + + + + + + + +
+ Please select the template to open in the editor
+ (the actual contents will be lost):
+
+
+ + +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_textarea.html b/htdocs/includes/fckeditor/editor/dialog/fck_textarea.html index 31908e33657..15d01ffd9a5 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_textarea.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_textarea.html @@ -1,90 +1,90 @@ - - - - - Text Area Properties - - - - - - - - - - -
- - - - -
- Name
- - Collumns
- -
- Rows
- -
-
- - + + + + + Text Area Properties + + + + + + + + + + +
+ + + + +
+ Name
+ + Collumns
+ +
+ Rows
+ +
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_textfield.html b/htdocs/includes/fckeditor/editor/dialog/fck_textfield.html index 0e9d3b4662c..26b12b11d33 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_textfield.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_textfield.html @@ -1,131 +1,131 @@ - - - - - Text Field Properties - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- Name
- -
- Value
- -
- Character Width
- -
- Maximum Characters
- -
- Type
- -
 
-
- - + + + + + Text Field Properties + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ Name
+ +
+ Value
+ +
+ Character Width
+ +
+ Maximum Characters
+ +
+ Type
+ +
 
+
+ + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey.html b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey.html index 7c3dbd1ff12..fda239b97c3 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey.html +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey.html @@ -1,63 +1,63 @@ - - - - - Universal Keyboard - - - - - - - - - - - - - + + + + + Universal Keyboard + + + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/data.js b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/data.js index 485d02ba9a0..c434d9ce91e 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/data.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/data.js @@ -1,70 +1,70 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: data.js - * Scripts for the fck_universalkey.html page. - * Definition des 104 caracteres en hexa unicode. - * - * File Authors: - * Michel Staelens (michel.staelens@wanadoo.fr) - * Abdul-Aziz Al-Oraij (top7up@hotmail.com) - */ - -var Maj = new Array() ; -var Min = new Array() ; - -Maj["Arabic"] ="0651|0021|0040|0023|0024|0025|005E|0026|002A|0029|0028|005F|002B|064E|064B|064F|064C|0625|0625|2018|00F7|00D7|061B|003C|003E|0650|064D|005D|005B|0623|0623|0640|060C|002F|003A|0022|007E|0652|007D|007B|0622|0622|2019|002C|002E|061F|007C|0020|0020|0020|0020|0020" ; -Min["Arabic"] ="0630|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|062F|0634|0633|064A|0628|0644|0627|062A|0646|0645|0643|0637|0626|0621|0624|0631|0644|0627|0649|0629|0648|0632|0638|005C|0020|0020|0020|0020" ; -Maj["Belarusian (C)"] ="0401|0021|0022|2116|003B|0025|003A|003F|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|040E|0417|0425|0027|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0406|0422|042C|0411|042E|002C|0020|0020|0020|0020|0020|0020" ; -Min["Belarusian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|045E|0437|0445|0027|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0456|0442|044C|0431|044E|002E|0020|0020|0020|0020|0020|0020" ; -Maj["Bulgarian (C)"] ="007E|0021|003F|002B|0022|0025|003D|003A|002F|005F|2116|0406|0056|044B|0423|0415|0418|0428|0429|041A|0421|0414|0417|0426|00A7|042C|042F|0410|041E|0416|0413|0422|041D|0412|041C|0427|042E|0419|042A|042D|0424|0425|041F|0420|041B|0411|0029|0020|0020|0020|0020|0020" ; -Min["Bulgarian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|002E|002C|0443|0435|0438|0448|0449|043A|0441|0434|0437|0446|003B|044C|044F|0430|043E|0436|0433|0442|043D|0432|043C|0447|044E|0439|044A|044D|0444|0445|043F|0440|043B|0431|0028|0020|0020|0020|0020|0020" ; -Maj["Croatian (L)"] ="00B8|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|00A8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|0059|0058|0043|0056|0042|004E|004D|017D|003B|003A|003C|003E|005F|002D|002A|002B" ; -Min["Croatian (L)"] ="00B8|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|0079|0078|0063|0076|0062|006E|006D|017E|002C|002E|003C|003E|005F|002D|002A|002B" ; -Maj["Czech (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0027|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|005B|007B|0021|0020|0148|010F" ; -Min["Czech (L)"] ="003B|002B|011B|0161|010D|0159|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|0029|0061|0073|0064|0066|0067|0068|006A|006B|006C|016F|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|005D|007D|00A8|0040|00F3|0165" ; -Maj["Danish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C6|00D8|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; -Min["Danish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E6|00F8|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; -Maj["Farsi"] ="0020|0021|0040|0023|0024|0025|005E|0026|002A|0029|0028|005F|002B|0020|0020|0020|0020|0020|0020|0020|00F7|00D7|0020|007D|007B|0020|0020|005D|005B|0623|0622|0640|060C|061B|003A|0022|007E|0020|0020|0020|0020|0020|2019|003E|003C|061F|007C|0020|0020|0020|0020|0020" -Min["Farsi"] ="067E|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|0686|0634|0633|064A|0628|0644|0627|062A|0646|0645|0643|06AF|0638|0637|0632|0631|0630|062F|0621|0648|002E|002F|005C|0020|0020|0020|0020|0020" -Maj["Finnish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; -Min["Finnish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; -Maj["French (L)"] ="0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|00B0|002B|0023|0041|005A|0045|0052|0054|0059|0055|0049|004F|0050|00A8|0025|0051|0053|0044|0046|0047|0048|004A|004B|004C|004D|00B5|0057|0058|0043|0056|0042|004E|003F|002E|002F|00A7|003C|005B|007B|00A3|007E|0020" ; -Min["French (L)"] ="0026|00E9|0022|0027|0028|002D|00E8|005F|00E7|00E0|0029|003D|0040|0061|007A|0065|0072|0074|0079|0075|0069|006F|0070|005E|00F9|0071|0073|0064|0066|0067|0068|006A|006B|006C|006D|002A|0077|0078|0063|0076|0062|006E|002C|003B|003A|0021|003E|005D|007D|0024|007E|0020" ; -Maj["Greek"] ="007E|0021|0040|0023|0024|0025|0390|0026|03B0|0028|0029|005F|002B|003A|03A3|0395|03A1|03A4|03A5|0398|0399|039F|03A0|0386|038F|0391|03A3|0394|03A6|0393|0397|039E|039A|039B|038C|0022|0396|03A7|03A8|03A9|0392|039D|039C|003C|003E|003F|0388|0389|038A|03AA|03AB|038E" ; -Min["Greek"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|003B|03C2|03B5|03C1|03C4|03C5|03B8|03B9|03BF|03C0|03AC|03CE|03B1|03C3|03B4|03C6|03B3|03B7|03BE|03BA|03BB|03CC|0027|03B6|03C7|03C8|03C9|03B2|03BD|03BC|002C|002E|002F|03AD|03AE|03AF|03CA|03CB|03CD" ; -Maj["Hebrew"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|007B|007D|0041|0053|0044|0046|0047|0048|004A|004B|004C|003A|0022|005A|0058|0043|0056|0042|004E|004D|003C|003E|003F|0020|0020|0020|0020|0020|0020" ; -Min["Hebrew"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|002F|0027|05E7|05E8|05D0|05D8|05D5|05DF|05DD|05E4|005B|005D|05E9|05D3|05D2|05DB|05E2|05D9|05D7|05DC|05DA|05E3|002C|05D6|05E1|05D1|05D4|05E0|05DE|05E6|05EA|05E5|002E|0020|0020|0020|0020|0020|0020" ; -Maj["Hungarian (L)"] ="00A7|0027|0022|002B|0021|0025|002F|003D|0028|0029|00ED|00DC|00D3|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0150|00DA|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C9|00C1|0170|00CD|0059|0058|0043|0056|0042|004E|004D|003F|002E|003A|002D|005F|007B|007D" ; -Min["Hungarian (L)"] ="0030|0031|0032|0033|0034|0035|0036|0037|0038|0039|00F6|00FC|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0151|00FA|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E9|00E1|0171|00ED|0079|0078|0063|0076|0062|006E|006D|002C|002E|003A|002D|005F|007B|007D" ; -Maj["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|00C6|02DD|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0152|0059|0058|0043|0056|0042|004E|004D|01A0|01AF|00D8|0126|0110|0132|00DE|00D0|00DF" ; -Min["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00E6|02DD|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0153|0079|0078|0063|0076|0062|006E|006D|01A1|01B0|00F8|0127|0111|0133|00FE|00F0|00DF" ; -Maj["Macedonian (C)"] ="007E|0021|201E|201C|2019|0025|2018|0026|002A|0028|0029|005F|002B|0409|040A|0415|0420|0422|0405|0423|0418|041E|041F|0428|0403|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040C|0401|0417|040F|0426|0412|0411|041D|041C|0416|003B|003A|003F|002A|005F|007B|007D" ; -Min["Macedonian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0459|045A|0435|0440|0442|0455|0443|0438|043E|043F|0448|0453|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045C|0451|0437|045F|0446|0432|0431|043D|043C|0436|002C|002E|002F|0027|002D|005B|005D" ; -Maj["Norwegian (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|00D8|00C6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; -Min["Norwegian (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|00F8|00E6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; -Maj["Polish (L)"] ="002A|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|017A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0144|0107|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0119|0059|0058|0043|0056|0042|004E|004D|003B|003A|005F|003C|005B|007B|02D9|00B4|02DB" ; -Min["Polish (L)"] ="0027|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|017C|015B|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0105|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|007D|02D9|00B4|02DB" ; -Maj["Russian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|042A|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0418|0422|042C|0411|042E|003E|002E|003A|0022|005B|005D|003F" ; -Min["Russian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|044A|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0438|0442|044C|0431|044E|003C|002C|003B|0027|007B|007D|002F" ; -Maj["Serbian (C)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0409|040A|0415|0420|0422|0417|0423|0418|041E|041F|0428|0402|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040B|003E|0405|040F|0426|0412|0411|041D|041C|0416|003A|005F|002E|003A|0022|005B|005D" ; -Min["Serbian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0459|045A|0435|0440|0442|0437|0443|0438|043E|043F|0448|0452|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045B|003C|0455|045F|0446|0432|0431|043D|043C|0436|002E|002D|002C|003B|0027|007B|007D" ; -Maj["Serbian (L)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|003E|0059|0058|0043|0056|0042|004E|004D|017D|003A|005F|002E|003A|0022|005B|005D" ; -Min["Serbian (L)"] ="201A|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|003C|0079|0078|0063|0076|0062|006E|006D|017E|002E|002D|002C|003B|0027|007B|007D" ; -Maj["Slovak (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0021|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|003C|005B|010F|0029|002A|0020" ; -Min["Slovak (L)"] ="003B|002B|013E|0161|010D|0165|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|00E4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F4|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|00F3|0148|0026|0020" ; -Maj["Spanish (L)"] ="00AA|0021|0022|00B7|0024|0025|0026|002F|0028|0029|003D|003F|00BF|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|005E|00A8|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D1|00C7|005A|0058|0043|0056|0042|004E|004D|003B|003A|005F|003E|007C|0040|0023|007E|002A" ; -Min["Spanish (L)"] ="00BA|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A1|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|0060|00B4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F1|00E7|007A|0078|0063|0076|0062|006E|006D|002C|002E|002D|003C|005C|0040|0023|007E|002B" ; -Maj["Ukrainian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|0407|0424|0406|0412|0410|041F|0420|041E|041B|0414|0416|0404|0490|042F|0427|0421|041C|0418|0422|042C|0411|042E|002E|003A|0022|003C|003E|003F" ; -Min["Ukrainian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|0457|0444|0456|0432|0430|043F|0440|043E|043B|0434|0436|0454|0491|044F|0447|0441|043C|0438|0442|044C|0431|044E|002C|003B|0027|007B|007D|002F" ; -Maj["Vietnamese (L)"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|01AF|01A0|0041|0053|0044|0046|0047|0048|004A|004B|004C|0102|00C2|005A|0058|0043|0056|0042|004E|004D|00CA|00D4|0110|003C|003E|003F|007D|003A|0022" ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: data.js + * Scripts for the fck_universalkey.html page. + * Definition des 104 caracteres en hexa unicode. + * + * File Authors: + * Michel Staelens (michel.staelens@wanadoo.fr) + * Abdul-Aziz Al-Oraij (top7up@hotmail.com) + */ + +var Maj = new Array() ; +var Min = new Array() ; + +Maj["Arabic"] ="0651|0021|0040|0023|0024|0025|005E|0026|002A|0029|0028|005F|002B|064E|064B|064F|064C|0625|0625|2018|00F7|00D7|061B|003C|003E|0650|064D|005D|005B|0623|0623|0640|060C|002F|003A|0022|007E|0652|007D|007B|0622|0622|2019|002C|002E|061F|007C|0020|0020|0020|0020|0020" ; +Min["Arabic"] ="0630|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|062F|0634|0633|064A|0628|0644|0627|062A|0646|0645|0643|0637|0626|0621|0624|0631|0644|0627|0649|0629|0648|0632|0638|005C|0020|0020|0020|0020" ; +Maj["Belarusian (C)"] ="0401|0021|0022|2116|003B|0025|003A|003F|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|040E|0417|0425|0027|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0406|0422|042C|0411|042E|002C|0020|0020|0020|0020|0020|0020" ; +Min["Belarusian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|045E|0437|0445|0027|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0456|0442|044C|0431|044E|002E|0020|0020|0020|0020|0020|0020" ; +Maj["Bulgarian (C)"] ="007E|0021|003F|002B|0022|0025|003D|003A|002F|005F|2116|0406|0056|044B|0423|0415|0418|0428|0429|041A|0421|0414|0417|0426|00A7|042C|042F|0410|041E|0416|0413|0422|041D|0412|041C|0427|042E|0419|042A|042D|0424|0425|041F|0420|041B|0411|0029|0020|0020|0020|0020|0020" ; +Min["Bulgarian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|002E|002C|0443|0435|0438|0448|0449|043A|0441|0434|0437|0446|003B|044C|044F|0430|043E|0436|0433|0442|043D|0432|043C|0447|044E|0439|044A|044D|0444|0445|043F|0440|043B|0431|0028|0020|0020|0020|0020|0020" ; +Maj["Croatian (L)"] ="00B8|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|00A8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|0059|0058|0043|0056|0042|004E|004D|017D|003B|003A|003C|003E|005F|002D|002A|002B" ; +Min["Croatian (L)"] ="00B8|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|0079|0078|0063|0076|0062|006E|006D|017E|002C|002E|003C|003E|005F|002D|002A|002B" ; +Maj["Czech (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0027|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|005B|007B|0021|0020|0148|010F" ; +Min["Czech (L)"] ="003B|002B|011B|0161|010D|0159|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|0029|0061|0073|0064|0066|0067|0068|006A|006B|006C|016F|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|005D|007D|00A8|0040|00F3|0165" ; +Maj["Danish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C6|00D8|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; +Min["Danish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E6|00F8|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; +Maj["Farsi"] ="0020|0021|0040|0023|0024|0025|005E|0026|002A|0029|0028|005F|002B|0020|0020|0020|0020|0020|0020|0020|00F7|00D7|0020|007D|007B|0020|0020|005D|005B|0623|0622|0640|060C|061B|003A|0022|007E|0020|0020|0020|0020|0020|2019|003E|003C|061F|007C|0020|0020|0020|0020|0020" +Min["Farsi"] ="067E|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0636|0635|062B|0642|0641|063A|0639|0647|062E|062D|062C|0686|0634|0633|064A|0628|0644|0627|062A|0646|0645|0643|06AF|0638|0637|0632|0631|0630|062F|0621|0648|002E|002F|005C|0020|0020|0020|0020|0020" +Maj["Finnish (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; +Min["Finnish (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; +Maj["French (L)"] ="0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|00B0|002B|0023|0041|005A|0045|0052|0054|0059|0055|0049|004F|0050|00A8|0025|0051|0053|0044|0046|0047|0048|004A|004B|004C|004D|00B5|0057|0058|0043|0056|0042|004E|003F|002E|002F|00A7|003C|005B|007B|00A3|007E|0020" ; +Min["French (L)"] ="0026|00E9|0022|0027|0028|002D|00E8|005F|00E7|00E0|0029|003D|0040|0061|007A|0065|0072|0074|0079|0075|0069|006F|0070|005E|00F9|0071|0073|0064|0066|0067|0068|006A|006B|006C|006D|002A|0077|0078|0063|0076|0062|006E|002C|003B|003A|0021|003E|005D|007D|0024|007E|0020" ; +Maj["Greek"] ="007E|0021|0040|0023|0024|0025|0390|0026|03B0|0028|0029|005F|002B|003A|03A3|0395|03A1|03A4|03A5|0398|0399|039F|03A0|0386|038F|0391|03A3|0394|03A6|0393|0397|039E|039A|039B|038C|0022|0396|03A7|03A8|03A9|0392|039D|039C|003C|003E|003F|0388|0389|038A|03AA|03AB|038E" ; +Min["Greek"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|003B|03C2|03B5|03C1|03C4|03C5|03B8|03B9|03BF|03C0|03AC|03CE|03B1|03C3|03B4|03C6|03B3|03B7|03BE|03BA|03BB|03CC|0027|03B6|03C7|03C8|03C9|03B2|03BD|03BC|002C|002E|002F|03AD|03AE|03AF|03CA|03CB|03CD" ; +Maj["Hebrew"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|007B|007D|0041|0053|0044|0046|0047|0048|004A|004B|004C|003A|0022|005A|0058|0043|0056|0042|004E|004D|003C|003E|003F|0020|0020|0020|0020|0020|0020" ; +Min["Hebrew"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|002F|0027|05E7|05E8|05D0|05D8|05D5|05DF|05DD|05E4|005B|005D|05E9|05D3|05D2|05DB|05E2|05D9|05D7|05DC|05DA|05E3|002C|05D6|05E1|05D1|05D4|05E0|05DE|05E6|05EA|05E5|002E|0020|0020|0020|0020|0020|0020" ; +Maj["Hungarian (L)"] ="00A7|0027|0022|002B|0021|0025|002F|003D|0028|0029|00ED|00DC|00D3|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0150|00DA|0041|0053|0044|0046|0047|0048|004A|004B|004C|00C9|00C1|0170|00CD|0059|0058|0043|0056|0042|004E|004D|003F|002E|003A|002D|005F|007B|007D" ; +Min["Hungarian (L)"] ="0030|0031|0032|0033|0034|0035|0036|0037|0038|0039|00F6|00FC|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0151|00FA|0061|0073|0064|0066|0067|0068|006A|006B|006C|00E9|00E1|0171|00ED|0079|0078|0063|0076|0062|006E|006D|002C|002E|003A|002D|005F|007B|007D" ; +Maj["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|00C6|02DD|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0152|0059|0058|0043|0056|0042|004E|004D|01A0|01AF|00D8|0126|0110|0132|00DE|00D0|00DF" ; +Min["Diacritical (L)"] ="0060|00B4|005E|00A8|007E|00B0|00B7|00B8|00AF|02D9|02DB|02C7|02D8|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00E6|02DD|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0153|0079|0078|0063|0076|0062|006E|006D|01A1|01B0|00F8|0127|0111|0133|00FE|00F0|00DF" ; +Maj["Macedonian (C)"] ="007E|0021|201E|201C|2019|0025|2018|0026|002A|0028|0029|005F|002B|0409|040A|0415|0420|0422|0405|0423|0418|041E|041F|0428|0403|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040C|0401|0417|040F|0426|0412|0411|041D|041C|0416|003B|003A|003F|002A|005F|007B|007D" ; +Min["Macedonian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0459|045A|0435|0440|0442|0455|0443|0438|043E|043F|0448|0453|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045C|0451|0437|045F|0446|0432|0431|043D|043C|0436|002C|002E|002F|0027|002D|005B|005D" ; +Maj["Norwegian (L)"] ="00A7|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|0060|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|00C5|005E|0041|0053|0044|0046|0047|0048|004A|004B|00D8|00C6|00C4|003E|005A|0058|0043|0056|0042|004E|004D|003B|003A|002A|005F|007B|007D|005C|007E" ; +Min["Norwegian (L)"] ="00BD|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00B4|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|00E5|00A8|0061|0073|0064|0066|0067|0068|006A|006B|00F8|00E6|00E4|003C|007A|0078|0063|0076|0062|006E|006D|002C|002E|0027|002D|005B|005D|007C|0040" ; +Maj["Polish (L)"] ="002A|0021|0022|0023|00A4|0025|0026|002F|0028|0029|003D|003F|017A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0144|0107|0041|0053|0044|0046|0047|0048|004A|004B|004C|0141|0119|0059|0058|0043|0056|0042|004E|004D|003B|003A|005F|003C|005B|007B|02D9|00B4|02DB" ; +Min["Polish (L)"] ="0027|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002B|00F3|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|017C|015B|0061|0073|0064|0066|0067|0068|006A|006B|006C|0142|0105|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|007D|02D9|00B4|02DB" ; +Maj["Russian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|042A|0424|042B|0412|0410|041F|0420|041E|041B|0414|0416|042D|042F|0427|0421|041C|0418|0422|042C|0411|042E|003E|002E|003A|0022|005B|005D|003F" ; +Min["Russian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|044A|0444|044B|0432|0430|043F|0440|043E|043B|0434|0436|044D|044F|0447|0441|043C|0438|0442|044C|0431|044E|003C|002C|003B|0027|007B|007D|002F" ; +Maj["Serbian (C)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0409|040A|0415|0420|0422|0417|0423|0418|041E|041F|0428|0402|0410|0421|0414|0424|0413|0425|0408|041A|041B|0427|040B|003E|0405|040F|0426|0412|0411|041D|041C|0416|003A|005F|002E|003A|0022|005B|005D" ; +Min["Serbian (C)"] ="0060|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0459|045A|0435|0440|0442|0437|0443|0438|043E|043F|0448|0452|0430|0441|0434|0444|0433|0445|0458|043A|043B|0447|045B|003C|0455|045F|0446|0432|0431|043D|043C|0436|002E|002D|002C|003B|0027|007B|007D" ; +Maj["Serbian (L)"] ="007E|0021|0022|0023|0024|0025|0026|002F|0028|0029|003D|003F|002A|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|0160|0110|0041|0053|0044|0046|0047|0048|004A|004B|004C|010C|0106|003E|0059|0058|0043|0056|0042|004E|004D|017D|003A|005F|002E|003A|0022|005B|005D" ; +Min["Serbian (L)"] ="201A|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|002B|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|0161|0111|0061|0073|0064|0066|0067|0068|006A|006B|006C|010D|0107|003C|0079|0078|0063|0076|0062|006E|006D|017E|002E|002D|002C|003B|0027|007B|007D" ; +Maj["Slovak (L)"] ="00B0|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0025|02C7|0051|0057|0045|0052|0054|005A|0055|0049|004F|0050|002F|0028|0041|0053|0044|0046|0047|0048|004A|004B|004C|0022|0021|0059|0058|0043|0056|0042|004E|004D|003F|003A|005F|003C|005B|010F|0029|002A|0020" ; +Min["Slovak (L)"] ="003B|002B|013E|0161|010D|0165|017E|00FD|00E1|00ED|00E9|003D|00B4|0071|0077|0065|0072|0074|007A|0075|0069|006F|0070|00FA|00E4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F4|00A7|0079|0078|0063|0076|0062|006E|006D|002C|002E|002D|003E|005D|00F3|0148|0026|0020" ; +Maj["Spanish (L)"] ="00AA|0021|0022|00B7|0024|0025|0026|002F|0028|0029|003D|003F|00BF|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|005E|00A8|0041|0053|0044|0046|0047|0048|004A|004B|004C|00D1|00C7|005A|0058|0043|0056|0042|004E|004D|003B|003A|005F|003E|007C|0040|0023|007E|002A" ; +Min["Spanish (L)"] ="00BA|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|0027|00A1|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|0060|00B4|0061|0073|0064|0066|0067|0068|006A|006B|006C|00F1|00E7|007A|0078|0063|0076|0062|006E|006D|002C|002E|002D|003C|005C|0040|0023|007E|002B" ; +Maj["Ukrainian (C)"] ="0401|0021|0040|0023|2116|0025|005E|0026|002A|0028|0029|005F|002B|0419|0426|0423|041A|0415|041D|0413|0428|0429|0417|0425|0407|0424|0406|0412|0410|041F|0420|041E|041B|0414|0416|0404|0490|042F|0427|0421|041C|0418|0422|042C|0411|042E|002E|003A|0022|003C|003E|003F" ; +Min["Ukrainian (C)"] ="0451|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0439|0446|0443|043A|0435|043D|0433|0448|0449|0437|0445|0457|0444|0456|0432|0430|043F|0440|043E|043B|0434|0436|0454|0491|044F|0447|0441|043C|0438|0442|044C|0431|044E|002C|003B|0027|007B|007D|002F" ; +Maj["Vietnamese (L)"] ="007E|0021|0040|0023|0024|0025|005E|0026|002A|0028|0029|005F|002B|0051|0057|0045|0052|0054|0059|0055|0049|004F|0050|01AF|01A0|0041|0053|0044|0046|0047|0048|004A|004B|004C|0102|00C2|005A|0058|0043|0056|0042|004E|004D|00CA|00D4|0110|003C|003E|003F|007D|003A|0022" ; Min["Vietnamese (L)"] ="20AB|0031|0032|0033|0034|0035|0036|0037|0038|0039|0030|002D|003D|0071|0077|0065|0072|0074|0079|0075|0069|006F|0070|01B0|01A1|0061|0073|0064|0066|0067|0068|006A|006B|006C|0103|00E2|007A|0078|0063|0076|0062|006E|006D|00EA|00F4|0111|002C|002E|002F|007B|003B|0027" ; \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/diacritic.js b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/diacritic.js index 6b2ff9ac17b..2446799df35 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/diacritic.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/diacritic.js @@ -1,65 +1,65 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: diacritic.js - * Scripts for the fck_universalkey.html page. - * - * File Authors: - * Michel Staelens (michel.staelens@wanadoo.fr) - * Abdul-Aziz Al-Oraij (top7up@hotmail.com) - */ - -var dia = new Array() - -dia["0060"]=new Array();dia["00B4"]=new Array();dia["005E"]=new Array();dia["00A8"]=new Array();dia["007E"]=new Array();dia["00B0"]=new Array();dia["00B7"]=new Array();dia["00B8"]=new Array();dia["00AF"]=new Array();dia["02D9"]=new Array();dia["02DB"]=new Array();dia["02C7"]=new Array();dia["02D8"]=new Array();dia["02DD"]=new Array();dia["031B"]=new Array(); -dia["0060"]["0061"]="00E0";dia["00B4"]["0061"]="00E1";dia["005E"]["0061"]="00E2";dia["00A8"]["0061"]="00E4";dia["007E"]["0061"]="00E3";dia["00B0"]["0061"]="00E5";dia["00AF"]["0061"]="0101";dia["02DB"]["0061"]="0105";dia["02D8"]["0061"]="0103"; -dia["00B4"]["0063"]="0107";dia["005E"]["0063"]="0109";dia["00B8"]["0063"]="00E7";dia["02D9"]["0063"]="010B";dia["02C7"]["0063"]="010D"; -dia["02C7"]["0064"]="010F"; -dia["0060"]["0065"]="00E8";dia["00B4"]["0065"]="00E9";dia["005E"]["0065"]="00EA";dia["00A8"]["0065"]="00EB";dia["00AF"]["0065"]="0113";dia["02D9"]["0065"]="0117";dia["02DB"]["0065"]="0119";dia["02C7"]["0065"]="011B";dia["02D8"]["0065"]="0115"; -dia["005E"]["0067"]="011D";dia["00B8"]["0067"]="0123";dia["02D9"]["0067"]="0121";dia["02D8"]["0067"]="011F"; -dia["005E"]["0068"]="0125"; -dia["0060"]["0069"]="00EC";dia["00B4"]["0069"]="00ED";dia["005E"]["0069"]="00EE";dia["00A8"]["0069"]="00EF";dia["007E"]["0069"]="0129";dia["00AF"]["0069"]="012B";dia["02DB"]["0069"]="012F";dia["02D8"]["0069"]="012D"; -dia["005E"]["006A"]="0135"; -dia["00B8"]["006B"]="0137"; -dia["00B4"]["006C"]="013A";dia["00B7"]["006C"]="0140";dia["00B8"]["006C"]="013C";dia["02C7"]["006C"]="013E"; -dia["00B4"]["006E"]="0144";dia["007E"]["006E"]="00F1";dia["00B8"]["006E"]="0146";dia["02D8"]["006E"]="0148"; -dia["0060"]["006F"]="00F2";dia["00B4"]["006F"]="00F3";dia["005E"]["006F"]="00F4";dia["00A8"]["006F"]="00F6";dia["007E"]["006F"]="00F5";dia["00AF"]["006F"]="014D";dia["02D8"]["006F"]="014F";dia["02DD"]["006F"]="0151";dia["031B"]["006F"]="01A1"; -dia["00B4"]["0072"]="0155";dia["00B8"]["0072"]="0157";dia["02C7"]["0072"]="0159"; -dia["00B4"]["0073"]="015B";dia["005E"]["0073"]="015D";dia["00B8"]["0073"]="015F";dia["02C7"]["0073"]="0161"; -dia["00B8"]["0074"]="0163";dia["02C7"]["0074"]="0165"; -dia["0060"]["0075"]="00F9";dia["00B4"]["0075"]="00FA";dia["005E"]["0075"]="00FB";dia["00A8"]["0075"]="00FC";dia["007E"]["0075"]="0169";dia["00B0"]["0075"]="016F";dia["00AF"]["0075"]="016B";dia["02DB"]["0075"]="0173";dia["02D8"]["0075"]="016D";dia["02DD"]["0075"]="0171";dia["031B"]["0075"]="01B0"; -dia["005E"]["0077"]="0175"; -dia["00B4"]["0079"]="00FD";dia["005E"]["0079"]="0177";dia["00A8"]["0079"]="00FF"; -dia["00B4"]["007A"]="017A";dia["02D9"]["007A"]="017C";dia["02C7"]["007A"]="017E"; -dia["00B4"]["00E6"]="01FD"; -dia["00B4"]["00F8"]="01FF"; -dia["0060"]["0041"]="00C0";dia["00B4"]["0041"]="00C1";dia["005E"]["0041"]="00C2";dia["00A8"]["0041"]="00C4";dia["007E"]["0041"]="00C3";dia["00B0"]["0041"]="00C5";dia["00AF"]["0041"]="0100";dia["02DB"]["0041"]="0104";dia["02D8"]["0041"]="0102"; -dia["00B4"]["0043"]="0106";dia["005E"]["0043"]="0108";dia["00B8"]["0043"]="00C7";dia["02D9"]["0043"]="010A";dia["02C7"]["0043"]="010C"; -dia["02C7"]["0044"]="010E"; -dia["0060"]["0045"]="00C8";dia["00B4"]["0045"]="00C9";dia["005E"]["0045"]="00CA";dia["00A8"]["0045"]="00CB";dia["00AF"]["0045"]="0112";dia["02D9"]["0045"]="0116";dia["02DB"]["0045"]="0118";dia["02C7"]["0045"]="011A";dia["02D8"]["0045"]="0114"; -dia["005E"]["0047"]="011C";dia["00B8"]["0047"]="0122";dia["02D9"]["0047"]="0120";dia["02D8"]["0047"]="011E"; -dia["005E"]["0048"]="0124"; -dia["0060"]["0049"]="00CC";dia["00B4"]["0049"]="00CD";dia["005E"]["0049"]="00CE";dia["00A8"]["0049"]="00CF";dia["007E"]["0049"]="0128";dia["00AF"]["0049"]="012A";dia["02D9"]["0049"]="0130";dia["02DB"]["0049"]="012E";dia["02D8"]["0049"]="012C"; -dia["005E"]["004A"]="0134"; -dia["00B8"]["004B"]="0136"; -dia["00B4"]["004C"]="0139";dia["00B7"]["004C"]="013F";dia["00B8"]["004C"]="013B";dia["02C7"]["004C"]="013D"; -dia["00B4"]["004E"]="0143";dia["007E"]["004E"]="00D1";dia["00B8"]["004E"]="0145";dia["02D8"]["004E"]="0147"; -dia["0060"]["004F"]="00D2";dia["00B4"]["004F"]="00D3";dia["005E"]["004F"]="00D4";dia["00A8"]["004F"]="00D6";dia["007E"]["004F"]="00D5";dia["00AF"]["004F"]="014C";dia["02D8"]["004F"]="014E";dia["02DD"]["004F"]="0150";dia["031B"]["004F"]="01A0"; -dia["00B4"]["0052"]="0154";dia["00B8"]["0052"]="0156";dia["02C7"]["0052"]="0158"; -dia["00B4"]["0053"]="015A";dia["005E"]["0053"]="015C";dia["00B8"]["0053"]="015E";dia["02C7"]["0053"]="0160"; -dia["00B8"]["0054"]="0162";dia["02C7"]["0054"]="0164"; -dia["0060"]["0055"]="00D9";dia["00B4"]["0055"]="00DA";dia["005E"]["0055"]="00DB";dia["00A8"]["0055"]="00DC";dia["007E"]["0055"]="0168";dia["00B0"]["0055"]="016E";dia["00AF"]["0055"]="016A";dia["02DB"]["0055"]="0172";dia["02D8"]["0055"]="016C";dia["02DD"]["0055"]="0170";dia["031B"]["0055"]="01AF"; -dia["005E"]["0057"]="0174"; -dia["00B4"]["0059"]="00DD";dia["005E"]["0059"]="0176";dia["00A8"]["0059"]="0178"; -dia["00B4"]["005A"]="0179";dia["02D9"]["005A"]="017B";dia["02C7"]["005A"]="017D"; -dia["00B4"]["00C6"]="01FC"; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: diacritic.js + * Scripts for the fck_universalkey.html page. + * + * File Authors: + * Michel Staelens (michel.staelens@wanadoo.fr) + * Abdul-Aziz Al-Oraij (top7up@hotmail.com) + */ + +var dia = new Array() + +dia["0060"]=new Array();dia["00B4"]=new Array();dia["005E"]=new Array();dia["00A8"]=new Array();dia["007E"]=new Array();dia["00B0"]=new Array();dia["00B7"]=new Array();dia["00B8"]=new Array();dia["00AF"]=new Array();dia["02D9"]=new Array();dia["02DB"]=new Array();dia["02C7"]=new Array();dia["02D8"]=new Array();dia["02DD"]=new Array();dia["031B"]=new Array(); +dia["0060"]["0061"]="00E0";dia["00B4"]["0061"]="00E1";dia["005E"]["0061"]="00E2";dia["00A8"]["0061"]="00E4";dia["007E"]["0061"]="00E3";dia["00B0"]["0061"]="00E5";dia["00AF"]["0061"]="0101";dia["02DB"]["0061"]="0105";dia["02D8"]["0061"]="0103"; +dia["00B4"]["0063"]="0107";dia["005E"]["0063"]="0109";dia["00B8"]["0063"]="00E7";dia["02D9"]["0063"]="010B";dia["02C7"]["0063"]="010D"; +dia["02C7"]["0064"]="010F"; +dia["0060"]["0065"]="00E8";dia["00B4"]["0065"]="00E9";dia["005E"]["0065"]="00EA";dia["00A8"]["0065"]="00EB";dia["00AF"]["0065"]="0113";dia["02D9"]["0065"]="0117";dia["02DB"]["0065"]="0119";dia["02C7"]["0065"]="011B";dia["02D8"]["0065"]="0115"; +dia["005E"]["0067"]="011D";dia["00B8"]["0067"]="0123";dia["02D9"]["0067"]="0121";dia["02D8"]["0067"]="011F"; +dia["005E"]["0068"]="0125"; +dia["0060"]["0069"]="00EC";dia["00B4"]["0069"]="00ED";dia["005E"]["0069"]="00EE";dia["00A8"]["0069"]="00EF";dia["007E"]["0069"]="0129";dia["00AF"]["0069"]="012B";dia["02DB"]["0069"]="012F";dia["02D8"]["0069"]="012D"; +dia["005E"]["006A"]="0135"; +dia["00B8"]["006B"]="0137"; +dia["00B4"]["006C"]="013A";dia["00B7"]["006C"]="0140";dia["00B8"]["006C"]="013C";dia["02C7"]["006C"]="013E"; +dia["00B4"]["006E"]="0144";dia["007E"]["006E"]="00F1";dia["00B8"]["006E"]="0146";dia["02D8"]["006E"]="0148"; +dia["0060"]["006F"]="00F2";dia["00B4"]["006F"]="00F3";dia["005E"]["006F"]="00F4";dia["00A8"]["006F"]="00F6";dia["007E"]["006F"]="00F5";dia["00AF"]["006F"]="014D";dia["02D8"]["006F"]="014F";dia["02DD"]["006F"]="0151";dia["031B"]["006F"]="01A1"; +dia["00B4"]["0072"]="0155";dia["00B8"]["0072"]="0157";dia["02C7"]["0072"]="0159"; +dia["00B4"]["0073"]="015B";dia["005E"]["0073"]="015D";dia["00B8"]["0073"]="015F";dia["02C7"]["0073"]="0161"; +dia["00B8"]["0074"]="0163";dia["02C7"]["0074"]="0165"; +dia["0060"]["0075"]="00F9";dia["00B4"]["0075"]="00FA";dia["005E"]["0075"]="00FB";dia["00A8"]["0075"]="00FC";dia["007E"]["0075"]="0169";dia["00B0"]["0075"]="016F";dia["00AF"]["0075"]="016B";dia["02DB"]["0075"]="0173";dia["02D8"]["0075"]="016D";dia["02DD"]["0075"]="0171";dia["031B"]["0075"]="01B0"; +dia["005E"]["0077"]="0175"; +dia["00B4"]["0079"]="00FD";dia["005E"]["0079"]="0177";dia["00A8"]["0079"]="00FF"; +dia["00B4"]["007A"]="017A";dia["02D9"]["007A"]="017C";dia["02C7"]["007A"]="017E"; +dia["00B4"]["00E6"]="01FD"; +dia["00B4"]["00F8"]="01FF"; +dia["0060"]["0041"]="00C0";dia["00B4"]["0041"]="00C1";dia["005E"]["0041"]="00C2";dia["00A8"]["0041"]="00C4";dia["007E"]["0041"]="00C3";dia["00B0"]["0041"]="00C5";dia["00AF"]["0041"]="0100";dia["02DB"]["0041"]="0104";dia["02D8"]["0041"]="0102"; +dia["00B4"]["0043"]="0106";dia["005E"]["0043"]="0108";dia["00B8"]["0043"]="00C7";dia["02D9"]["0043"]="010A";dia["02C7"]["0043"]="010C"; +dia["02C7"]["0044"]="010E"; +dia["0060"]["0045"]="00C8";dia["00B4"]["0045"]="00C9";dia["005E"]["0045"]="00CA";dia["00A8"]["0045"]="00CB";dia["00AF"]["0045"]="0112";dia["02D9"]["0045"]="0116";dia["02DB"]["0045"]="0118";dia["02C7"]["0045"]="011A";dia["02D8"]["0045"]="0114"; +dia["005E"]["0047"]="011C";dia["00B8"]["0047"]="0122";dia["02D9"]["0047"]="0120";dia["02D8"]["0047"]="011E"; +dia["005E"]["0048"]="0124"; +dia["0060"]["0049"]="00CC";dia["00B4"]["0049"]="00CD";dia["005E"]["0049"]="00CE";dia["00A8"]["0049"]="00CF";dia["007E"]["0049"]="0128";dia["00AF"]["0049"]="012A";dia["02D9"]["0049"]="0130";dia["02DB"]["0049"]="012E";dia["02D8"]["0049"]="012C"; +dia["005E"]["004A"]="0134"; +dia["00B8"]["004B"]="0136"; +dia["00B4"]["004C"]="0139";dia["00B7"]["004C"]="013F";dia["00B8"]["004C"]="013B";dia["02C7"]["004C"]="013D"; +dia["00B4"]["004E"]="0143";dia["007E"]["004E"]="00D1";dia["00B8"]["004E"]="0145";dia["02D8"]["004E"]="0147"; +dia["0060"]["004F"]="00D2";dia["00B4"]["004F"]="00D3";dia["005E"]["004F"]="00D4";dia["00A8"]["004F"]="00D6";dia["007E"]["004F"]="00D5";dia["00AF"]["004F"]="014C";dia["02D8"]["004F"]="014E";dia["02DD"]["004F"]="0150";dia["031B"]["004F"]="01A0"; +dia["00B4"]["0052"]="0154";dia["00B8"]["0052"]="0156";dia["02C7"]["0052"]="0158"; +dia["00B4"]["0053"]="015A";dia["005E"]["0053"]="015C";dia["00B8"]["0053"]="015E";dia["02C7"]["0053"]="0160"; +dia["00B8"]["0054"]="0162";dia["02C7"]["0054"]="0164"; +dia["0060"]["0055"]="00D9";dia["00B4"]["0055"]="00DA";dia["005E"]["0055"]="00DB";dia["00A8"]["0055"]="00DC";dia["007E"]["0055"]="0168";dia["00B0"]["0055"]="016E";dia["00AF"]["0055"]="016A";dia["02DB"]["0055"]="0172";dia["02D8"]["0055"]="016C";dia["02DD"]["0055"]="0170";dia["031B"]["0055"]="01AF"; +dia["005E"]["0057"]="0174"; +dia["00B4"]["0059"]="00DD";dia["005E"]["0059"]="0176";dia["00A8"]["0059"]="0178"; +dia["00B4"]["005A"]="0179";dia["02D9"]["005A"]="017B";dia["02C7"]["005A"]="017D"; +dia["00B4"]["00C6"]="01FC"; dia["00B4"]["00D8"]="01FE"; \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/dialogue.js b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/dialogue.js index d962e90d9c7..67cab47405d 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/dialogue.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/dialogue.js @@ -1,31 +1,31 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: dialogue.js - * Scripts for the fck_universalkey.html page. - * - * File Authors: - * Michel Staelens (michel.staelens@wanadoo.fr) - * Bernadette Cierzniak - * Abdul-Aziz Al-Oraij (top7up@hotmail.com) - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -function afficher(txt) -{ - document.getElementById( 'uni_area' ).value = txt ; -} - -function rechercher() -{ - return document.getElementById( 'uni_area' ).value ; +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: dialogue.js + * Scripts for the fck_universalkey.html page. + * + * File Authors: + * Michel Staelens (michel.staelens@wanadoo.fr) + * Bernadette Cierzniak + * Abdul-Aziz Al-Oraij (top7up@hotmail.com) + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +function afficher(txt) +{ + document.getElementById( 'uni_area' ).value = txt ; +} + +function rechercher() +{ + return document.getElementById( 'uni_area' ).value ; } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css index 925e789fe44..706940d1696 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/fck_universalkey.css @@ -1,62 +1,62 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fck_universalkey.css - * CSS styles for the Universal Keyboard. - * - * File Authors: - * Michel Staelens (michel.staelens@wanadoo.fr) - * Bernadette Cierzniak - * Abdul-Aziz Al-Oraij (top7up@hotmail.com) - */ - -BODY, TEXTAREA, INPUT, TD, SELECT -{ - font-family: Tahoma,verdana,arial,sans-serif; -} -DIV -{ - position: absolute; -} -.simple -{ - font-size: 11pt; -} -.double -{ - font-size: 9pt; -} -.simpledia -{ - color: red; - font-size: 11pt; -} -.doubledia -{ - color: red; - font-size: 9pt; -} -.action -{ - color: white; - font-size: 7pt; -} -.clavier -{ - color: blue; - font-size: 7pt; -} -.sign -{ - color: gray; - font-size: 7pt; -} +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fck_universalkey.css + * CSS styles for the Universal Keyboard. + * + * File Authors: + * Michel Staelens (michel.staelens@wanadoo.fr) + * Bernadette Cierzniak + * Abdul-Aziz Al-Oraij (top7up@hotmail.com) + */ + +BODY, TEXTAREA, INPUT, TD, SELECT +{ + font-family: Tahoma,verdana,arial,sans-serif; +} +DIV +{ + position: absolute; +} +.simple +{ + font-size: 11pt; +} +.double +{ + font-size: 9pt; +} +.simpledia +{ + color: red; + font-size: 11pt; +} +.doubledia +{ + color: red; + font-size: 9pt; +} +.action +{ + color: white; + font-size: 7pt; +} +.clavier +{ + color: blue; + font-size: 7pt; +} +.sign +{ + color: gray; + font-size: 7pt; +} diff --git a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/multihexa.js b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/multihexa.js index a377d2bb80d..928b0f2d131 100644 --- a/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/multihexa.js +++ b/htdocs/includes/fckeditor/editor/dialog/fck_universalkey/multihexa.js @@ -1,309 +1,309 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: multihexa.js - * Scripts for the fck_universalkey.html page. - * Definition des 104 caracteres en hexa unicode. - * - * File Authors: - * Michel Staelens (michel.staelens@wanadoo.fr) - * Bernadette Cierzniak - * Abdul-Aziz Al-Oraij (top7up@hotmail.com) - */ - -var caps=0, lock=0, hexchars="0123456789ABCDEF", accent="0000", keydeb=0 -var key=new Array();j=0;for (i in Maj){key[j]=i;j++} -var ns6=((!document.all)&&(document.getElementById)) -var ie=document.all - -var langue=getCk(); -if (langue==""){ - langue=key[keydeb] -} -CarMaj=Maj[langue].split("|");CarMin=Min[langue].split("|") - -/*unikey*/ -var posUniKeyLeft=0, posUniKeyTop=0 -if (ns6){posUniKeyLeft=0;posUniKeyTop=60} -else if (ie){posUniKeyLeft=0;posUniKeyTop=60} -tracer("fond",posUniKeyLeft,posUniKeyTop,'
',"sign") -/*touches*/ -var posX=new Array(0,28,56,84,112,140,168,196,224,252,280,308,336,42,70,98,126,154,182,210,238,266,294,322,350,50,78,106,134,162,190,218,246,274,302,330,64,92,120,148,176,204,232,260,288,316,28,56,84,294,322,350) -var posY=new Array(14,14,14,14,14,14,14,14,14,14,14,14,14,42,42,42,42,42,42,42,42,42,42,42,42,70,70,70,70,70,70,70,70,70,70,70,98,98,98,98,98,98,98,98,98,98,126,126,126,126,126,126) -var nbTouches=52 -for (i=0;i Lock","Enter","Shift","Shift","<|<","Space",">|>") -var effet=new Array("keyscroll(-3)","keyscroll(3)","faire(\"del\")","RAZ()","faire(\"bck\")","bloq()","faire(\"\\n\")","haut()","haut()","faire(\"ar\")","faire(\" \")","faire(\"av\")") -var nbActions=12 -for (i=0;i') -document.write('') -for (i=0;i') -} -for (i=0;i') -} -for (i=0;i<4;i++){ - document.write('') -} -document.write('') - -/*fonctions*/ -function ecrire(i){ - txt=rechercher()+"|";subtxt=txt.split("|") - ceci=(lock==1)?CarMaj[i]:((caps==1)?CarMaj[i]:CarMin[i]) - if (test(ceci)){subtxt[0]+=cardia(ceci);distinguer(false)} - else if(dia[accent]!=null&&dia[hexa(ceci)]!=null){distinguer(false);accent=hexa(ceci);distinguer(true)} - else if(dia[accent]!=null){subtxt[0]+=fromhexby4tocar(accent)+ceci;distinguer(false)} - else if(dia[hexa(ceci)]!=null){accent=hexa(ceci);distinguer(true)} - else {subtxt[0]+=ceci} - txt=subtxt[0]+"|"+subtxt[1] - afficher(txt) - if (caps==1){caps=0;MinusMajus()} -} -function faire(ceci){ - txt=rechercher()+"|";subtxt=txt.split("|") - l0=subtxt[0].length - l1=subtxt[1].length - c1=subtxt[0].substring(0,(l0-2)) - c2=subtxt[0].substring(0,(l0-1)) - c3=subtxt[1].substring(0,1) - c4=subtxt[1].substring(0,2) - c5=subtxt[0].substring((l0-2),l0) - c6=subtxt[0].substring((l0-1),l0) - c7=subtxt[1].substring(1,l1) - c8=subtxt[1].substring(2,l1) - if(dia[accent]!=null){if(ceci==" "){ceci=fromhexby4tocar(accent)}distinguer(false)} - switch (ceci){ - case("av") :if(escape(c4)!="%0D%0A"){txt=subtxt[0]+c3+"|"+c7}else{txt=subtxt[0]+c4+"|"+c8}break - case("ar") :if(escape(c5)!="%0D%0A"){txt=c2+"|"+c6+subtxt[1]}else{txt=c1+"|"+c5+subtxt[1]}break - case("bck"):if(escape(c5)!="%0D%0A"){txt=c2+"|"+subtxt[1]}else{txt=c1+"|"+subtxt[1]}break - case("del"):if(escape(c4)!="%0D%0A"){txt=subtxt[0]+"|"+c7}else{txt=subtxt[0]+"|"+c8}break - default:txt=subtxt[0]+ceci+"|"+subtxt[1];break - } - afficher(txt) -} -function RAZ(){txt="";if(dia[accent]!=null){distinguer(false)}afficher(txt)} -function haut(){caps=1;MinusMajus()} -function bloq(){lock=(lock==1)?0:1;MinusMajus()} - -/*fonctions de traitement du unikey*/ -function tracer(nom,gauche,haut,ceci,classe){ceci=""+ceci+"";document.write('
'+ceci+'
');if (ns6){document.getElementById(nom).style.left=gauche+"px";document.getElementById(nom).style.top=haut+"px";}else if (ie){document.all(nom).style.left=gauche;document.all(nom).style.top=haut}} -function retracer(nom,ceci,classe){ceci=""+ceci+"";if (ns6){document.getElementById(nom).innerHTML=ceci}else if (ie){doc=document.all(nom);doc.innerHTML=ceci}} -function keyscroll(n){ - keydeb+=n - if (keydeb<0){ - keydeb=0 - } - if (keydeb>key.length-4){ - keydeb=key.length-4 - } - for (i=keydeb;i=0;a--){out+=Math.pow(16,inval.length-a-1)*hexchars.indexOf(inval.charAt(a))}return out} -function fromhexby4tocar(ceci){out4=new String();for (l=0;l-1)|(langue!="Arabic")) return true; - - if (!e) var e = window.event; - if (e.keyCode) keyCode = e.keyCode; - else if (e.which) keyCode = e.which; - var character = String.fromCharCode(keyCode); - - entry = true; - cont=e.srcElement || e.currentTarget || e.target; - if (keyCode>64 && keyCode<91) { - entry=false; - source='ش لاؤ ي ث ب ل ا ه ت ن م ة ى خ ح ض ق س ف ع ر ص ء غ ئ '; - shsource='ِ لآ} ] ُ [ لأأ ÷ ـ ، / آ × ؛ َ ٌ ٍ لإ { ً ْ إ ~'; - - if (e.shiftKey) cont.value += shsource.substr((keyCode-64)*2-2,2); - else - cont.value += source.substr((keyCode-64)*2-2,2); - if (cont.value.substr(cont.value.length-1,1)==' ') cont.value=cont.value.substr(0,cont.value.length-1); - } - if (e.shiftKey) { - if (keyCode==186) {cont.value += ':';entry=false;} - if (keyCode==188) {cont.value += ',';entry=false;} - if (keyCode==190) {cont.value += '.';entry=false;} - if (keyCode==191) {cont.value += '؟';entry=false;} - if (keyCode==192) {cont.value += 'ّ';entry=false;} - if (keyCode==219) {cont.value += '<';entry=false;} - if (keyCode==221) {cont.value += '>';entry=false;} - } else { - if (keyCode==186||keyCode==59) {cont.value += 'ك';entry=false;} - if (keyCode==188) {cont.value += 'و';entry=false;} - if (keyCode==190) {cont.value += 'ز';entry=false;} - if (keyCode==191) {cont.value += 'ظ';entry=false;} - if (keyCode==192) {cont.value += 'ذ';entry=false;} - if (keyCode==219) {cont.value += 'ج';entry=false;} - if (keyCode==221) {cont.value += 'د';entry=false;} - if (keyCode==222) {cont.value += 'ط';entry=false;} - } - return entry; -} -function hold_it(e){ - if ((document.layers)|(navigator.userAgent.indexOf("MSIE 4")>-1)|(langue!="Arabic")) return true; - - var keyCode; - if (!e) var e = window.event; - if (e.keyCode) keyCode = e.keyCode; - else if (e.which) keyCode = e.which; - var character = String.fromCharCode(keyCode); - switch(keyCode){ - case 186: - case 188: - case 190: - case 191: - case 192: - case 219: - case 221: - case 222: - case 116: - case 59: - case 47: - case 46: - case 44: - case 39: - return false; - case 92: - return true; - } - if (keyCode<63) return true; - return false; - } - -var obj = document.getElementById( 'uni_area' ); -if ( obj && langue=="Arabic"){ - with (navigator) { - if (appName=="Netscape") - obj.onkeypress = hold_it; - } - obj.onkeydown = arkey; -} +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: multihexa.js + * Scripts for the fck_universalkey.html page. + * Definition des 104 caracteres en hexa unicode. + * + * File Authors: + * Michel Staelens (michel.staelens@wanadoo.fr) + * Bernadette Cierzniak + * Abdul-Aziz Al-Oraij (top7up@hotmail.com) + */ + +var caps=0, lock=0, hexchars="0123456789ABCDEF", accent="0000", keydeb=0 +var key=new Array();j=0;for (i in Maj){key[j]=i;j++} +var ns6=((!document.all)&&(document.getElementById)) +var ie=document.all + +var langue=getCk(); +if (langue==""){ + langue=key[keydeb] +} +CarMaj=Maj[langue].split("|");CarMin=Min[langue].split("|") + +/*unikey*/ +var posUniKeyLeft=0, posUniKeyTop=0 +if (ns6){posUniKeyLeft=0;posUniKeyTop=60} +else if (ie){posUniKeyLeft=0;posUniKeyTop=60} +tracer("fond",posUniKeyLeft,posUniKeyTop,'
',"sign") +/*touches*/ +var posX=new Array(0,28,56,84,112,140,168,196,224,252,280,308,336,42,70,98,126,154,182,210,238,266,294,322,350,50,78,106,134,162,190,218,246,274,302,330,64,92,120,148,176,204,232,260,288,316,28,56,84,294,322,350) +var posY=new Array(14,14,14,14,14,14,14,14,14,14,14,14,14,42,42,42,42,42,42,42,42,42,42,42,42,70,70,70,70,70,70,70,70,70,70,70,98,98,98,98,98,98,98,98,98,98,126,126,126,126,126,126) +var nbTouches=52 +for (i=0;i Lock","Enter","Shift","Shift","<|<","Space",">|>") +var effet=new Array("keyscroll(-3)","keyscroll(3)","faire(\"del\")","RAZ()","faire(\"bck\")","bloq()","faire(\"\\n\")","haut()","haut()","faire(\"ar\")","faire(\" \")","faire(\"av\")") +var nbActions=12 +for (i=0;i') +document.write('') +for (i=0;i') +} +for (i=0;i') +} +for (i=0;i<4;i++){ + document.write('') +} +document.write('') + +/*fonctions*/ +function ecrire(i){ + txt=rechercher()+"|";subtxt=txt.split("|") + ceci=(lock==1)?CarMaj[i]:((caps==1)?CarMaj[i]:CarMin[i]) + if (test(ceci)){subtxt[0]+=cardia(ceci);distinguer(false)} + else if(dia[accent]!=null&&dia[hexa(ceci)]!=null){distinguer(false);accent=hexa(ceci);distinguer(true)} + else if(dia[accent]!=null){subtxt[0]+=fromhexby4tocar(accent)+ceci;distinguer(false)} + else if(dia[hexa(ceci)]!=null){accent=hexa(ceci);distinguer(true)} + else {subtxt[0]+=ceci} + txt=subtxt[0]+"|"+subtxt[1] + afficher(txt) + if (caps==1){caps=0;MinusMajus()} +} +function faire(ceci){ + txt=rechercher()+"|";subtxt=txt.split("|") + l0=subtxt[0].length + l1=subtxt[1].length + c1=subtxt[0].substring(0,(l0-2)) + c2=subtxt[0].substring(0,(l0-1)) + c3=subtxt[1].substring(0,1) + c4=subtxt[1].substring(0,2) + c5=subtxt[0].substring((l0-2),l0) + c6=subtxt[0].substring((l0-1),l0) + c7=subtxt[1].substring(1,l1) + c8=subtxt[1].substring(2,l1) + if(dia[accent]!=null){if(ceci==" "){ceci=fromhexby4tocar(accent)}distinguer(false)} + switch (ceci){ + case("av") :if(escape(c4)!="%0D%0A"){txt=subtxt[0]+c3+"|"+c7}else{txt=subtxt[0]+c4+"|"+c8}break + case("ar") :if(escape(c5)!="%0D%0A"){txt=c2+"|"+c6+subtxt[1]}else{txt=c1+"|"+c5+subtxt[1]}break + case("bck"):if(escape(c5)!="%0D%0A"){txt=c2+"|"+subtxt[1]}else{txt=c1+"|"+subtxt[1]}break + case("del"):if(escape(c4)!="%0D%0A"){txt=subtxt[0]+"|"+c7}else{txt=subtxt[0]+"|"+c8}break + default:txt=subtxt[0]+ceci+"|"+subtxt[1];break + } + afficher(txt) +} +function RAZ(){txt="";if(dia[accent]!=null){distinguer(false)}afficher(txt)} +function haut(){caps=1;MinusMajus()} +function bloq(){lock=(lock==1)?0:1;MinusMajus()} + +/*fonctions de traitement du unikey*/ +function tracer(nom,gauche,haut,ceci,classe){ceci=""+ceci+"";document.write('
'+ceci+'
');if (ns6){document.getElementById(nom).style.left=gauche+"px";document.getElementById(nom).style.top=haut+"px";}else if (ie){document.all(nom).style.left=gauche;document.all(nom).style.top=haut}} +function retracer(nom,ceci,classe){ceci=""+ceci+"";if (ns6){document.getElementById(nom).innerHTML=ceci}else if (ie){doc=document.all(nom);doc.innerHTML=ceci}} +function keyscroll(n){ + keydeb+=n + if (keydeb<0){ + keydeb=0 + } + if (keydeb>key.length-4){ + keydeb=key.length-4 + } + for (i=keydeb;i=0;a--){out+=Math.pow(16,inval.length-a-1)*hexchars.indexOf(inval.charAt(a))}return out} +function fromhexby4tocar(ceci){out4=new String();for (l=0;l-1)|(langue!="Arabic")) return true; + + if (!e) var e = window.event; + if (e.keyCode) keyCode = e.keyCode; + else if (e.which) keyCode = e.which; + var character = String.fromCharCode(keyCode); + + entry = true; + cont=e.srcElement || e.currentTarget || e.target; + if (keyCode>64 && keyCode<91) { + entry=false; + source='ش لاؤ ي ث ب ل ا ه ت ن م ة ى خ ح ض ق س ف ع ر ص ء غ ئ '; + shsource='ِ لآ} ] ُ [ لأأ ÷ ـ ، / آ × ؛ َ ٌ ٍ لإ { ً ْ إ ~'; + + if (e.shiftKey) cont.value += shsource.substr((keyCode-64)*2-2,2); + else + cont.value += source.substr((keyCode-64)*2-2,2); + if (cont.value.substr(cont.value.length-1,1)==' ') cont.value=cont.value.substr(0,cont.value.length-1); + } + if (e.shiftKey) { + if (keyCode==186) {cont.value += ':';entry=false;} + if (keyCode==188) {cont.value += ',';entry=false;} + if (keyCode==190) {cont.value += '.';entry=false;} + if (keyCode==191) {cont.value += '؟';entry=false;} + if (keyCode==192) {cont.value += 'ّ';entry=false;} + if (keyCode==219) {cont.value += '<';entry=false;} + if (keyCode==221) {cont.value += '>';entry=false;} + } else { + if (keyCode==186||keyCode==59) {cont.value += 'ك';entry=false;} + if (keyCode==188) {cont.value += 'و';entry=false;} + if (keyCode==190) {cont.value += 'ز';entry=false;} + if (keyCode==191) {cont.value += 'ظ';entry=false;} + if (keyCode==192) {cont.value += 'ذ';entry=false;} + if (keyCode==219) {cont.value += 'ج';entry=false;} + if (keyCode==221) {cont.value += 'د';entry=false;} + if (keyCode==222) {cont.value += 'ط';entry=false;} + } + return entry; +} +function hold_it(e){ + if ((document.layers)|(navigator.userAgent.indexOf("MSIE 4")>-1)|(langue!="Arabic")) return true; + + var keyCode; + if (!e) var e = window.event; + if (e.keyCode) keyCode = e.keyCode; + else if (e.which) keyCode = e.which; + var character = String.fromCharCode(keyCode); + switch(keyCode){ + case 186: + case 188: + case 190: + case 191: + case 192: + case 219: + case 221: + case 222: + case 116: + case 59: + case 47: + case 46: + case 44: + case 39: + return false; + case 92: + return true; + } + if (keyCode<63) return true; + return false; + } + +var obj = document.getElementById( 'uni_area' ); +if ( obj && langue=="Arabic"){ + with (navigator) { + if (appName=="Netscape") + obj.onkeypress = hold_it; + } + obj.onkeydown = arkey; +} // Arabic Keystroke Translator End \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.css b/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.css index 5b22a0049cf..bc7f6ace3d0 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.css +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.css @@ -1,84 +1,84 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: browser.css - * CSS styles used by all pages that compose the File Browser. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -body -{ - background-color: #f1f1f3; -} - -form -{ - margin: 0px 0px 0px 0px ; - padding: 0px 0px 0px 0px ; -} - -.Frame -{ - background-color: #f1f1f3; - border-color: #f1f1f3; - border-right: thin inset; - border-top: thin inset; - border-left: thin inset; - border-bottom: thin inset; -} - -body.FileArea -{ - - background-color: #ffffff; -} - -body, td, input, select -{ - font-size: 11px; - font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana; -} - -.ActualFolder -{ - font-weight: bold; - font-size: 14px; -} - -.PopupButtons -{ - border-top: #d5d59d 1px solid; - background-color: #e3e3d7; - padding: 7px 10px 7px 10px; -} - -.Button, button -{ - border-right: #737357 1px solid; - border-top: #737357 1px solid; - border-left: #737357 1px solid; - color: #3b3b1f; - border-bottom: #737357 1px solid; - background-color: #c7c7cf; -} - -.FolderListCurrentFolder img -{ - background-image: url(images/FolderOpened.gif); -} - -.FolderListFolder img -{ - background-image: url(images/Folder.gif); +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: browser.css + * CSS styles used by all pages that compose the File Browser. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +body +{ + background-color: #f1f1e3; +} + +form +{ + margin: 0px 0px 0px 0px ; + padding: 0px 0px 0px 0px ; +} + +.Frame +{ + background-color: #f1f1e3; + border-color: #f1f1e3; + border-right: thin inset; + border-top: thin inset; + border-left: thin inset; + border-bottom: thin inset; +} + +body.FileArea +{ + + background-color: #ffffff; +} + +body, td, input, select +{ + font-size: 11px; + font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana; +} + +.ActualFolder +{ + font-weight: bold; + font-size: 14px; +} + +.PopupButtons +{ + border-top: #d5d59d 1px solid; + background-color: #e3e3c7; + padding: 7px 10px 7px 10px; +} + +.Button, button +{ + border-right: #737357 1px solid; + border-top: #737357 1px solid; + border-left: #737357 1px solid; + color: #3b3b1f; + border-bottom: #737357 1px solid; + background-color: #c7c78f; +} + +.FolderListCurrentFolder img +{ + background-image: url(images/FolderOpened.gif); +} + +.FolderListFolder img +{ + background-image: url(images/Folder.gif); } \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.html index 10f53146e24..9d7d6058dcb 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/browser.html @@ -1,148 +1,148 @@ - - - - - FCKeditor - Resources Browser - - - - - - - - - - - - - - - - - - - - + + + + + FCKeditor - Resources Browser + + + + + + + + + + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp index fa86743ee7a..b07d2ec97ca 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/basexml.asp @@ -1,58 +1,58 @@ - -<% - -Sub SetXmlHeaders() - ' Cleans the response buffer. - Response.Clear() - - ' Prevent the browser from caching the result. - Response.CacheControl = "no-cache" - - ' Set the response format. - Response.CharSet = "UTF-8" - Response.ContentType = "text/xml" -End Sub - -Sub CreateXmlHeader( command, resourceType, currentFolder ) - ' Create the XML document header. - Response.Write "" - - ' Create the main "Connector" node. - Response.Write "" - - ' Add the current folder node. - Response.Write "" -End Sub - -Sub CreateXmlFooter() - Response.Write "" -End Sub - -Sub SendError( number, text ) - SetXmlHeaders - - ' Create the XML document header. - Response.Write "" - - Response.Write "" - - Response.End -End Sub + +<% + +Sub SetXmlHeaders() + ' Cleans the response buffer. + Response.Clear() + + ' Prevent the browser from caching the result. + Response.CacheControl = "no-cache" + + ' Set the response format. + Response.CharSet = "UTF-8" + Response.ContentType = "text/xml" +End Sub + +Sub CreateXmlHeader( command, resourceType, currentFolder ) + ' Create the XML document header. + Response.Write "" + + ' Create the main "Connector" node. + Response.Write "" + + ' Add the current folder node. + Response.Write "" +End Sub + +Sub CreateXmlFooter() + Response.Write "" +End Sub + +Sub SendError( number, text ) + SetXmlHeaders + + ' Create the XML document header. + Response.Write "" + + Response.Write "" + + Response.End +End Sub %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp index 5e60ab92ee3..05f39f7c24d 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/class_upload.asp @@ -1,230 +1,230 @@ - -<% -'********************************************** -' File: NetRube_Upload.asp -' Version: NetRube Upload Class Version 2.1 Build 20050228 -' Author: NetRube -' Email: NetRube@126.com -' Date: 02/28/2005 -' Comments: The code for the Upload. -' This can free usage, but please -' not to delete this copyright information. -' If you have a modification version, -' Please send out a duplicate to me. -'********************************************** -' 文件名: NetRube_Upload.asp -' 版本: NetRube Upload Class Version 2.1 Build 20050228 -' 作者: NetRube(网络乡巴佬) -' 电子邮件: NetRube@126.com -' 日期: 2005年02月28日 -' 声明: 文件上传类 -' 本上传类可以自由使用,但请保留此版权声明信息 -' 如果您对本上传类进行修改增强, -' 请发送一份给俺。 -'********************************************** - -Class NetRube_Upload - - Public File, Form - Private oSourceData - Private nMaxSize, nErr, sAllowed, sDenied - - Private Sub Class_Initialize - nErr = 0 - nMaxSize = 1048576 - - Set File = Server.CreateObject("Scripting.Dictionary") - File.CompareMode = 1 - Set Form = Server.CreateObject("Scripting.Dictionary") - Form.CompareMode = 1 - - Set oSourceData = Server.CreateObject("ADODB.Stream") - oSourceData.Type = 1 - oSourceData.Mode = 3 - oSourceData.Open - End Sub - - Private Sub Class_Terminate - Form.RemoveAll - Set Form = Nothing - File.RemoveAll - Set File = Nothing - - oSourceData.Close - Set oSourceData = Nothing - End Sub - - Public Property Get Version - Version = "NetRube Upload Class Version 1.0 Build 20041218" - End Property - - Public Property Get ErrNum - ErrNum = nErr - End Property - - Public Property Let MaxSize(nSize) - nMaxSize = nSize - End Property - - Public Property Let Allowed(sExt) - sAllowed = sExt - End Property - - Public Property Let Denied(sExt) - sDenied = sExt - End Property - - Public Sub GetData - Dim aCType - aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") - If aCType(0) <> "multipart/form-data" Then - nErr = 1 - Exit Sub - End If - - Dim nTotalSize - nTotalSize = Request.TotalBytes - If nTotalSize < 1 Then - nErr = 2 - Exit Sub - End If - If nMaxSize > 0 And nTotalSize > nMaxSize Then - nErr = 3 - Exit Sub - End If - - oSourceData.Write Request.BinaryRead(nTotalSize) - oSourceData.Position = 0 - - Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary - - oTotalData = oSourceData.Read - bCrLf = ChrB(13) & ChrB(10) - sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) - nBoundLen = LenB(sBoundary) + 2 - nFormStart = nBoundLen - - Set oFormStream = Server.CreateObject("ADODB.Stream") - - Do While (nFormStart + 2) < nTotalSize - nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 - - With oFormStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = nFormStart - oSourceData.CopyTo oFormStream, nFormEnd - nFormStart - .Position = 0 - .Type = 2 - .CharSet = "UTF-8" - sFormHeader = .ReadText - .Close - End With - - nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 - nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 - nPosEnd = InStr(nPosStart, sFormHeader, """") - sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - - If InStr(45, sFormHeader, " filename=", 1) > 0 Then - Set File(sFormName) = New NetRube_FileInfo - File(sFormName).FormName = sFormName - File(sFormName).Start = nFormEnd - File(sFormName).Size = nFormStart - nFormEnd - 2 - nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 - nPosEnd = InStr(nPosStart, sFormHeader, """") - File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) - File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) - nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 - nPosEnd = InStr(nPosStart, sFormHeader, vbCr) - File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - Else - With oFormStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = nPosEnd - oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 - .Position = 0 - .Type = 2 - .CharSet = "UTF-8" - Form(sFormName) = .ReadText - .Close - End With - End If - - nFormStart = nFormStart + nBoundLen - Loop - - oTotalData = "" - Set oFormStream = Nothing - End Sub - - Public Sub SaveAs(sItem, sFileName) - If File(sItem).Size < 1 Then - nErr = 2 - Exit Sub - End If - - If Not IsAllowed(File(sItem).Ext) Then - nErr = 4 - Exit Sub - End If - - Dim oFileStream - Set oFileStream = Server.CreateObject("ADODB.Stream") - With oFileStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = File(sItem).Start - oSourceData.CopyTo oFileStream, File(sItem).Size - .Position = 0 - .SaveToFile sFileName, 2 - .Close - End With - Set oFileStream = Nothing - End Sub - - Private Function IsAllowed(sExt) - Dim oRE - Set oRE = New RegExp - oRE.IgnoreCase = True - oRE.Global = True - - If sDenied = "" Then - oRE.Pattern = sAllowed - IsAllowed = (sAllowed = "") Or oRE.Test(sExt) - Else - oRE.Pattern = sDenied - IsAllowed = Not oRE.Test(sExt) - End If - - Set oRE = Nothing - End Function -End Class - -Class NetRube_FileInfo - Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start -End Class + +<% +'********************************************** +' File: NetRube_Upload.asp +' Version: NetRube Upload Class Version 2.1 Build 20050228 +' Author: NetRube +' Email: NetRube@126.com +' Date: 02/28/2005 +' Comments: The code for the Upload. +' This can free usage, but please +' not to delete this copyright information. +' If you have a modification version, +' Please send out a duplicate to me. +'********************************************** +' 文件名: NetRube_Upload.asp +' 版本: NetRube Upload Class Version 2.1 Build 20050228 +' 作者: NetRube(网络乡巴佬) +' 电子邮件: NetRube@126.com +' 日期: 2005年02月28日 +' 声明: 文件上传类 +' 本上传类可以自由使用,但请保留此版权声明信息 +' 如果您对本上传类进行修改增强, +' 请发送一份给俺。 +'********************************************** + +Class NetRube_Upload + + Public File, Form + Private oSourceData + Private nMaxSize, nErr, sAllowed, sDenied + + Private Sub Class_Initialize + nErr = 0 + nMaxSize = 1048576 + + Set File = Server.CreateObject("Scripting.Dictionary") + File.CompareMode = 1 + Set Form = Server.CreateObject("Scripting.Dictionary") + Form.CompareMode = 1 + + Set oSourceData = Server.CreateObject("ADODB.Stream") + oSourceData.Type = 1 + oSourceData.Mode = 3 + oSourceData.Open + End Sub + + Private Sub Class_Terminate + Form.RemoveAll + Set Form = Nothing + File.RemoveAll + Set File = Nothing + + oSourceData.Close + Set oSourceData = Nothing + End Sub + + Public Property Get Version + Version = "NetRube Upload Class Version 1.0 Build 20041218" + End Property + + Public Property Get ErrNum + ErrNum = nErr + End Property + + Public Property Let MaxSize(nSize) + nMaxSize = nSize + End Property + + Public Property Let Allowed(sExt) + sAllowed = sExt + End Property + + Public Property Let Denied(sExt) + sDenied = sExt + End Property + + Public Sub GetData + Dim aCType + aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") + If aCType(0) <> "multipart/form-data" Then + nErr = 1 + Exit Sub + End If + + Dim nTotalSize + nTotalSize = Request.TotalBytes + If nTotalSize < 1 Then + nErr = 2 + Exit Sub + End If + If nMaxSize > 0 And nTotalSize > nMaxSize Then + nErr = 3 + Exit Sub + End If + + oSourceData.Write Request.BinaryRead(nTotalSize) + oSourceData.Position = 0 + + Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary + + oTotalData = oSourceData.Read + bCrLf = ChrB(13) & ChrB(10) + sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) + nBoundLen = LenB(sBoundary) + 2 + nFormStart = nBoundLen + + Set oFormStream = Server.CreateObject("ADODB.Stream") + + Do While (nFormStart + 2) < nTotalSize + nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 + + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nFormStart + oSourceData.CopyTo oFormStream, nFormEnd - nFormStart + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + sFormHeader = .ReadText + .Close + End With + + nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 + nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 + nPosEnd = InStr(nPosStart, sFormHeader, """") + sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + + If InStr(45, sFormHeader, " filename=", 1) > 0 Then + Set File(sFormName) = New NetRube_FileInfo + File(sFormName).FormName = sFormName + File(sFormName).Start = nFormEnd + File(sFormName).Size = nFormStart - nFormEnd - 2 + nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 + nPosEnd = InStr(nPosStart, sFormHeader, """") + File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) + File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) + nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 + nPosEnd = InStr(nPosStart, sFormHeader, vbCr) + File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + Else + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nPosEnd + oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + Form(sFormName) = .ReadText + .Close + End With + End If + + nFormStart = nFormStart + nBoundLen + Loop + + oTotalData = "" + Set oFormStream = Nothing + End Sub + + Public Sub SaveAs(sItem, sFileName) + If File(sItem).Size < 1 Then + nErr = 2 + Exit Sub + End If + + If Not IsAllowed(File(sItem).Ext) Then + nErr = 4 + Exit Sub + End If + + Dim oFileStream + Set oFileStream = Server.CreateObject("ADODB.Stream") + With oFileStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = File(sItem).Start + oSourceData.CopyTo oFileStream, File(sItem).Size + .Position = 0 + .SaveToFile sFileName, 2 + .Close + End With + Set oFileStream = Nothing + End Sub + + Private Function IsAllowed(sExt) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + If sDenied = "" Then + oRE.Pattern = sAllowed + IsAllowed = (sAllowed = "") Or oRE.Test(sExt) + Else + oRE.Pattern = sDenied + IsAllowed = Not oRE.Test(sExt) + End If + + Set oRE = Nothing + End Function +End Class + +Class NetRube_FileInfo + Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start +End Class %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp index d093488a47a..f3844476aad 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/commands.asp @@ -1,179 +1,179 @@ - -<% -Sub GetFolders( resourceType, currentFolder ) - ' Map the virtual path to the local server path. - Dim sServerDir - sServerDir = ServerMapFolder( resourceType, currentFolder ) - - ' Open the "Folders" node. - Response.Write "" - - Dim oFSO, oCurrentFolder, oFolders, oFolder - Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) - Set oCurrentFolder = oFSO.GetFolder( sServerDir ) - Set oFolders = oCurrentFolder.SubFolders - - For Each oFolder in oFolders - Response.Write "" - Next - - Set oFSO = Nothing - - ' Close the "Folders" node. - Response.Write "" -End Sub - -Sub GetFoldersAndFiles( resourceType, currentFolder ) - ' Map the virtual path to the local server path. - Dim sServerDir - sServerDir = ServerMapFolder( resourceType, currentFolder ) - - Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile - Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) - Set oCurrentFolder = oFSO.GetFolder( sServerDir ) - Set oFolders = oCurrentFolder.SubFolders - Set oFiles = oCurrentFolder.Files - - ' Open the "Folders" node. - Response.Write "" - - For Each oFolder in oFolders - Response.Write "" - Next - - ' Close the "Folders" node. - Response.Write "" - - ' Open the "Files" node. - Response.Write "" - - For Each oFile in oFiles - Dim iFileSize - iFileSize = Round( oFile.size / 1024 ) - If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1 - - Response.Write "" - Next - - ' Close the "Files" node. - Response.Write "" -End Sub - -Sub CreateFolder( resourceType, currentFolder ) - Dim sErrorNumber - - Dim sNewFolderName - sNewFolderName = Request.QueryString( "NewFolderName" ) - - If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0 ) Then - sErrorNumber = "102" - Else - ' Map the virtual path to the local server path of the current folder. - Dim sServerDir - sServerDir = ServerMapFolder( resourceType, currentFolder & "/" & sNewFolderName ) - - On Error Resume Next - - CreateServerFolder sServerDir - - Dim iErrNumber, sErrDescription - iErrNumber = err.number - sErrDescription = err.Description - - On Error Goto 0 - - Select Case iErrNumber - Case 0 - sErrorNumber = "0" - Case 52 - sErrorNumber = "102" ' Invalid Folder Name. - Case 70 - sErrorNumber = "103" ' Security Error. - Case 76 - sErrorNumber = "102" ' Path too long. - Case Else - sErrorNumber = "110" - End Select - End If - - ' Create the "Error" node. - Response.Write "" -End Sub - -Sub FileUpload( resourceType, currentFolder ) - Dim oUploader - Set oUploader = New NetRube_Upload - oUploader.MaxSize = 0 - oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) - oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) - oUploader.GetData - - Dim sErrorNumber - sErrorNumber = "0" - - Dim sFileName, sOriginalFileName, sExtension - sFileName = "" - - If oUploader.ErrNum > 1 Then - sErrorNumber = "202" - Else - ' Map the virtual path to the local server path. - Dim sServerDir - sServerDir = ServerMapFolder( resourceType, currentFolder ) - - Dim oFSO - Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) - - ' Get the uploaded file name. - sFileName = oUploader.File( "NewFile" ).Name - sExtension = oUploader.File( "NewFile" ).Ext - sOriginalFileName = sFileName - - Dim iCounter - iCounter = 0 - - Do While ( True ) - Dim sFilePath - sFilePath = sServerDir & sFileName - - If ( oFSO.FileExists( sFilePath ) ) Then - iCounter = iCounter + 1 - sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension - sErrorNumber = "201" - Else - oUploader.SaveAs "NewFile", sFilePath - If oUploader.ErrNum > 0 Then sErrorNumber = "202" - Exit Do - End If - Loop - End If - - Set oUploader = Nothing - - Response.Clear - - Response.Write "" - - Response.End -End Sub + +<% +Sub GetFolders( resourceType, currentFolder ) + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder ) + + ' Open the "Folders" node. + Response.Write "" + + Dim oFSO, oCurrentFolder, oFolders, oFolder + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + Set oCurrentFolder = oFSO.GetFolder( sServerDir ) + Set oFolders = oCurrentFolder.SubFolders + + For Each oFolder in oFolders + Response.Write "" + Next + + Set oFSO = Nothing + + ' Close the "Folders" node. + Response.Write "" +End Sub + +Sub GetFoldersAndFiles( resourceType, currentFolder ) + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder ) + + Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + Set oCurrentFolder = oFSO.GetFolder( sServerDir ) + Set oFolders = oCurrentFolder.SubFolders + Set oFiles = oCurrentFolder.Files + + ' Open the "Folders" node. + Response.Write "" + + For Each oFolder in oFolders + Response.Write "" + Next + + ' Close the "Folders" node. + Response.Write "" + + ' Open the "Files" node. + Response.Write "" + + For Each oFile in oFiles + Dim iFileSize + iFileSize = Round( oFile.size / 1024 ) + If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1 + + Response.Write "" + Next + + ' Close the "Files" node. + Response.Write "" +End Sub + +Sub CreateFolder( resourceType, currentFolder ) + Dim sErrorNumber + + Dim sNewFolderName + sNewFolderName = Request.QueryString( "NewFolderName" ) + + If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0 ) Then + sErrorNumber = "102" + Else + ' Map the virtual path to the local server path of the current folder. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder & "/" & sNewFolderName ) + + On Error Resume Next + + CreateServerFolder sServerDir + + Dim iErrNumber, sErrDescription + iErrNumber = err.number + sErrDescription = err.Description + + On Error Goto 0 + + Select Case iErrNumber + Case 0 + sErrorNumber = "0" + Case 52 + sErrorNumber = "102" ' Invalid Folder Name. + Case 70 + sErrorNumber = "103" ' Security Error. + Case 76 + sErrorNumber = "102" ' Path too long. + Case Else + sErrorNumber = "110" + End Select + End If + + ' Create the "Error" node. + Response.Write "" +End Sub + +Sub FileUpload( resourceType, currentFolder ) + Dim oUploader + Set oUploader = New NetRube_Upload + oUploader.MaxSize = 0 + oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) + oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) + oUploader.GetData + + Dim sErrorNumber + sErrorNumber = "0" + + Dim sFileName, sOriginalFileName, sExtension + sFileName = "" + + If oUploader.ErrNum > 1 Then + sErrorNumber = "202" + Else + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = ServerMapFolder( resourceType, currentFolder ) + + Dim oFSO + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + + ' Get the uploaded file name. + sFileName = oUploader.File( "NewFile" ).Name + sExtension = oUploader.File( "NewFile" ).Ext + sOriginalFileName = sFileName + + Dim iCounter + iCounter = 0 + + Do While ( True ) + Dim sFilePath + sFilePath = sServerDir & sFileName + + If ( oFSO.FileExists( sFilePath ) ) Then + iCounter = iCounter + 1 + sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension + sErrorNumber = "201" + Else + oUploader.SaveAs "NewFile", sFilePath + If oUploader.ErrNum > 0 Then sErrorNumber = "202" + Exit Do + End If + Loop + End If + + Set oUploader = Nothing + + Response.Clear + + Response.Write "" + + Response.End +End Sub %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp index 804af66bee8..9da8c2da0c0 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/config.asp @@ -1,45 +1,45 @@ - -<% - -' SECURITY: You must explicitelly enable this "connector" (set it to "True"). -Dim ConfigIsEnabled -ConfigIsEnabled = False - -' Path to user files relative to the document root. -Dim ConfigUserFilesPath -ConfigUserFilesPath = "/UserFiles/" - -Dim ConfigAllowedExtensions, ConfigDeniedExtensions -Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) -Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) - -ConfigAllowedExtensions.Add "File", "" -ConfigDeniedExtensions.Add "File", "php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi" - -ConfigAllowedExtensions.Add "Image", "jpg|gif|jpeg|png|bmp" -ConfigDeniedExtensions.Add "Image", "" - -ConfigAllowedExtensions.Add "Flash", "swf|fla" -ConfigDeniedExtensions.Add "Flash", "" - -ConfigAllowedExtensions.Add "Media", "swf|fla|jpg|gif|jpeg|png|avi|mpg|mpeg|mp(1-4)|wma|wmv|wav|mid|midi|rmi|rm|ram|rmvb|mov|qt" -ConfigDeniedExtensions.Add "Media", "" - + +<% + +' SECURITY: You must explicitelly enable this "connector" (set it to "True"). +Dim ConfigIsEnabled +ConfigIsEnabled = False + +' Path to user files relative to the document root. +Dim ConfigUserFilesPath +ConfigUserFilesPath = "/UserFiles/" + +Dim ConfigAllowedExtensions, ConfigDeniedExtensions +Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) +Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) + +ConfigAllowedExtensions.Add "File", "" +ConfigDeniedExtensions.Add "File", "php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi" + +ConfigAllowedExtensions.Add "Image", "jpg|gif|jpeg|png|bmp" +ConfigDeniedExtensions.Add "Image", "" + +ConfigAllowedExtensions.Add "Flash", "swf|fla" +ConfigDeniedExtensions.Add "Flash", "" + +ConfigAllowedExtensions.Add "Media", "swf|fla|jpg|gif|jpeg|png|avi|mpg|mpeg|mp(1-4)|wma|wmv|wav|mid|midi|rmi|rm|ram|rmvb|mov|qt" +ConfigDeniedExtensions.Add "Media", "" + %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp index 157a5c1d31c..08b217b16dd 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/connector.asp @@ -1,120 +1,120 @@ -<%@ CodePage=65001 Language="VBScript"%> -<% -Option Explicit -Response.Buffer = True -%> - - - - - - - -<% - -If ( ConfigIsEnabled = False ) Then - SendError 1, "This connector is disabled. Please check the ""editor/filemanager/browser/default/connectors/asp/config.asp"" file" -End If - -' Get the "UserFiles" path. -Dim sUserFilesPath - -If ( Not IsEmpty( ConfigUserFilesPath ) ) Then - sUserFilesPath = ConfigUserFilesPath - - If ( Right( sUserFilesPath, 1 ) <> "/" ) Then - sUserFilesPath = sUserFilesPath & "/" - End If -Else - sUserFilesPath = "/UserFiles/" -End If - -' Map the "UserFiles" path to a local directory. -Dim sUserFilesDirectory -sUserFilesDirectory = Server.MapPath( sUserFilesPath ) - -If ( Right( sUserFilesDirectory, 1 ) <> "\" ) Then - sUserFilesDirectory = sUserFilesDirectory & "\" -End If - -DoResponse - -Sub DoResponse() - Dim sCommand, sResourceType, sCurrentFolder - - ' Get the main request information. - sCommand = Request.QueryString("Command") - If ( sCommand = "" ) Then Exit Sub - - sResourceType = Request.QueryString("Type") - If ( sResourceType = "" ) Then Exit Sub - - sCurrentFolder = Request.QueryString("CurrentFolder") - If ( sCurrentFolder = "" ) Then Exit Sub - - ' Check if it is an allower resource type. - if ( Not IsAllowedType( sResourceType ) ) Then Exit Sub - - ' Check the current folder syntax (must begin and start with a slash). - If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/" - If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder - - ' Check for invalid folder paths (..) - If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sResourceType, ".." ) <> 0 ) Then - SendError 102, "" - End If - - ' File Upload doesn't have to Return XML, so it must be intercepted before anything. - If ( sCommand = "FileUpload" ) Then - FileUpload sResourceType, sCurrentFolder - Exit Sub - End If - - SetXmlHeaders - - CreateXmlHeader sCommand, sResourceType, sCurrentFolder - - ' Execute the required command. - Select Case sCommand - Case "GetFolders" - GetFolders sResourceType, sCurrentFolder - Case "GetFoldersAndFiles" - GetFoldersAndFiles sResourceType, sCurrentFolder - Case "CreateFolder" - CreateFolder sResourceType, sCurrentFolder - End Select - - CreateXmlFooter - - Response.End -End Sub - -Function IsAllowedType( resourceType ) - Dim oRE - Set oRE = New RegExp - oRE.IgnoreCase = True - oRE.Global = True - oRE.Pattern = "^(File|Image|Flash|Media)$" - - IsAllowedType = oRE.Test( resourceType ) - - Set oRE = Nothing -End Function +<%@ CodePage=65001 Language="VBScript"%> +<% +Option Explicit +Response.Buffer = True +%> + + + + + + + +<% + +If ( ConfigIsEnabled = False ) Then + SendError 1, "This connector is disabled. Please check the ""editor/filemanager/browser/default/connectors/asp/config.asp"" file" +End If + +' Get the "UserFiles" path. +Dim sUserFilesPath + +If ( Not IsEmpty( ConfigUserFilesPath ) ) Then + sUserFilesPath = ConfigUserFilesPath + + If ( Right( sUserFilesPath, 1 ) <> "/" ) Then + sUserFilesPath = sUserFilesPath & "/" + End If +Else + sUserFilesPath = "/UserFiles/" +End If + +' Map the "UserFiles" path to a local directory. +Dim sUserFilesDirectory +sUserFilesDirectory = Server.MapPath( sUserFilesPath ) + +If ( Right( sUserFilesDirectory, 1 ) <> "\" ) Then + sUserFilesDirectory = sUserFilesDirectory & "\" +End If + +DoResponse + +Sub DoResponse() + Dim sCommand, sResourceType, sCurrentFolder + + ' Get the main request information. + sCommand = Request.QueryString("Command") + If ( sCommand = "" ) Then Exit Sub + + sResourceType = Request.QueryString("Type") + If ( sResourceType = "" ) Then Exit Sub + + sCurrentFolder = Request.QueryString("CurrentFolder") + If ( sCurrentFolder = "" ) Then Exit Sub + + ' Check if it is an allower resource type. + if ( Not IsAllowedType( sResourceType ) ) Then Exit Sub + + ' Check the current folder syntax (must begin and start with a slash). + If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/" + If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder + + ' Check for invalid folder paths (..) + If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sResourceType, ".." ) <> 0 ) Then + SendError 102, "" + End If + + ' File Upload doesn't have to Return XML, so it must be intercepted before anything. + If ( sCommand = "FileUpload" ) Then + FileUpload sResourceType, sCurrentFolder + Exit Sub + End If + + SetXmlHeaders + + CreateXmlHeader sCommand, sResourceType, sCurrentFolder + + ' Execute the required command. + Select Case sCommand + Case "GetFolders" + GetFolders sResourceType, sCurrentFolder + Case "GetFoldersAndFiles" + GetFoldersAndFiles sResourceType, sCurrentFolder + Case "CreateFolder" + CreateFolder sResourceType, sCurrentFolder + End Select + + CreateXmlFooter + + Response.End +End Sub + +Function IsAllowedType( resourceType ) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + oRE.Pattern = "^(File|Image|Flash|Media)$" + + IsAllowedType = oRE.Test( resourceType ) + + Set oRE = Nothing +End Function %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp index d4cedafb7d6..ec710776a08 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/io.asp @@ -1,85 +1,85 @@ - -<% -Function GetUrlFromPath( resourceType, folderPath ) - If resourceType = "" Then - GetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPath - Else - GetUrlFromPath = sUserFilesPath & resourceType & folderPath - End If -End Function - -Function RemoveExtension( fileName ) - RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) -End Function - -Function ServerMapFolder( resourceType, folderPath ) - ' Get the resource type directory. - Dim sResourceTypePath - sResourceTypePath = sUserFilesDirectory & resourceType & "\" - - ' Ensure that the directory exists. - CreateServerFolder sResourceTypePath - - ' Return the resource type directory combined with the required path. - ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" ) -End Function - -Sub CreateServerFolder( folderPath ) - Dim oFSO - Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) - - Dim sParent - sParent = oFSO.GetParentFolderName( folderPath ) - - ' Check if the parent exists, or create it. - If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent ) - - If ( oFSO.FolderExists( folderPath ) = False ) Then - oFSO.CreateFolder( folderPath ) - End If - - Set oFSO = Nothing -End Sub - -Function IsAllowedExt( extension, resourceType ) - Dim oRE - Set oRE = New RegExp - oRE.IgnoreCase = True - oRE.Global = True - - Dim sAllowed, sDenied - sAllowed = ConfigAllowedExtensions.Item( resourceType ) - sDenied = ConfigDeniedExtensions.Item( resourceType ) - - IsAllowedExt = True - - If sDenied <> "" Then - oRE.Pattern = sDenied - IsAllowedExt = Not oRE.Test( extension ) - End If - - If IsAllowedExt And sAllowed <> "" Then - oRE.Pattern = sAllowed - IsAllowedExt = oRE.Test( extension ) - End If - - Set oRE = Nothing -End Function + +<% +Function GetUrlFromPath( resourceType, folderPath ) + If resourceType = "" Then + GetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPath + Else + GetUrlFromPath = sUserFilesPath & resourceType & folderPath + End If +End Function + +Function RemoveExtension( fileName ) + RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) +End Function + +Function ServerMapFolder( resourceType, folderPath ) + ' Get the resource type directory. + Dim sResourceTypePath + sResourceTypePath = sUserFilesDirectory & resourceType & "\" + + ' Ensure that the directory exists. + CreateServerFolder sResourceTypePath + + ' Return the resource type directory combined with the required path. + ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" ) +End Function + +Sub CreateServerFolder( folderPath ) + Dim oFSO + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + + Dim sParent + sParent = oFSO.GetParentFolderName( folderPath ) + + ' Check if the parent exists, or create it. + If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent ) + + If ( oFSO.FolderExists( folderPath ) = False ) Then + oFSO.CreateFolder( folderPath ) + End If + + Set oFSO = Nothing +End Sub + +Function IsAllowedExt( extension, resourceType ) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + Dim sAllowed, sDenied + sAllowed = ConfigAllowedExtensions.Item( resourceType ) + sDenied = ConfigDeniedExtensions.Item( resourceType ) + + IsAllowedExt = True + + If sDenied <> "" Then + oRE.Pattern = sDenied + IsAllowedExt = Not oRE.Test( extension ) + End If + + If IsAllowedExt And sAllowed <> "" Then + oRE.Pattern = sAllowed + IsAllowedExt = oRE.Test( extension ) + End If + + Set oRE = Nothing +End Function %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp index c06eed66603..f149354b3bf 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/asp/util.asp @@ -1,51 +1,51 @@ - -<% -Function RemoveFromStart( sourceString, charToRemove ) - Dim oRegex - Set oRegex = New RegExp - oRegex.Pattern = "^" & charToRemove & "+" - - RemoveFromStart = oRegex.Replace( sourceString, "" ) -End Function - -Function RemoveFromEnd( sourceString, charToRemove ) - Dim oRegex - Set oRegex = New RegExp - oRegex.Pattern = charToRemove & "+$" - - RemoveFromEnd = oRegex.Replace( sourceString, "" ) -End Function - -Function ConvertToXmlAttribute( value ) - ConvertToXmlAttribute = Replace( value, "&", "&" ) -End Function - -Function InArray( value, sourceArray ) - Dim i - For i = 0 to UBound( sourceArray ) - If sourceArray(i) = value Then - InArray = True - Exit Function - End If - Next - InArray = False -End Function - + +<% +Function RemoveFromStart( sourceString, charToRemove ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Pattern = "^" & charToRemove & "+" + + RemoveFromStart = oRegex.Replace( sourceString, "" ) +End Function + +Function RemoveFromEnd( sourceString, charToRemove ) + Dim oRegex + Set oRegex = New RegExp + oRegex.Pattern = charToRemove & "+$" + + RemoveFromEnd = oRegex.Replace( sourceString, "" ) +End Function + +Function ConvertToXmlAttribute( value ) + ConvertToXmlAttribute = Replace( value, "&", "&" ) +End Function + +Function InArray( value, sourceArray ) + Dim i + For i = 0 to UBound( sourceArray ) + If sourceArray(i) = value Then + InArray = True + Exit Function + End If + Next + InArray = False +End Function + %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx index 8b814b39dee..465ecebb55b 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx @@ -1,26 +1,26 @@ -<%@ Page language="c#" Inherits="FredCK.FCKeditorV2.FileBrowserConnector" AutoEventWireup="false" %> -<%-- - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: connector.aspx - * This is the File Browser Connector for ASP.NET. - * - * The code of this page if included in the FCKeditor.Net package, - * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must - * include that DLL in your "bin" directory. - * - * To download the FCKeditor.Net package, go to our official web site: - * http://www.fckeditor.net - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) +<%@ Page language="c#" Inherits="FredCK.FCKeditorV2.FileBrowserConnector" AutoEventWireup="false" %> +<%-- + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: connector.aspx + * This is the File Browser Connector for ASP.NET. + * + * The code of this page if included in the FCKeditor.Net package, + * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must + * include that DLL in your "bin" directory. + * + * To download the FCKeditor.Net package, go to our official web site: + * http://www.fckeditor.net + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) --%> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm index 10c976dc133..6ceb2c425e3 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/config.cfm @@ -1,80 +1,80 @@ - - - - config = structNew(); - - // SECURITY: You must explicitly enable this "connector". (Set enabled to "true") - config.enabled = false; - - config.userFilesPath = "/UserFiles/"; - - config.serverPath = ""; // use this to force the server path if FCKeditor is not running directly off the root of the application or the FCKeditor directory in the URL is a virtual directory or a symbolic link / junction - - config.allowedExtensions = structNew(); - config.deniedExtensions = structNew(); - - // config.allowedExtensions["File"] = "doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip"; - config.allowedExtensions["File"] = ""; - config.deniedExtensions["File"] = "php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi"; - - config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp"; - config.deniedExtensions["Image"] = ""; - - config.allowedExtensions["Flash"] = "swf,fla"; - config.deniedExtensions["Flash"] = ""; - - config.allowedExtensions["Media"] = "swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt"; - config.deniedExtensions["Media"] = ""; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function structCopyKeys(stFrom, stTo) { - for ( key in stFrom ) { - if ( isStruct(stFrom[key]) ) { - structCopyKeys(stFrom[key],stTo[key]); - } else { - stTo[key] = stFrom[key]; - } - } - } - structCopyKeys(FCKeditor, config); - - - + + + + config = structNew(); + + // SECURITY: You must explicitly enable this "connector". (Set enabled to "true") + config.enabled = false; + + config.userFilesPath = "/UserFiles/"; + + config.serverPath = ""; // use this to force the server path if FCKeditor is not running directly off the root of the application or the FCKeditor directory in the URL is a virtual directory or a symbolic link / junction + + config.allowedExtensions = structNew(); + config.deniedExtensions = structNew(); + + // config.allowedExtensions["File"] = "doc,rtf,pdf,ppt,pps,xls,csv,vnd,zip"; + config.allowedExtensions["File"] = ""; + config.deniedExtensions["File"] = "php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi"; + + config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp"; + config.deniedExtensions["Image"] = ""; + + config.allowedExtensions["Flash"] = "swf,fla"; + config.deniedExtensions["Flash"] = ""; + + config.allowedExtensions["Media"] = "swf,fla,jpg,gif,jpeg,png,avi,mpg,mpeg,mp3,mp4,m4a,wma,wmv,wav,mid,midi,rmi,rm,ram,rmvb,mov,qt"; + config.deniedExtensions["Media"] = ""; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function structCopyKeys(stFrom, stTo) { + for ( key in stFrom ) { + if ( isStruct(stFrom[key]) ) { + structCopyKeys(stFrom[key],stTo[key]); + } else { + stTo[key] = stFrom[key]; + } + } + } + structCopyKeys(FCKeditor, config); + + + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm index 7fa0888abd7..60e8660d523 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/cfm/connector.cfm @@ -1,364 +1,364 @@ - - - - - - - - - - - - userFilesPath = config.userFilesPath; - lAllowedExtensions = config.allowedExtensions[url.type]; - lDeniedExtensions = config.deniedExtensions[url.type]; - - // make sure the user files path is correctly formatted - userFilesPath = replace(userFilesPath, "\", "/", "ALL"); - userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); - if ( right(userFilesPath,1) neq "/" ) { - userFilesPath = userFilesPath & "/"; - } - if ( left(userFilesPath,1) neq "/" ) { - userFilesPath = "/" & userFilesPath; - } - - // make sure the current folder is correctly formatted - url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); - url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); - if ( right(url.currentFolder,1) neq "/" ) { - url.currentFolder = url.currentFolder & "/"; - } - if ( left(url.currentFolder,1) neq "/" ) { - url.currentFolder = "/" & url.currentFolder; - } - - if ( find("/",getBaseTemplatePath()) neq 0 ) { - fs = "/"; - } else { - fs = "\"; - } - - // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that - // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a - // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. - if ( len(config.serverPath) ) { - serverPath = config.serverPath; - } else { - serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),""); - } - - // map the user files path to a physical directory - userFilesServerPath = serverPath & replace(userFilesPath,"/",fs,"all"); - - xmlContent = ""; // append to this string to build content - - - - - "> - - - - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - errorNumber = 0; - fileName = cffile.ClientFileName; - fileExt = cffile.ServerFileExt; - - // munge filename for html download. Only a-z, 0-9, _, - and . are allowed - if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { - fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); - fileName = reReplace(fileName, "_{2,}", "_", "ALL"); - fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); - fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); - } - - // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. - if( compare( cffile.ServerFileName, fileName ) ) { - counter = 0; - tmpFileName = fileName; - while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) { - counter = counter + 1; - fileName = tmpFileName & '(#counter#)'; - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - i=1; - folders = ""; - while( i lte qDir.recordCount ) { - if( not compareNoCase( qDir.type[i], "FILE" )) - break; - if( not listFind(".,..", qDir.name[i]) ) - folders = folders & ''; - i=i+1; - } - - xmlContent = xmlContent & '' & folders & ''; - - - - - - - - - - - - i=1; - folders = ""; - files = ""; - while( i lte qDir.recordCount ) { - if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) { - folders = folders & ''; - } else if( not compareNoCase( qDir.type[i], "FILE" ) ) { - fileSizeKB = round(qDir.size[i] / 1024); - files = files & ''; - } - i=i+1; - } - - xmlContent = xmlContent & '' & folders & ''; - xmlContent = xmlContent & '' & files & ''; - - - - - - - - - - - newFolderName = url.newFolderName; - if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) { - // Munge folder name same way as we do the filename - // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8 - newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all"); - newFolderName = reReplace(newFolderName, "_{2,}", "_", "all"); - newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all"); - newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all"); - } - - - - - - - - - - - - - - - - - - - - - '> - - - - - - - - - - - - - - - - - xmlHeader = ''; - xmlHeader = xmlHeader & ''; - xmlFooter = ''; - - - - - - + + + + + + + + + + + + userFilesPath = config.userFilesPath; + lAllowedExtensions = config.allowedExtensions[url.type]; + lDeniedExtensions = config.deniedExtensions[url.type]; + + // make sure the user files path is correctly formatted + userFilesPath = replace(userFilesPath, "\", "/", "ALL"); + userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); + if ( right(userFilesPath,1) neq "/" ) { + userFilesPath = userFilesPath & "/"; + } + if ( left(userFilesPath,1) neq "/" ) { + userFilesPath = "/" & userFilesPath; + } + + // make sure the current folder is correctly formatted + url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); + url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); + if ( right(url.currentFolder,1) neq "/" ) { + url.currentFolder = url.currentFolder & "/"; + } + if ( left(url.currentFolder,1) neq "/" ) { + url.currentFolder = "/" & url.currentFolder; + } + + if ( find("/",getBaseTemplatePath()) neq 0 ) { + fs = "/"; + } else { + fs = "\"; + } + + // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that + // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a + // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. + if ( len(config.serverPath) ) { + serverPath = config.serverPath; + } else { + serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),""); + } + + // map the user files path to a physical directory + userFilesServerPath = serverPath & replace(userFilesPath,"/",fs,"all"); + + xmlContent = ""; // append to this string to build content + + + + + "> + + + + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + errorNumber = 0; + fileName = cffile.ClientFileName; + fileExt = cffile.ServerFileExt; + + // munge filename for html download. Only a-z, 0-9, _, - and . are allowed + if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { + fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); + fileName = reReplace(fileName, "_{2,}", "_", "ALL"); + fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); + fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); + } + + // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. + if( compare( cffile.ServerFileName, fileName ) ) { + counter = 0; + tmpFileName = fileName; + while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) { + counter = counter + 1; + fileName = tmpFileName & '(#counter#)'; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + i=1; + folders = ""; + while( i lte qDir.recordCount ) { + if( not compareNoCase( qDir.type[i], "FILE" )) + break; + if( not listFind(".,..", qDir.name[i]) ) + folders = folders & ''; + i=i+1; + } + + xmlContent = xmlContent & '' & folders & ''; + + + + + + + + + + + + i=1; + folders = ""; + files = ""; + while( i lte qDir.recordCount ) { + if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) { + folders = folders & ''; + } else if( not compareNoCase( qDir.type[i], "FILE" ) ) { + fileSizeKB = round(qDir.size[i] / 1024); + files = files & ''; + } + i=i+1; + } + + xmlContent = xmlContent & '' & folders & ''; + xmlContent = xmlContent & '' & files & ''; + + + + + + + + + + + newFolderName = url.newFolderName; + if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) { + // Munge folder name same way as we do the filename + // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8 + newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all"); + newFolderName = reReplace(newFolderName, "_{2,}", "_", "all"); + newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all"); + newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all"); + } + + + + + + + + + + + + + + + + + + + + + '> + + + + + + + + + + + + + + + + + xmlHeader = ''; + xmlHeader = xmlHeader & ''; + xmlFooter = ''; + + + + + + #xmlHeader##xmlContent##xmlFooter# \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso index 460138e97ec..4f400430f10 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/config.lasso @@ -1,61 +1,61 @@ -[//lasso -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: config.lasso - * Configuration file for the File Manager Connector for Lasso. - * - * File Authors: - * Jason Huck (jason.huck@corefive.com) - */ - - /*..................................................................... - The connector uses the file tags, which require authentication. Enter a - valid username and password from Lasso admin for a group with file tags - permissions for uploads and the path you define in UserFilesPath below. - */ - - var('connection') = array( - -username='xxxxxxxx', - -password='xxxxxxxx' - ); - - - /*..................................................................... - Set the base path for files that users can upload and browse (relative - to server root). - - Set which file extensions are allowed and/or denied for each file type. - */ - var('config') = map( - 'Enabled' = true, - 'UserFilesPath' = '/UserFiles/', - 'Subdirectories' = map( - 'File' = 'File/', - 'Image' = 'Image/', - 'Flash' = 'Flash/', - 'Media' = 'Media/' - ), - 'AllowedExtensions' = map( - 'File' = array(), - 'Image' = array('jpg','gif','jpeg','png'), - 'Flash' = array('swf','fla'), - 'Media' = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') - ), - 'DeniedExtensions' = map( - 'File' = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','lasso','lassoapp'), - 'Image' = array(), - 'Flash' = array(), - 'Media' = array() - ) - ); +[//lasso +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: config.lasso + * Configuration file for the File Manager Connector for Lasso. + * + * File Authors: + * Jason Huck (jason.huck@corefive.com) + */ + + /*..................................................................... + The connector uses the file tags, which require authentication. Enter a + valid username and password from Lasso admin for a group with file tags + permissions for uploads and the path you define in UserFilesPath below. + */ + + var('connection') = array( + -username='xxxxxxxx', + -password='xxxxxxxx' + ); + + + /*..................................................................... + Set the base path for files that users can upload and browse (relative + to server root). + + Set which file extensions are allowed and/or denied for each file type. + */ + var('config') = map( + 'Enabled' = true, + 'UserFilesPath' = '/UserFiles/', + 'Subdirectories' = map( + 'File' = 'File/', + 'Image' = 'Image/', + 'Flash' = 'Flash/', + 'Media' = 'Media/' + ), + 'AllowedExtensions' = map( + 'File' = array(), + 'Image' = array('jpg','gif','jpeg','png'), + 'Flash' = array('swf','fla'), + 'Media' = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') + ), + 'DeniedExtensions' = map( + 'File' = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','lasso','lassoapp'), + 'Image' = array(), + 'Flash' = array(), + 'Media' = array() + ) + ); ] \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso index 54c0ce52e69..e7af87f6bde 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/lasso/connector.lasso @@ -1,245 +1,245 @@ -[//lasso -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: connector.lasso - * This is the File Manager Connector for Lasso. - * - * File Authors: - * Jason Huck (jason.huck@corefive.com) - */ - - /*..................................................................... - Include global configuration. See config.lasso for details. - */ - include('config.lasso'); - - - /*..................................................................... - Translate current date/time to GMT for custom header. - */ - var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT'); - - - /*..................................................................... - Convert query string parameters to variables and initialize output. - */ - var( - 'Command' = action_param('Command'), - 'Type' = action_param('Type'), - 'CurrentFolder' = action_param('CurrentFolder'), - 'ServerPath' = action_param('ServerPath'), - 'NewFolderName' = action_param('NewFolderName'), - 'NewFile' = null, - 'NewFileName' = string, - 'OrigFilePath' = string, - 'NewFilePath' = string, - 'commandData' = string, - 'folders' = '\t\n', - 'files' = '\t\n', - 'errorNumber' = integer, - 'responseType' = 'xml', - 'uploadResult' = '0' - ); - - - /*..................................................................... - Calculate the path to the current folder. - */ - $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); - - var('currentFolderURL' = $ServerPath - + $config->find('Subdirectories')->find(action_param('Type')) - + action_param('CurrentFolder') - ); - - - /*..................................................................... - Build the appropriate response per the 'Command' parameter. Wrap the - entire process in an inline for file tag permissions. - */ - inline($connection); - select($Command); - /*............................................................. - List all subdirectories in the 'Current Folder' directory. - */ - case('GetFolders'); - $commandData += '\t\n'; - - iterate(file_listdirectory($currentFolderURL), local('this')); - #this->endswith('/') ? $commandData += '\t\t\n'; - /iterate; - - $commandData += '\t\n'; - - - /*............................................................. - List both files and folders in the 'Current Folder' directory. - Include the file sizes in kilobytes. - */ - case('GetFoldersAndFiles'); - iterate(file_listdirectory($currentFolderURL), local('this')); - if(#this->endswith('/')); - $folders += '\t\t\n'; - else; - local('size') = file_getsize($currentFolderURL + #this) / 1024; - $files += '\t\t\n'; - /if; - /iterate; - - $folders += '\t\n'; - $files += '\t\n'; - - $commandData += $folders + $files; - - - /*............................................................. - Create a directory 'NewFolderName' within the 'Current Folder.' - */ - case('CreateFolder'); - var('newFolder' = $currentFolderURL + $NewFolderName + '/'); - file_create($newFolder); - - - /*......................................................... - Map Lasso's file error codes to FCKEditor's error codes. - */ - select(file_currenterror( -errorcode)); - case(0); - $errorNumber = 0; - case( -9983); - $errorNumber = 101; - case( -9976); - $errorNumber = 102; - case( -9977); - $errorNumber = 102; - case( -9961); - $errorNumber = 103; - case; - $errorNumber = 110; - /select; - - $commandData += '\n'; - - - /*............................................................. - Process an uploaded file. - */ - case('FileUpload'); - /*......................................................... - This is the only command that returns an HTML response. - */ - $responseType = 'html'; - - - /*......................................................... - Was a file actually uploaded? - */ - file_uploads->size ? $NewFile = file_uploads->get(1) | $uploadResult = '202'; - - if($uploadResult == '0'); - /*..................................................... - Split the file's extension from the filename in order - to follow the API's naming convention for duplicate - files. (Test.txt, Test(1).txt, Test(2).txt, etc.) - */ - $NewFileName = $NewFile->find('OrigName'); - $OrigFilePath = $currentFolderURL + $NewFileName; - $NewFilePath = $OrigFilePath; - local('fileExtension') = '.' + $NewFile->find('OrigExtension'); - local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; - - - /*..................................................... - Make sure the file extension is allowed. - */ - if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); - $uploadResult = '202'; - else; - /*................................................. - Rename the target path until it is unique. - */ - while(file_exists($NewFilePath)); - $NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension; - /while; - - - /*................................................. - Copy the uploaded file to its final location. - */ - file_copy($NewFile->find('path'), $NewFilePath); - - - /*................................................. - Set the error code for the response. Note whether - the file had to be renamed. - */ - select(file_currenterror( -errorcode)); - case(0); - $OrigFilePath != $NewFilePath ? $uploadResult = '201, \'' + $NewFilePath->split('/')->last + '\''; - case; - $uploadResult = '202'; - /select; - /if; - /if; - - - /*......................................................... - Set the HTML response. - */ - $__html_reply__ = '\ - - '; - /select; - /inline; - - - /*..................................................................... - Send a custom header for xml responses. - */ - if($responseType == 'xml'); - header; -] -HTTP/1.0 200 OK -Date: [$headerDate] -Server: Lasso Professional [lasso_version( -lassoversion)] -Expires: Mon, 26 Jul 1997 05:00:00 GMT -Last-Modified: [$headerDate] -Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 -Pragma: no-cache -Keep-Alive: timeout=15, max=98 -Connection: Keep-Alive -Content-Type: text/xml; charset=utf-8 -[//lasso - /header; - - - /*................................................................. - Set the content type encoding for Lasso. - */ - content_type('text/xml; charset=utf-8'); - - - /*................................................................. - Wrap the response as XML and output. - */ - $__html_reply__ = '\ - - - -' + $commandData + ' - - '; - /if; -] +[//lasso +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: connector.lasso + * This is the File Manager Connector for Lasso. + * + * File Authors: + * Jason Huck (jason.huck@corefive.com) + */ + + /*..................................................................... + Include global configuration. See config.lasso for details. + */ + include('config.lasso'); + + + /*..................................................................... + Translate current date/time to GMT for custom header. + */ + var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT'); + + + /*..................................................................... + Convert query string parameters to variables and initialize output. + */ + var( + 'Command' = action_param('Command'), + 'Type' = action_param('Type'), + 'CurrentFolder' = action_param('CurrentFolder'), + 'ServerPath' = action_param('ServerPath'), + 'NewFolderName' = action_param('NewFolderName'), + 'NewFile' = null, + 'NewFileName' = string, + 'OrigFilePath' = string, + 'NewFilePath' = string, + 'commandData' = string, + 'folders' = '\t\n', + 'files' = '\t\n', + 'errorNumber' = integer, + 'responseType' = 'xml', + 'uploadResult' = '0' + ); + + + /*..................................................................... + Calculate the path to the current folder. + */ + $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); + + var('currentFolderURL' = $ServerPath + + $config->find('Subdirectories')->find(action_param('Type')) + + action_param('CurrentFolder') + ); + + + /*..................................................................... + Build the appropriate response per the 'Command' parameter. Wrap the + entire process in an inline for file tag permissions. + */ + inline($connection); + select($Command); + /*............................................................. + List all subdirectories in the 'Current Folder' directory. + */ + case('GetFolders'); + $commandData += '\t\n'; + + iterate(file_listdirectory($currentFolderURL), local('this')); + #this->endswith('/') ? $commandData += '\t\t\n'; + /iterate; + + $commandData += '\t\n'; + + + /*............................................................. + List both files and folders in the 'Current Folder' directory. + Include the file sizes in kilobytes. + */ + case('GetFoldersAndFiles'); + iterate(file_listdirectory($currentFolderURL), local('this')); + if(#this->endswith('/')); + $folders += '\t\t\n'; + else; + local('size') = file_getsize($currentFolderURL + #this) / 1024; + $files += '\t\t\n'; + /if; + /iterate; + + $folders += '\t\n'; + $files += '\t\n'; + + $commandData += $folders + $files; + + + /*............................................................. + Create a directory 'NewFolderName' within the 'Current Folder.' + */ + case('CreateFolder'); + var('newFolder' = $currentFolderURL + $NewFolderName + '/'); + file_create($newFolder); + + + /*......................................................... + Map Lasso's file error codes to FCKEditor's error codes. + */ + select(file_currenterror( -errorcode)); + case(0); + $errorNumber = 0; + case( -9983); + $errorNumber = 101; + case( -9976); + $errorNumber = 102; + case( -9977); + $errorNumber = 102; + case( -9961); + $errorNumber = 103; + case; + $errorNumber = 110; + /select; + + $commandData += '\n'; + + + /*............................................................. + Process an uploaded file. + */ + case('FileUpload'); + /*......................................................... + This is the only command that returns an HTML response. + */ + $responseType = 'html'; + + + /*......................................................... + Was a file actually uploaded? + */ + file_uploads->size ? $NewFile = file_uploads->get(1) | $uploadResult = '202'; + + if($uploadResult == '0'); + /*..................................................... + Split the file's extension from the filename in order + to follow the API's naming convention for duplicate + files. (Test.txt, Test(1).txt, Test(2).txt, etc.) + */ + $NewFileName = $NewFile->find('OrigName'); + $OrigFilePath = $currentFolderURL + $NewFileName; + $NewFilePath = $OrigFilePath; + local('fileExtension') = '.' + $NewFile->find('OrigExtension'); + local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; + + + /*..................................................... + Make sure the file extension is allowed. + */ + if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); + $uploadResult = '202'; + else; + /*................................................. + Rename the target path until it is unique. + */ + while(file_exists($NewFilePath)); + $NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension; + /while; + + + /*................................................. + Copy the uploaded file to its final location. + */ + file_copy($NewFile->find('path'), $NewFilePath); + + + /*................................................. + Set the error code for the response. Note whether + the file had to be renamed. + */ + select(file_currenterror( -errorcode)); + case(0); + $OrigFilePath != $NewFilePath ? $uploadResult = '201, \'' + $NewFilePath->split('/')->last + '\''; + case; + $uploadResult = '202'; + /select; + /if; + /if; + + + /*......................................................... + Set the HTML response. + */ + $__html_reply__ = '\ + + '; + /select; + /inline; + + + /*..................................................................... + Send a custom header for xml responses. + */ + if($responseType == 'xml'); + header; +] +HTTP/1.0 200 OK +Date: [$headerDate] +Server: Lasso Professional [lasso_version( -lassoversion)] +Expires: Mon, 26 Jul 1997 05:00:00 GMT +Last-Modified: [$headerDate] +Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 +Pragma: no-cache +Keep-Alive: timeout=15, max=98 +Connection: Keep-Alive +Content-Type: text/xml; charset=utf-8 +[//lasso + /header; + + + /*................................................................. + Set the content type encoding for Lasso. + */ + content_type('text/xml; charset=utf-8'); + + + /*................................................................. + Wrap the response as XML and output. + */ + $__html_reply__ = '\ + + + +' + $commandData + ' + + '; + /if; +] diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl index 2f28287b185..fed09747cb9 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl @@ -1,59 +1,59 @@ -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: basexml.pl -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -##### - -sub CreateXmlHeader -{ - local($command,$resourceType,$currentFolder) = @_; - - # Create the XML document header. - print ''; - - # Create the main "Connector" node. - print ''; - - # Add the current folder node. - print ''; -} - -sub CreateXmlFooter -{ - print ''; -} - -sub SendError -{ - local( $number, $text ) = @_; - - print << "_HTML_HEAD_"; -Content-Type:text/xml; charset=utf-8 -Pragma: no-cache -Cache-Control: no-cache -Expires: Thu, 01 Dec 1994 16:00:00 GMT - -_HTML_HEAD_ - - # Create the XML document header - print '' ; - - print '' ; - - exit ; -} - -1; +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: basexml.pl +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +##### + +sub CreateXmlHeader +{ + local($command,$resourceType,$currentFolder) = @_; + + # Create the XML document header. + print ''; + + # Create the main "Connector" node. + print ''; + + # Add the current folder node. + print ''; +} + +sub CreateXmlFooter +{ + print ''; +} + +sub SendError +{ + local( $number, $text ) = @_; + + print << "_HTML_HEAD_"; +Content-Type:text/xml; charset=utf-8 +Pragma: no-cache +Cache-Control: no-cache +Expires: Thu, 01 Dec 1994 16:00:00 GMT + +_HTML_HEAD_ + + # Create the XML document header + print '' ; + + print '' ; + + exit ; +} + +1; diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl index 6e54d0c93b7..1b5928f95fe 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl @@ -1,154 +1,154 @@ -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: commands.pl -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -##### - -sub GetFolders -{ - - local($resourceType, $currentFolder) = @_; - - # Map the virtual path to the local server path. - $sServerDir = &ServerMapFolder($resourceType, $currentFolder); - print ""; # Open the "Folders" node. - - opendir(DIR,"$sServerDir"); - @files = grep(!/^\.\.?$/,readdir(DIR)); - closedir(DIR); - - foreach $sFile (@files) { - if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) { - $cnv_filename = &ConvertToXmlAttribute($sFile); - print ''; - } - } - print ""; # Close the "Folders" node. -} - -sub GetFoldersAndFiles -{ - - local($resourceType, $currentFolder) = @_; - # Map the virtual path to the local server path. - $sServerDir = &ServerMapFolder($resourceType,$currentFolder); - - # Initialize the output buffers for "Folders" and "Files". - $sFolders = ''; - $sFiles = ''; - - opendir(DIR,"$sServerDir"); - @files = grep(!/^\.\.?$/,readdir(DIR)); - closedir(DIR); - - foreach $sFile (@files) { - if($sFile ne '.' && $sFile ne '..') { - if(-d "$sServerDir$sFile") { - $cnv_filename = &ConvertToXmlAttribute($sFile); - $sFolders .= '' ; - } else { - ($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2]; - if($iFileSize > 0) { - $iFileSize = int($iFileSize / 1024); - if($iFileSize < 1) { - $iFileSize = 1; - } - } - $cnv_filename = &ConvertToXmlAttribute($sFile); - $sFiles .= '' ; - } - } - } - print $sFolders ; - print ''; # Close the "Folders" node. - print $sFiles ; - print ''; # Close the "Files" node. -} - -sub CreateFolder -{ - - local($resourceType, $currentFolder) = @_; - $sErrorNumber = '0' ; - $sErrorMsg = '' ; - - if($FORM{'NewFolderName'} ne "") { - $sNewFolderName = $FORM{'NewFolderName'}; - # Map the virtual path to the local server path of the current folder. - $sServerDir = &ServerMapFolder($resourceType, $currentFolder); - if(-w $sServerDir) { - $sServerDir .= $sNewFolderName; - $sErrorMsg = &CreateServerFolder($sServerDir); - if($sErrorMsg == 0) { - $sErrorNumber = '0'; - } elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') { - $sErrorNumber = '102'; #// Path too long. - } else { - $sErrorNumber = '110'; - } - } else { - $sErrorNumber = '103'; - } - } else { - $sErrorNumber = '102' ; - } - # Create the "Error" node. - $cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg); - print ''; -} - -sub FileUpload -{ -eval("use File::Copy;"); - - local($resourceType, $currentFolder) = @_; - - $sErrorNumber = '0' ; - $sFileName = '' ; - if($new_fname) { - # Map the virtual path to the local server path. - $sServerDir = &ServerMapFolder($resourceType,$currentFolder); - - # Get the uploaded file name. - $sFileName = $new_fname; - $sOriginalFileName = $sFileName; - - $iCounter = 0; - while(1) { - $sFilePath = $sServerDir . $sFileName; - if(-e $sFilePath) { - $iCounter++ ; - ($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName); - $sFileName = $BaseName . '(' . $iCounter . ').' . $ext; - $sErrorNumber = '201'; - } else { - copy("$img_dir/$new_fname","$sFilePath"); - chmod(0777,$sFilePath); - unlink("$img_dir/$new_fname"); - last; - } - } - } else { - $sErrorNumber = '202' ; - } - $sFileName =~ s/"/\\"/g; - print "Content-type: text/html\n\n"; - print ''; - exit ; -} -1; +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: commands.pl +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +##### + +sub GetFolders +{ + + local($resourceType, $currentFolder) = @_; + + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType, $currentFolder); + print ""; # Open the "Folders" node. + + opendir(DIR,"$sServerDir"); + @files = grep(!/^\.\.?$/,readdir(DIR)); + closedir(DIR); + + foreach $sFile (@files) { + if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) { + $cnv_filename = &ConvertToXmlAttribute($sFile); + print ''; + } + } + print ""; # Close the "Folders" node. +} + +sub GetFoldersAndFiles +{ + + local($resourceType, $currentFolder) = @_; + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType,$currentFolder); + + # Initialize the output buffers for "Folders" and "Files". + $sFolders = ''; + $sFiles = ''; + + opendir(DIR,"$sServerDir"); + @files = grep(!/^\.\.?$/,readdir(DIR)); + closedir(DIR); + + foreach $sFile (@files) { + if($sFile ne '.' && $sFile ne '..') { + if(-d "$sServerDir$sFile") { + $cnv_filename = &ConvertToXmlAttribute($sFile); + $sFolders .= '' ; + } else { + ($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2]; + if($iFileSize > 0) { + $iFileSize = int($iFileSize / 1024); + if($iFileSize < 1) { + $iFileSize = 1; + } + } + $cnv_filename = &ConvertToXmlAttribute($sFile); + $sFiles .= '' ; + } + } + } + print $sFolders ; + print ''; # Close the "Folders" node. + print $sFiles ; + print ''; # Close the "Files" node. +} + +sub CreateFolder +{ + + local($resourceType, $currentFolder) = @_; + $sErrorNumber = '0' ; + $sErrorMsg = '' ; + + if($FORM{'NewFolderName'} ne "") { + $sNewFolderName = $FORM{'NewFolderName'}; + # Map the virtual path to the local server path of the current folder. + $sServerDir = &ServerMapFolder($resourceType, $currentFolder); + if(-w $sServerDir) { + $sServerDir .= $sNewFolderName; + $sErrorMsg = &CreateServerFolder($sServerDir); + if($sErrorMsg == 0) { + $sErrorNumber = '0'; + } elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') { + $sErrorNumber = '102'; #// Path too long. + } else { + $sErrorNumber = '110'; + } + } else { + $sErrorNumber = '103'; + } + } else { + $sErrorNumber = '102' ; + } + # Create the "Error" node. + $cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg); + print ''; +} + +sub FileUpload +{ +eval("use File::Copy;"); + + local($resourceType, $currentFolder) = @_; + + $sErrorNumber = '0' ; + $sFileName = '' ; + if($new_fname) { + # Map the virtual path to the local server path. + $sServerDir = &ServerMapFolder($resourceType,$currentFolder); + + # Get the uploaded file name. + $sFileName = $new_fname; + $sOriginalFileName = $sFileName; + + $iCounter = 0; + while(1) { + $sFilePath = $sServerDir . $sFileName; + if(-e $sFilePath) { + $iCounter++ ; + ($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName); + $sFileName = $BaseName . '(' . $iCounter . ').' . $ext; + $sErrorNumber = '201'; + } else { + copy("$img_dir/$new_fname","$sFilePath"); + chmod(0777,$sFilePath); + unlink("$img_dir/$new_fname"); + last; + } + } + } else { + $sErrorNumber = '202' ; + } + $sFileName =~ s/"/\\"/g; + print "Content-type: text/html\n\n"; + print ''; + exit ; +} +1; diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi index dadfcb9ccde..ca123a8390a 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi @@ -1,134 +1,134 @@ -#!/usr/bin/env perl - -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: connector.cgi -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -# Frederico Caldeira Knabben (fredck@fckeditor.net) -##### - -## -# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. -## - -## START: Hack for Windows (Not important to understand the editor code... Perl specific). -if(Windows_check()) { - chdir(GetScriptPath($0)); -} - -sub Windows_check -{ - # IIS,PWS(NT/95) - $www_server_os = $^O; - # Win98 & NT(SP4) - if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } - # AnHTTPd/Omni/IIS - if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } - # Win Apache - if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } - if($www_server_os=~ /win/i) { return(1); } - return(0); -} - -sub GetScriptPath { - local($path) = @_; - if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } - $path; -} -## END: Hack for IIS - -require 'util.pl'; -require 'io.pl'; -require 'basexml.pl'; -require 'commands.pl'; -require 'upload_fck.pl'; - -## -# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. -## -&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/perl/connector.cgi" file' ) ; - - &read_input(); - - if($FORM{'ServerPath'} ne "") { - $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; - if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { - $GLOBALS{'UserFilesPath'} .= '/' ; - } - } else { - $GLOBALS{'UserFilesPath'} = '/UserFiles/'; - } - - # Map the "UserFiles" path to a local directory. - $rootpath = &GetRootPath(); - $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; - - &DoResponse(); - -sub DoResponse -{ - - if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") { - return ; - } - # Get the main request informaiton. - $sCommand = $FORM{'Command'}; - $sResourceType = $FORM{'Type'}; - $sCurrentFolder = $FORM{'CurrentFolder'}; - - # Check the current folder syntax (must begin and start with a slash). - if(!($sCurrentFolder =~ /\/$/)) { - $sCurrentFolder .= '/'; - } - if(!($sCurrentFolder =~ /^\//)) { - $sCurrentFolder = '/' . $sCurrentFolder; - } - - # Check for invalid folder paths (..) - if ( $sCurrentFolder =~ /\.\./ ) { - SendError( 102, "" ) ; - } - - # File Upload doesn't have to Return XML, so it must be intercepted before anything. - if($sCommand eq 'FileUpload') { - FileUpload($sResourceType,$sCurrentFolder); - return ; - } - - print << "_HTML_HEAD_"; -Content-Type:text/xml; charset=utf-8 -Pragma: no-cache -Cache-Control: no-cache -Expires: Thu, 01 Dec 1994 16:00:00 GMT - -_HTML_HEAD_ - - &CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder); - - # Execute the required command. - if($sCommand eq 'GetFolders') { - &GetFolders($sResourceType,$sCurrentFolder); - } elsif($sCommand eq 'GetFoldersAndFiles') { - &GetFoldersAndFiles($sResourceType,$sCurrentFolder); - } elsif($sCommand eq 'CreateFolder') { - &CreateFolder($sResourceType,$sCurrentFolder); - } - - &CreateXmlFooter(); - - exit ; -} - +#!/usr/bin/env perl + +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: connector.cgi +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +# Frederico Caldeira Knabben (fredck@fckeditor.net) +##### + +## +# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. +## + +## START: Hack for Windows (Not important to understand the editor code... Perl specific). +if(Windows_check()) { + chdir(GetScriptPath($0)); +} + +sub Windows_check +{ + # IIS,PWS(NT/95) + $www_server_os = $^O; + # Win98 & NT(SP4) + if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } + # AnHTTPd/Omni/IIS + if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } + # Win Apache + if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } + if($www_server_os=~ /win/i) { return(1); } + return(0); +} + +sub GetScriptPath { + local($path) = @_; + if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } + $path; +} +## END: Hack for IIS + +require 'util.pl'; +require 'io.pl'; +require 'basexml.pl'; +require 'commands.pl'; +require 'upload_fck.pl'; + +## +# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. +## +&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/browser/default/connectors/perl/connector.cgi" file' ) ; + + &read_input(); + + if($FORM{'ServerPath'} ne "") { + $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; + if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { + $GLOBALS{'UserFilesPath'} .= '/' ; + } + } else { + $GLOBALS{'UserFilesPath'} = '/UserFiles/'; + } + + # Map the "UserFiles" path to a local directory. + $rootpath = &GetRootPath(); + $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; + + &DoResponse(); + +sub DoResponse +{ + + if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") { + return ; + } + # Get the main request informaiton. + $sCommand = $FORM{'Command'}; + $sResourceType = $FORM{'Type'}; + $sCurrentFolder = $FORM{'CurrentFolder'}; + + # Check the current folder syntax (must begin and start with a slash). + if(!($sCurrentFolder =~ /\/$/)) { + $sCurrentFolder .= '/'; + } + if(!($sCurrentFolder =~ /^\//)) { + $sCurrentFolder = '/' . $sCurrentFolder; + } + + # Check for invalid folder paths (..) + if ( $sCurrentFolder =~ /\.\./ ) { + SendError( 102, "" ) ; + } + + # File Upload doesn't have to Return XML, so it must be intercepted before anything. + if($sCommand eq 'FileUpload') { + FileUpload($sResourceType,$sCurrentFolder); + return ; + } + + print << "_HTML_HEAD_"; +Content-Type:text/xml; charset=utf-8 +Pragma: no-cache +Cache-Control: no-cache +Expires: Thu, 01 Dec 1994 16:00:00 GMT + +_HTML_HEAD_ + + &CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder); + + # Execute the required command. + if($sCommand eq 'GetFolders') { + &GetFolders($sResourceType,$sCurrentFolder); + } elsif($sCommand eq 'GetFoldersAndFiles') { + &GetFoldersAndFiles($sResourceType,$sCurrentFolder); + } elsif($sCommand eq 'CreateFolder') { + &CreateFolder($sResourceType,$sCurrentFolder); + } + + &CreateXmlFooter(); + + exit ; +} + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl index 472f6be8aa9..18d501e738c 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl @@ -1,127 +1,127 @@ -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: io.pl -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -##### - -sub GetUrlFromPath -{ - local($resourceType, $folderPath) = @_; - - if($resourceType eq '') { - $rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/'); - return("$rmpath$folderPath"); - } else { - return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath"); - } -} - -sub RemoveExtension -{ - local($fileName) = @_; - local($path, $base, $ext); - if($fileName !~ /\./) { - $fileName .= '.'; - } - if($fileName =~ /([^\\\/]*)\.(.*)$/) { - $base = $1; - $ext = $2; - if($fileName =~ /(.*)$base\.$ext$/) { - $path = $1; - } - } - return($path,$base,$ext); - -} - -sub ServerMapFolder -{ - local($resourceType,$folderPath) = @_; - - # Get the resource type directory. - $sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/'; - - # Ensure that the directory exists. - &CreateServerFolder($sResourceTypePath); - - # Return the resource type directory combined with the required path. - $rmpath = &RemoveFromStart($folderPath,'/'); - return("$sResourceTypePath$rmpath"); -} - -sub GetParentFolder -{ - local($folderPath) = @_; - - $folderPath =~ s/[\/][^\/]+[\/]?$//g; - return $folderPath; -} - -sub CreateServerFolder -{ - local($folderPath) = @_; - - $sParent = &GetParentFolder($folderPath); - # Check if the parent exists, or create it. - if(!(-e $sParent)) { - $sErrorMsg = &CreateServerFolder($sParent); - if($sErrorMsg == 1) { - return(1); - } - } - if(!(-e $folderPath)) { - umask(000); - mkdir("$folderPath",0777); - chmod(0777,"$folderPath"); - return(0); - } else { - return(1); - } -} - -sub GetRootPath -{ -#use Cwd; - -# my $dir = getcwd; -# print $dir; -# $dir =~ s/$ENV{'DOCUMENT_ROOT'}//g; -# print $dir; -# return($dir); - -# $wk = $0; -# $wk =~ s/\/connector\.cgi//g; -# if($wk) { -# $current_dir = $wk; -# } else { -# $current_dir = `pwd`; -# } -# return($current_dir); -use Cwd; - - if($ENV{'DOCUMENT_ROOT'}) { - $dir = $ENV{'DOCUMENT_ROOT'}; - } else { - my $dir = getcwd; - $workdir =~ s/\/connector\.cgi//g; - $dir =~ s/$workdir//g; - } - return($dir); - - - -} -1; +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: io.pl +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +##### + +sub GetUrlFromPath +{ + local($resourceType, $folderPath) = @_; + + if($resourceType eq '') { + $rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/'); + return("$rmpath$folderPath"); + } else { + return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath"); + } +} + +sub RemoveExtension +{ + local($fileName) = @_; + local($path, $base, $ext); + if($fileName !~ /\./) { + $fileName .= '.'; + } + if($fileName =~ /([^\\\/]*)\.(.*)$/) { + $base = $1; + $ext = $2; + if($fileName =~ /(.*)$base\.$ext$/) { + $path = $1; + } + } + return($path,$base,$ext); + +} + +sub ServerMapFolder +{ + local($resourceType,$folderPath) = @_; + + # Get the resource type directory. + $sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/'; + + # Ensure that the directory exists. + &CreateServerFolder($sResourceTypePath); + + # Return the resource type directory combined with the required path. + $rmpath = &RemoveFromStart($folderPath,'/'); + return("$sResourceTypePath$rmpath"); +} + +sub GetParentFolder +{ + local($folderPath) = @_; + + $folderPath =~ s/[\/][^\/]+[\/]?$//g; + return $folderPath; +} + +sub CreateServerFolder +{ + local($folderPath) = @_; + + $sParent = &GetParentFolder($folderPath); + # Check if the parent exists, or create it. + if(!(-e $sParent)) { + $sErrorMsg = &CreateServerFolder($sParent); + if($sErrorMsg == 1) { + return(1); + } + } + if(!(-e $folderPath)) { + umask(000); + mkdir("$folderPath",0777); + chmod(0777,"$folderPath"); + return(0); + } else { + return(1); + } +} + +sub GetRootPath +{ +#use Cwd; + +# my $dir = getcwd; +# print $dir; +# $dir =~ s/$ENV{'DOCUMENT_ROOT'}//g; +# print $dir; +# return($dir); + +# $wk = $0; +# $wk =~ s/\/connector\.cgi//g; +# if($wk) { +# $current_dir = $wk; +# } else { +# $current_dir = `pwd`; +# } +# return($current_dir); +use Cwd; + + if($ENV{'DOCUMENT_ROOT'}) { + $dir = $ENV{'DOCUMENT_ROOT'}; + } else { + my $dir = getcwd; + $workdir =~ s/\/connector\.cgi//g; + $dir =~ s/$workdir//g; + } + return($dir); + + + +} +1; diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl index 04540812c5a..326880a8c2b 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl @@ -1,663 +1,663 @@ -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: upload_fck.pl -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -##### - -# image data save dir -$img_dir = './temp/'; - - -# File size max(unit KB) -$MAX_CONTENT_SIZE = 30000; - -# Filelock (1=use,0=not use) -$PM{'flock'} = '1'; - - -# upload Content-Type list -my %UPLOAD_CONTENT_TYPE_LIST = ( - 'image/(x-)?png' => 'png', # PNG image - 'image/p?jpe?g' => 'jpg', # JPEG image - 'image/gif' => 'gif', # GIF image - 'image/x-xbitmap' => 'xbm', # XBM image - - 'image/(x-(MS-)?)?bmp' => 'bmp', # Windows BMP image - 'image/pict' => 'pict', # Macintosh PICT image - 'image/tiff' => 'tif', # TIFF image - 'application/pdf' => 'pdf', # PDF image - 'application/x-shockwave-flash' => 'swf', # Shockwave Flash - - 'video/(x-)?msvideo' => 'avi', # Microsoft Video - 'video/quicktime' => 'mov', # QuickTime Video - 'video/mpeg' => 'mpeg', # MPEG Video - 'video/x-mpeg2' => 'mpv2', # MPEG2 Video - - 'audio/(x-)?midi?' => 'mid', # MIDI Audio - 'audio/(x-)?wav' => 'wav', # WAV Audio - 'audio/basic' => 'au', # ULAW Audio - 'audio/mpeg' => 'mpga', # MPEG Audio - - 'application/(x-)?zip(-compressed)?' => 'zip', # ZIP Compress - - 'text/html' => 'html', # HTML - 'text/plain' => 'txt', # TEXT - '(?:application|text)/(?:rtf|richtext)' => 'rtf', # RichText - - 'application/msword' => 'doc', # Microsoft Word - 'application/vnd.ms-excel' => 'xls', # Microsoft Excel - - '' -); - -# Upload is permitted. -# A regular expression is possible. -my %UPLOAD_EXT_LIST = ( - 'png' => 'PNG image', - 'p?jpe?g|jpe|jfif|pjp' => 'JPEG image', - 'gif' => 'GIF image', - 'xbm' => 'XBM image', - - 'bmp|dib|rle' => 'Windows BMP image', - 'pi?ct' => 'Macintosh PICT image', - 'tiff?' => 'TIFF image', - 'pdf' => 'PDF image', - 'swf' => 'Shockwave Flash', - - 'avi' => 'Microsoft Video', - 'moo?v|qt' => 'QuickTime Video', - 'm(p(e?gv?|e|v)|1v)' => 'MPEG Video', - 'mp(v2|2v)' => 'MPEG2 Video', - - 'midi?|kar|smf|rmi|mff' => 'MIDI Audio', - 'wav' => 'WAVE Audio', - 'au|snd' => 'ULAW Audio', - 'mp(e?ga|2|a|3)|abs' => 'MPEG Audio', - - 'zip' => 'ZIP Compress', - 'lzh' => 'LZH Compress', - 'cab' => 'CAB Compress', - - 'd?html?' => 'HTML', - 'rtf|rtx' => 'RichText', - 'txt|text' => 'Text', - - '' -); - - -# sjis or euc -my $CHARCODE = 'sjis'; - -$TRANS_2BYTE_CODE = 0; - -############################################################################## -# Summary -# -# Form Read input -# -# Parameters -# Returns -# Memo -############################################################################## -sub read_input -{ -eval("use File::Copy;"); -eval("use File::Path;"); - - my ($FORM) = @_; - - - mkdir($img_dir,0777); - chmod(0777,$img_dir); - - undef $img_data_exists; - undef @NEWFNAMES; - undef @NEWFNAME_DATA; - - if($ENV{'CONTENT_LENGTH'} > 10000000 || $ENV{'CONTENT_LENGTH'} > $MAX_CONTENT_SIZE * 1024) { - &upload_error( - 'Size Error', - sprintf( - "Transmitting size is too large.MAX %d KB Now Size %d KB(%d bytes Over)", - $MAX_CONTENT_SIZE, - int($ENV{'CONTENT_LENGTH'} / 1024), - $ENV{'CONTENT_LENGTH'} - $MAX_CONTENT_SIZE * 1024 - ) - ); - } - - my $Buffer; - if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) { - # METHOD POST only - return unless($ENV{'CONTENT_LENGTH'}); - - binmode(STDIN); - # STDIN A pause character is detected.'(MacIE3.0 boundary of $ENV{'CONTENT_TYPE'} cannot be trusted.) - my $Boundary = ; - $Boundary =~ s/\x0D\x0A//; - $Boundary = quotemeta($Boundary); - while() { - if(/^\s*Content-Disposition:/i) { - my($name,$ContentType,$FileName); - # form data get - if(/\bname="([^"]+)"/i || /\bname=([^\s:;]+)/i) { - $name = $1; - $name =~ tr/+/ /; - $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; - &Encode(\$name); - } - if(/\bfilename="([^"]*)"/i || /\bfilename=([^\s:;]*)/i) { - $FileName = $1 || 'unknown'; - } - # head read - while() { - last if(! /\w/); - if(/^\s*Content-Type:\s*"([^"]+)"/i || /^\s*Content-Type:\s*([^\s:;]+)/i) { - $ContentType = $1; - } - } - # body read - $value = ""; - while() { - last if(/^$Boundary/o); - $value .= $_; - }; - $lastline = $_; - $value =~s /\x0D\x0A$//; - if($value ne '') { - if($FileName || $ContentType) { - $img_data_exists = 1; - ( - $FileName, # - $Ext, # - $Length, # - $ImageWidth, # - $ImageHeight, # - $ContentName # - ) = &CheckContentType(\$value,$FileName,$ContentType); - - $FORM{$name} = $FileName; - $new_fname = $FileName; - push(@NEWFNAME_DATA,"$FileName\t$Ext\t$Length\t$ImageWidth\t$ImageHeight\t$ContentName"); - - # Multi-upload correspondence - push(@NEWFNAMES,$new_fname); - open(OUT,">$img_dir/$new_fname"); - binmode(OUT); - eval "flock(OUT,2);" if($PM{'flock'} == 1); - print OUT $value; - eval "flock(OUT,8);" if($PM{'flock'} == 1); - close(OUT); - - } elsif($name) { - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; - &Encode(\$value,'trans'); - $FORM{$name} .= "\0" if(defined($FORM{$name})); - $FORM{$name} .= $value; - } - } - }; - last if($lastline =~ /^$Boundary\-\-/o); - } - } elsif($ENV{'CONTENT_LENGTH'}) { - read(STDIN,$Buffer,$ENV{'CONTENT_LENGTH'}); - } - foreach(split(/&/,$Buffer),split(/&/,$ENV{'QUERY_STRING'})) { - my($name, $value) = split(/=/); - $name =~ tr/+/ /; - $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; - - &Encode(\$name); - &Encode(\$value,'trans'); - $FORM{$name} .= "\0" if(defined($FORM{$name})); - $FORM{$name} .= $value; - - } - -} - -############################################################################## -# Summary -# -# CheckContentType -# -# Parameters -# Returns -# Memo -############################################################################## -sub CheckContentType -{ - - my($DATA,$FileName,$ContentType) = @_; - my($Ext,$ImageWidth,$ImageHeight,$ContentName,$Infomation); - my $DataLength = length($$DATA); - - # An unknown file type - - $_ = $ContentType; - my $UnknownType = ( - !$_ - || /^application\/(x-)?macbinary$/i - || /^application\/applefile$/i - || /^application\/octet-stream$/i - || /^text\/plane$/i - || /^x-unknown-content-type/i - ); - - # MacBinary(Mac Unnecessary data are deleted.) - if($UnknownType || $ENV{'HTTP_USER_AGENT'} =~ /Macintosh|Mac_/) { - if($DataLength > 128 && !unpack("C",substr($$DATA,0,1)) && !unpack("C",substr($$DATA,74,1)) && !unpack("C",substr($$DATA,82,1)) ) { - my $MacBinary_ForkLength = unpack("N", substr($$DATA, 83, 4)); # ForkLength Get - my $MacBinary_FileName = quotemeta(substr($$DATA, 2, unpack("C",substr($$DATA, 1, 1)))); - if($MacBinary_FileName && $MacBinary_ForkLength && $DataLength >= $MacBinary_ForkLength + 128 - && ($FileName =~ /$MacBinary_FileName/i || substr($$DATA,102,4) eq 'mBIN')) { # DATA TOP 128byte MacBinary!! - $$DATA = substr($$DATA,128,$MacBinary_ForkLength); - my $ResourceLength = $DataLength - $MacBinary_ForkLength - 128; - $DataLength = $MacBinary_ForkLength; - } - } - } - - # A file name is changed into EUC. -# &jcode::convert(\$FileName,'euc',$FormCodeDefault); -# &jcode::h2z_euc(\$FileName); - $FileName =~ s/^.*\\//; # Windows, Mac - $FileName =~ s/^.*\///; # UNIX - $FileName =~ s/&/&/g; - $FileName =~ s/"/"/g; - $FileName =~ s//>/g; -# -# if($CHARCODE ne 'euc') { -# &jcode::convert(\$FileName,$CHARCODE,'euc'); -# } - - # An extension is extracted and it changes into a small letter. - my $FileExt; - if($FileName =~ /\.(\w+)$/) { - $FileExt = $1; - $FileExt =~ tr/A-Z/a-z/; - } - - # Executable file detection (ban on upload) - if($$DATA =~ /^MZ/) { - $Ext = 'exe'; - } - # text - if(!$Ext && ($UnknownType || $ContentType =~ /^text\//i || $ContentType =~ /^application\/(?:rtf|richtext)$/i || $ContentType =~ /^image\/x-xbitmap$/i) - && ! $$DATA =~ /[\000-\006\177\377]/) { -# $$DATA =~ s/\x0D\x0A/\n/g; -# $$DATA =~ tr/\x0D\x0A/\n\n/; -# -# if( -# $$DATA =~ /<\s*SCRIPT(?:.|\n)*?>/i -# || $$DATA =~ /<\s*(?:.|\n)*?\bONLOAD\s*=(?:.|\n)*?>/i -# || $$DATA =~ /<\s*(?:.|\n)*?\bONCLICK\s*=(?:.|\n)*?>/i -# ) { -# $Infomation = '(JavaScript contains)'; -# } -# if($$DATA =~ /<\s*TABLE(?:.|\n)*?>/i -# || $$DATA =~ /<\s*BLINK(?:.|\n)*?>/i -# || $$DATA =~ /<\s*MARQUEE(?:.|\n)*?>/i -# || $$DATA =~ /<\s*OBJECT(?:.|\n)*?>/i -# || $$DATA =~ /<\s*EMBED(?:.|\n)*?>/i -# || $$DATA =~ /<\s*FRAME(?:.|\n)*?>/i -# || $$DATA =~ /<\s*APPLET(?:.|\n)*?>/i -# || $$DATA =~ /<\s*FORM(?:.|\n)*?>/i -# || $$DATA =~ /<\s*(?:.|\n)*?\bSRC\s*=(?:.|\n)*?>/i -# || $$DATA =~ /<\s*(?:.|\n)*?\bDYNSRC\s*=(?:.|\n)*?>/i -# ) { -# $Infomation = '(the HTML tag which is not safe is included)'; -# } - - if($FileExt =~ /^txt$/i || $FileExt =~ /^cgi$/i || $FileExt =~ /^pl$/i) { # Text File - $Ext = 'txt'; - } elsif($ContentType =~ /^text\/html$/i || $FileExt =~ /html?/i || $$DATA =~ /<\s*HTML(?:.|\n)*?>/i) { # HTML File - $Ext = 'html'; - } elsif($ContentType =~ /^image\/x-xbitmap$/i || $FileExt =~ /^xbm$/i) { # XBM(x-BitMap) Image - my $XbmName = $1; - my ($XbmWidth, $XbmHeight); - if($$DATA =~ /\#define\s*$XbmName\_width\s*(\d+)/i) { - $XbmWidth = $1; - } - if($$DATA =~ /\#define\s*$XbmName\_height\s*(\d+)/i) { - $XbmHeight = $1; - } - if($XbmWidth && $XbmHeight) { - $Ext = 'xbm'; - $ImageWidth = $XbmWidth; - $ImageHeight = $XbmHeight; - } - } else { # - $Ext = 'txt'; - } - } - - # image - if(!$Ext && ($UnknownType || $ContentType =~ /^image\//i)) { - # PNG - if($$DATA =~ /^\x89PNG\x0D\x0A\x1A\x0A/) { - if(substr($$DATA, 12, 4) eq 'IHDR') { - $Ext = 'png'; - ($ImageWidth, $ImageHeight) = unpack("N2", substr($$DATA, 16, 8)); - } - } elsif($$DATA =~ /^GIF8(?:9|7)a/) { # GIF89a(modified), GIF89a, GIF87a - $Ext = 'gif'; - ($ImageWidth, $ImageHeight) = unpack("v2", substr($$DATA, 6, 4)); - } elsif($$DATA =~ /^II\x2a\x00\x08\x00\x00\x00/ || $$DATA =~ /^MM\x00\x2a\x00\x00\x00\x08/) { # TIFF - $Ext = 'tif'; - } elsif($$DATA =~ /^BM/) { # BMP - $Ext = 'bmp'; - } elsif($$DATA =~ /^\xFF\xD8\xFF/ || $$DATA =~ /JFIF/) { # JPEG - my $HeaderPoint = index($$DATA, "\xFF\xD8\xFF", 0); - my $Point = $HeaderPoint + 2; - while($Point < $DataLength) { - my($Maker, $MakerType, $MakerLength) = unpack("C2n",substr($$DATA,$Point,4)); - if($Maker != 0xFF || $MakerType == 0xd9 || $MakerType == 0xda) { - last; - } elsif($MakerType >= 0xC0 && $MakerType <= 0xC3) { - $Ext = 'jpg'; - ($ImageHeight, $ImageWidth) = unpack("n2", substr($$DATA, $Point + 5, 4)); - if($HeaderPoint > 0) { - $$DATA = substr($$DATA, $HeaderPoint); - $DataLength = length($$DATA); - } - last; - } else { - $Point += $MakerLength + 2; - } - } - } - } - - # audio - if(!$Ext && ($UnknownType || $ContentType =~ /^audio\//i)) { - # MIDI Audio - if($$DATA =~ /^MThd/) { - $Ext = 'mid'; - } elsif($$DATA =~ /^\x2esnd/) { # ULAW Audio - $Ext = 'au'; - } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { - my $HeaderPoint = index($$DATA, "RIFF", 0); - $_ = substr($$DATA, $HeaderPoint + 8, 8); - if(/^WAVEfmt $/) { - # WAVE - if(unpack("V",substr($$DATA, $HeaderPoint + 16, 4)) == 16) { - $Ext = 'wav'; - } else { # RIFF WAVE MP3 - $Ext = 'mp3'; - } - } elsif(/^RMIDdata$/) { # RIFF MIDI - $Ext = 'rmi'; - } elsif(/^RMP3data$/) { # RIFF MP3 - $Ext = 'rmp'; - } - if($ContentType =~ /^audio\//i) { - $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; - } - } - } - - # a binary file - unless ($Ext) { - # PDF image - if($$DATA =~ /^\%PDF/) { - # Picture size is not measured. - $Ext = 'pdf'; - } elsif($$DATA =~ /^FWS/) { # Shockwave Flash - $Ext = 'swf'; - } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { - my $HeaderPoint = index($$DATA, "RIFF", 0); - $_ = substr($$DATA,$HeaderPoint + 8, 8); - # AVI - if(/^AVI LIST$/) { - $Ext = 'avi'; - } - if($ContentType =~ /^video\//i) { - $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; - } - } elsif($$DATA =~ /^PK/) { # ZIP Compress File - $Ext = 'zip'; - } elsif($$DATA =~ /^MSCF/) { # CAB Compress File - $Ext = 'cab'; - } elsif($$DATA =~ /^Rar\!/) { # RAR Compress File - $Ext = 'rar'; - } elsif(substr($$DATA, 2, 5) =~ /^\-lh(\d+|d)\-$/) { # LHA Compress File - $Infomation .= "(lh$1)"; - $Ext = 'lzh'; - } elsif(substr($$DATA, 325, 25) eq "Apple Video Media Handler" || substr($$DATA, 325, 30) eq "Apple \x83\x72\x83\x66\x83\x49\x81\x45\x83\x81\x83\x66\x83\x42\x83\x41\x83\x6E\x83\x93\x83\x68\x83\x89") { - # QuickTime - $Ext = 'mov'; - } - } - - # Header analysis failure - unless ($Ext) { - # It will be followed if it applies for the MIME type from the browser. - foreach (keys %UPLOAD_CONTENT_TYPE_LIST) { - next unless ($_); - if($ContentType =~ /^$_$/i) { - $Ext = $UPLOAD_CONTENT_TYPE_LIST{$_}; - $ContentName = &CheckContentExt($Ext); - if( - grep {$_ eq $Ext;} ( - 'png', - 'gif', - 'jpg', - 'xbm', - 'tif', - 'bmp', - 'pdf', - 'swf', - 'mov', - 'zip', - 'cab', - 'lzh', - 'rar', - 'mid', - 'rmi', - 'au', - 'wav', - 'avi', - 'exe' - ) - ) { - $Infomation .= ' / Header analysis failure'; - } - if($Ext ne $FileExt && &CheckContentExt($FileExt) eq $ContentName) { - $Ext = $FileExt; - } - last; - } - } - # a MIME type is unknown--It judges from an extension. - unless ($Ext) { - $ContentName = &CheckContentExt($FileExt); - if($ContentName) { - $Ext = $FileExt; - $Infomation .= ' / MIME type is unknown('. $ContentType. ')'; - last; - } - } - } - -# $ContentName = &CheckContentExt($Ext) unless($ContentName); -# if($Ext && $ContentName) { -# $ContentName .= $Infomation; -# } else { -# &upload_error( -# 'Extension Error', -# "$FileName A not corresponding extension ($Ext)
The extension which can be responded ". join(',', sort values(%UPLOAD_EXT_LIST)) -# ); -# } - -# # SSI Tag Deletion -# if($Ext =~ /.?html?/ && $$DATA =~ /<\!/) { -# foreach ( -# 'config', -# 'echo', -# 'exec', -# 'flastmod', -# 'fsize', -# 'include' -# ) { -# $$DATA =~ s/\#\s*$_/\&\#35\;$_/ig -# } -# } - - return ( - $FileName, - $Ext, - int($DataLength / 1024 + 1), - $ImageWidth, - $ImageHeight, - $ContentName - ); -} - -############################################################################## -# Summary -# -# Extension discernment -# -# Parameters -# Returns -# Memo -############################################################################## - -sub CheckContentExt -{ - - my($Ext) = @_; - my $ContentName; - foreach (keys %UPLOAD_EXT_LIST) { - next unless ($_); - if($_ && $Ext =~ /^$_$/) { - $ContentName = $UPLOAD_EXT_LIST{$_}; - last; - } - } - return $ContentName; - -} - -############################################################################## -# Summary -# -# Form decode -# -# Parameters -# Returns -# Memo -############################################################################## -sub Encode -{ - - my($value,$Trans) = @_; - -# my $FormCode = &jcode::getcode($value) || $FormCodeDefault; -# $FormCodeDefault ||= $FormCode; -# -# if($Trans && $TRANS_2BYTE_CODE) { -# if($FormCode ne 'euc') { -# &jcode::convert($value, 'euc', $FormCode); -# } -# &jcode::tr( -# $value, -# "\xA3\xB0-\xA3\xB9\xA3\xC1-\xA3\xDA\xA3\xE1-\xA3\xFA", -# '0-9A-Za-z' -# ); -# if($CHARCODE ne 'euc') { -# &jcode::convert($value,$CHARCODE,'euc'); -# } -# } else { -# if($CHARCODE ne $FormCode) { -# &jcode::convert($value,$CHARCODE,$FormCode); -# } -# } -# if($CHARCODE eq 'euc') { -# &jcode::h2z_euc($value); -# } elsif($CHARCODE eq 'sjis') { -# &jcode::h2z_sjis($value); -# } - -} - -############################################################################## -# Summary -# -# Error Msg -# -# Parameters -# Returns -# Memo -############################################################################## - -sub upload_error -{ - - local($error_message) = $_[0]; - local($error_message2) = $_[1]; - - print "Content-type: text/html\n\n"; - print< - -Error Message - - - - - -
Error Message
-
    -

    $error_message

    -$error_message2
    -
- - -EOF - &rm_tmp_uploaded_files; # Image Temporary deletion - exit; -} - -############################################################################## -# Summary -# -# Image Temporary deletion -# -# Parameters -# Returns -# Memo -############################################################################## - -sub rm_tmp_uploaded_files -{ - if($img_data_exists == 1){ - sleep 1; - foreach $fname_list(@NEWFNAMES) { - if(-e "$img_dir/$fname_list") { - unlink("$img_dir/$fname_list"); - } - } - } - -} -1; +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: upload_fck.pl +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +##### + +# image data save dir +$img_dir = './temp/'; + + +# File size max(unit KB) +$MAX_CONTENT_SIZE = 30000; + +# Filelock (1=use,0=not use) +$PM{'flock'} = '1'; + + +# upload Content-Type list +my %UPLOAD_CONTENT_TYPE_LIST = ( + 'image/(x-)?png' => 'png', # PNG image + 'image/p?jpe?g' => 'jpg', # JPEG image + 'image/gif' => 'gif', # GIF image + 'image/x-xbitmap' => 'xbm', # XBM image + + 'image/(x-(MS-)?)?bmp' => 'bmp', # Windows BMP image + 'image/pict' => 'pict', # Macintosh PICT image + 'image/tiff' => 'tif', # TIFF image + 'application/pdf' => 'pdf', # PDF image + 'application/x-shockwave-flash' => 'swf', # Shockwave Flash + + 'video/(x-)?msvideo' => 'avi', # Microsoft Video + 'video/quicktime' => 'mov', # QuickTime Video + 'video/mpeg' => 'mpeg', # MPEG Video + 'video/x-mpeg2' => 'mpv2', # MPEG2 Video + + 'audio/(x-)?midi?' => 'mid', # MIDI Audio + 'audio/(x-)?wav' => 'wav', # WAV Audio + 'audio/basic' => 'au', # ULAW Audio + 'audio/mpeg' => 'mpga', # MPEG Audio + + 'application/(x-)?zip(-compressed)?' => 'zip', # ZIP Compress + + 'text/html' => 'html', # HTML + 'text/plain' => 'txt', # TEXT + '(?:application|text)/(?:rtf|richtext)' => 'rtf', # RichText + + 'application/msword' => 'doc', # Microsoft Word + 'application/vnd.ms-excel' => 'xls', # Microsoft Excel + + '' +); + +# Upload is permitted. +# A regular expression is possible. +my %UPLOAD_EXT_LIST = ( + 'png' => 'PNG image', + 'p?jpe?g|jpe|jfif|pjp' => 'JPEG image', + 'gif' => 'GIF image', + 'xbm' => 'XBM image', + + 'bmp|dib|rle' => 'Windows BMP image', + 'pi?ct' => 'Macintosh PICT image', + 'tiff?' => 'TIFF image', + 'pdf' => 'PDF image', + 'swf' => 'Shockwave Flash', + + 'avi' => 'Microsoft Video', + 'moo?v|qt' => 'QuickTime Video', + 'm(p(e?gv?|e|v)|1v)' => 'MPEG Video', + 'mp(v2|2v)' => 'MPEG2 Video', + + 'midi?|kar|smf|rmi|mff' => 'MIDI Audio', + 'wav' => 'WAVE Audio', + 'au|snd' => 'ULAW Audio', + 'mp(e?ga|2|a|3)|abs' => 'MPEG Audio', + + 'zip' => 'ZIP Compress', + 'lzh' => 'LZH Compress', + 'cab' => 'CAB Compress', + + 'd?html?' => 'HTML', + 'rtf|rtx' => 'RichText', + 'txt|text' => 'Text', + + '' +); + + +# sjis or euc +my $CHARCODE = 'sjis'; + +$TRANS_2BYTE_CODE = 0; + +############################################################################## +# Summary +# +# Form Read input +# +# Parameters +# Returns +# Memo +############################################################################## +sub read_input +{ +eval("use File::Copy;"); +eval("use File::Path;"); + + my ($FORM) = @_; + + + mkdir($img_dir,0777); + chmod(0777,$img_dir); + + undef $img_data_exists; + undef @NEWFNAMES; + undef @NEWFNAME_DATA; + + if($ENV{'CONTENT_LENGTH'} > 10000000 || $ENV{'CONTENT_LENGTH'} > $MAX_CONTENT_SIZE * 1024) { + &upload_error( + 'Size Error', + sprintf( + "Transmitting size is too large.MAX %d KB Now Size %d KB(%d bytes Over)", + $MAX_CONTENT_SIZE, + int($ENV{'CONTENT_LENGTH'} / 1024), + $ENV{'CONTENT_LENGTH'} - $MAX_CONTENT_SIZE * 1024 + ) + ); + } + + my $Buffer; + if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/) { + # METHOD POST only + return unless($ENV{'CONTENT_LENGTH'}); + + binmode(STDIN); + # STDIN A pause character is detected.'(MacIE3.0 boundary of $ENV{'CONTENT_TYPE'} cannot be trusted.) + my $Boundary = ; + $Boundary =~ s/\x0D\x0A//; + $Boundary = quotemeta($Boundary); + while() { + if(/^\s*Content-Disposition:/i) { + my($name,$ContentType,$FileName); + # form data get + if(/\bname="([^"]+)"/i || /\bname=([^\s:;]+)/i) { + $name = $1; + $name =~ tr/+/ /; + $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + &Encode(\$name); + } + if(/\bfilename="([^"]*)"/i || /\bfilename=([^\s:;]*)/i) { + $FileName = $1 || 'unknown'; + } + # head read + while() { + last if(! /\w/); + if(/^\s*Content-Type:\s*"([^"]+)"/i || /^\s*Content-Type:\s*([^\s:;]+)/i) { + $ContentType = $1; + } + } + # body read + $value = ""; + while() { + last if(/^$Boundary/o); + $value .= $_; + }; + $lastline = $_; + $value =~s /\x0D\x0A$//; + if($value ne '') { + if($FileName || $ContentType) { + $img_data_exists = 1; + ( + $FileName, # + $Ext, # + $Length, # + $ImageWidth, # + $ImageHeight, # + $ContentName # + ) = &CheckContentType(\$value,$FileName,$ContentType); + + $FORM{$name} = $FileName; + $new_fname = $FileName; + push(@NEWFNAME_DATA,"$FileName\t$Ext\t$Length\t$ImageWidth\t$ImageHeight\t$ContentName"); + + # Multi-upload correspondence + push(@NEWFNAMES,$new_fname); + open(OUT,">$img_dir/$new_fname"); + binmode(OUT); + eval "flock(OUT,2);" if($PM{'flock'} == 1); + print OUT $value; + eval "flock(OUT,8);" if($PM{'flock'} == 1); + close(OUT); + + } elsif($name) { + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + &Encode(\$value,'trans'); + $FORM{$name} .= "\0" if(defined($FORM{$name})); + $FORM{$name} .= $value; + } + } + }; + last if($lastline =~ /^$Boundary\-\-/o); + } + } elsif($ENV{'CONTENT_LENGTH'}) { + read(STDIN,$Buffer,$ENV{'CONTENT_LENGTH'}); + } + foreach(split(/&/,$Buffer),split(/&/,$ENV{'QUERY_STRING'})) { + my($name, $value) = split(/=/); + $name =~ tr/+/ /; + $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + + &Encode(\$name); + &Encode(\$value,'trans'); + $FORM{$name} .= "\0" if(defined($FORM{$name})); + $FORM{$name} .= $value; + + } + +} + +############################################################################## +# Summary +# +# CheckContentType +# +# Parameters +# Returns +# Memo +############################################################################## +sub CheckContentType +{ + + my($DATA,$FileName,$ContentType) = @_; + my($Ext,$ImageWidth,$ImageHeight,$ContentName,$Infomation); + my $DataLength = length($$DATA); + + # An unknown file type + + $_ = $ContentType; + my $UnknownType = ( + !$_ + || /^application\/(x-)?macbinary$/i + || /^application\/applefile$/i + || /^application\/octet-stream$/i + || /^text\/plane$/i + || /^x-unknown-content-type/i + ); + + # MacBinary(Mac Unnecessary data are deleted.) + if($UnknownType || $ENV{'HTTP_USER_AGENT'} =~ /Macintosh|Mac_/) { + if($DataLength > 128 && !unpack("C",substr($$DATA,0,1)) && !unpack("C",substr($$DATA,74,1)) && !unpack("C",substr($$DATA,82,1)) ) { + my $MacBinary_ForkLength = unpack("N", substr($$DATA, 83, 4)); # ForkLength Get + my $MacBinary_FileName = quotemeta(substr($$DATA, 2, unpack("C",substr($$DATA, 1, 1)))); + if($MacBinary_FileName && $MacBinary_ForkLength && $DataLength >= $MacBinary_ForkLength + 128 + && ($FileName =~ /$MacBinary_FileName/i || substr($$DATA,102,4) eq 'mBIN')) { # DATA TOP 128byte MacBinary!! + $$DATA = substr($$DATA,128,$MacBinary_ForkLength); + my $ResourceLength = $DataLength - $MacBinary_ForkLength - 128; + $DataLength = $MacBinary_ForkLength; + } + } + } + + # A file name is changed into EUC. +# &jcode::convert(\$FileName,'euc',$FormCodeDefault); +# &jcode::h2z_euc(\$FileName); + $FileName =~ s/^.*\\//; # Windows, Mac + $FileName =~ s/^.*\///; # UNIX + $FileName =~ s/&/&/g; + $FileName =~ s/"/"/g; + $FileName =~ s//>/g; +# +# if($CHARCODE ne 'euc') { +# &jcode::convert(\$FileName,$CHARCODE,'euc'); +# } + + # An extension is extracted and it changes into a small letter. + my $FileExt; + if($FileName =~ /\.(\w+)$/) { + $FileExt = $1; + $FileExt =~ tr/A-Z/a-z/; + } + + # Executable file detection (ban on upload) + if($$DATA =~ /^MZ/) { + $Ext = 'exe'; + } + # text + if(!$Ext && ($UnknownType || $ContentType =~ /^text\//i || $ContentType =~ /^application\/(?:rtf|richtext)$/i || $ContentType =~ /^image\/x-xbitmap$/i) + && ! $$DATA =~ /[\000-\006\177\377]/) { +# $$DATA =~ s/\x0D\x0A/\n/g; +# $$DATA =~ tr/\x0D\x0A/\n\n/; +# +# if( +# $$DATA =~ /<\s*SCRIPT(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bONLOAD\s*=(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bONCLICK\s*=(?:.|\n)*?>/i +# ) { +# $Infomation = '(JavaScript contains)'; +# } +# if($$DATA =~ /<\s*TABLE(?:.|\n)*?>/i +# || $$DATA =~ /<\s*BLINK(?:.|\n)*?>/i +# || $$DATA =~ /<\s*MARQUEE(?:.|\n)*?>/i +# || $$DATA =~ /<\s*OBJECT(?:.|\n)*?>/i +# || $$DATA =~ /<\s*EMBED(?:.|\n)*?>/i +# || $$DATA =~ /<\s*FRAME(?:.|\n)*?>/i +# || $$DATA =~ /<\s*APPLET(?:.|\n)*?>/i +# || $$DATA =~ /<\s*FORM(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bSRC\s*=(?:.|\n)*?>/i +# || $$DATA =~ /<\s*(?:.|\n)*?\bDYNSRC\s*=(?:.|\n)*?>/i +# ) { +# $Infomation = '(the HTML tag which is not safe is included)'; +# } + + if($FileExt =~ /^txt$/i || $FileExt =~ /^cgi$/i || $FileExt =~ /^pl$/i) { # Text File + $Ext = 'txt'; + } elsif($ContentType =~ /^text\/html$/i || $FileExt =~ /html?/i || $$DATA =~ /<\s*HTML(?:.|\n)*?>/i) { # HTML File + $Ext = 'html'; + } elsif($ContentType =~ /^image\/x-xbitmap$/i || $FileExt =~ /^xbm$/i) { # XBM(x-BitMap) Image + my $XbmName = $1; + my ($XbmWidth, $XbmHeight); + if($$DATA =~ /\#define\s*$XbmName\_width\s*(\d+)/i) { + $XbmWidth = $1; + } + if($$DATA =~ /\#define\s*$XbmName\_height\s*(\d+)/i) { + $XbmHeight = $1; + } + if($XbmWidth && $XbmHeight) { + $Ext = 'xbm'; + $ImageWidth = $XbmWidth; + $ImageHeight = $XbmHeight; + } + } else { # + $Ext = 'txt'; + } + } + + # image + if(!$Ext && ($UnknownType || $ContentType =~ /^image\//i)) { + # PNG + if($$DATA =~ /^\x89PNG\x0D\x0A\x1A\x0A/) { + if(substr($$DATA, 12, 4) eq 'IHDR') { + $Ext = 'png'; + ($ImageWidth, $ImageHeight) = unpack("N2", substr($$DATA, 16, 8)); + } + } elsif($$DATA =~ /^GIF8(?:9|7)a/) { # GIF89a(modified), GIF89a, GIF87a + $Ext = 'gif'; + ($ImageWidth, $ImageHeight) = unpack("v2", substr($$DATA, 6, 4)); + } elsif($$DATA =~ /^II\x2a\x00\x08\x00\x00\x00/ || $$DATA =~ /^MM\x00\x2a\x00\x00\x00\x08/) { # TIFF + $Ext = 'tif'; + } elsif($$DATA =~ /^BM/) { # BMP + $Ext = 'bmp'; + } elsif($$DATA =~ /^\xFF\xD8\xFF/ || $$DATA =~ /JFIF/) { # JPEG + my $HeaderPoint = index($$DATA, "\xFF\xD8\xFF", 0); + my $Point = $HeaderPoint + 2; + while($Point < $DataLength) { + my($Maker, $MakerType, $MakerLength) = unpack("C2n",substr($$DATA,$Point,4)); + if($Maker != 0xFF || $MakerType == 0xd9 || $MakerType == 0xda) { + last; + } elsif($MakerType >= 0xC0 && $MakerType <= 0xC3) { + $Ext = 'jpg'; + ($ImageHeight, $ImageWidth) = unpack("n2", substr($$DATA, $Point + 5, 4)); + if($HeaderPoint > 0) { + $$DATA = substr($$DATA, $HeaderPoint); + $DataLength = length($$DATA); + } + last; + } else { + $Point += $MakerLength + 2; + } + } + } + } + + # audio + if(!$Ext && ($UnknownType || $ContentType =~ /^audio\//i)) { + # MIDI Audio + if($$DATA =~ /^MThd/) { + $Ext = 'mid'; + } elsif($$DATA =~ /^\x2esnd/) { # ULAW Audio + $Ext = 'au'; + } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { + my $HeaderPoint = index($$DATA, "RIFF", 0); + $_ = substr($$DATA, $HeaderPoint + 8, 8); + if(/^WAVEfmt $/) { + # WAVE + if(unpack("V",substr($$DATA, $HeaderPoint + 16, 4)) == 16) { + $Ext = 'wav'; + } else { # RIFF WAVE MP3 + $Ext = 'mp3'; + } + } elsif(/^RMIDdata$/) { # RIFF MIDI + $Ext = 'rmi'; + } elsif(/^RMP3data$/) { # RIFF MP3 + $Ext = 'rmp'; + } + if($ContentType =~ /^audio\//i) { + $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; + } + } + } + + # a binary file + unless ($Ext) { + # PDF image + if($$DATA =~ /^\%PDF/) { + # Picture size is not measured. + $Ext = 'pdf'; + } elsif($$DATA =~ /^FWS/) { # Shockwave Flash + $Ext = 'swf'; + } elsif($$DATA =~ /^RIFF/ || $$DATA =~ /^ID3/ && $$DATA =~ /RIFF/) { + my $HeaderPoint = index($$DATA, "RIFF", 0); + $_ = substr($$DATA,$HeaderPoint + 8, 8); + # AVI + if(/^AVI LIST$/) { + $Ext = 'avi'; + } + if($ContentType =~ /^video\//i) { + $Infomation .= '(RIFF '. substr($$DATA, $HeaderPoint + 8, 4). ')'; + } + } elsif($$DATA =~ /^PK/) { # ZIP Compress File + $Ext = 'zip'; + } elsif($$DATA =~ /^MSCF/) { # CAB Compress File + $Ext = 'cab'; + } elsif($$DATA =~ /^Rar\!/) { # RAR Compress File + $Ext = 'rar'; + } elsif(substr($$DATA, 2, 5) =~ /^\-lh(\d+|d)\-$/) { # LHA Compress File + $Infomation .= "(lh$1)"; + $Ext = 'lzh'; + } elsif(substr($$DATA, 325, 25) eq "Apple Video Media Handler" || substr($$DATA, 325, 30) eq "Apple \x83\x72\x83\x66\x83\x49\x81\x45\x83\x81\x83\x66\x83\x42\x83\x41\x83\x6E\x83\x93\x83\x68\x83\x89") { + # QuickTime + $Ext = 'mov'; + } + } + + # Header analysis failure + unless ($Ext) { + # It will be followed if it applies for the MIME type from the browser. + foreach (keys %UPLOAD_CONTENT_TYPE_LIST) { + next unless ($_); + if($ContentType =~ /^$_$/i) { + $Ext = $UPLOAD_CONTENT_TYPE_LIST{$_}; + $ContentName = &CheckContentExt($Ext); + if( + grep {$_ eq $Ext;} ( + 'png', + 'gif', + 'jpg', + 'xbm', + 'tif', + 'bmp', + 'pdf', + 'swf', + 'mov', + 'zip', + 'cab', + 'lzh', + 'rar', + 'mid', + 'rmi', + 'au', + 'wav', + 'avi', + 'exe' + ) + ) { + $Infomation .= ' / Header analysis failure'; + } + if($Ext ne $FileExt && &CheckContentExt($FileExt) eq $ContentName) { + $Ext = $FileExt; + } + last; + } + } + # a MIME type is unknown--It judges from an extension. + unless ($Ext) { + $ContentName = &CheckContentExt($FileExt); + if($ContentName) { + $Ext = $FileExt; + $Infomation .= ' / MIME type is unknown('. $ContentType. ')'; + last; + } + } + } + +# $ContentName = &CheckContentExt($Ext) unless($ContentName); +# if($Ext && $ContentName) { +# $ContentName .= $Infomation; +# } else { +# &upload_error( +# 'Extension Error', +# "$FileName A not corresponding extension ($Ext)
The extension which can be responded ". join(',', sort values(%UPLOAD_EXT_LIST)) +# ); +# } + +# # SSI Tag Deletion +# if($Ext =~ /.?html?/ && $$DATA =~ /<\!/) { +# foreach ( +# 'config', +# 'echo', +# 'exec', +# 'flastmod', +# 'fsize', +# 'include' +# ) { +# $$DATA =~ s/\#\s*$_/\&\#35\;$_/ig +# } +# } + + return ( + $FileName, + $Ext, + int($DataLength / 1024 + 1), + $ImageWidth, + $ImageHeight, + $ContentName + ); +} + +############################################################################## +# Summary +# +# Extension discernment +# +# Parameters +# Returns +# Memo +############################################################################## + +sub CheckContentExt +{ + + my($Ext) = @_; + my $ContentName; + foreach (keys %UPLOAD_EXT_LIST) { + next unless ($_); + if($_ && $Ext =~ /^$_$/) { + $ContentName = $UPLOAD_EXT_LIST{$_}; + last; + } + } + return $ContentName; + +} + +############################################################################## +# Summary +# +# Form decode +# +# Parameters +# Returns +# Memo +############################################################################## +sub Encode +{ + + my($value,$Trans) = @_; + +# my $FormCode = &jcode::getcode($value) || $FormCodeDefault; +# $FormCodeDefault ||= $FormCode; +# +# if($Trans && $TRANS_2BYTE_CODE) { +# if($FormCode ne 'euc') { +# &jcode::convert($value, 'euc', $FormCode); +# } +# &jcode::tr( +# $value, +# "\xA3\xB0-\xA3\xB9\xA3\xC1-\xA3\xDA\xA3\xE1-\xA3\xFA", +# '0-9A-Za-z' +# ); +# if($CHARCODE ne 'euc') { +# &jcode::convert($value,$CHARCODE,'euc'); +# } +# } else { +# if($CHARCODE ne $FormCode) { +# &jcode::convert($value,$CHARCODE,$FormCode); +# } +# } +# if($CHARCODE eq 'euc') { +# &jcode::h2z_euc($value); +# } elsif($CHARCODE eq 'sjis') { +# &jcode::h2z_sjis($value); +# } + +} + +############################################################################## +# Summary +# +# Error Msg +# +# Parameters +# Returns +# Memo +############################################################################## + +sub upload_error +{ + + local($error_message) = $_[0]; + local($error_message2) = $_[1]; + + print "Content-type: text/html\n\n"; + print< + +Error Message + + + + + +
Error Message
+
    +

    $error_message

    +$error_message2
    +
+ + +EOF + &rm_tmp_uploaded_files; # Image Temporary deletion + exit; +} + +############################################################################## +# Summary +# +# Image Temporary deletion +# +# Parameters +# Returns +# Memo +############################################################################## + +sub rm_tmp_uploaded_files +{ + if($img_data_exists == 1){ + sleep 1; + foreach $fname_list(@NEWFNAMES) { + if(-e "$img_dir/$fname_list") { + unlink("$img_dir/$fname_list"); + } + } + } + +} +1; diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl index 614dcfee8ce..0bd960e9698 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl @@ -1,56 +1,56 @@ -##### -# FCKeditor - The text editor for internet -# Copyright (C) 2003-2006 Frederico Caldeira Knabben -# -# Licensed under the terms of the GNU Lesser General Public License: -# http://www.opensource.org/licenses/lgpl-license.php -# -# For further information visit: -# http://www.fckeditor.net/ -# -# "Support Open Source software. What about a donation today?" -# -# File Name: util.pl -# This is the File Manager Connector for Perl. -# -# File Authors: -# Takashi Yamaguchi (jack@omakase.net) -##### - -sub RemoveFromStart -{ - local($sourceString, $charToRemove) = @_; - $sPattern = '^' . $charToRemove . '+' ; - $sourceString =~ s/^$charToRemove+//g; - return $sourceString; -} - -sub RemoveFromEnd -{ - local($sourceString, $charToRemove) = @_; - $sPattern = $charToRemove . '+$' ; - $sourceString =~ s/$charToRemove+$//g; - return $sourceString; -} - -sub ConvertToXmlAttribute -{ - local($value) = @_; - return $value; -# return utf8_encode(htmlspecialchars($value)); - -} - -sub specialchar_cnv -{ - local($ch) = @_; - - $ch =~ s/&/&/g; # & - $ch =~ s/\"/"/g; #" - $ch =~ s/\'/'/g; # ' - $ch =~ s//>/g; # > - return($ch); -} - -1; +##### +# FCKeditor - The text editor for internet +# Copyright (C) 2003-2006 Frederico Caldeira Knabben +# +# Licensed under the terms of the GNU Lesser General Public License: +# http://www.opensource.org/licenses/lgpl-license.php +# +# For further information visit: +# http://www.fckeditor.net/ +# +# "Support Open Source software. What about a donation today?" +# +# File Name: util.pl +# This is the File Manager Connector for Perl. +# +# File Authors: +# Takashi Yamaguchi (jack@omakase.net) +##### + +sub RemoveFromStart +{ + local($sourceString, $charToRemove) = @_; + $sPattern = '^' . $charToRemove . '+' ; + $sourceString =~ s/^$charToRemove+//g; + return $sourceString; +} + +sub RemoveFromEnd +{ + local($sourceString, $charToRemove) = @_; + $sPattern = $charToRemove . '+$' ; + $sourceString =~ s/$charToRemove+$//g; + return $sourceString; +} + +sub ConvertToXmlAttribute +{ + local($value) = @_; + return $value; +# return utf8_encode(htmlspecialchars($value)); + +} + +sub specialchar_cnv +{ + local($ch) = @_; + + $ch =~ s/&/&/g; # & + $ch =~ s/\"/"/g; #" + $ch =~ s/\'/'/g; # ' + $ch =~ s//>/g; # > + return($ch); +} + +1; diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php index 89428a8a724..f49745f8a20 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/basexml.php @@ -1,68 +1,71 @@ -' ; - - // Create the main "Connector" node. - echo '' ; - - // Add the current folder node. - echo '' ; -} - -function CreateXmlFooter() -{ - echo '' ; -} - -function SendError( $number, $text ) -{ - SetXmlHeaders() ; - - // Create the XML document header - echo '' ; - - echo '' ; - - exit ; -} +' ; + + // Create the main "Connector" node. + echo '' ; + + // Add the current folder node. + echo '' ; +} + +function CreateXmlFooter() +{ + echo '' ; +} + +function SendError( $number, $text ) +{ + SetXmlHeaders() ; + + // Create the XML document header + echo '' ; + + echo '' ; + + exit ; +} ?> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php index 7a3abbc5771..282a6a3fa46 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/commands.php @@ -1,218 +1,218 @@ -' ; - } - - closedir( $oCurrentFolder ) ; - - // Open the "Folders" node. - echo "" ; - - natcasesort( $aFolders ) ; - foreach ( $aFolders as $sFolder ) - echo $sFolder ; - - // Close the "Folders" node. - echo "" ; -} - -function GetFoldersAndFiles( $resourceType, $currentFolder ) -{ - // Map the virtual path to the local server path. - $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; - - // Arrays that will hold the folders and files names. - $aFolders = array() ; - $aFiles = array() ; - - $oCurrentFolder = opendir( $sServerDir ) ; - - while ( $sFile = readdir( $oCurrentFolder ) ) - { - if ( $sFile != '.' && $sFile != '..' ) - { - if ( is_dir( $sServerDir . $sFile ) ) - $aFolders[] = '' ; - else - { - $iFileSize = filesize( $sServerDir . $sFile ) ; - if ( $iFileSize > 0 ) - { - $iFileSize = round( $iFileSize / 1024 ) ; - if ( $iFileSize < 1 ) $iFileSize = 1 ; - } - - $aFiles[] = '' ; - } - } - } - - // Send the folders - natcasesort( $aFolders ) ; - echo '' ; - - foreach ( $aFolders as $sFolder ) - echo $sFolder ; - - echo '' ; - - // Send the files - natcasesort( $aFiles ) ; - echo '' ; - - foreach ( $aFiles as $sFiles ) - echo $sFiles ; - - echo '' ; -} - -function CreateFolder( $resourceType, $currentFolder ) -{ - $sErrorNumber = '0' ; - $sErrorMsg = '' ; - - if ( isset( $_GET['NewFolderName'] ) ) - { - $sNewFolderName = $_GET['NewFolderName'] ; - - if ( strpos( $sNewFolderName, '..' ) !== FALSE ) - $sErrorNumber = '102' ; // Invalid folder name. - else - { - // Map the virtual path to the local server path of the current folder. - $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; - - if ( is_writable( $sServerDir ) ) - { - $sServerDir .= $sNewFolderName ; - - $sErrorMsg = CreateServerFolder( $sServerDir ) ; - - switch ( $sErrorMsg ) - { - case '' : - $sErrorNumber = '0' ; - break ; - case 'Invalid argument' : - case 'No such file or directory' : - $sErrorNumber = '102' ; // Path too long. - break ; - default : - $sErrorNumber = '110' ; - break ; - } - } - else - $sErrorNumber = '103' ; - } - } - else - $sErrorNumber = '102' ; - - // Create the "Error" node. - echo '' ; -} - -function FileUpload( $resourceType, $currentFolder ) -{ - $sErrorNumber = '0' ; - $sFileName = '' ; - - if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) ) - { - global $Config ; - - $oFile = $_FILES['NewFile'] ; - - // Map the virtual path to the local server path. - $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; - - // Get the uploaded file name. - $sFileName = $oFile['name'] ; - - // Replace dots in the name with underscores (only one dot can be there... security issue). - if ( $Config['ForceSingleExtension'] ) - $sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ; - - $sOriginalFileName = $sFileName ; - - // Get the extension. - $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; - $sExtension = strtolower( $sExtension ) ; - - $arAllowed = $Config['AllowedExtensions'][$resourceType] ; - $arDenied = $Config['DeniedExtensions'][$resourceType] ; - - if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) - { - $iCounter = 0 ; - - while ( true ) - { - $sFilePath = $sServerDir . $sFileName ; - - if ( is_file( $sFilePath ) ) - { - $iCounter++ ; - $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; - $sErrorNumber = '201' ; - } - else - { - move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; - - if ( is_file( $sFilePath ) ) - { - $oldumask = umask(0) ; - chmod( $sFilePath, 0777 ) ; - umask( $oldumask ) ; - } - - break ; - } - } - } - else - $sErrorNumber = '202' ; - } - else - $sErrorNumber = '202' ; - - echo '' ; - - exit ; -} +' ; + } + + closedir( $oCurrentFolder ) ; + + // Open the "Folders" node. + echo "" ; + + natcasesort( $aFolders ) ; + foreach ( $aFolders as $sFolder ) + echo $sFolder ; + + // Close the "Folders" node. + echo "" ; +} + +function GetFoldersAndFiles( $resourceType, $currentFolder ) +{ + // Map the virtual path to the local server path. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; + + // Arrays that will hold the folders and files names. + $aFolders = array() ; + $aFiles = array() ; + + $oCurrentFolder = opendir( $sServerDir ) ; + + while ( $sFile = readdir( $oCurrentFolder ) ) + { + if ( $sFile != '.' && $sFile != '..' ) + { + if ( is_dir( $sServerDir . $sFile ) ) + $aFolders[] = '' ; + else + { + $iFileSize = filesize( $sServerDir . $sFile ) ; + if ( $iFileSize > 0 ) + { + $iFileSize = round( $iFileSize / 1024 ) ; + if ( $iFileSize < 1 ) $iFileSize = 1 ; + } + + $aFiles[] = '' ; + } + } + } + + // Send the folders + natcasesort( $aFolders ) ; + echo '' ; + + foreach ( $aFolders as $sFolder ) + echo $sFolder ; + + echo '' ; + + // Send the files + natcasesort( $aFiles ) ; + echo '' ; + + foreach ( $aFiles as $sFiles ) + echo $sFiles ; + + echo '' ; +} + +function CreateFolder( $resourceType, $currentFolder ) +{ + $sErrorNumber = '0' ; + $sErrorMsg = '' ; + + if ( isset( $_GET['NewFolderName'] ) ) + { + $sNewFolderName = $_GET['NewFolderName'] ; + + if ( strpos( $sNewFolderName, '..' ) !== FALSE ) + $sErrorNumber = '102' ; // Invalid folder name. + else + { + // Map the virtual path to the local server path of the current folder. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; + + if ( is_writable( $sServerDir ) ) + { + $sServerDir .= $sNewFolderName ; + + $sErrorMsg = CreateServerFolder( $sServerDir ) ; + + switch ( $sErrorMsg ) + { + case '' : + $sErrorNumber = '0' ; + break ; + case 'Invalid argument' : + case 'No such file or directory' : + $sErrorNumber = '102' ; // Path too long. + break ; + default : + $sErrorNumber = '110' ; + break ; + } + } + else + $sErrorNumber = '103' ; + } + } + else + $sErrorNumber = '102' ; + + // Create the "Error" node. + echo '' ; +} + +function FileUpload( $resourceType, $currentFolder ) +{ + $sErrorNumber = '0' ; + $sFileName = '' ; + + if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) ) + { + global $Config ; + + $oFile = $_FILES['NewFile'] ; + + // Map the virtual path to the local server path. + $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; + + // Get the uploaded file name. + $sFileName = $oFile['name'] ; + + // Replace dots in the name with underscores (only one dot can be there... security issue). + if ( $Config['ForceSingleExtension'] ) + $sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ; + + $sOriginalFileName = $sFileName ; + + // Get the extension. + $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; + $sExtension = strtolower( $sExtension ) ; + + $arAllowed = $Config['AllowedExtensions'][$resourceType] ; + $arDenied = $Config['DeniedExtensions'][$resourceType] ; + + if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) + { + $iCounter = 0 ; + + while ( true ) + { + $sFilePath = $sServerDir . $sFileName ; + + if ( is_file( $sFilePath ) ) + { + $iCounter++ ; + $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; + $sErrorNumber = '201' ; + } + else + { + move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; + + if ( is_file( $sFilePath ) ) + { + $oldumask = umask(0) ; + chmod( $sFilePath, 0777 ) ; + umask( $oldumask ) ; + } + + break ; + } + } + } + else + $sErrorNumber = '202' ; + } + else + $sErrorNumber = '202' ; + + echo '' ; + + exit ; +} ?> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/config.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/config.php index cf33cfbf39d..67e1d6db0fd 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/config.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/config.php @@ -18,15 +18,22 @@ * Frederico Caldeira Knabben (fredck@fckeditor.net) */ -require_once("../../../../../../../../conf/conf.php"); // ajout car $conf et DOL_DATA_ROOT ne fonctionne pas - global $Config ; +//require_once("../../../../../../../../master.inc.php"); +require_once("../../../../../../../../conf/conf.php"); // ajout car include master.inc.php ne marche pas +/* +$conf->syslog->enabled=1; +define('SYSLOG_FILE','c:/log/dolibarr/dolibarr.log'); +require_once("../../../../../../../../lib/functions.inc.php"); +dolibarr_syslog("eee".$conf->fckeditor->dir_output); +*/ + // SECURITY: You must explicitelly enable this "connector". (Set it to "true"). $Config['Enabled'] = true ; // Path to user files relative to the document root. -//$Config['UserFilesPath'] = '/UserFiles/' ; +$Config['UserFilesPath'] = '/viewimage.php?modulepart=fckeditor&file=' ; // Fill the following value it you prefer to specify the absolute path for the // user files directory. Usefull if you are using a virtual directory, symbolic @@ -34,7 +41,6 @@ $Config['Enabled'] = true ; // Attention: The above 'UserFilesPath' must point to the same directory. //$Config['UserFilesAbsolutePath'] = $conf->fckeditor->dir_output; // ne fonctionne pas -//$Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/fckeditor/'; // ne fonctionne pas $Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root.'/fckeditor/'; // Due to security issues with Apache modules, it is reccomended to leave the diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php index dca87524508..a2f5cc1031a 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php @@ -1,107 +1,109 @@ - 0 ) -{ - $GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ; - - if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) ) - $GLOBALS["UserFilesDirectory"] .= '/' ; -} -else -{ - // Map the "UserFiles" path to a local directory. - $GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ; -} - -DoResponse() ; - -function DoResponse() -{ - if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) - return ; - - // Get the main request informaiton. - $sCommand = $_GET['Command'] ; - $sResourceType = $_GET['Type'] ; - $sCurrentFolder = $_GET['CurrentFolder'] ; - - // Check if it is an allowed type. - if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) ) - return ; - - // Check the current folder syntax (must begin and start with a slash). - if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ; - if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ; - - // Check for invalid folder paths (..) - if ( strpos( $sCurrentFolder, '..' ) ) - SendError( 102, "" ) ; - - // File Upload doesn't have to Return XML, so it must be intercepted before anything. - if ( $sCommand == 'FileUpload' ) - { - FileUpload( $sResourceType, $sCurrentFolder ) ; - return ; - } - - CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ; - - // Execute the required command. - switch ( $sCommand ) - { - case 'GetFolders' : - GetFolders( $sResourceType, $sCurrentFolder ) ; - break ; - case 'GetFoldersAndFiles' : - GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ; - break ; - case 'CreateFolder' : - CreateFolder( $sResourceType, $sCurrentFolder ) ; - break ; - } - - CreateXmlFooter() ; - - exit ; -} + 0 ) +{ + $GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ; + + if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) ) + $GLOBALS["UserFilesDirectory"] .= '/' ; +} +else +{ + // Map the "UserFiles" path to a local directory. + $GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ; +} + +DoResponse() ; + +function DoResponse() +{ + if ( !isset( $_GET['Command'] ) || !isset( $_GET['Type'] ) || !isset( $_GET['CurrentFolder'] ) ) + return ; + + // Get the main request informaiton. + $sCommand = $_GET['Command'] ; + $sResourceType = $_GET['Type'] ; + $sCurrentFolder = $_GET['CurrentFolder'] ; + + // Check if it is an allowed type. + if ( !in_array( $sResourceType, array('File','Image','Flash','Media') ) ) + return ; + + // Check the current folder syntax (must begin and start with a slash). + if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ; + if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ; + + // Check for invalid folder paths (..) + if ( strpos( $sCurrentFolder, '..' ) ) + SendError( 102, "" ) ; + + // File Upload doesn't have to Return XML, so it must be intercepted before anything. + if ( $sCommand == 'FileUpload' ) + { + FileUpload( $sResourceType, $sCurrentFolder ) ; + return ; + } + + CreateXmlHeader( $sCommand, $sResourceType, $sCurrentFolder ) ; + + // Execute the required command. + switch ( $sCommand ) + { + case 'GetFolders' : + GetFolders( $sResourceType, $sCurrentFolder ) ; + break ; + case 'GetFoldersAndFiles' : + GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ; + break ; + case 'CreateFolder' : + CreateFolder( $sResourceType, $sCurrentFolder ) ; + break ; + } + + CreateXmlFooter() ; + + exit ; +} ?> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/io.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/io.php index 2f997c6f812..c08082958c2 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/io.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/io.php @@ -1,97 +1,97 @@ - \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/util.php b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/util.php index 13d6d77f5fb..04f62e51aed 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/util.php +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/php/util.php @@ -1,37 +1,37 @@ - \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py index 70883dc1643..3c783640738 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/py/connector.py @@ -1,781 +1,781 @@ -#!/usr/bin/env python - -""" -FCKeditor - The text editor for internet -Copyright (C) 2003-2006 Frederico Caldeira Knabben - -Licensed under the terms of the GNU Lesser General Public License: - http://www.opensource.org/licenses/lgpl-license.php - -For further information visit: - http://www.fckeditor.net/ - -"Support Open Source software. What about a donation today?" - -File Name: connector.py - Connector for Python. - - Tested With: - Standard: - Python 2.3.3 - Zope: - Zope Version: (Zope 2.8.1-final, python 2.3.5, linux2) - Python Version: 2.3.5 (#4, Mar 10 2005, 01:40:25) - [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] - System Platform: linux2 - -File Authors: - Andrew Liu (andrew@liuholdings.com) -""" - -""" -Author Notes (04 December 2005): -This module has gone through quite a few phases of change. Obviously, -I am only supporting that part of the code that I use. Initially -I had the upload directory as a part of zope (ie. uploading files -directly into Zope), before realising that there were too many -complex intricacies within Zope to deal with. Zope is one ugly piece -of code. So I decided to complement Zope by an Apache server (which -I had running anyway, and doing nothing). So I mapped all uploads -from an arbitrary server directory to an arbitrary web directory. -All the FCKeditor uploading occurred this way, and I didn't have to -stuff around with fiddling with Zope objects and the like (which are -terribly complex and something you don't want to do - trust me). - -Maybe a Zope expert can touch up the Zope components. In the end, -I had FCKeditor loaded in Zope (probably a bad idea as well), and -I replaced the connector.py with an alias to a server module. -Right now, all Zope components will simple remain as is because -I've had enough of Zope. - -See notes right at the end of this file for how I aliased out of Zope. - -Anyway, most of you probably wont use Zope, so things are pretty -simple in that regard. - -Typically, SERVER_DIR is the root of WEB_DIR (not necessarily). -Most definitely, SERVER_USERFILES_DIR points to WEB_USERFILES_DIR. -""" - -import cgi -import re -import os -import string - -""" -escape - -Converts the special characters '<', '>', and '&'. - -RFC 1866 specifies that these characters be represented -in HTML as < > and & respectively. In Python -1.5 we use the new string.replace() function for speed. -""" -def escape(text, replace=string.replace): - text = replace(text, '&', '&') # must be done 1st - text = replace(text, '<', '<') - text = replace(text, '>', '>') - text = replace(text, '"', '"') - return text - -""" -getFCKeditorConnector - -Creates a new instance of an FCKeditorConnector, and runs it -""" -def getFCKeditorConnector(context=None): - # Called from Zope. Passes the context through - connector = FCKeditorConnector(context=context) - return connector.run() - - -""" -FCKeditorRequest - -A wrapper around the request object -Can handle normal CGI request, or a Zope request -Extend as required -""" -class FCKeditorRequest(object): - def __init__(self, context=None): - if (context is not None): - r = context.REQUEST - else: - r = cgi.FieldStorage() - self.context = context - self.request = r - - def isZope(self): - if (self.context is not None): - return True - return False - - def has_key(self, key): - return self.request.has_key(key) - - def get(self, key, default=None): - value = None - if (self.isZope()): - value = self.request.get(key, default) - else: - if key in self.request.keys(): - value = self.request[key].value - else: - value = default - return value - -""" -FCKeditorConnector - -The connector class -""" -class FCKeditorConnector(object): - # Configuration for FCKEditor - # can point to another server here, if linked correctly - #WEB_HOST = "http://127.0.0.1/" - WEB_HOST = "" - SERVER_DIR = "/var/www/html/" - - WEB_USERFILES_FOLDER = WEB_HOST + "upload/" - SERVER_USERFILES_FOLDER = SERVER_DIR + "upload/" - - # Allow access (Zope) - __allow_access_to_unprotected_subobjects__ = 1 - # Class Attributes - parentFolderRe = re.compile("[\/][^\/]+[\/]?$") - - """ - Constructor - """ - def __init__(self, context=None): - # The given root path will NOT be shown to the user - # Only the userFilesPath will be shown - - # Instance Attributes - self.context = context - self.request = FCKeditorRequest(context=context) - self.rootPath = self.SERVER_DIR - self.userFilesFolder = self.SERVER_USERFILES_FOLDER - self.webUserFilesFolder = self.WEB_USERFILES_FOLDER - - # Enables / Disables the connector - self.enabled = False # Set to True to enable this connector - - # These are instance variables - self.zopeRootContext = None - self.zopeUploadContext = None - - # Copied from php module =) - self.allowedExtensions = { - "File": None, - "Image": None, - "Flash": None, - "Media": None - } - self.deniedExtensions = { - "File": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], - "Image": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], - "Flash": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], - "Media": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ] - } - - """ - Zope specific functions - """ - def isZope(self): - # The context object is the zope object - if (self.context is not None): - return True - return False - - def getZopeRootContext(self): - if self.zopeRootContext is None: - self.zopeRootContext = self.context.getPhysicalRoot() - return self.zopeRootContext - - def getZopeUploadContext(self): - if self.zopeUploadContext is None: - folderNames = self.userFilesFolder.split("/") - c = self.getZopeRootContext() - for folderName in folderNames: - if (folderName <> ""): - c = c[folderName] - self.zopeUploadContext = c - return self.zopeUploadContext - - """ - Generic manipulation functions - """ - def getUserFilesFolder(self): - return self.userFilesFolder - - def getWebUserFilesFolder(self): - return self.webUserFilesFolder - - def getAllowedExtensions(self, resourceType): - return self.allowedExtensions[resourceType] - - def getDeniedExtensions(self, resourceType): - return self.deniedExtensions[resourceType] - - def removeFromStart(self, string, char): - return string.lstrip(char) - - def removeFromEnd(self, string, char): - return string.rstrip(char) - - def convertToXmlAttribute(self, value): - if (value is None): - value = "" - return escape(value) - - def convertToPath(self, path): - if (path[-1] <> "/"): - return path + "/" - else: - return path - - def getUrlFromPath(self, resourceType, path): - if (resourceType is None) or (resourceType == ''): - url = "%s%s" % ( - self.removeFromEnd(self.getUserFilesFolder(), '/'), - path - ) - else: - url = "%s%s%s" % ( - self.getUserFilesFolder(), - resourceType, - path - ) - return url - - def getWebUrlFromPath(self, resourceType, path): - if (resourceType is None) or (resourceType == ''): - url = "%s%s" % ( - self.removeFromEnd(self.getWebUserFilesFolder(), '/'), - path - ) - else: - url = "%s%s%s" % ( - self.getWebUserFilesFolder(), - resourceType, - path - ) - return url - - def removeExtension(self, fileName): - index = fileName.rindex(".") - newFileName = fileName[0:index] - return newFileName - - def getExtension(self, fileName): - index = fileName.rindex(".") + 1 - fileExtension = fileName[index:] - return fileExtension - - def getParentFolder(self, folderPath): - parentFolderPath = self.parentFolderRe.sub('', folderPath) - return parentFolderPath - - """ - serverMapFolder - - Purpose: works out the folder map on the server - """ - def serverMapFolder(self, resourceType, folderPath): - # Get the resource type directory - resourceTypeFolder = "%s%s/" % ( - self.getUserFilesFolder(), - resourceType - ) - # Ensure that the directory exists - self.createServerFolder(resourceTypeFolder) - - # Return the resource type directory combined with the - # required path - return "%s%s" % ( - resourceTypeFolder, - self.removeFromStart(folderPath, '/') - ) - - """ - createServerFolder - - Purpose: physically creates a folder on the server - """ - def createServerFolder(self, folderPath): - # Check if the parent exists - parentFolderPath = self.getParentFolder(folderPath) - if not(os.path.exists(parentFolderPath)): - errorMsg = self.createServerFolder(parentFolderPath) - if errorMsg is not None: - return errorMsg - # Check if this exists - if not(os.path.exists(folderPath)): - os.mkdir(folderPath) - os.chmod(folderPath, 0755) - errorMsg = None - else: - if os.path.isdir(folderPath): - errorMsg = None - else: - raise "createServerFolder: Non-folder of same name already exists" - return errorMsg - - - """ - getRootPath - - Purpose: returns the root path on the server - """ - def getRootPath(self): - return self.rootPath - - """ - setXmlHeaders - - Purpose: to prepare the headers for the xml to return - """ - def setXmlHeaders(self): - #now = self.context.BS_get_now() - #yesterday = now - 1 - self.setHeader("Content-Type", "text/xml") - #self.setHeader("Expires", yesterday) - #self.setHeader("Last-Modified", now) - #self.setHeader("Cache-Control", "no-store, no-cache, must-revalidate") - self.printHeaders() - return - - def setHeader(self, key, value): - if (self.isZope()): - self.context.REQUEST.RESPONSE.setHeader(key, value) - else: - print "%s: %s" % (key, value) - return - - def printHeaders(self): - # For non-Zope requests, we need to print an empty line - # to denote the end of headers - if (not(self.isZope())): - print "" - - """ - createXmlFooter - - Purpose: returns the xml header - """ - def createXmlHeader(self, command, resourceType, currentFolder): - self.setXmlHeaders() - s = "" - # Create the XML document header - s += """""" - # Create the main connector node - s += """""" % ( - command, - resourceType - ) - # Add the current folder node - s += """""" % ( - self.convertToXmlAttribute(currentFolder), - self.convertToXmlAttribute( - self.getWebUrlFromPath( - resourceType, - currentFolder - ) - ), - ) - return s - - """ - createXmlFooter - - Purpose: returns the xml footer - """ - def createXmlFooter(self): - s = """""" - return s - - """ - sendError - - Purpose: in the event of an error, return an xml based error - """ - def sendError(self, number, text): - self.setXmlHeaders() - s = "" - # Create the XML document header - s += """""" - s += """""" - s += """""" % (number, text) - s += """""" - return s - - """ - getFolders - - Purpose: command to recieve a list of folders - """ - def getFolders(self, resourceType, currentFolder): - if (self.isZope()): - return self.getZopeFolders(resourceType, currentFolder) - else: - return self.getNonZopeFolders(resourceType, currentFolder) - - def getZopeFolders(self, resourceType, currentFolder): - # Open the folders node - s = "" - s += """""" - zopeFolder = self.findZopeFolder(resourceType, currentFolder) - for (name, o) in zopeFolder.objectItems(["Folder"]): - s += """""" % ( - self.convertToXmlAttribute(name) - ) - # Close the folders node - s += """""" - return s - - def getNonZopeFolders(self, resourceType, currentFolder): - # Map the virtual path to our local server - serverPath = self.serverMapFolder(resourceType, currentFolder) - # Open the folders node - s = "" - s += """""" - for someObject in os.listdir(serverPath): - someObjectPath = os.path.join(serverPath, someObject) - if os.path.isdir(someObjectPath): - s += """""" % ( - self.convertToXmlAttribute(someObject) - ) - # Close the folders node - s += """""" - return s - - """ - getFoldersAndFiles - - Purpose: command to recieve a list of folders and files - """ - def getFoldersAndFiles(self, resourceType, currentFolder): - if (self.isZope()): - return self.getZopeFoldersAndFiles(resourceType, currentFolder) - else: - return self.getNonZopeFoldersAndFiles(resourceType, currentFolder) - - def getNonZopeFoldersAndFiles(self, resourceType, currentFolder): - # Map the virtual path to our local server - serverPath = self.serverMapFolder(resourceType, currentFolder) - # Open the folders / files node - folders = """""" - files = """""" - for someObject in os.listdir(serverPath): - someObjectPath = os.path.join(serverPath, someObject) - if os.path.isdir(someObjectPath): - folders += """""" % ( - self.convertToXmlAttribute(someObject) - ) - elif os.path.isfile(someObjectPath): - size = os.path.getsize(someObjectPath) - files += """""" % ( - self.convertToXmlAttribute(someObject), - os.path.getsize(someObjectPath) - ) - # Close the folders / files node - folders += """""" - files += """""" - # Return it - s = folders + files - return s - - def getZopeFoldersAndFiles(self, resourceType, currentFolder): - folders = self.getZopeFolders(resourceType, currentFolder) - files = self.getZopeFiles(resourceType, currentFolder) - s = folders + files - return s - - def getZopeFiles(self, resourceType, currentFolder): - # Open the files node - s = "" - s += """""" - zopeFolder = self.findZopeFolder(resourceType, currentFolder) - for (name, o) in zopeFolder.objectItems(["File","Image"]): - s += """""" % ( - self.convertToXmlAttribute(name), - ((o.get_size() / 1024) + 1) - ) - # Close the files node - s += """""" - return s - - def findZopeFolder(self, resourceType, folderName): - # returns the context of the resource / folder - zopeFolder = self.getZopeUploadContext() - folderName = self.removeFromStart(folderName, "/") - folderName = self.removeFromEnd(folderName, "/") - if (resourceType <> ""): - try: - zopeFolder = zopeFolder[resourceType] - except: - zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=resourceType, title=resourceType) - zopeFolder = zopeFolder[resourceType] - if (folderName <> ""): - folderNames = folderName.split("/") - for folderName in folderNames: - zopeFolder = zopeFolder[folderName] - return zopeFolder - - """ - createFolder - - Purpose: command to create a new folder - """ - def createFolder(self, resourceType, currentFolder): - if (self.isZope()): - return self.createZopeFolder(resourceType, currentFolder) - else: - return self.createNonZopeFolder(resourceType, currentFolder) - - def createZopeFolder(self, resourceType, currentFolder): - # Find out where we are - zopeFolder = self.findZopeFolder(resourceType, currentFolder) - errorNo = 0 - errorMsg = "" - if self.request.has_key("NewFolderName"): - newFolder = self.request.get("NewFolderName", None) - zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=newFolder, title=newFolder) - else: - errorNo = 102 - error = """""" % ( - errorNo, - self.convertToXmlAttribute(errorMsg) - ) - return error - - def createNonZopeFolder(self, resourceType, currentFolder): - errorNo = 0 - errorMsg = "" - if self.request.has_key("NewFolderName"): - newFolder = self.request.get("NewFolderName", None) - currentFolderPath = self.serverMapFolder( - resourceType, - currentFolder - ) - try: - newFolderPath = currentFolderPath + newFolder - errorMsg = self.createServerFolder(newFolderPath) - if (errorMsg is not None): - errorNo = 110 - except: - errorNo = 103 - else: - errorNo = 102 - error = """""" % ( - errorNo, - self.convertToXmlAttribute(errorMsg) - ) - return error - - """ - getFileName - - Purpose: helper function to extrapolate the filename - """ - def getFileName(self, filename): - for splitChar in ["/", "\\"]: - array = filename.split(splitChar) - if (len(array) > 1): - filename = array[-1] - return filename - - """ - fileUpload - - Purpose: command to upload files to server - """ - def fileUpload(self, resourceType, currentFolder): - if (self.isZope()): - return self.zopeFileUpload(resourceType, currentFolder) - else: - return self.nonZopeFileUpload(resourceType, currentFolder) - - def zopeFileUpload(self, resourceType, currentFolder, count=None): - zopeFolder = self.findZopeFolder(resourceType, currentFolder) - file = self.request.get("NewFile", None) - fileName = self.getFileName(file.filename) - fileNameOnly = self.removeExtension(fileName) - fileExtension = self.getExtension(fileName).lower() - if (count): - nid = "%s.%s.%s" % (fileNameOnly, count, fileExtension) - else: - nid = fileName - title = nid - try: - zopeFolder.manage_addProduct['OFSP'].manage_addFile( - id=nid, - title=title, - file=file.read() - ) - except: - if (count): - count += 1 - else: - count = 1 - self.zopeFileUpload(resourceType, currentFolder, count) - return - - def nonZopeFileUpload(self, resourceType, currentFolder): - errorNo = 0 - errorMsg = "" - if self.request.has_key("NewFile"): - # newFile has all the contents we need - newFile = self.request.get("NewFile", "") - # Get the file name - newFileName = newFile.filename - newFileNameOnly = self.removeExtension(newFileName) - newFileExtension = self.getExtension(newFileName).lower() - allowedExtensions = self.getAllowedExtensions(resourceType) - deniedExtensions = self.getDeniedExtensions(resourceType) - if (allowedExtensions is not None): - # Check for allowed - isAllowed = False - if (newFileExtension in allowedExtensions): - isAllowed = True - elif (deniedExtensions is not None): - # Check for denied - isAllowed = True - if (newFileExtension in deniedExtensions): - isAllowed = False - else: - # No extension limitations - isAllowed = True - - if (isAllowed): - if (self.isZope()): - # Upload into zope - self.zopeFileUpload(resourceType, currentFolder) - else: - # Upload to operating system - # Map the virtual path to the local server path - currentFolderPath = self.serverMapFolder( - resourceType, - currentFolder - ) - i = 0 - while (True): - newFilePath = "%s%s" % ( - currentFolderPath, - newFileName - ) - if os.path.exists(newFilePath): - i += 1 - newFilePath = "%s%s(%s).%s" % ( - currentFolderPath, - newFileNameOnly, - i, - newFileExtension - ) - errorNo = 201 - break - else: - fileHandle = open(newFilePath,'w') - linecount = 0 - while (1): - #line = newFile.file.readline() - line = newFile.readline() - if not line: break - fileHandle.write("%s" % line) - linecount += 1 - os.chmod(newFilePath, 0777) - break - else: - newFileName = "Extension not allowed" - errorNo = 203 - else: - newFileName = "No File" - errorNo = 202 - - string = """ - - """ % ( - errorNo, - newFileName.replace('"',"'") - ) - return string - - def run(self): - s = "" - try: - # Check if this is disabled - if not(self.enabled): - return self.sendError(1, "This connector is disabled. Please check the connector configurations and try again") - # Make sure we have valid inputs - if not( - (self.request.has_key("Command")) and - (self.request.has_key("Type")) and - (self.request.has_key("CurrentFolder")) - ): - return - # Get command - command = self.request.get("Command", None) - # Get resource type - resourceType = self.request.get("Type", None) - # folder syntax must start and end with "/" - currentFolder = self.request.get("CurrentFolder", None) - if (currentFolder[-1] <> "/"): - currentFolder += "/" - if (currentFolder[0] <> "/"): - currentFolder = "/" + currentFolder - # Check for invalid paths - if (".." in currentFolder): - return self.sendError(102, "") - # File upload doesn't have to return XML, so intercept - # her:e - if (command == "FileUpload"): - return self.fileUpload(resourceType, currentFolder) - # Begin XML - s += self.createXmlHeader(command, resourceType, currentFolder) - # Execute the command - if (command == "GetFolders"): - f = self.getFolders - elif (command == "GetFoldersAndFiles"): - f = self.getFoldersAndFiles - elif (command == "CreateFolder"): - f = self.createFolder - else: - f = None - if (f is not None): - s += f(resourceType, currentFolder) - s += self.createXmlFooter() - except Exception, e: - s = "ERROR: %s" % e - return s - -# Running from command line -if __name__ == '__main__': - # To test the output, uncomment the standard headers - #print "Content-Type: text/html" - #print "" - print getFCKeditorConnector() - -""" -Running from zope, you will need to modify this connector. -If you have uploaded the FCKeditor into Zope (like me), you need to -move this connector out of Zope, and replace the "connector" with an -alias as below. The key to it is to pass the Zope context in, as -we then have a like to the Zope context. - -## Script (Python) "connector.py" -##bind container=container -##bind context=context -##bind namespace= -##bind script=script -##bind subpath=traverse_subpath -##parameters=*args, **kws -##title=ALIAS -## -import Products.connector as connector -return connector.getFCKeditorConnector(context=context).run() -""" - - +#!/usr/bin/env python + +""" +FCKeditor - The text editor for internet +Copyright (C) 2003-2006 Frederico Caldeira Knabben + +Licensed under the terms of the GNU Lesser General Public License: + http://www.opensource.org/licenses/lgpl-license.php + +For further information visit: + http://www.fckeditor.net/ + +"Support Open Source software. What about a donation today?" + +File Name: connector.py + Connector for Python. + + Tested With: + Standard: + Python 2.3.3 + Zope: + Zope Version: (Zope 2.8.1-final, python 2.3.5, linux2) + Python Version: 2.3.5 (#4, Mar 10 2005, 01:40:25) + [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] + System Platform: linux2 + +File Authors: + Andrew Liu (andrew@liuholdings.com) +""" + +""" +Author Notes (04 December 2005): +This module has gone through quite a few phases of change. Obviously, +I am only supporting that part of the code that I use. Initially +I had the upload directory as a part of zope (ie. uploading files +directly into Zope), before realising that there were too many +complex intricacies within Zope to deal with. Zope is one ugly piece +of code. So I decided to complement Zope by an Apache server (which +I had running anyway, and doing nothing). So I mapped all uploads +from an arbitrary server directory to an arbitrary web directory. +All the FCKeditor uploading occurred this way, and I didn't have to +stuff around with fiddling with Zope objects and the like (which are +terribly complex and something you don't want to do - trust me). + +Maybe a Zope expert can touch up the Zope components. In the end, +I had FCKeditor loaded in Zope (probably a bad idea as well), and +I replaced the connector.py with an alias to a server module. +Right now, all Zope components will simple remain as is because +I've had enough of Zope. + +See notes right at the end of this file for how I aliased out of Zope. + +Anyway, most of you probably wont use Zope, so things are pretty +simple in that regard. + +Typically, SERVER_DIR is the root of WEB_DIR (not necessarily). +Most definitely, SERVER_USERFILES_DIR points to WEB_USERFILES_DIR. +""" + +import cgi +import re +import os +import string + +""" +escape + +Converts the special characters '<', '>', and '&'. + +RFC 1866 specifies that these characters be represented +in HTML as < > and & respectively. In Python +1.5 we use the new string.replace() function for speed. +""" +def escape(text, replace=string.replace): + text = replace(text, '&', '&') # must be done 1st + text = replace(text, '<', '<') + text = replace(text, '>', '>') + text = replace(text, '"', '"') + return text + +""" +getFCKeditorConnector + +Creates a new instance of an FCKeditorConnector, and runs it +""" +def getFCKeditorConnector(context=None): + # Called from Zope. Passes the context through + connector = FCKeditorConnector(context=context) + return connector.run() + + +""" +FCKeditorRequest + +A wrapper around the request object +Can handle normal CGI request, or a Zope request +Extend as required +""" +class FCKeditorRequest(object): + def __init__(self, context=None): + if (context is not None): + r = context.REQUEST + else: + r = cgi.FieldStorage() + self.context = context + self.request = r + + def isZope(self): + if (self.context is not None): + return True + return False + + def has_key(self, key): + return self.request.has_key(key) + + def get(self, key, default=None): + value = None + if (self.isZope()): + value = self.request.get(key, default) + else: + if key in self.request.keys(): + value = self.request[key].value + else: + value = default + return value + +""" +FCKeditorConnector + +The connector class +""" +class FCKeditorConnector(object): + # Configuration for FCKEditor + # can point to another server here, if linked correctly + #WEB_HOST = "http://127.0.0.1/" + WEB_HOST = "" + SERVER_DIR = "/var/www/html/" + + WEB_USERFILES_FOLDER = WEB_HOST + "upload/" + SERVER_USERFILES_FOLDER = SERVER_DIR + "upload/" + + # Allow access (Zope) + __allow_access_to_unprotected_subobjects__ = 1 + # Class Attributes + parentFolderRe = re.compile("[\/][^\/]+[\/]?$") + + """ + Constructor + """ + def __init__(self, context=None): + # The given root path will NOT be shown to the user + # Only the userFilesPath will be shown + + # Instance Attributes + self.context = context + self.request = FCKeditorRequest(context=context) + self.rootPath = self.SERVER_DIR + self.userFilesFolder = self.SERVER_USERFILES_FOLDER + self.webUserFilesFolder = self.WEB_USERFILES_FOLDER + + # Enables / Disables the connector + self.enabled = False # Set to True to enable this connector + + # These are instance variables + self.zopeRootContext = None + self.zopeUploadContext = None + + # Copied from php module =) + self.allowedExtensions = { + "File": None, + "Image": None, + "Flash": None, + "Media": None + } + self.deniedExtensions = { + "File": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], + "Image": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], + "Flash": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ], + "Media": [ "php","php2","php3","php4","php5","phtml","pwml","inc","asp","aspx","ascx","jsp","cfm","cfc","pl","bat","exe","com","dll","vbs","js","reg","cgi" ] + } + + """ + Zope specific functions + """ + def isZope(self): + # The context object is the zope object + if (self.context is not None): + return True + return False + + def getZopeRootContext(self): + if self.zopeRootContext is None: + self.zopeRootContext = self.context.getPhysicalRoot() + return self.zopeRootContext + + def getZopeUploadContext(self): + if self.zopeUploadContext is None: + folderNames = self.userFilesFolder.split("/") + c = self.getZopeRootContext() + for folderName in folderNames: + if (folderName <> ""): + c = c[folderName] + self.zopeUploadContext = c + return self.zopeUploadContext + + """ + Generic manipulation functions + """ + def getUserFilesFolder(self): + return self.userFilesFolder + + def getWebUserFilesFolder(self): + return self.webUserFilesFolder + + def getAllowedExtensions(self, resourceType): + return self.allowedExtensions[resourceType] + + def getDeniedExtensions(self, resourceType): + return self.deniedExtensions[resourceType] + + def removeFromStart(self, string, char): + return string.lstrip(char) + + def removeFromEnd(self, string, char): + return string.rstrip(char) + + def convertToXmlAttribute(self, value): + if (value is None): + value = "" + return escape(value) + + def convertToPath(self, path): + if (path[-1] <> "/"): + return path + "/" + else: + return path + + def getUrlFromPath(self, resourceType, path): + if (resourceType is None) or (resourceType == ''): + url = "%s%s" % ( + self.removeFromEnd(self.getUserFilesFolder(), '/'), + path + ) + else: + url = "%s%s%s" % ( + self.getUserFilesFolder(), + resourceType, + path + ) + return url + + def getWebUrlFromPath(self, resourceType, path): + if (resourceType is None) or (resourceType == ''): + url = "%s%s" % ( + self.removeFromEnd(self.getWebUserFilesFolder(), '/'), + path + ) + else: + url = "%s%s%s" % ( + self.getWebUserFilesFolder(), + resourceType, + path + ) + return url + + def removeExtension(self, fileName): + index = fileName.rindex(".") + newFileName = fileName[0:index] + return newFileName + + def getExtension(self, fileName): + index = fileName.rindex(".") + 1 + fileExtension = fileName[index:] + return fileExtension + + def getParentFolder(self, folderPath): + parentFolderPath = self.parentFolderRe.sub('', folderPath) + return parentFolderPath + + """ + serverMapFolder + + Purpose: works out the folder map on the server + """ + def serverMapFolder(self, resourceType, folderPath): + # Get the resource type directory + resourceTypeFolder = "%s%s/" % ( + self.getUserFilesFolder(), + resourceType + ) + # Ensure that the directory exists + self.createServerFolder(resourceTypeFolder) + + # Return the resource type directory combined with the + # required path + return "%s%s" % ( + resourceTypeFolder, + self.removeFromStart(folderPath, '/') + ) + + """ + createServerFolder + + Purpose: physically creates a folder on the server + """ + def createServerFolder(self, folderPath): + # Check if the parent exists + parentFolderPath = self.getParentFolder(folderPath) + if not(os.path.exists(parentFolderPath)): + errorMsg = self.createServerFolder(parentFolderPath) + if errorMsg is not None: + return errorMsg + # Check if this exists + if not(os.path.exists(folderPath)): + os.mkdir(folderPath) + os.chmod(folderPath, 0755) + errorMsg = None + else: + if os.path.isdir(folderPath): + errorMsg = None + else: + raise "createServerFolder: Non-folder of same name already exists" + return errorMsg + + + """ + getRootPath + + Purpose: returns the root path on the server + """ + def getRootPath(self): + return self.rootPath + + """ + setXmlHeaders + + Purpose: to prepare the headers for the xml to return + """ + def setXmlHeaders(self): + #now = self.context.BS_get_now() + #yesterday = now - 1 + self.setHeader("Content-Type", "text/xml") + #self.setHeader("Expires", yesterday) + #self.setHeader("Last-Modified", now) + #self.setHeader("Cache-Control", "no-store, no-cache, must-revalidate") + self.printHeaders() + return + + def setHeader(self, key, value): + if (self.isZope()): + self.context.REQUEST.RESPONSE.setHeader(key, value) + else: + print "%s: %s" % (key, value) + return + + def printHeaders(self): + # For non-Zope requests, we need to print an empty line + # to denote the end of headers + if (not(self.isZope())): + print "" + + """ + createXmlFooter + + Purpose: returns the xml header + """ + def createXmlHeader(self, command, resourceType, currentFolder): + self.setXmlHeaders() + s = "" + # Create the XML document header + s += """""" + # Create the main connector node + s += """""" % ( + command, + resourceType + ) + # Add the current folder node + s += """""" % ( + self.convertToXmlAttribute(currentFolder), + self.convertToXmlAttribute( + self.getWebUrlFromPath( + resourceType, + currentFolder + ) + ), + ) + return s + + """ + createXmlFooter + + Purpose: returns the xml footer + """ + def createXmlFooter(self): + s = """""" + return s + + """ + sendError + + Purpose: in the event of an error, return an xml based error + """ + def sendError(self, number, text): + self.setXmlHeaders() + s = "" + # Create the XML document header + s += """""" + s += """""" + s += """""" % (number, text) + s += """""" + return s + + """ + getFolders + + Purpose: command to recieve a list of folders + """ + def getFolders(self, resourceType, currentFolder): + if (self.isZope()): + return self.getZopeFolders(resourceType, currentFolder) + else: + return self.getNonZopeFolders(resourceType, currentFolder) + + def getZopeFolders(self, resourceType, currentFolder): + # Open the folders node + s = "" + s += """""" + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + for (name, o) in zopeFolder.objectItems(["Folder"]): + s += """""" % ( + self.convertToXmlAttribute(name) + ) + # Close the folders node + s += """""" + return s + + def getNonZopeFolders(self, resourceType, currentFolder): + # Map the virtual path to our local server + serverPath = self.serverMapFolder(resourceType, currentFolder) + # Open the folders node + s = "" + s += """""" + for someObject in os.listdir(serverPath): + someObjectPath = os.path.join(serverPath, someObject) + if os.path.isdir(someObjectPath): + s += """""" % ( + self.convertToXmlAttribute(someObject) + ) + # Close the folders node + s += """""" + return s + + """ + getFoldersAndFiles + + Purpose: command to recieve a list of folders and files + """ + def getFoldersAndFiles(self, resourceType, currentFolder): + if (self.isZope()): + return self.getZopeFoldersAndFiles(resourceType, currentFolder) + else: + return self.getNonZopeFoldersAndFiles(resourceType, currentFolder) + + def getNonZopeFoldersAndFiles(self, resourceType, currentFolder): + # Map the virtual path to our local server + serverPath = self.serverMapFolder(resourceType, currentFolder) + # Open the folders / files node + folders = """""" + files = """""" + for someObject in os.listdir(serverPath): + someObjectPath = os.path.join(serverPath, someObject) + if os.path.isdir(someObjectPath): + folders += """""" % ( + self.convertToXmlAttribute(someObject) + ) + elif os.path.isfile(someObjectPath): + size = os.path.getsize(someObjectPath) + files += """""" % ( + self.convertToXmlAttribute(someObject), + os.path.getsize(someObjectPath) + ) + # Close the folders / files node + folders += """""" + files += """""" + # Return it + s = folders + files + return s + + def getZopeFoldersAndFiles(self, resourceType, currentFolder): + folders = self.getZopeFolders(resourceType, currentFolder) + files = self.getZopeFiles(resourceType, currentFolder) + s = folders + files + return s + + def getZopeFiles(self, resourceType, currentFolder): + # Open the files node + s = "" + s += """""" + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + for (name, o) in zopeFolder.objectItems(["File","Image"]): + s += """""" % ( + self.convertToXmlAttribute(name), + ((o.get_size() / 1024) + 1) + ) + # Close the files node + s += """""" + return s + + def findZopeFolder(self, resourceType, folderName): + # returns the context of the resource / folder + zopeFolder = self.getZopeUploadContext() + folderName = self.removeFromStart(folderName, "/") + folderName = self.removeFromEnd(folderName, "/") + if (resourceType <> ""): + try: + zopeFolder = zopeFolder[resourceType] + except: + zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=resourceType, title=resourceType) + zopeFolder = zopeFolder[resourceType] + if (folderName <> ""): + folderNames = folderName.split("/") + for folderName in folderNames: + zopeFolder = zopeFolder[folderName] + return zopeFolder + + """ + createFolder + + Purpose: command to create a new folder + """ + def createFolder(self, resourceType, currentFolder): + if (self.isZope()): + return self.createZopeFolder(resourceType, currentFolder) + else: + return self.createNonZopeFolder(resourceType, currentFolder) + + def createZopeFolder(self, resourceType, currentFolder): + # Find out where we are + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + errorNo = 0 + errorMsg = "" + if self.request.has_key("NewFolderName"): + newFolder = self.request.get("NewFolderName", None) + zopeFolder.manage_addProduct["OFSP"].manage_addFolder(id=newFolder, title=newFolder) + else: + errorNo = 102 + error = """""" % ( + errorNo, + self.convertToXmlAttribute(errorMsg) + ) + return error + + def createNonZopeFolder(self, resourceType, currentFolder): + errorNo = 0 + errorMsg = "" + if self.request.has_key("NewFolderName"): + newFolder = self.request.get("NewFolderName", None) + currentFolderPath = self.serverMapFolder( + resourceType, + currentFolder + ) + try: + newFolderPath = currentFolderPath + newFolder + errorMsg = self.createServerFolder(newFolderPath) + if (errorMsg is not None): + errorNo = 110 + except: + errorNo = 103 + else: + errorNo = 102 + error = """""" % ( + errorNo, + self.convertToXmlAttribute(errorMsg) + ) + return error + + """ + getFileName + + Purpose: helper function to extrapolate the filename + """ + def getFileName(self, filename): + for splitChar in ["/", "\\"]: + array = filename.split(splitChar) + if (len(array) > 1): + filename = array[-1] + return filename + + """ + fileUpload + + Purpose: command to upload files to server + """ + def fileUpload(self, resourceType, currentFolder): + if (self.isZope()): + return self.zopeFileUpload(resourceType, currentFolder) + else: + return self.nonZopeFileUpload(resourceType, currentFolder) + + def zopeFileUpload(self, resourceType, currentFolder, count=None): + zopeFolder = self.findZopeFolder(resourceType, currentFolder) + file = self.request.get("NewFile", None) + fileName = self.getFileName(file.filename) + fileNameOnly = self.removeExtension(fileName) + fileExtension = self.getExtension(fileName).lower() + if (count): + nid = "%s.%s.%s" % (fileNameOnly, count, fileExtension) + else: + nid = fileName + title = nid + try: + zopeFolder.manage_addProduct['OFSP'].manage_addFile( + id=nid, + title=title, + file=file.read() + ) + except: + if (count): + count += 1 + else: + count = 1 + self.zopeFileUpload(resourceType, currentFolder, count) + return + + def nonZopeFileUpload(self, resourceType, currentFolder): + errorNo = 0 + errorMsg = "" + if self.request.has_key("NewFile"): + # newFile has all the contents we need + newFile = self.request.get("NewFile", "") + # Get the file name + newFileName = newFile.filename + newFileNameOnly = self.removeExtension(newFileName) + newFileExtension = self.getExtension(newFileName).lower() + allowedExtensions = self.getAllowedExtensions(resourceType) + deniedExtensions = self.getDeniedExtensions(resourceType) + if (allowedExtensions is not None): + # Check for allowed + isAllowed = False + if (newFileExtension in allowedExtensions): + isAllowed = True + elif (deniedExtensions is not None): + # Check for denied + isAllowed = True + if (newFileExtension in deniedExtensions): + isAllowed = False + else: + # No extension limitations + isAllowed = True + + if (isAllowed): + if (self.isZope()): + # Upload into zope + self.zopeFileUpload(resourceType, currentFolder) + else: + # Upload to operating system + # Map the virtual path to the local server path + currentFolderPath = self.serverMapFolder( + resourceType, + currentFolder + ) + i = 0 + while (True): + newFilePath = "%s%s" % ( + currentFolderPath, + newFileName + ) + if os.path.exists(newFilePath): + i += 1 + newFilePath = "%s%s(%s).%s" % ( + currentFolderPath, + newFileNameOnly, + i, + newFileExtension + ) + errorNo = 201 + break + else: + fileHandle = open(newFilePath,'w') + linecount = 0 + while (1): + #line = newFile.file.readline() + line = newFile.readline() + if not line: break + fileHandle.write("%s" % line) + linecount += 1 + os.chmod(newFilePath, 0777) + break + else: + newFileName = "Extension not allowed" + errorNo = 203 + else: + newFileName = "No File" + errorNo = 202 + + string = """ + + """ % ( + errorNo, + newFileName.replace('"',"'") + ) + return string + + def run(self): + s = "" + try: + # Check if this is disabled + if not(self.enabled): + return self.sendError(1, "This connector is disabled. Please check the connector configurations and try again") + # Make sure we have valid inputs + if not( + (self.request.has_key("Command")) and + (self.request.has_key("Type")) and + (self.request.has_key("CurrentFolder")) + ): + return + # Get command + command = self.request.get("Command", None) + # Get resource type + resourceType = self.request.get("Type", None) + # folder syntax must start and end with "/" + currentFolder = self.request.get("CurrentFolder", None) + if (currentFolder[-1] <> "/"): + currentFolder += "/" + if (currentFolder[0] <> "/"): + currentFolder = "/" + currentFolder + # Check for invalid paths + if (".." in currentFolder): + return self.sendError(102, "") + # File upload doesn't have to return XML, so intercept + # her:e + if (command == "FileUpload"): + return self.fileUpload(resourceType, currentFolder) + # Begin XML + s += self.createXmlHeader(command, resourceType, currentFolder) + # Execute the command + if (command == "GetFolders"): + f = self.getFolders + elif (command == "GetFoldersAndFiles"): + f = self.getFoldersAndFiles + elif (command == "CreateFolder"): + f = self.createFolder + else: + f = None + if (f is not None): + s += f(resourceType, currentFolder) + s += self.createXmlFooter() + except Exception, e: + s = "ERROR: %s" % e + return s + +# Running from command line +if __name__ == '__main__': + # To test the output, uncomment the standard headers + #print "Content-Type: text/html" + #print "" + print getFCKeditorConnector() + +""" +Running from zope, you will need to modify this connector. +If you have uploaded the FCKeditor into Zope (like me), you need to +move this connector out of Zope, and replace the "connector" with an +alias as below. The key to it is to pass the Zope context in, as +we then have a like to the Zope context. + +## Script (Python) "connector.py" +##bind container=container +##bind context=context +##bind namespace= +##bind script=script +##bind subpath=traverse_subpath +##parameters=*args, **kws +##title=ALIAS +## +import Products.connector as connector +return connector.getFCKeditorConnector(context=context).run() +""" + + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/test.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/test.html index 51dbb5f148a..624be6cc145 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/test.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/connectors/test.html @@ -1,177 +1,177 @@ - - - - - FCKeditor - Connectors Tests - - - - - - - - - - - -
- - - - - - - - -
- Connector:
- -
-     - Current Folder
-
-     - Resource Type
- -
-
- - - - - - - - - - -
- Get Folders -     - Get Folders and Files -     - Create Folder -     -
- File Upload
- - -
-
-
- URL: -
- -
- - + + + + + FCKeditor - Connectors Tests + + + + + + + + + + + +
+ + + + + + + + +
+ Connector:
+ +
+     + Current Folder
+
+     + Resource Type
+ +
+
+ + + + + + + + + + +
+ Get Folders +     + Get Folders and Files +     + Create Folder +     +
+ File Upload
+ + +
+
+
+ URL: +
+ +
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmactualfolder.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmactualfolder.html index 39776a3d558..d2f24ec2451 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmactualfolder.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmactualfolder.html @@ -1,63 +1,63 @@ - - - - - - - - - - - - -
- -
- - + + + + + + + + + + + + +
+ +
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html index e0b5ec6c401..a62826bd8fb 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html @@ -1,109 +1,109 @@ - - - - - - - - - - - - - - -
- -
- - + + + + + + + + + + + + + + +
+ +
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmfolders.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmfolders.html index 4a8003323d8..440bb443b3b 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmfolders.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmfolders.html @@ -1,192 +1,192 @@ - - - - - - - - - - - - - - -
- - + + + + + + + + + + + + + + +
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourceslist.html index ef1080a74b6..dfa98adefbd 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourceslist.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourceslist.html @@ -1,144 +1,145 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourcetype.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourcetype.html index 89b7e23dc8b..8eb2270de06 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourcetype.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmresourcetype.html @@ -1,61 +1,61 @@ - - - - - - - - - - - - - - -
- Resource Type
- -
- - + + + + + + + + + + + + + + +
+ Resource Type
+ +
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmupload.html b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmupload.html index 3a0e21ef86f..325dff5fe1d 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmupload.html +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/frmupload.html @@ -1,109 +1,109 @@ - - - - - - - - - -
- - - - -
- Upload a new file in this folder
- - - - - -
 
-
-
- - + + + + + + + + + +
+ + + + +
+ Upload a new file in this folder
+ + + + + +
 
+
+
+ + diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/common.js b/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/common.js index 16ccef5fa2f..18e3e216368 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/common.js +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/common.js @@ -1,34 +1,51 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: common.js - * Common objects and functions shared by all pages that compose the - * File Browser dialog window. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -function AddSelectOption( selectElement, optionText, optionValue ) -{ - var oOption = document.createElement("OPTION") ; - - oOption.text = optionText ; - oOption.value = optionValue ; - - selectElement.options.add(oOption) ; - - return oOption ; -} - -var oConnector = window.parent.oConnector ; -var oIcons = window.parent.oIcons ; \ No newline at end of file +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: common.js + * Common objects and functions shared by all pages that compose the + * File Browser dialog window. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +function AddSelectOption( selectElement, optionText, optionValue ) +{ + var oOption = document.createElement("OPTION") ; + + oOption.text = optionText ; + oOption.value = optionValue ; + + selectElement.options.add(oOption) ; + + return oOption ; +} + +var oConnector = window.parent.oConnector ; +var oIcons = window.parent.oIcons ; + + +function StringBuilder( value ) +{ + this._Strings = new Array( value || '' ) ; +} + +StringBuilder.prototype.Append = function( value ) +{ + if ( value ) + this._Strings.push( value ) ; +} + +StringBuilder.prototype.ToString = function() +{ + return this._Strings.join( '' ) ; +} \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/fckxml.js b/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/fckxml.js index 1a5eb9ee17d..7549499eae5 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/fckxml.js +++ b/htdocs/includes/fckeditor/editor/filemanager/browser/default/js/fckxml.js @@ -1,109 +1,109 @@ -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: fckxml.js - * Defines the FCKXml object that is used for XML data calls - * and XML processing. - * This script is shared by almost all pages that compose the - * File Browser frameset. - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) - */ - -var FCKXml = function() -{} - -FCKXml.prototype.GetHttpRequest = function() -{ - if ( window.XMLHttpRequest ) // Gecko - return new XMLHttpRequest() ; - else if ( window.ActiveXObject ) // IE - return new ActiveXObject("MsXml2.XmlHttp") ; -} - -FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer ) -{ - var oFCKXml = this ; - - var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ; - - var oXmlHttp = this.GetHttpRequest() ; - - oXmlHttp.open( "GET", urlToCall, bAsync ) ; - - if ( bAsync ) - { - oXmlHttp.onreadystatechange = function() - { - if ( oXmlHttp.readyState == 4 ) - { - oFCKXml.DOMDocument = oXmlHttp.responseXML ; - if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) - asyncFunctionPointer( oFCKXml ) ; - else - alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; - } - } - } - - oXmlHttp.send( null ) ; - - if ( ! bAsync ) - { - if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) - this.DOMDocument = oXmlHttp.responseXML ; - else - { - alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; - } - } -} - -FCKXml.prototype.SelectNodes = function( xpath ) -{ - if ( document.all ) // IE - return this.DOMDocument.selectNodes( xpath ) ; - else // Gecko - { - var aNodeArray = new Array(); - - var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, - this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ; - if ( xPathResult ) - { - var oNode = xPathResult.iterateNext() ; - while( oNode ) - { - aNodeArray[aNodeArray.length] = oNode ; - oNode = xPathResult.iterateNext(); - } - } - return aNodeArray ; - } -} - -FCKXml.prototype.SelectSingleNode = function( xpath ) -{ - if ( document.all ) // IE - return this.DOMDocument.selectSingleNode( xpath ) ; - else // Gecko - { - var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, - this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null); - - if ( xPathResult && xPathResult.singleNodeValue ) - return xPathResult.singleNodeValue ; - else - return null ; - } -} +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: fckxml.js + * Defines the FCKXml object that is used for XML data calls + * and XML processing. + * This script is shared by almost all pages that compose the + * File Browser frameset. + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) + */ + +var FCKXml = function() +{} + +FCKXml.prototype.GetHttpRequest = function() +{ + if ( window.XMLHttpRequest ) // Gecko + return new XMLHttpRequest() ; + else if ( window.ActiveXObject ) // IE + return new ActiveXObject("MsXml2.XmlHttp") ; +} + +FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer ) +{ + var oFCKXml = this ; + + var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ; + + var oXmlHttp = this.GetHttpRequest() ; + + oXmlHttp.open( "GET", urlToCall, bAsync ) ; + + if ( bAsync ) + { + oXmlHttp.onreadystatechange = function() + { + if ( oXmlHttp.readyState == 4 ) + { + oFCKXml.DOMDocument = oXmlHttp.responseXML ; + if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) + asyncFunctionPointer( oFCKXml ) ; + else + alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; + } + } + } + + oXmlHttp.send( null ) ; + + if ( ! bAsync ) + { + if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) + this.DOMDocument = oXmlHttp.responseXML ; + else + { + alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; + } + } +} + +FCKXml.prototype.SelectNodes = function( xpath ) +{ + if ( document.all ) // IE + return this.DOMDocument.selectNodes( xpath ) ; + else // Gecko + { + var aNodeArray = new Array(); + + var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, + this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ; + if ( xPathResult ) + { + var oNode = xPathResult.iterateNext() ; + while( oNode ) + { + aNodeArray[aNodeArray.length] = oNode ; + oNode = xPathResult.iterateNext(); + } + } + return aNodeArray ; + } +} + +FCKXml.prototype.SelectSingleNode = function( xpath ) +{ + if ( document.all ) // IE + return this.DOMDocument.selectSingleNode( xpath ) ; + else // Gecko + { + var xPathResult = this.DOMDocument.evaluate( xpath, this.DOMDocument, + this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null); + + if ( xPathResult && xPathResult.singleNodeValue ) + return xPathResult.singleNodeValue ; + else + return null ; + } +} diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/class_upload.asp b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/class_upload.asp index 5e60ab92ee3..05f39f7c24d 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/class_upload.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/class_upload.asp @@ -1,230 +1,230 @@ - -<% -'********************************************** -' File: NetRube_Upload.asp -' Version: NetRube Upload Class Version 2.1 Build 20050228 -' Author: NetRube -' Email: NetRube@126.com -' Date: 02/28/2005 -' Comments: The code for the Upload. -' This can free usage, but please -' not to delete this copyright information. -' If you have a modification version, -' Please send out a duplicate to me. -'********************************************** -' 文件名: NetRube_Upload.asp -' 版本: NetRube Upload Class Version 2.1 Build 20050228 -' 作者: NetRube(网络乡巴佬) -' 电子邮件: NetRube@126.com -' 日期: 2005年02月28日 -' 声明: 文件上传类 -' 本上传类可以自由使用,但请保留此版权声明信息 -' 如果您对本上传类进行修改增强, -' 请发送一份给俺。 -'********************************************** - -Class NetRube_Upload - - Public File, Form - Private oSourceData - Private nMaxSize, nErr, sAllowed, sDenied - - Private Sub Class_Initialize - nErr = 0 - nMaxSize = 1048576 - - Set File = Server.CreateObject("Scripting.Dictionary") - File.CompareMode = 1 - Set Form = Server.CreateObject("Scripting.Dictionary") - Form.CompareMode = 1 - - Set oSourceData = Server.CreateObject("ADODB.Stream") - oSourceData.Type = 1 - oSourceData.Mode = 3 - oSourceData.Open - End Sub - - Private Sub Class_Terminate - Form.RemoveAll - Set Form = Nothing - File.RemoveAll - Set File = Nothing - - oSourceData.Close - Set oSourceData = Nothing - End Sub - - Public Property Get Version - Version = "NetRube Upload Class Version 1.0 Build 20041218" - End Property - - Public Property Get ErrNum - ErrNum = nErr - End Property - - Public Property Let MaxSize(nSize) - nMaxSize = nSize - End Property - - Public Property Let Allowed(sExt) - sAllowed = sExt - End Property - - Public Property Let Denied(sExt) - sDenied = sExt - End Property - - Public Sub GetData - Dim aCType - aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") - If aCType(0) <> "multipart/form-data" Then - nErr = 1 - Exit Sub - End If - - Dim nTotalSize - nTotalSize = Request.TotalBytes - If nTotalSize < 1 Then - nErr = 2 - Exit Sub - End If - If nMaxSize > 0 And nTotalSize > nMaxSize Then - nErr = 3 - Exit Sub - End If - - oSourceData.Write Request.BinaryRead(nTotalSize) - oSourceData.Position = 0 - - Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary - - oTotalData = oSourceData.Read - bCrLf = ChrB(13) & ChrB(10) - sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) - nBoundLen = LenB(sBoundary) + 2 - nFormStart = nBoundLen - - Set oFormStream = Server.CreateObject("ADODB.Stream") - - Do While (nFormStart + 2) < nTotalSize - nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 - - With oFormStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = nFormStart - oSourceData.CopyTo oFormStream, nFormEnd - nFormStart - .Position = 0 - .Type = 2 - .CharSet = "UTF-8" - sFormHeader = .ReadText - .Close - End With - - nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 - nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 - nPosEnd = InStr(nPosStart, sFormHeader, """") - sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - - If InStr(45, sFormHeader, " filename=", 1) > 0 Then - Set File(sFormName) = New NetRube_FileInfo - File(sFormName).FormName = sFormName - File(sFormName).Start = nFormEnd - File(sFormName).Size = nFormStart - nFormEnd - 2 - nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 - nPosEnd = InStr(nPosStart, sFormHeader, """") - File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) - File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) - nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 - nPosEnd = InStr(nPosStart, sFormHeader, vbCr) - File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) - Else - With oFormStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = nPosEnd - oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 - .Position = 0 - .Type = 2 - .CharSet = "UTF-8" - Form(sFormName) = .ReadText - .Close - End With - End If - - nFormStart = nFormStart + nBoundLen - Loop - - oTotalData = "" - Set oFormStream = Nothing - End Sub - - Public Sub SaveAs(sItem, sFileName) - If File(sItem).Size < 1 Then - nErr = 2 - Exit Sub - End If - - If Not IsAllowed(File(sItem).Ext) Then - nErr = 4 - Exit Sub - End If - - Dim oFileStream - Set oFileStream = Server.CreateObject("ADODB.Stream") - With oFileStream - .Type = 1 - .Mode = 3 - .Open - oSourceData.Position = File(sItem).Start - oSourceData.CopyTo oFileStream, File(sItem).Size - .Position = 0 - .SaveToFile sFileName, 2 - .Close - End With - Set oFileStream = Nothing - End Sub - - Private Function IsAllowed(sExt) - Dim oRE - Set oRE = New RegExp - oRE.IgnoreCase = True - oRE.Global = True - - If sDenied = "" Then - oRE.Pattern = sAllowed - IsAllowed = (sAllowed = "") Or oRE.Test(sExt) - Else - oRE.Pattern = sDenied - IsAllowed = Not oRE.Test(sExt) - End If - - Set oRE = Nothing - End Function -End Class - -Class NetRube_FileInfo - Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start -End Class + +<% +'********************************************** +' File: NetRube_Upload.asp +' Version: NetRube Upload Class Version 2.1 Build 20050228 +' Author: NetRube +' Email: NetRube@126.com +' Date: 02/28/2005 +' Comments: The code for the Upload. +' This can free usage, but please +' not to delete this copyright information. +' If you have a modification version, +' Please send out a duplicate to me. +'********************************************** +' 文件名: NetRube_Upload.asp +' 版本: NetRube Upload Class Version 2.1 Build 20050228 +' 作者: NetRube(网络乡巴佬) +' 电子邮件: NetRube@126.com +' 日期: 2005年02月28日 +' 声明: 文件上传类 +' 本上传类可以自由使用,但请保留此版权声明信息 +' 如果您对本上传类进行修改增强, +' 请发送一份给俺。 +'********************************************** + +Class NetRube_Upload + + Public File, Form + Private oSourceData + Private nMaxSize, nErr, sAllowed, sDenied + + Private Sub Class_Initialize + nErr = 0 + nMaxSize = 1048576 + + Set File = Server.CreateObject("Scripting.Dictionary") + File.CompareMode = 1 + Set Form = Server.CreateObject("Scripting.Dictionary") + Form.CompareMode = 1 + + Set oSourceData = Server.CreateObject("ADODB.Stream") + oSourceData.Type = 1 + oSourceData.Mode = 3 + oSourceData.Open + End Sub + + Private Sub Class_Terminate + Form.RemoveAll + Set Form = Nothing + File.RemoveAll + Set File = Nothing + + oSourceData.Close + Set oSourceData = Nothing + End Sub + + Public Property Get Version + Version = "NetRube Upload Class Version 1.0 Build 20041218" + End Property + + Public Property Get ErrNum + ErrNum = nErr + End Property + + Public Property Let MaxSize(nSize) + nMaxSize = nSize + End Property + + Public Property Let Allowed(sExt) + sAllowed = sExt + End Property + + Public Property Let Denied(sExt) + sDenied = sExt + End Property + + Public Sub GetData + Dim aCType + aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") + If aCType(0) <> "multipart/form-data" Then + nErr = 1 + Exit Sub + End If + + Dim nTotalSize + nTotalSize = Request.TotalBytes + If nTotalSize < 1 Then + nErr = 2 + Exit Sub + End If + If nMaxSize > 0 And nTotalSize > nMaxSize Then + nErr = 3 + Exit Sub + End If + + oSourceData.Write Request.BinaryRead(nTotalSize) + oSourceData.Position = 0 + + Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary + + oTotalData = oSourceData.Read + bCrLf = ChrB(13) & ChrB(10) + sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) + nBoundLen = LenB(sBoundary) + 2 + nFormStart = nBoundLen + + Set oFormStream = Server.CreateObject("ADODB.Stream") + + Do While (nFormStart + 2) < nTotalSize + nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 + + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nFormStart + oSourceData.CopyTo oFormStream, nFormEnd - nFormStart + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + sFormHeader = .ReadText + .Close + End With + + nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 + nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 + nPosEnd = InStr(nPosStart, sFormHeader, """") + sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + + If InStr(45, sFormHeader, " filename=", 1) > 0 Then + Set File(sFormName) = New NetRube_FileInfo + File(sFormName).FormName = sFormName + File(sFormName).Start = nFormEnd + File(sFormName).Size = nFormStart - nFormEnd - 2 + nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 + nPosEnd = InStr(nPosStart, sFormHeader, """") + File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) + File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) + nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 + nPosEnd = InStr(nPosStart, sFormHeader, vbCr) + File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) + Else + With oFormStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = nPosEnd + oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 + .Position = 0 + .Type = 2 + .CharSet = "UTF-8" + Form(sFormName) = .ReadText + .Close + End With + End If + + nFormStart = nFormStart + nBoundLen + Loop + + oTotalData = "" + Set oFormStream = Nothing + End Sub + + Public Sub SaveAs(sItem, sFileName) + If File(sItem).Size < 1 Then + nErr = 2 + Exit Sub + End If + + If Not IsAllowed(File(sItem).Ext) Then + nErr = 4 + Exit Sub + End If + + Dim oFileStream + Set oFileStream = Server.CreateObject("ADODB.Stream") + With oFileStream + .Type = 1 + .Mode = 3 + .Open + oSourceData.Position = File(sItem).Start + oSourceData.CopyTo oFileStream, File(sItem).Size + .Position = 0 + .SaveToFile sFileName, 2 + .Close + End With + Set oFileStream = Nothing + End Sub + + Private Function IsAllowed(sExt) + Dim oRE + Set oRE = New RegExp + oRE.IgnoreCase = True + oRE.Global = True + + If sDenied = "" Then + oRE.Pattern = sAllowed + IsAllowed = (sAllowed = "") Or oRE.Test(sExt) + Else + oRE.Pattern = sDenied + IsAllowed = Not oRE.Test(sExt) + End If + + Set oRE = Nothing + End Function +End Class + +Class NetRube_FileInfo + Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start +End Class %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/config.asp b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/config.asp index a4b56dbe298..9009e46dc3a 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/config.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/config.asp @@ -1,43 +1,43 @@ - -<% - -' SECURITY: You must explicitelly enable this "uploader" (set it to "True"). -Dim ConfigIsEnabled -ConfigIsEnabled = False - -' Path to user files relative to the document root. -Dim ConfigUserFilesPath -ConfigUserFilesPath = "/UserFiles/" - -' Allowed and Denied extensions configurations. -Dim ConfigAllowedExtensions, ConfigDeniedExtensions -Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) -Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) - -ConfigAllowedExtensions.Add "File", "" -ConfigDeniedExtensions.Add "File", "php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi" - -ConfigAllowedExtensions.Add "Image", "jpg|gif|jpeg|png|bmp" -ConfigDeniedExtensions.Add "Image", "" - -ConfigAllowedExtensions.Add "Flash", "swf|fla" -ConfigDeniedExtensions.Add "Flash", "" - + +<% + +' SECURITY: You must explicitelly enable this "uploader" (set it to "True"). +Dim ConfigIsEnabled +ConfigIsEnabled = False + +' Path to user files relative to the document root. +Dim ConfigUserFilesPath +ConfigUserFilesPath = "/UserFiles/" + +' Allowed and Denied extensions configurations. +Dim ConfigAllowedExtensions, ConfigDeniedExtensions +Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) +Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) + +ConfigAllowedExtensions.Add "File", "" +ConfigDeniedExtensions.Add "File", "php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi" + +ConfigAllowedExtensions.Add "Image", "jpg|gif|jpeg|png|bmp" +ConfigDeniedExtensions.Add "Image", "" + +ConfigAllowedExtensions.Add "Flash", "swf|fla" +ConfigDeniedExtensions.Add "Flash", "" + %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/io.asp b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/io.asp index 11354334a59..41a79b49c8f 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/io.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/io.asp @@ -1,25 +1,25 @@ - -<% - -Function RemoveExtension( fileName ) - RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) -End Function - + +<% + +Function RemoveExtension( fileName ) + RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) +End Function + %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/upload.asp b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/upload.asp index 9688ab41839..20cd100efdc 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/asp/upload.asp +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/asp/upload.asp @@ -1,109 +1,109 @@ -<%@ CodePage=65001 Language="VBScript"%> -<% -Option Explicit -Response.Buffer = True -%> - - - - -<% - -' This is the function that sends the results of the uploading process. -Function SendResults( errorNumber, fileUrl, fileName, customMsg ) - Response.Write "" - Response.End -End Function - -%> -<% - -' Check if this uploader has been enabled. -If ( ConfigIsEnabled = False ) Then - SendResults "1", "", "", "This file uploader is disabled. Please check the ""editor/filemanager/upload/asp/config.asp"" file" -End If - -' The the file type (from the QueryString, by default 'File'). -Dim resourceType -If ( Request.QueryString("Type") <> "" ) Then - resourceType = Request.QueryString("Type") -Else - resourceType = "File" -End If - -' Create the Uploader object. -Dim oUploader -Set oUploader = New NetRube_Upload -oUploader.MaxSize = 0 -oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) -oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) -oUploader.GetData - -If oUploader.ErrNum > 1 Then - SendResults "202", "", "", "" -Else - Dim sFileName, sFileUrl, sErrorNumber, sOriginalFileName, sExtension - sFileName = "" - sFileUrl = "" - sErrorNumber = "0" - - ' Map the virtual path to the local server path. - Dim sServerDir - sServerDir = Server.MapPath( ConfigUserFilesPath ) - If ( Right( sServerDir, 1 ) <> "\" ) Then - sServerDir = sServerDir & "\" - End If - - Dim oFSO - Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) - - ' Get the uploaded file name. - sFileName = oUploader.File( "NewFile" ).Name - sExtension = oUploader.File( "NewFile" ).Ext - sOriginalFileName = sFileName - - Dim iCounter - iCounter = 0 - - Do While ( True ) - Dim sFilePath - sFilePath = sServerDir & sFileName - - If ( oFSO.FileExists( sFilePath ) ) Then - iCounter = iCounter + 1 - sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension - sErrorNumber = "201" - Else - oUploader.SaveAs "NewFile", sFilePath - If oUploader.ErrNum > 0 Then SendResults "202", "", "", "" - Exit Do - End If - Loop - Response.Write( sFilePath ) - sFileUrl = ConfigUserFilesPath & sFileName - - SendResults sErrorNumber, sFileUrl, sFileName, "" - -End If - -Set oUploader = Nothing +<%@ CodePage=65001 Language="VBScript"%> +<% +Option Explicit +Response.Buffer = True +%> + + + + +<% + +' This is the function that sends the results of the uploading process. +Function SendResults( errorNumber, fileUrl, fileName, customMsg ) + Response.Write "" + Response.End +End Function + +%> +<% + +' Check if this uploader has been enabled. +If ( ConfigIsEnabled = False ) Then + SendResults "1", "", "", "This file uploader is disabled. Please check the ""editor/filemanager/upload/asp/config.asp"" file" +End If + +' The the file type (from the QueryString, by default 'File'). +Dim resourceType +If ( Request.QueryString("Type") <> "" ) Then + resourceType = Request.QueryString("Type") +Else + resourceType = "File" +End If + +' Create the Uploader object. +Dim oUploader +Set oUploader = New NetRube_Upload +oUploader.MaxSize = 0 +oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) +oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) +oUploader.GetData + +If oUploader.ErrNum > 1 Then + SendResults "202", "", "", "" +Else + Dim sFileName, sFileUrl, sErrorNumber, sOriginalFileName, sExtension + sFileName = "" + sFileUrl = "" + sErrorNumber = "0" + + ' Map the virtual path to the local server path. + Dim sServerDir + sServerDir = Server.MapPath( ConfigUserFilesPath ) + If ( Right( sServerDir, 1 ) <> "\" ) Then + sServerDir = sServerDir & "\" + End If + + Dim oFSO + Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) + + ' Get the uploaded file name. + sFileName = oUploader.File( "NewFile" ).Name + sExtension = oUploader.File( "NewFile" ).Ext + sOriginalFileName = sFileName + + Dim iCounter + iCounter = 0 + + Do While ( True ) + Dim sFilePath + sFilePath = sServerDir & sFileName + + If ( oFSO.FileExists( sFilePath ) ) Then + iCounter = iCounter + 1 + sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension + sErrorNumber = "201" + Else + oUploader.SaveAs "NewFile", sFilePath + If oUploader.ErrNum > 0 Then SendResults "202", "", "", "" + Exit Do + End If + Loop + Response.Write( sFilePath ) + sFileUrl = ConfigUserFilesPath & sFileName + + SendResults sErrorNumber, sFileUrl, sFileName, "" + +End If + +Set oUploader = Nothing %> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/aspx/upload.aspx b/htdocs/includes/fckeditor/editor/filemanager/upload/aspx/upload.aspx index 5be74f28286..9f951c075fd 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/aspx/upload.aspx +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/aspx/upload.aspx @@ -1,26 +1,26 @@ -<%@ Page language="c#" Inherits="FredCK.FCKeditorV2.Uploader" AutoEventWireup="false" %> -<%-- - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * "Support Open Source software. What about a donation today?" - * - * File Name: upload.aspx - * This is the Uploader for ASP.NET. - * - * The code of this page if included in the FCKeditor.Net package, - * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must - * include that DLL in your "bin" directory. - * - * To download the FCKeditor.Net package, go to our official web site: - * http://www.fckeditor.net - * - * File Authors: - * Frederico Caldeira Knabben (fredck@fckeditor.net) +<%@ Page language="c#" Inherits="FredCK.FCKeditorV2.Uploader" AutoEventWireup="false" %> +<%-- + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * "Support Open Source software. What about a donation today?" + * + * File Name: upload.aspx + * This is the Uploader for ASP.NET. + * + * The code of this page if included in the FCKeditor.Net package, + * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must + * include that DLL in your "bin" directory. + * + * To download the FCKeditor.Net package, go to our official web site: + * http://www.fckeditor.net + * + * File Authors: + * Frederico Caldeira Knabben (fredck@fckeditor.net) --%> \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/config.cfm b/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/config.cfm index 3ca64267201..ee686775f9c 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/config.cfm +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/config.cfm @@ -1,94 +1,94 @@ - - - - config = StructNew(); - - // SECURITY: You must explicitelly enable this "uploader". - config.enabled = false; - - // Path to uploaded files relative to the document root. - config.userFilesPath = "/UserFiles/"; - - config.serverPath = ""; // use this to force the server path if FCKeditor is not running directly off the root of the application or the FCKeditor directory in the URL is a virtual directory or a symbolic link / junction - - config.allowedExtensions = StructNew(); - config.deniedExtensions = StructNew(); - - config.allowedExtensions["File"] = ""; - config.deniedExtensions["File"] = "php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi"; - - config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp"; - config.deniedExtensions["Image"] = ""; - - config.allowedExtensions["Flash"] = "swf,fla"; - config.deniedExtensions["Flash"] = ""; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function structCopyKeys(stFrom, stTo) { - for ( key in stFrom ) { - if ( isStruct(stFrom[key]) ) { - structCopyKeys(stFrom[key],stTo[key]); - } else { - stTo[key] = stFrom[key]; - } - } - } - structCopyKeys(FCKeditor, config); - - + + + + config = StructNew(); + + // SECURITY: You must explicitelly enable this "uploader". + config.enabled = false; + + // Path to uploaded files relative to the document root. + config.userFilesPath = "/UserFiles/"; + + config.serverPath = ""; // use this to force the server path if FCKeditor is not running directly off the root of the application or the FCKeditor directory in the URL is a virtual directory or a symbolic link / junction + + config.allowedExtensions = StructNew(); + config.deniedExtensions = StructNew(); + + config.allowedExtensions["File"] = ""; + config.deniedExtensions["File"] = "php,php2,php3,php4,php5,phtml,pwml,inc,asp,aspx,ascx,jsp,cfm,cfc,pl,bat,exe,com,dll,vbs,js,reg,cgi"; + + config.allowedExtensions["Image"] = "png,gif,jpg,jpeg,bmp"; + config.deniedExtensions["Image"] = ""; + + config.allowedExtensions["Flash"] = "swf,fla"; + config.deniedExtensions["Flash"] = ""; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function structCopyKeys(stFrom, stTo) { + for ( key in stFrom ) { + if ( isStruct(stFrom[key]) ) { + structCopyKeys(stFrom[key],stTo[key]); + } else { + stTo[key] = stFrom[key]; + } + } + } + structCopyKeys(FCKeditor, config); + + \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/upload.cfm b/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/upload.cfm index df3d6bef89d..91a815eabdd 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/upload.cfm +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/cfm/upload.cfm @@ -1,164 +1,164 @@ - - - - - - - - - - - - - - - - - - - - - - - - - userFilesPath = config.userFilesPath; - lAllowedExtensions = config.allowedExtensions[url.type]; - lDeniedExtensions = config.deniedExtensions[url.type]; - customMsg = ''; // Can be overwritten. The last value will be sent with the result - - // make sure the user files path is correctly formatted - userFilesPath = replace(userFilesPath, "\", "/", "ALL"); - userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); - if ( right(userFilesPath,1) NEQ "/" ) { - userFilesPath = userFilesPath & "/"; - } - if ( left(userFilesPath,1) NEQ "/" ) { - userFilesPath = "/" & userFilesPath; - } - - if (find("/",getBaseTemplatePath())) { - fs = "/"; - } else { - fs = "\"; - } - - // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that - // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a - // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. - if ( len(config.serverPath) ) { - serverPath = config.serverPath; - } else { - serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),""); - } - - // map the user files path to a physical directory - userFilesServerPath = serverPath & replace(userFilesPath,"/",fs,"all"); - - - - - - - - - - - - - - - - - - - - - - - - - errorNumber = 0; - fileName = cffile.ClientFileName; - fileExt = cffile.ServerFileExt; - - // munge filename for html download. Only a-z, 0-9, _, - and . are allowed - if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { - fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); - fileName = reReplace(fileName, "_{2,}", "_", "ALL"); - fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); - fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); - } - - // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. - if( compare( cffile.ServerFileName, fileName ) ) { - counter = 0; - tmpFileName = fileName; - while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) { - counter = counter + 1; - fileName = tmpFileName & '(#counter#)'; - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + userFilesPath = config.userFilesPath; + lAllowedExtensions = config.allowedExtensions[url.type]; + lDeniedExtensions = config.deniedExtensions[url.type]; + customMsg = ''; // Can be overwritten. The last value will be sent with the result + + // make sure the user files path is correctly formatted + userFilesPath = replace(userFilesPath, "\", "/", "ALL"); + userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); + if ( right(userFilesPath,1) NEQ "/" ) { + userFilesPath = userFilesPath & "/"; + } + if ( left(userFilesPath,1) NEQ "/" ) { + userFilesPath = "/" & userFilesPath; + } + + if (find("/",getBaseTemplatePath())) { + fs = "/"; + } else { + fs = "\"; + } + + // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that + // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a + // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. + if ( len(config.serverPath) ) { + serverPath = config.serverPath; + } else { + serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),""); + } + + // map the user files path to a physical directory + userFilesServerPath = serverPath & replace(userFilesPath,"/",fs,"all"); + + + + + + + + + + + + + + + + + + + + + + + + + errorNumber = 0; + fileName = cffile.ClientFileName; + fileExt = cffile.ServerFileExt; + + // munge filename for html download. Only a-z, 0-9, _, - and . are allowed + if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { + fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); + fileName = reReplace(fileName, "_{2,}", "_", "ALL"); + fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); + fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); + } + + // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. + if( compare( cffile.ServerFileName, fileName ) ) { + counter = 0; + tmpFileName = fileName; + while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) { + counter = counter + 1; + fileName = tmpFileName & '(#counter#)'; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/config.lasso b/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/config.lasso index 7317163f80a..d6bca2f90ef 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/config.lasso +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/config.lasso @@ -1,59 +1,59 @@ -[//lasso -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * File Name: config.php - * Configuration file for the Lasso File Uploader. - * - * File Authors: - * Jason Huck (jason.huck@corefive.com) - */ - - /*..................................................................... - The connector uses the file tags, which require authentication. Enter a - valid username and password from Lasso admin for a group with file tags - permissions for uploads and the path you define in UserFilesPath below. - */ - - var('connection') = array( - -username='xxxxxxxx', - -password='xxxxxxxx' - ); - - - /*..................................................................... - Set the base path for files that users can upload and browse (relative - to server root). - - Set which file extensions are allowed and/or denied for each file type. - */ - var('config') = map( - 'Enabled' = false, - 'UserFilesPath' = '/UserFiles/', - 'Subdirectories' = map( - 'File' = 'File/', - 'Image' = 'Image/', - 'Flash' = 'Flash/', - 'Media' = 'Media/' - ), - 'AllowedExtensions' = map( - 'File' = array(), - 'Image' = array('jpg','gif','jpeg','png'), - 'Flash' = array('swf','fla'), - 'Media' = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') - ), - 'DeniedExtensions' = map( - 'File' = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','lasso','lassoapp'), - 'Image' = array(), - 'Flash' = array(), - 'Media' = array() - ) - ); -] +[//lasso +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * File Name: config.php + * Configuration file for the Lasso File Uploader. + * + * File Authors: + * Jason Huck (jason.huck@corefive.com) + */ + + /*..................................................................... + The connector uses the file tags, which require authentication. Enter a + valid username and password from Lasso admin for a group with file tags + permissions for uploads and the path you define in UserFilesPath below. + */ + + var('connection') = array( + -username='xxxxxxxx', + -password='xxxxxxxx' + ); + + + /*..................................................................... + Set the base path for files that users can upload and browse (relative + to server root). + + Set which file extensions are allowed and/or denied for each file type. + */ + var('config') = map( + 'Enabled' = false, + 'UserFilesPath' = '/UserFiles/', + 'Subdirectories' = map( + 'File' = 'File/', + 'Image' = 'Image/', + 'Flash' = 'Flash/', + 'Media' = 'Media/' + ), + 'AllowedExtensions' = map( + 'File' = array(), + 'Image' = array('jpg','gif','jpeg','png'), + 'Flash' = array('swf','fla'), + 'Media' = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') + ), + 'DeniedExtensions' = map( + 'File' = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi','lasso','lassoapp'), + 'Image' = array(), + 'Flash' = array(), + 'Media' = array() + ) + ); +] diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/upload.lasso b/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/upload.lasso index cfd8b268f91..5b6b173d19d 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/upload.lasso +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/lasso/upload.lasso @@ -1,152 +1,152 @@ -[//lasso -/* - * FCKeditor - The text editor for internet - * Copyright (C) 2003-2006 Frederico Caldeira Knabben - * - * Licensed under the terms of the GNU Lesser General Public License: - * http://www.opensource.org/licenses/lgpl-license.php - * - * For further information visit: - * http://www.fckeditor.net/ - * - * File Name: upload.php - * This is the "File Uploader" for Lasso. - * - * File Authors: - * Jason Huck (jason.huck@corefive.com) - */ - - - /*..................................................................... - Include global configuration. See config.lasso for details. - */ - include('config.lasso'); - - - /*..................................................................... - Convert query string parameters to variables and initialize output. - */ - var( - 'Type' = action_param('Type'), - 'CurrentFolder' = action_param('CurrentFolder'), - 'ServerPath' = action_param('ServerPath'), - 'NewFile' = null, - 'NewFileName' = string, - 'OrigFilePath' = string, - 'NewFilePath' = string, - 'errorNumber' = 0, - 'customMsg' = '' - ); - - $Type == '' ? $Type = 'File'; - - - /*..................................................................... - Calculate the path to the current folder. - */ - $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); - - var('currentFolderURL' = $ServerPath - + $config->find('Subdirectories')->find(action_param('Type')) - + action_param('CurrentFolder') - ); - - - /*..................................................................... - Custom tag sets the HTML response. - */ - - define_tag( - 'sendresults', - -namespace='fck_', - -priority='replace', - -required='errorNumber', - -type='integer', - -optional='fileUrl', - -type='string', - -optional='fileName', - -type='string', - -optional='customMsg', - -type='string', - -description='Sets the HTML response for the FCKEditor Quick Upload feature.' - ); - $__html_reply__ = '\ - - '; - /define_tag; - - - if($config->find('Enabled')); - /*................................................................. - Process an uploaded file. - */ - inline($connection); - /*............................................................. - Was a file actually uploaded? - */ - file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; - - if($errorNumber == 0); - /*......................................................... - Split the file's extension from the filename in order - to follow the API's naming convention for duplicate - files. (Test.txt, Test(1).txt, Test(2).txt, etc.) - */ - $NewFileName = $NewFile->find('OrigName'); - $OrigFilePath = $currentFolderURL + $NewFileName; - $NewFilePath = $OrigFilePath; - local('fileExtension') = '.' + $NewFile->find('OrigExtension'); - local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; - - - /*......................................................... - Make sure the file extension is allowed. - */ - - if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); - $errorNumber = 202; - else; - /*..................................................... - Rename the target path until it is unique. - */ - while(file_exists($NewFilePath)); - $NewFileName = #shortFileName + '(' + loop_count + ')' + #fileExtension; - $NewFilePath = $currentFolderURL + $NewFileName; - /while; - - - /*..................................................... - Copy the uploaded file to its final location. - */ - file_copy($NewFile->find('path'), $NewFilePath); - - - /*..................................................... - Set the error code for the response. - */ - select(file_currenterror( -errorcode)); - case(0); - $OrigFilePath != $NewFilePath ? $errorNumber = 201; - case; - $errorNumber = 202; - /select; - /if; - /if; - /inline; - else; - $errorNumber = 1; - $customMsg = 'This file uploader is disabled. Please check the "editor/filemanager/upload/lasso/config.lasso" file.'; - /if; - - fck_sendresults( - -errorNumber=$errorNumber, - -fileUrl=$NewFilePath, - -fileName=$NewFileName, - -customMsg=$customMsg - ); -] +[//lasso +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003-2006 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License: + * http://www.opensource.org/licenses/lgpl-license.php + * + * For further information visit: + * http://www.fckeditor.net/ + * + * File Name: upload.php + * This is the "File Uploader" for Lasso. + * + * File Authors: + * Jason Huck (jason.huck@corefive.com) + */ + + + /*..................................................................... + Include global configuration. See config.lasso for details. + */ + include('config.lasso'); + + + /*..................................................................... + Convert query string parameters to variables and initialize output. + */ + var( + 'Type' = action_param('Type'), + 'CurrentFolder' = action_param('CurrentFolder'), + 'ServerPath' = action_param('ServerPath'), + 'NewFile' = null, + 'NewFileName' = string, + 'OrigFilePath' = string, + 'NewFilePath' = string, + 'errorNumber' = 0, + 'customMsg' = '' + ); + + $Type == '' ? $Type = 'File'; + + + /*..................................................................... + Calculate the path to the current folder. + */ + $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); + + var('currentFolderURL' = $ServerPath + + $config->find('Subdirectories')->find(action_param('Type')) + + action_param('CurrentFolder') + ); + + + /*..................................................................... + Custom tag sets the HTML response. + */ + + define_tag( + 'sendresults', + -namespace='fck_', + -priority='replace', + -required='errorNumber', + -type='integer', + -optional='fileUrl', + -type='string', + -optional='fileName', + -type='string', + -optional='customMsg', + -type='string', + -description='Sets the HTML response for the FCKEditor Quick Upload feature.' + ); + $__html_reply__ = '\ + + '; + /define_tag; + + + if($config->find('Enabled')); + /*................................................................. + Process an uploaded file. + */ + inline($connection); + /*............................................................. + Was a file actually uploaded? + */ + file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; + + if($errorNumber == 0); + /*......................................................... + Split the file's extension from the filename in order + to follow the API's naming convention for duplicate + files. (Test.txt, Test(1).txt, Test(2).txt, etc.) + */ + $NewFileName = $NewFile->find('OrigName'); + $OrigFilePath = $currentFolderURL + $NewFileName; + $NewFilePath = $OrigFilePath; + local('fileExtension') = '.' + $NewFile->find('OrigExtension'); + local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; + + + /*......................................................... + Make sure the file extension is allowed. + */ + + if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); + $errorNumber = 202; + else; + /*..................................................... + Rename the target path until it is unique. + */ + while(file_exists($NewFilePath)); + $NewFileName = #shortFileName + '(' + loop_count + ')' + #fileExtension; + $NewFilePath = $currentFolderURL + $NewFileName; + /while; + + + /*..................................................... + Copy the uploaded file to its final location. + */ + file_copy($NewFile->find('path'), $NewFilePath); + + + /*..................................................... + Set the error code for the response. + */ + select(file_currenterror( -errorcode)); + case(0); + $OrigFilePath != $NewFilePath ? $errorNumber = 201; + case; + $errorNumber = 202; + /select; + /if; + /if; + /inline; + else; + $errorNumber = 1; + $customMsg = 'This file uploader is disabled. Please check the "editor/filemanager/upload/lasso/config.lasso" file.'; + /if; + + fck_sendresults( + -errorNumber=$errorNumber, + -fileUrl=$NewFilePath, + -fileName=$NewFileName, + -customMsg=$customMsg + ); +] diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/php/config.php b/htdocs/includes/fckeditor/editor/filemanager/upload/php/config.php index cd52b630e37..786aafd3ad7 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/php/config.php +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/php/config.php @@ -1,53 +1,48 @@ -fckeditor->dir_output; // ne fonctionne pas -//$Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/fckeditor/'; // ne fonctionne pas -$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root.'/fckeditor/'; - -// Due to security issues with Apache modules, it is reccomended to leave the -// following setting enabled. -$Config['ForceSingleExtension'] = true ; - -$Config['AllowedExtensions']['File'] = array() ; -$Config['DeniedExtensions']['File'] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi') ; - -$Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ; -$Config['DeniedExtensions']['Image'] = array() ; - -$Config['AllowedExtensions']['Flash'] = array('swf','fla') ; -$Config['DeniedExtensions']['Flash'] = array() ; - + \ No newline at end of file diff --git a/htdocs/includes/fckeditor/editor/filemanager/upload/test.html b/htdocs/includes/fckeditor/editor/filemanager/upload/test.html index 9e18443f0d3..a49c7cb4118 100644 --- a/htdocs/includes/fckeditor/editor/filemanager/upload/test.html +++ b/htdocs/includes/fckeditor/editor/filemanager/upload/test.html @@ -1,129 +1,129 @@ - - - - FCKeditor - Uploaders Tests - - - - - - - - - - -
- - - - - - -
- Select the "File Uploader" to use:
- -
       - Custom Uploader URL:
- -
-
- - - - - - -
-
- Upload a new file:
-
- -
-
       - Uploaded File URL:
- -
-
- Post URL:   -
- -
- - + + + + FCKeditor - Uploaders Tests + + + + + + + + + + +
+ + + + + + +
+ Select the "File Uploader" to use:
+ +
       + Custom Uploader URL:
+ +
+
+ + + + + + +
+
+ Upload a new file:
+
+ +
+
       + Uploaded File URL:
+ +
+
+ Post URL:   +
+ +
+ + diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 1492f723e74..d7817d9a199 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -199,6 +199,13 @@ if ($modulepart) $accessallowed=1; $original_file=$conf->banque->dir_temp.'/'.$original_file; } + + // Wrapping pour les graph bank + if ($modulepart == 'fckeditor') + { + $accessallowed=1; + $original_file=$conf->fckeditor->dir_output.'/'.$original_file; + } } // Limite accs si droits non corrects