summaryrefslogtreecommitdiff
path: root/httemplate/elements/fckeditor/editor/filemanager/browser
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/fckeditor/editor/filemanager/browser')
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css87
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html200
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl63
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl158
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi137
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl131
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl667
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl60
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html95
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html114
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html198
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html169
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html69
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html115
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gifbin0 -> 138 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder.gifbin0 -> 128 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder32.gifbin0 -> 281 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gifbin0 -> 132 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gifbin0 -> 264 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderUp.gifbin0 -> 132 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gifbin0 -> 1140 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gifbin0 -> 454 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gifbin0 -> 709 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gifbin0 -> 224 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gifbin0 -> 177 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gifbin0 -> 258 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gifbin0 -> 260 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gifbin0 -> 170 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gifbin0 -> 946 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gifbin0 -> 704 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gifbin0 -> 1527 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gifbin0 -> 1527 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gifbin0 -> 463 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gifbin0 -> 274 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gifbin0 -> 274 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gifbin0 -> 454 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gifbin0 -> 567 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gifbin0 -> 464 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gifbin0 -> 254 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gifbin0 -> 1493 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gifbin0 -> 725 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gifbin0 -> 724 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gifbin0 -> 213 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gifbin0 -> 277 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gifbin0 -> 271 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gifbin0 -> 408 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gifbin0 -> 368 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ai.gifbin0 -> 403 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/avi.gifbin0 -> 249 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gifbin0 -> 126 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/cs.gifbin0 -> 128 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gifbin0 -> 113 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/dll.gifbin0 -> 132 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/doc.gifbin0 -> 140 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/exe.gifbin0 -> 109 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/fla.gifbin0 -> 382 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/gif.gifbin0 -> 125 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/htm.gifbin0 -> 621 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/html.gifbin0 -> 621 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gifbin0 -> 125 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/js.gifbin0 -> 139 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gifbin0 -> 146 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gifbin0 -> 249 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gifbin0 -> 230 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/png.gifbin0 -> 125 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gifbin0 -> 139 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gifbin0 -> 606 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swf.gifbin0 -> 388 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swt.gifbin0 -> 388 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/txt.gifbin0 -> 122 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gifbin0 -> 136 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xls.gifbin0 -> 138 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xml.gifbin0 -> 231 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/zip.gifbin0 -> 235 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/images/spacer.gifbin0 -> 43 bytes
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js88
-rw-r--r--httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js147
77 files changed, 2498 insertions, 0 deletions
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css
new file mode 100644
index 0000000..8325a88
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css
@@ -0,0 +1,87 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * CSS styles used by all pages that compose the File Browser.
+ */
+
+body
+{
+ background-color: #f1f1e3;
+ margin-top:0;
+ margin-bottom:0;
+}
+
+form
+{
+ margin: 0;
+ padding: 0;
+}
+
+.Frame
+{
+ background-color: #f1f1e3;
+ border: thin inset #f1f1e3;
+}
+
+body.FileArea
+{
+ background-color: #ffffff;
+ margin: 10px;
+}
+
+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
+{
+ color: #3b3b1f;
+ border: #737357 1px solid;
+ background-color: #c7c78f;
+}
+
+.FolderListCurrentFolder img
+{
+ background-image: url(images/FolderOpened.gif);
+}
+
+.FolderListFolder img
+{
+ background-image: url(images/Folder.gif);
+}
+
+.fullHeight {
+ height: 100%;
+}
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html
new file mode 100644
index 0000000..d5e773b
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html
@@ -0,0 +1,200 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+ "http://www.w3.org/TR/html4/frameset.dtd">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This page compose the File Browser dialog frameset.
+-->
+<html>
+ <head>
+ <title>FCKeditor - Resources Browser</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <script type="text/javascript" src="js/fckxml.js"></script>
+ <script type="text/javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+ var d = document.domain ;
+
+ while ( true )
+ {
+ // Test if we can access a parent property.
+ try
+ {
+ var test = window.opener.document.domain ;
+ break ;
+ }
+ catch( e )
+ {}
+
+ // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+ d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+ if ( d.length == 0 )
+ break ; // It was not able to detect the domain.
+
+ try
+ {
+ document.domain = d ;
+ }
+ catch (e)
+ {
+ break ;
+ }
+ }
+})() ;
+
+function GetUrlParam( paramName )
+{
+ var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
+ var oMatch = oRegex.exec( window.top.location.search ) ;
+
+ if ( oMatch && oMatch.length > 1 )
+ return decodeURIComponent( oMatch[1] ) ;
+ else
+ return '' ;
+}
+
+var oConnector = new Object() ;
+oConnector.CurrentFolder = '/' ;
+
+var sConnUrl = GetUrlParam( 'Connector' ) ;
+
+// Gecko has some problems when using relative URLs (not starting with slash).
+if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
+ sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
+
+oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
+
+var sServerPath = GetUrlParam( 'ServerPath' ) ;
+if ( sServerPath.length > 0 )
+ oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
+
+oConnector.ResourceType = GetUrlParam( 'Type' ) ;
+oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;
+
+if ( oConnector.ShowAllTypes )
+ oConnector.ResourceType = 'File' ;
+
+oConnector.SendCommand = function( command, params, callBackFunction )
+{
+ var sUrl = this.ConnectorUrl + 'Command=' + command ;
+ sUrl += '&Type=' + this.ResourceType ;
+ sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
+
+ if ( params ) sUrl += '&' + params ;
+
+ // Add a random salt to avoid getting a cached version of the command execution
+ sUrl += '&uuid=' + new Date().getTime() ;
+
+ var oXML = new FCKXml() ;
+
+ if ( callBackFunction )
+ oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
+ else
+ return oXML.LoadUrl( sUrl ) ;
+
+ return null ;
+}
+
+oConnector.CheckError = function( responseXml )
+{
+ var iErrorNumber = 0 ;
+ var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
+
+ if ( oErrorNode )
+ {
+ iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
+
+ switch ( iErrorNumber )
+ {
+ case 0 :
+ break ;
+ case 1 : // Custom error. Message placed in the "text" attribute.
+ alert( oErrorNode.attributes.getNamedItem('text').value ) ;
+ break ;
+ case 101 :
+ alert( 'Folder already exists' ) ;
+ break ;
+ case 102 :
+ alert( 'Invalid folder name' ) ;
+ break ;
+ case 103 :
+ alert( 'You have no permissions to create the folder' ) ;
+ break ;
+ case 110 :
+ alert( 'Unknown error creating folder' ) ;
+ break ;
+ default :
+ alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
+ break ;
+ }
+ }
+ return iErrorNumber ;
+}
+
+var oIcons = new Object() ;
+
+oIcons.AvailableIconsArray = [
+ 'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
+ 'mdb','mp3','pdf','png','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
+
+oIcons.AvailableIcons = new Object() ;
+
+for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
+ oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
+
+oIcons.GetIcon = function( fileName )
+{
+ var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
+
+ if ( this.AvailableIcons[ sExtension ] == true )
+ return sExtension ;
+ else
+ return 'default.icon' ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+ if (errorNumber == "1")
+ window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
+ else
+ window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
+}
+
+ </script>
+ </head>
+ <frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
+ <frameset rows="50,*" framespacing="0">
+ <frame src="frmresourcetype.html" scrolling="no" frameborder="0">
+ <frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
+ </frameset>
+ <frameset rows="50,*,50" framespacing="0">
+ <frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
+ <frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
+ <frameset cols="150,*,0" framespacing="0" frameborder="0">
+ <frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
+ <frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
+ <frame name="frmUploadWorker" src="javascript:void(0)" scrolling="no" frameborder="0">
+ </frameset>
+ </frameset>
+ </frameset>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl
new file mode 100644
index 0000000..f64b7c7
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/basexml.pl
@@ -0,0 +1,63 @@
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+sub CreateXmlHeader
+{
+ local($command,$resourceType,$currentFolder) = @_;
+
+ # Create the XML document header.
+ print '<?xml version="1.0" encoding="utf-8" ?>';
+
+ # Create the main "Connector" node.
+ print '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
+
+ # Add the current folder node.
+ print '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType,$currentFolder)) . '" />';
+}
+
+sub CreateXmlFooter
+{
+ print '</Connector>';
+}
+
+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 '<?xml version="1.0" encoding="utf-8" ?>' ;
+
+ print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;
+
+ exit ;
+}
+
+1;
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl
new file mode 100644
index 0000000..2ed2e62
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/commands.pl
@@ -0,0 +1,158 @@
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+sub GetFolders
+{
+
+ local($resourceType, $currentFolder) = @_;
+
+ # Map the virtual path to the local server path.
+ $sServerDir = &ServerMapFolder($resourceType, $currentFolder);
+ print "<Folders>"; # 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 '<Folder name="' . $cnv_filename . '" />';
+ }
+ }
+ print "</Folders>"; # 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 = '<Folders>';
+ $sFiles = '<Files>';
+
+ 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 .= '<Folder name="' . $cnv_filename . '" />' ;
+ } 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 .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ;
+ }
+ }
+ }
+ print $sFolders ;
+ print '</Folders>'; # Close the "Folders" node.
+ print $sFiles ;
+ print '</Files>'; # 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 '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
+}
+
+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 '<script type="text/javascript">';
+ print 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . $sFileName . '") ;';
+ print '</script>';
+ exit ;
+}
+1;
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi
new file mode 100644
index 0000000..a741215
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/connector.cgi
@@ -0,0 +1,137 @@
+#!/usr/bin/env perl
+
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+##
+# 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/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl
new file mode 100644
index 0000000..c1dbccf
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/io.pl
@@ -0,0 +1,131 @@
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+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/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl
new file mode 100644
index 0000000..1c3f4e2
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/upload_fck.pl
@@ -0,0 +1,667 @@
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+# 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 <strong>%d KB</strong> Now Size <strong>%d KB</strong>(<strong>%d bytes</strong> 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 = <STDIN>;
+ $Boundary =~ s/\x0D\x0A//;
+ $Boundary = quotemeta($Boundary);
+ while(<STDIN>) {
+ 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(<STDIN>) {
+ last if(! /\w/);
+ if(/^\s*Content-Type:\s*"([^"]+)"/i || /^\s*Content-Type:\s*([^\s:;]+)/i) {
+ $ContentType = $1;
+ }
+ }
+ # body read
+ $value = "";
+ while(<STDIN>) {
+ 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/&/&amp;/g;
+ $FileName =~ s/"/&quot;/g;
+ $FileName =~ s/</&lt;/g;
+ $FileName =~ s/>/&gt;/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)<BR>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<<EOF;
+<HTML>
+<HEAD>
+<TITLE>Error Message</TITLE></HEAD>
+<BODY>
+<table border="1" cellspacing="10" cellpadding="10">
+ <TR bgcolor="#0000B0">
+ <TD bgcolor="#0000B0" NOWRAP><font size="-1" color="white"><B>Error Message</B></font></TD>
+ </TR>
+</table>
+<UL>
+<H4> $error_message </H4>
+$error_message2 <BR>
+</UL>
+</BODY>
+</HTML>
+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/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl
new file mode 100644
index 0000000..e860292
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/connectors/perl/util.pl
@@ -0,0 +1,60 @@
+#####
+# FCKeditor - The text editor for Internet - http://www.fckeditor.net
+# Copyright (C) 2003-2007 Frederico Caldeira Knabben
+#
+# == BEGIN LICENSE ==
+#
+# Licensed under the terms of any of the following licenses at your
+# choice:
+#
+# - GNU General Public License Version 2 or later (the "GPL")
+# http://www.gnu.org/licenses/gpl.html
+#
+# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+# http://www.gnu.org/licenses/lgpl.html
+#
+# - Mozilla Public License Version 1.1 or later (the "MPL")
+# http://www.mozilla.org/MPL/MPL-1.1.html
+#
+# == END LICENSE ==
+#
+# This is the File Manager Connector for Perl.
+#####
+
+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/&/&amp;/g; # &
+ $ch =~ s/\"/&quot;/g; #"
+ $ch =~ s/\'/&#39;/g; # '
+ $ch =~ s/</&lt;/g; # <
+ $ch =~ s/>/&gt;/g; # >
+ return($ch);
+}
+
+1;
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html
new file mode 100644
index 0000000..dc1f517
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html
@@ -0,0 +1,95 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This page shows the actual folder path.
+-->
+<html>
+ <head>
+ <title>Folder path</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <script type="text/javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+ var d = document.domain ;
+
+ while ( true )
+ {
+ // Test if we can access a parent property.
+ try
+ {
+ var test = window.top.opener.document.domain ;
+ break ;
+ }
+ catch( e )
+ {}
+
+ // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+ d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+ if ( d.length == 0 )
+ break ; // It was not able to detect the domain.
+
+ try
+ {
+ document.domain = d ;
+ }
+ catch (e)
+ {
+ break ;
+ }
+ }
+})() ;
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+ document.getElementById('tdName').innerHTML = folderPath ;
+}
+
+window.onload = function()
+{
+ window.top.IsLoadedActualFolder = true ;
+}
+
+ </script>
+ </head>
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <tr>
+ <td>
+ <button style="WIDTH: 100%" type="button">
+ <table cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <tr>
+ <td><img height="32" alt="" src="images/FolderOpened32.gif" width="32"></td>
+ <td>&nbsp;</td>
+ <td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
+ <td>&nbsp;</td>
+ <td><img height="8" src="images/ButtonArrow.gif" width="12" alt=""></td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ </button>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html
new file mode 100644
index 0000000..390eb49
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html
@@ -0,0 +1,114 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Page used to create new folders in the current folder.
+-->
+<html>
+ <head>
+ <title>Create Folder</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript">
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+ oConnector.ResourceType = resourceType ;
+ oConnector.CurrentFolder = folderPath ;
+}
+
+function CreateFolder()
+{
+ var sFolderName ;
+
+ while ( true )
+ {
+ sFolderName = prompt( 'Type the name of the new folder:', '' ) ;
+
+ if ( sFolderName == null )
+ return ;
+ else if ( sFolderName.length == 0 )
+ alert( 'Please type the folder name' ) ;
+ else
+ break ;
+ }
+
+ oConnector.SendCommand( 'CreateFolder', 'NewFolderName=' + encodeURIComponent( sFolderName) , CreateFolderCallBack ) ;
+}
+
+function CreateFolderCallBack( fckXml )
+{
+ if ( oConnector.CheckError( fckXml ) == 0 )
+ window.parent.frames['frmResourcesList'].Refresh() ;
+
+ /*
+ // Get the current folder path.
+ var oNode = fckXml.SelectSingleNode( 'Connector/Error' ) ;
+ var iErrorNumber = parseInt( oNode.attributes.getNamedItem('number').value ) ;
+
+ switch ( iErrorNumber )
+ {
+ case 0 :
+ window.parent.frames['frmResourcesList'].Refresh() ;
+ break ;
+ case 101 :
+ alert( 'Folder already exists' ) ;
+ break ;
+ case 102 :
+ alert( 'Invalid folder name' ) ;
+ break ;
+ case 103 :
+ alert( 'You have no permissions to create the folder' ) ;
+ break ;
+ case 110 :
+ alert( 'Unknown error creating folder' ) ;
+ break ;
+ default :
+ alert( 'Error creating folder. Error number: ' + iErrorNumber ) ;
+ break ;
+ }
+ */
+}
+
+window.onload = function()
+{
+ window.top.IsLoadedCreateFolder = true ;
+}
+ </script>
+ </head>
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <tr>
+ <td>
+ <button type="button" style="WIDTH: 100%" onclick="CreateFolder();">
+ <table cellSpacing="0" cellPadding="0" border="0">
+ <tr>
+ <td><img height="16" alt="" src="images/Folder.gif" width="16"></td>
+ <td>&nbsp;</td>
+ <td nowrap>Create New Folder</td>
+ </tr>
+ </table>
+ </button>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html
new file mode 100644
index 0000000..d4b3b3d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html
@@ -0,0 +1,198 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This page shows the list of folders available in the parent folder
+ * of the current folder.
+-->
+<html>
+ <head>
+ <title>Folders</title>
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript">
+
+var sActiveFolder ;
+
+var bIsLoaded = false ;
+var iIntervalId ;
+
+var oListManager = new Object() ;
+
+oListManager.Init = function()
+{
+ this.Table = document.getElementById('tableFiles') ;
+ this.UpRow = document.getElementById('trUp') ;
+
+ this.TableRows = new Object() ;
+}
+
+oListManager.Clear = function()
+{
+ // Remove all other rows available.
+ while ( this.Table.rows.length > 1 )
+ this.Table.deleteRow(1) ;
+
+ // Reset the TableRows collection.
+ this.TableRows = new Object() ;
+}
+
+oListManager.AddItem = function( folderName, folderPath )
+{
+ // Create the new row.
+ var oRow = this.Table.insertRow(-1) ;
+ oRow.className = 'FolderListFolder' ;
+
+ // Build the link to view the folder.
+ var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath + '\');return false;">' ;
+
+ // Add the folder icon cell.
+ var oCell = oRow.insertCell(-1) ;
+ oCell.width = 16 ;
+ oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"><\/a>' ;
+
+ // Add the folder name cell.
+ oCell = oRow.insertCell(-1) ;
+ oCell.noWrap = true ;
+ oCell.innerHTML = '&nbsp;' + sLink + folderName + '<\/a>' ;
+
+ this.TableRows[ folderPath ] = oRow ;
+}
+
+oListManager.ShowUpFolder = function( upFolderPath )
+{
+ this.UpRow.style.display = ( upFolderPath != null ? '' : 'none' ) ;
+
+ if ( upFolderPath != null )
+ {
+ document.getElementById('linkUpIcon').onclick = document.getElementById('linkUp').onclick = function()
+ {
+ LoadFolders( upFolderPath ) ;
+ return false ;
+ }
+ }
+}
+
+function CheckLoaded()
+{
+ if ( window.top.IsLoadedActualFolder
+ && window.top.IsLoadedCreateFolder
+ && window.top.IsLoadedUpload
+ && window.top.IsLoadedResourcesList )
+ {
+ window.clearInterval( iIntervalId ) ;
+ bIsLoaded = true ;
+ OpenFolder( sActiveFolder ) ;
+ }
+}
+
+function OpenFolder( folderPath )
+{
+ sActiveFolder = folderPath ;
+
+ if ( ! bIsLoaded )
+ {
+ if ( ! iIntervalId )
+ iIntervalId = window.setInterval( CheckLoaded, 100 ) ;
+ return ;
+ }
+
+ // Change the style for the select row (to show the opened folder).
+ for ( var sFolderPath in oListManager.TableRows )
+ {
+ oListManager.TableRows[ sFolderPath ].className =
+ ( sFolderPath == folderPath ? 'FolderListCurrentFolder' : 'FolderListFolder' ) ;
+ }
+
+ // Set the current folder in all frames.
+ window.parent.frames['frmActualFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+ window.parent.frames['frmCreateFolder'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+ window.parent.frames['frmUpload'].SetCurrentFolder( oConnector.ResourceType, folderPath ) ;
+
+ // Load the resources list for this folder.
+ window.parent.frames['frmResourcesList'].LoadResources( oConnector.ResourceType, folderPath ) ;
+}
+
+function LoadFolders( folderPath )
+{
+ // Clear the folders list.
+ oListManager.Clear() ;
+
+ // Get the parent folder path.
+ var sParentFolderPath ;
+ if ( folderPath != '/' )
+ sParentFolderPath = folderPath.substring( 0, folderPath.lastIndexOf( '/', folderPath.length - 2 ) + 1 ) ;
+
+ // Show/Hide the Up Folder.
+ oListManager.ShowUpFolder( sParentFolderPath ) ;
+
+ if ( folderPath != '/' )
+ {
+ sActiveFolder = folderPath ;
+ oConnector.CurrentFolder = sParentFolderPath ;
+ oConnector.SendCommand( 'GetFolders', null, GetFoldersCallBack ) ;
+ }
+ else
+ OpenFolder( '/' ) ;
+}
+
+function GetFoldersCallBack( fckXml )
+{
+ if ( oConnector.CheckError( fckXml ) != 0 )
+ return ;
+
+ // Get the current folder path.
+ var oNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
+ var sCurrentFolderPath = oNode.attributes.getNamedItem('path').value ;
+
+ var oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
+
+ for ( var i = 0 ; i < oNodes.length ; i++ )
+ {
+ var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
+ oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' ) ;
+ }
+
+ OpenFolder( sActiveFolder ) ;
+}
+
+function SetResourceType( type )
+{
+ oConnector.ResourceType = type ;
+ LoadFolders( '/' ) ;
+}
+
+window.onload = function()
+{
+ oListManager.Init() ;
+ LoadFolders( '/' ) ;
+}
+ </script>
+ </head>
+ <body class="FileArea">
+ <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <tr id="trUp" style="DISPLAY: none">
+ <td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>
+ <td nowrap width="100%">&nbsp;<a id="linkUp" href="#">..</a></td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html
new file mode 100644
index 0000000..3e2771d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html
@@ -0,0 +1,169 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This page shows all resources available in a folder in the File Browser.
+-->
+<html>
+<head>
+ <title>Resources</title>
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript">
+
+var oListManager = new Object() ;
+
+oListManager.Clear = function()
+{
+ document.body.innerHTML = '' ;
+}
+
+function ProtectPath(path)
+{
+ path = path.replace( /\\/g, '\\\\') ;
+ path = path.replace( /'/g, '\\\'') ;
+ return path ;
+}
+
+oListManager.GetFolderRowHtml = function( folderName, folderPath )
+{
+ // Build the link to view the folder.
+ var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ;
+
+ return '<tr>' +
+ '<td width="16">' +
+ sLink +
+ '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"><\/a>' +
+ '<\/td><td nowrap colspan="2">&nbsp;' +
+ sLink +
+ folderName +
+ '<\/a>' +
+ '<\/td><\/tr>' ;
+}
+
+oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
+{
+ // Build the link to view the folder.
+ var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;
+
+ // Get the file icon.
+ var sIcon = oIcons.GetIcon( fileName ) ;
+
+ return '<tr>' +
+ '<td width="16">' +
+ sLink +
+ '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"><\/a>' +
+ '<\/td><td>&nbsp;' +
+ sLink +
+ fileName +
+ '<\/a>' +
+ '<\/td><td align="right" nowrap>&nbsp;' +
+ fileSize +
+ ' KB' +
+ '<\/td><\/tr>' ;
+}
+
+function OpenFolder( folderPath )
+{
+ // Load the resources list for this folder.
+ window.parent.frames['frmFolders'].LoadFolders( folderPath ) ;
+}
+
+function OpenFile( fileUrl )
+{
+ window.top.opener.SetUrl( fileUrl ) ;
+ window.top.close() ;
+ window.top.opener.focus() ;
+}
+
+function LoadResources( resourceType, folderPath )
+{
+ oListManager.Clear() ;
+ oConnector.ResourceType = resourceType ;
+ oConnector.CurrentFolder = folderPath ;
+ oConnector.SendCommand( 'GetFoldersAndFiles', null, GetFoldersAndFilesCallBack ) ;
+}
+
+function Refresh()
+{
+ LoadResources( oConnector.ResourceType, oConnector.CurrentFolder ) ;
+}
+
+function GetFoldersAndFilesCallBack( fckXml )
+{
+ if ( oConnector.CheckError( fckXml ) != 0 )
+ return ;
+
+ // Get the current folder path.
+ var oFolderNode = fckXml.SelectSingleNode( 'Connector/CurrentFolder' ) ;
+ if ( oFolderNode == null )
+ {
+ alert( 'The server didn\'t reply with a proper XML data. Please check your configuration.' ) ;
+ return ;
+ }
+ var sCurrentFolderPath = oFolderNode.attributes.getNamedItem('path').value ;
+ var sCurrentFolderUrl = oFolderNode.attributes.getNamedItem('url').value ;
+
+// var dTimer = new Date() ;
+
+ var oHtml = new StringBuilder( '<table id="tableFiles" cellspacing="1" cellpadding="0" width="100%" border="0">' ) ;
+
+ // Add the Folders.
+ var oNodes ;
+ oNodes = fckXml.SelectNodes( 'Connector/Folders/Folder' ) ;
+ for ( var i = 0 ; i < oNodes.length ; i++ )
+ {
+ var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
+ oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
+ }
+
+ // Add the Files.
+ oNodes = fckXml.SelectNodes( 'Connector/Files/File' ) ;
+ for ( var j = 0 ; j < oNodes.length ; j++ )
+ {
+ var oNode = oNodes[j] ;
+ var sFileName = oNode.attributes.getNamedItem('name').value ;
+ var sFileSize = oNode.attributes.getNamedItem('size').value ;
+
+ // Get the optional "url" attribute. If not available, build the url.
+ var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ;
+ var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : encodeURI( sCurrentFolderUrl + sFileName ).replace( /#/g, '%23' ) ;
+
+ oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
+ }
+
+ oHtml.Append( '<\/table>' ) ;
+
+ document.body.innerHTML = oHtml.ToString() ;
+
+// window.top.document.title = 'Finished processing in ' + ( ( ( new Date() ) - dTimer ) / 1000 ) + ' seconds' ;
+
+}
+
+window.onload = function()
+{
+ window.top.IsLoadedResourcesList = true ;
+}
+ </script>
+</head>
+<body class="FileArea">
+</body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html
new file mode 100644
index 0000000..e918f9f
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * This page shows the list of available resource types.
+-->
+<html>
+ <head>
+ <title>Available types</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet">
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript">
+
+function SetResourceType( type )
+{
+ window.parent.frames["frmFolders"].SetResourceType( type ) ;
+}
+
+var aTypes = [
+ ['File','File'],
+ ['Image','Image'],
+ ['Flash','Flash'],
+ ['Media','Media']
+] ;
+
+window.onload = function()
+{
+ var oCombo = document.getElementById('cmbType') ;
+ oCombo.innerHTML = '' ;
+ for ( var i = 0 ; i < aTypes.length ; i++ )
+ {
+ if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType )
+ AddSelectOption( oCombo, aTypes[i][1], aTypes[i][0] ) ;
+ }
+}
+
+ </script>
+ </head>
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <tr>
+ <td nowrap>
+ Resource Type<BR>
+ <select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
+ <option>&nbsp;
+ </select>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html
new file mode 100644
index 0000000..e840c0a
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html
@@ -0,0 +1,115 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Page used to upload new files in the current folder.
+-->
+<html>
+ <head>
+ <title>File Upload</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet" >
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript">
+
+function SetCurrentFolder( resourceType, folderPath )
+{
+ var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;
+ sUrl += '&Type=' + resourceType ;
+ sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;
+
+ document.getElementById('frmUpload').action = sUrl ;
+}
+
+function OnSubmit()
+{
+ if ( document.getElementById('NewFile').value.length == 0 )
+ {
+ alert( 'Please select a file from your computer' ) ;
+ return false ;
+ }
+
+ // Set the interface elements.
+ document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder (Upload in progress, please wait...)' ;
+ document.getElementById('btnUpload').disabled = true ;
+
+ return true ;
+}
+
+function OnUploadCompleted( errorNumber, data )
+{
+ // Reset the Upload Worker Frame.
+ window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
+
+ // Reset the upload form (On IE we must do a little trick to avoid problems).
+ if ( document.all )
+ document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
+ else
+ document.getElementById('frmUpload').reset() ;
+
+ // Reset the interface elements.
+ document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder' ;
+ document.getElementById('btnUpload').disabled = false ;
+
+ switch ( errorNumber )
+ {
+ case 0 :
+ window.parent.frames['frmResourcesList'].Refresh() ;
+ break ;
+ case 1 : // Custom error.
+ alert( data ) ;
+ break ;
+ case 201 :
+ window.parent.frames['frmResourcesList'].Refresh() ;
+ alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' ) ;
+ break ;
+ case 202 :
+ alert( 'Invalid file' ) ;
+ break ;
+ default :
+ alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+ break ;
+ }
+}
+
+window.onload = function()
+{
+ window.top.IsLoadedUpload = true ;
+}
+ </script>
+ </head>
+ <body>
+ <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
+ <table class="fullHeight" cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tr>
+ <td nowrap="nowrap">
+ <span id="eUploadMessage">Upload a new file in this folder</span><br>
+ <table cellspacing="0" cellpadding="0" width="100%" border="0">
+ <tr>
+ <td width="100%"><input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file"></td>
+ <td nowrap="nowrap">&nbsp;<input id="btnUpload" type="submit" value="Upload"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </body>
+</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif
new file mode 100644
index 0000000..a355e5a
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder.gif
new file mode 100644
index 0000000..ab6824d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder32.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder32.gif
new file mode 100644
index 0000000..b93b752
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/Folder32.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif
new file mode 100644
index 0000000..0c5dd41
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif
new file mode 100644
index 0000000..3e3fcf5
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif
new file mode 100644
index 0000000..ad5bc20
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif
new file mode 100644
index 0000000..699e6a3
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif
new file mode 100644
index 0000000..97025bb
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif
new file mode 100644
index 0000000..f3c7f82
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif
new file mode 100644
index 0000000..b62bd02
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif
new file mode 100644
index 0000000..976997b
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif
new file mode 100644
index 0000000..9b54964
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif
new file mode 100644
index 0000000..b557568
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif
new file mode 100644
index 0000000..7584993
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif
new file mode 100644
index 0000000..923079f
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif
new file mode 100644
index 0000000..df5f579
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif
new file mode 100644
index 0000000..a9bdf00
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif
new file mode 100644
index 0000000..a9bdf00
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif
new file mode 100644
index 0000000..de78363
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif
new file mode 100644
index 0000000..fe0c98e
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif
new file mode 100644
index 0000000..d3af9e8
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif
new file mode 100644
index 0000000..7d6360f
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif
new file mode 100644
index 0000000..4950ec8
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif
new file mode 100644
index 0000000..0a79ebf
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif
new file mode 100644
index 0000000..023431c
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif
new file mode 100644
index 0000000..b9eace7
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif
new file mode 100644
index 0000000..5df7de5
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif
new file mode 100644
index 0000000..7807c07
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif
new file mode 100644
index 0000000..4e2c2e3
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif
new file mode 100644
index 0000000..7624697
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif
new file mode 100644
index 0000000..afe724a
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif
new file mode 100644
index 0000000..4fae356
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif
new file mode 100644
index 0000000..7157f72
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif
new file mode 100644
index 0000000..ba5a913
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif
new file mode 100644
index 0000000..6f3bac9
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif
new file mode 100644
index 0000000..7708dd8
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif
new file mode 100644
index 0000000..4d92723
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif
new file mode 100644
index 0000000..6ce26a4
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif
new file mode 100644
index 0000000..48d445a
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif
new file mode 100644
index 0000000..6535b4c
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif
new file mode 100644
index 0000000..315817f
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif
new file mode 100644
index 0000000..8f91a98
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif
new file mode 100644
index 0000000..a5e3e6c
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif
new file mode 100644
index 0000000..0b5d6ba
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/html.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/html.gif
new file mode 100644
index 0000000..0b5d6ba
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/html.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif
new file mode 100644
index 0000000..634b386
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/js.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/js.gif
new file mode 100644
index 0000000..4ea17d4
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/js.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif
new file mode 100644
index 0000000..0d7c102
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif
new file mode 100644
index 0000000..6f3bac9
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif
new file mode 100644
index 0000000..ca1f94a
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/png.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/png.gif
new file mode 100644
index 0000000..b6d1b32
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/png.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif
new file mode 100644
index 0000000..877a8c8
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif
new file mode 100644
index 0000000..916cd7e
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif
new file mode 100644
index 0000000..314469d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif
new file mode 100644
index 0000000..314469d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif
new file mode 100644
index 0000000..1511ba3
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif
new file mode 100644
index 0000000..9be3daa
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif
new file mode 100644
index 0000000..f57715d
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif
new file mode 100644
index 0000000..4559928
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif
new file mode 100644
index 0000000..b1e2492
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/spacer.gif b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/spacer.gif
new file mode 100644
index 0000000..35d42e8
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/images/spacer.gif
Binary files differ
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js
new file mode 100644
index 0000000..98c4b90
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js
@@ -0,0 +1,88 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Common objects and functions shared by all pages that compose the
+ * File Browser dialog window.
+ */
+
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+ var d = document.domain ;
+
+ while ( true )
+ {
+ // Test if we can access a parent property.
+ try
+ {
+ var test = window.top.opener.document.domain ;
+ break ;
+ }
+ catch( e )
+ {}
+
+ // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+ d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+ if ( d.length == 0 )
+ break ; // It was not able to detect the domain.
+
+ try
+ {
+ document.domain = d ;
+ }
+ catch (e)
+ {
+ break ;
+ }
+ }
+})() ;
+
+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( '' ) ;
+}
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js
new file mode 100644
index 0000000..b7eddc6
--- /dev/null
+++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js
@@ -0,0 +1,147 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * 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.
+ */
+
+var FCKXml = function()
+{}
+
+FCKXml.prototype.GetHttpRequest = function()
+{
+ // Gecko / IE7
+ try { return new XMLHttpRequest(); }
+ catch(e) {}
+
+ // IE6
+ try { return new ActiveXObject( 'Msxml2.XMLHTTP' ) ; }
+ catch(e) {}
+
+ // IE5
+ try { return new ActiveXObject( 'Microsoft.XMLHTTP' ) ; }
+ catch(e) {}
+
+ return null ;
+}
+
+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 )
+ {
+ var oXml ;
+ try
+ {
+ // this is the same test for an FF2 bug as in fckxml_gecko.js
+ // but we've moved the responseXML assignment into the try{}
+ // so we don't even have to check the return status codes.
+ var test = oXmlHttp.responseXML.firstChild ;
+ oXml = oXmlHttp.responseXML ;
+ }
+ catch ( e )
+ {
+ try
+ {
+ oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
+ }
+ catch ( e ) {}
+ }
+
+ if ( !oXml || !oXml.firstChild || oXml.firstChild.nodeName == 'parsererror' )
+ {
+ alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' +
+ 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
+ 'Requested URL:\n' + urlToCall + '\n\n' +
+ 'Response text:\n' + oXmlHttp.responseText ) ;
+ return ;
+ }
+
+ oFCKXml.DOMDocument = oXml ;
+ asyncFunctionPointer( oFCKXml ) ;
+ }
+ }
+ }
+
+ 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 ( navigator.userAgent.indexOf('MSIE') >= 0 ) // 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 ( navigator.userAgent.indexOf('MSIE') >= 0 ) // 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 ;
+ }
+}