New: update fckeditor version 2.6.4

This commit is contained in:
Regis Houssin
2009-05-08 12:34:26 +00:00
parent db6d1c1527
commit 7cd94e95cf
224 changed files with 13923 additions and 10019 deletions

View File

@@ -10,12 +10,12 @@ Composant Version License Compatible GPL Usage
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
In alphabetical order of external-lib directory: In alphabetical order of external-lib directory:
ArtiChow 1.07 Public Domain Yes Graphics ArtiChow 1.07 Public Domain Yes Graphics
Smarty 2.6.0 LGPL 2.1 Yes Some pages templates Smarty 2.6.0 LGPL 2.1 Yes Some pages templates
In alphabetical order of includes directory: In alphabetical order of includes directory:
AdoDb-Date 0.21 Modified BSD License Yes Date convertion AdoDb-Date 0.21 Modified BSD License Yes Date convertion
Php-barcode 0.3pl1 GPL 2.0 Yes Bar code generation Php-barcode 0.3pl1 GPL 2.0 Yes Bar code generation
FCKEditor 2.6 LGPL 2.1 or Mozilla PL 1.0 Yes Editor WYSIWYG FCKEditor 2.6.4 LGPL 2.1 or Mozilla PL 1.0 Yes Editor WYSIWYG
FPDF 1.53 Public domain Yes PDF generation (original code is modified) FPDF 1.53 Public domain Yes PDF generation (original code is modified)
FPDF_TPL 1.1.2 Apache Software License 2.0 No GPL3 only PDF templates management FPDF_TPL 1.1.2 Apache Software License 2.0 No GPL3 only PDF templates management
FPDI 1.2.1 Apache Software License 2.0 No GPL3 only PDF templates management FPDI 1.2.1 Apache Software License 2.0 No GPL3 only PDF templates management

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -33,261 +33,138 @@
<h1> <h1>
FCKeditor ChangeLog - What's New?</h1> FCKeditor ChangeLog - What's New?</h1>
<h3> <h3>
Version 2.6</h3> Version 2.6.4</h3>
<p>
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
<h3>
Version 2.6 RC</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
object can now be used to access all FCKeditor instances available in the page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
style="color: #ff0000">Attention:</span> By default, the editor now produces &lt;strong&gt;
and &lt;em&gt; instead of &lt;b&gt; and &lt;i&gt;.</li>
</ul>
<p> <p>
Fixed Bugs:</p> Fixed Bugs:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2777">#2777</a>] Merging
close button is now correctly positioned in IE in RTL languages.</li> cells between table header and body is no longer possible.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2815">#2815</a>] Fixed
dialog will now display the placeholder value correctly in IE.</li> WSC issues at slow connection speed. Added SSL support.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing <li>Language file updates for the following languages:
Enter or typing after a placeholder with the placeholder plugin will no longer generate <ul>
colored text.</li> <li>Chinese (Traditional)</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2846">#2846</a>] French</li>
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2801">#2801</a>] Hebrew</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2824">#2824</a>] Russian</li>
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2811">#2811</a>] Turkish</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed </ul>
permission denied errors during opening popup menus in IE6 under domain relaxation
mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
Fixed XHTML source formatting errors in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
character is now properly encoded in file names returned by the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
and file names are now properly sanitized against control characters. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
character is now disallowed in current folder path.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
logic to override JavaScript errors occurring inside the editing frame due to user
added JavaScript code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
ENTER on list items containing block elements will now create new list item elements,
instead of adding further blocks to the same list item.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
only combos now get properly grayed out when moving to source view.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
an important bug regarding styles removal on styled text boundaries, introduced
with the 2.6 Beta 1. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
CSS &lt;style&gt; tags where being outputted when FullPage=true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
dialog now properly selects the first field when opening it to modify mailto or
anchor links. This problem was also throwing an error in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
will no longer remain behind in the editing area when the placeholder dialog is
opened.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
the issue where context menus sometimes don't disappear after selecting an option.
</li> </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2757">#2757</a>] Fixed
JavaScript error when EnterMode=br and user tries to insert a page break.</li> a minor bug which causes selection positions to be improperly restored during undos
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed and redos.</li>
the issue where the maximize editor button does not vertically expand the editing
area in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
fixed filename encoding problems in file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
FCK.InsertHtml() in non-IE browsers would now activate the document processor as
expected.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
XMLHttpRequest class is now used in IE, whenever it is available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
the browser was able to enter in an infinite loop when working with multiple editors
in the same page. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
having problems with SpellerPages, causing some errors to be thrown when completing
the spell checking in some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
command was throwing an error if executed in an editor where its relative button
is not present in the toolbar.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
a generic document processor for &lt;OBJECT&gt; and &lt;EMBED&gt; tags.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
the issue where the placeholder icon for &lt;EMBED&gt; tags does not always show
up in IE7.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
the caret will not any more move to the previous line when selecting a Format style
inside an empty paragraph.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
dialogs using API calls which deals with the selection, like InsertHtml now can
be sure the selection will be placed in the correct position.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
IE, the first character of table captions where being lost on table creation.</li>
<li>The selection and cursor position was not being properly handled when creating some
elements like forms and tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
</ul> </ul>
<h3> <h3>
Version 2.6 Beta 1</h3> Version 2.6.4 Beta</h3>
<p> <p>
New Features and Improvements:</p> New Features and Improvements:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2685">#2685</a>] Integration
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers with "WebSpellChecker", a <strong>zero installation and free spell checker</strong>
and enhancing the editor usability.</li> provided by SpellChecker.net. This is now the default spell checker in the editor
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong> (requires internet connection). All previous spell checking solutions are still
Adobe AIR</strong> compatibility.</li> available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2430">#2430</a>] In the
for <strong>document.domain</strong> with automatic domain detection.</li> table dialog it's possible to create header cells in the first row (included in
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong> a thead element) or the first column of the table. </li>
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/822">#822</a>] The table
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS, cell dialog allows switching between normal data cells or header cells (TD vs. TH).
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|&lt;minified </li>
CSS styles". All internal CSS links are already using this feature. </li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2515">#2515</a>] New language
<li>New language file for <strong>Canadian French</strong>.</li> file for Icelandic.</li>
</ul> </ul>
<p> <p>
Fixed Bugs:</p> Fixed Bugs:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2381">#2381</a>] Protected
several "strict warning" messages in Firefox when running FCKeditor.</li> the editor from duplicate iframes</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1752">#1752</a>] Fixed
key will now work properly in IE with the cursor at the start of a formatted block.</li> the issue with tablecommands plugin and undefined tagName.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2333">#2333</a>] The &amp;gt;
possible to define in the Styles that a Style (with an empty class) must be shown character inside text wasn't encoded in Opera and Safari.</li>
selected only when no class is present in the current element, and selecting that <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2467">#2467</a>] Fixed
item will clear the current class (it does apply to any attribute, not only classes).</li> JavaScript error with the fit window command in source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2472">#2472</a>] Splitting
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden a TH will create a two TH, not a TH and a TD.</li>
div.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1891">#1891</a>] Removed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned unnecessary name attributes in dialogs. </li>
&lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/798">#798</a>, <a target="_blank"
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER href="http://dev.fckeditor.net/ticket/2495">#2495</a>] If an image was placed inside
key will not any more break &lt;button&gt; elements at the beginning of paragraphs.</li> a container with dimensions or floating it wasn't possible to edit its properties
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor from the toolbar or context menu.</li>
was not loading on a specific unknown situation. The breaking point has been removed.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1982">#1982</a>] Submenus
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor in IE7 now are shown properly.</li>
no longer hangs when operating on documents imported from Microsoft Word.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2496">#2496</a>] Using
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating the Paste dialogs in IE might insert the content at the start of the editor.</li>
panels attached to a shared toolbar among multiple FCKeditor instances are no longer <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2349">#2496</a>] Fixed
misplaced when the editing areas are absolutely or relatively positioned.</li> RTL dialog layout in Internet Explorer.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2488">#2488</a>] Fixed
is now enforced only when ForcePasteAsPlainText = true.</li> the issue where email links in IE would take the browser to a new page in addition
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes to calling up the email client.</li>
the autogrow plugin didn't work properly in Firefox.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2519">#2519</a>] Fixed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External race condition at registering the FCKeditorAPI object in multiple editor scenarios.</li>
toolbars are now properly sized in Opera.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2525">#2525</a>] Fixed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking JavaScript error in Google Chrome when StartupShowBlocks is set to true.</li>
on radio buttons or checkboxes in the editor in IE will no longer cause lockups <li>Language file updates for the following languages:
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2440">#2440</a>] Dutch</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2451">#2451</a>] Basque</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2451">#2650</a>] Danish</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2208">#2535</a>] German
</li>
</ul>
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2531">#2531</a>] The ENTER
key will properly scroll to the cursor position when breaking long paragraphs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2573">#2573</a>] The type
name in configurations for the ASP connector are now case sensitive.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2503">#2503</a>] DL, DT
and DD where missing the formatting in the generated HTML.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2516">#2516</a>] Replaced
the extension AddItem of Array with the standard "push" method.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2486">#2486</a>] Vertically
splitting cell with colspan &gt; 1 breaks table layout.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2597">#2597</a>] Fixed
the issue where dropping contents from outside of the editor doesn't work in Safari.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2412">#2412</a>] Fixed
the issue where FCK.InsertHtml() is no longer removing selected contents after content
insertion in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2407">#2407</a>] Fixed
the issue where the Div container command and the blockquote command would break
lists.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2469">#2469</a>] Fixed
a minor issue where FCK.SetData() may cause the editor to become unresponsive to
the first click after being defocused.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2611">#2611</a>] Fixed
an extra slash on quickupload of the asp connector.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2616">#2616</a>] Fixed
another situation where new elements were inserted at the beginning of the content
in IE.</li> in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2634">#2634</a>] Fixed
commands where executed even if the command itself was disabled.</li> two obsolete references to Array::AddItem() instances still in the code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2679">#2679</a>] Fixed
to empty the box in the "Paste from Word" has been removed as it leads to confusion infinite loop problems with FCKDomRangeIterator class which causes some commands
for some users.</li> to hang when applied to certain document structures.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2649">#2649</a>] Fixed
control elements in Firefox, Opera and Safari now works properly.</li> a JavaScript error in IE when user tries to search with the "Match whole word" option
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor enabled and the matched word is at exactly the end of document.</li>
was surrounded by a &lt;div&gt; element that wasn't really needed.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2603">#2603</a>] Changed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form the <a href="http://docs.fckeditor.net/EMailProtection">EMailProtection</a> to "none"
control was moved in IE after creating it, then it did lose its name.</li> for better compatibility.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2612">#2612</a>] The 'ForcePasteAsPlainText'
possible to change the type of an existing button.</li> configuration option didn't work correctly in Safari and Chrome.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2696">#2696</a>] Fixed
now works inside table cells.</li> non-working autogrow plugin.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2753">#2753</a>] Fixed
was entering on looping on some specific cases when dealing with invalid source occasional exceptions in the dragersizetable plugin with IE.</li>
markup.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2653">#2653</a>] and [<a
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting target="_blank" href="http://dev.fckeditor.net/ticket/2733">#2733</a>] Enable undo
text into the "Find what" fields in the Find and Replace dialog would now activate of changes to tables and table cells.</li>
the find and replace buttons.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1865">#1865</a>] The context
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace menu is now working properly over the last row in a table with thead. Thanks to
dialog will no longer display wrong starting positions for the match when there Koen Willems.</li>
are multiple and identical characters preceding the character at the real starting
point of the match.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
a JavaScript error which occurs in the Find/Replace dialog when the user presses
"Find" or "Replace" after the "No match found" message has appeared.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
breaks and spaces are now conserved when converting to and from the "Formatted"
format.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
the background color behind smiley icons and special characters in their corresponding
dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
error messages are now properly displayed in the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
and value fields in the selection box dialog will no longer extend beyond the dialog
limits when the user inputs a very long text or value for one of the selection options.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
issue where pressing Enter in an &lt;o:p&gt; tag in IE does not generate line breaks.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
issue where the image preview in image dialog sometimes doesn't display after selecting
the image from server browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
of depreciated "var").</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
removed closing tag: "?&gt;", so no additional whitespace added when files are included.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
integration: fixed issues with setting the editor height.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
returning an empty string.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
in IE will no longer turn the preceding normal whitespace into &amp;nbsp;.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
method now has an additional fifth parameter "customData" that will be sent to the
Execute method of the command for that menu item, allowing a single command to be
used for different menu items..</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
command now also removes the attributes from the cleaned text. The list of attributes
is configurable with FCKConfig.RemoveAttributes.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
warning message on Copy and Cut operation failure on IE due to paste permission
settings.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
to file browser has been changed to avoid requests containing double dots.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
failed to load from local filesystem in IE7.</li>
</ul> </ul>
<p> <p>
<a href="_whatsnew_history.html">See previous versions history</a> <a href="_whatsnew_history.html">See previous versions history</a></p>
</p>
</body> </body>
</html> </html>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -32,6 +32,549 @@
<body> <body>
<h1> <h1>
FCKeditor ChangeLog - What's New?</h1> FCKeditor ChangeLog - What's New?</h1>
<h3>
Version 2.6.3</h3>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2412">#2412</a>] FCK.InsertHtml()
is now properly removing selected contents after content insertion in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2420">#2420</a>] Spelling
mistake corrections made by the spell checking dialog are now undoable. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2411">#2411</a>] Insert
anchor was not working for non-empty selections.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2426">#2426</a>] It was
impossible to switch between editor areas with a single click.</li>
<li>Language file updates for the following languages:
<ul>
<li>Canadian French</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2402">#2402</a>] Catalan
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2400">#2400</a>] Chinese
(Simplified and Traditional)</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2401">#2401</a>] Croatian</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2422">#2422</a>] Czech</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2417">#2417</a>] Dutch</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2428">#2428</a>] French</li>
<li>German</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2427">#2427</a>] Hebrew</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2410">#2410</a>] Hindi</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2405">#2405</a>] Japanese</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2409">#2409</a>] Norwegian
and Norwegian Bokmål</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2429">#2429</a>] Spanish</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2406">#2406</a>] Vietnamese</li>
</ul>
</li>
</ul>
<p>
This version has been sponsored by <a href="http://www.dataillusion.com/fs/">Data Illusion
survey software solutions</a>.</p>
<h3>
Version 2.6.3 Beta</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/439">#439</a>] Added a
new <strong>context menu option for opening links</strong> in the editor.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2220">#2220</a>] <strong>
Email links</strong> from the Link dialog <strong>are now encoded</strong> by default
to prevent being harvested by spammers. (Kudos to asuter for proposing the patch)
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2234">#2234</a>] Added
the ability to create, modify and remove <strong>DIV containers</strong>. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2247">#2247</a>] The <strong>
SHIFT+SPACE</strong> keystroke will now <strong>produce a &amp;nbsp;</strong> character.
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2252">#2252</a>] It's
now possible to enable the browsers default menu using the configuration file (FCKConfig.BrowserContextMenu
option). </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2032">#2032</a>] Added
HTML samples for legacy HTML and Flash HTML. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/234">#234</a>] Introduced
the "PreventSubmitHandler" setting, which makes it possible to instruct the editor
to not handle the hidden field update on form submit events.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2319">#2319</a>] On Opera
and Firefox 3, the entire page was scrolling on SHIFT+ENTER, or when EnterMode='br'.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2321">#2321</a>] On Firefox
3, the entire page was scrolling when inserting block elements with the FCK.InsertElement
function, used by the Table and Horizontal Rule buttons.. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/692">#692</a>] Added some
hints in editor/css/fck_editorarea.css on how to handle style items that would break
the style combo. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2263">#2263</a>] Fixed
a JavaScript error in IE which occurs when there are placeholder elements in the
document and the user has pressed the Source button.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2314">#2314</a>] Corrected
mixed up Chinese translations for the blockquote command.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2323">#2323</a>] Fixed
the issue where the show blocks command loses the current selection from the view
area when editing a long document.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2322">#2322</a>] Fixed
the issue where the fit window command loses the current selection and scroll position
in the editing area.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1917">#1917</a>] Fixed
the issue where the merge down command for tables cells does not work in IE for
more than two cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2320">#2320</a>] Fixed
the issue where the Find/Replace dialog scrolls the entire page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1645">#1645</a>] Added
warning message about Firefox 3's strict origin policy.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2272">#2272</a>] Improved
the garbage filter in Paste from Word dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2327">#2327</a>] Fixed
invalid HTML in the Paste dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1907">#1907</a>] Fixed
sporadic "FCKeditorAPI is not defined" errors in Firefox 3.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2356">#2356</a>] Fixed
access denied error in IE7 when FCKeditor is launched from local filesystem.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1150">#1150</a>] Fixed
the type="_moz" attribute that sometimes appear in &lt;br&gt; tags in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2363">#2363</a>] There
were some sporadic "Permission Denied" errors with IE on some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2135">#2135</a>] Fixed
a data loss bug in IE when there are @import statements in the editor's CSS files,
and IE's cache is set to "Check for newer versions on every visit".</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2376">#2376</a>] FCK.InsertHtml()
will now insert to the last selected position after the user has selected things
outside of FCKeditor, in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2368">#2368</a>] Fixed
broken protect source logic for comments in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2387">#2387</a>] Fixed
JavaScript error with list commands when the editable document is selected with
Ctrl-A.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2390">#2390</a>] Fixed
the issue where indent styles in JavaScript-generated &lt;p&gt; blocks are erased
in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2394">#2394</a>] Fixed
JavaScript error with the "split vertically" command in IE when attempting to split
cells in the last row of a table.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2316">#2316</a>] The sample
posted data page has now the table fixed at 100% width. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2396">#2396</a>] SpellerPages
was causing a "Permission Denied" error in some situations. </li>
</ul>
<h3>
Version 2.6.2</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2043">#2043</a>] The debug
script is not any more part of the compressed files. If FCKeditor native debugging
features (FCKDebug) are required, the _source folder must be present in your installation.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2248">#2248</a>] Calling
FCK.InsertHtml( 'nbsp;') was inserting a plain space instead of a non breaking space
character.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2273">#2273</a>] The dragresizetable
plugin now works in Firefox 3 as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2254">#2254</a>] Minor
fix in FCKSelection for nodeTagName object.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1614">#1614</a>] Unified
FCKConfig.FullBasePath with FCKConfig.BasePath.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2127">#2127</a>] Changed
floating dialogs to use fixed positioning so that they are no longer affected by
scrolling.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2018">#2018</a>] Reversed
the fix for <a target="_blank" href="http://dev.fckeditor.net/ticket/183">#183</a>
which broke FCKeditorAPI's cleanup logic. A new configuration directive <strong>MsWebBrowserControlCompat</strong>
has been added for those who wish to force the #183 fix to be enabled.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2276">#2276</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/2279">#2279</a>] On Opera
and Firefox 3, the entire page was scrolling on ENTER.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2149</a>] CSS urls
with querystring parameters were not being accepted for CSS values in the configuration
file (like EditorAreaCSS).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] On some
specific cases, with Firefox 2, some extra spacing was appearing in the final HTML
on posting, if inserting two successive tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] Block
elements (like tables or horizontal rules) will be inserted correctly now when the
cursor is at the start or the end of blocks. No extra paragraphs will be included
in this operation.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2197</a>] The TAB
key will now have the default browser behavior if TabSpaces=0. It will move the
focus out of the editor (expect on Safari).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2296">#2296</a>] Fixed
permission denied error on clicking on files in the file browser.</li>
</ul>
<h3>
Version 2.6.1</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2150">#2150</a>] The searching
speed of the Find/Replace dialog has been vastly improved.</li>
<li>New language file for <strong>Gujarati</strong> (by Nilam Doctor).</li>
<li>A new TabIndex property has been added to the JavaScript integration files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2215">#2215</a>] Following
the above new feature, the ReplaceTextarea method will now copy the textarea.tabIndex
value if available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2163">#2163</a>] If the
FCKConfig.DocType setting points to a HTML DocType then the output won't generate
self-closing tags (it will output &lt;img &gt; instead of &lt;img /&gt;).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2173">#2173</a>] A throbber
will be shown in the Quick Uploads.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2142">#2142</a>] HTML
samples will now use sampleposteddata.php in action parameter inside a form.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/768">#768</a>] It is no
longer possible for an image to have its width and height defined with both HTML
attributes and inline CSS styles in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1426">#1426</a>] Fixed
the error loading fckstyles.xml in servers which cannot return the correct content
type header for .xml files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2102">#2102</a>] Fixed
FCKConfig.DocType which stopped working in FCKeditor 2.6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2039">#2039</a>] Fixed
the locking up issue in the Find/Replace dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2124">#2124</a>] PHP File
Browser: fixed issue with resolving paths on Windows servers with PHP 5.2.4/5.2.5.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2059">#2059</a>] Fixed
the error in the toolbar name in fckeditor.py.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2065">#2065</a>] Floating
dialogs will now block the user from re-selecting the editing area by pressing Tab.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2114">#2114</a>] Added
a workaround for an IE6 bug which causes floating dialogs to appear blank after
opening it for the first time.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2136">#2136</a>] Fixed
JavaScript error in IE when opening the bullet list properties dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1633">#1633</a>] External
styles should no longer interfere with the appearance of the editor and floating
panels now.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2113">#2113</a>] Fixed
unneeded &lt;span class=&quot;Apple-style-span&quot;&gt; created after inserting
special characters.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2170">#2170</a>] Fixed
Ctrl-Insert hotkey for copying.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2125">#2125</a>] Fixed
the issue that FCK.InsertHtml() doesn't insert contents at the caret position when
dialogs are opened in IE. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1764">#1764</a>] FCKeditor
will no longer catch focus in IE on load when StartupFocus is false and the initial
content is empty.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2126">#2126</a>] Opening
and closing floating dialogs will no longer cause toolbar button states to become
frozen.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2159">#2159</a>] Selection
are now correctly restored when undoing changes made by the Replace dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2160">#2160</a>] "Match
whole word" in the Find and Replace dialog will now find words next to punctuation
marks as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2162">#2162</a>] If the
configuration is set to work including the &lt;head&gt; (FullPage), references to
stylesheets added by Firefox extensions won't be added to the output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2168">#2168</a>] Comments
won't generate new paragraphs in the output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2184">#2184</a>] Fixed
several validation errors in the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed
an IE issue where pressing backspace may merge a hyperlink on the previous line
with the text on the current line.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1691">#1691</a>] Creation
of links in Safari failed if there was no selection.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2188">#2188</a>] PreserveSessionOnFileBrowser
is now removed as it was made obsolete with 2.6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/898">#898</a>] The styles
for the editing area are applied in the image preview dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2056">#2056</a>] Fixed
several validation errors in the dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2063">#2063</a>] Fixed
some problems in asp related to the use of network paths for the location of the
uploaded files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1593">#1593</a>] The "Sample
Posted Data" page will now properly wrap the text.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2239">#2239</a>] The PHP
code in sampleposteddata.php has been changed from "&lt;?=" to "&lt;? echo".</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2241">#2241</a>] Fixed
404 error in floating panels when FCKeditor is installed to a different domain.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2066">#2066</a>] Added
a workaround for a Mac Safari 3.1 browser bug which caused the Fit Window button
to give a blank screen.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2218">#2218</a>] Improved
Gecko based browser detection to accept Epiphany/Gecko as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2193">#2193</a>] Fixed
the issue where the caret cannot reach the last character of a paragraph in Opera
9.50.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2264">#2264</a>] Fixed
empty spaces that appear at the top of the editor in Opera 9.50.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2238">#2238</a>] The &lt;object&gt;
placeholder was not being properly displayed in the compressed distribution version
and nightly builds.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2115">#2115</a>] Fixed
JavaScript (permission denied) error in Firefox when file has been uploaded.</li>
</ul>
<h3>
Version 2.6</h3>
<p>
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
<h3>
Version 2.6 RC</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
object can now be used to access all FCKeditor instances available in the page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
style="color: #ff0000">Attention:</span> By default, the editor now produces &lt;strong&gt;
and &lt;em&gt; instead of &lt;b&gt; and &lt;i&gt;.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog
close button is now correctly positioned in IE in RTL languages.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder
dialog will now display the placeholder value correctly in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing
Enter or typing after a placeholder with the placeholder plugin will no longer generate
colored text.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed
permission denied errors during opening popup menus in IE6 under domain relaxation
mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
Fixed XHTML source formatting errors in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
character is now properly encoded in file names returned by the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
and file names are now properly sanitized against control characters. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
character is now disallowed in current folder path.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
logic to override JavaScript errors occurring inside the editing frame due to user
added JavaScript code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
ENTER on list items containing block elements will now create new list item elements,
instead of adding further blocks to the same list item.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
only combos now get properly grayed out when moving to source view.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
an important bug regarding styles removal on styled text boundaries, introduced
with the 2.6 Beta 1. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
CSS &lt;style&gt; tags where being outputted when FullPage=true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
dialog now properly selects the first field when opening it to modify mailto or
anchor links. This problem was also throwing an error in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
will no longer remain behind in the editing area when the placeholder dialog is
opened.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
the issue where context menus sometimes don't disappear after selecting an option.
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed
JavaScript error when EnterMode=br and user tries to insert a page break.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed
the issue where the maximize editor button does not vertically expand the editing
area in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
fixed filename encoding problems in file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
FCK.InsertHtml() in non-IE browsers would now activate the document processor as
expected.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
XMLHttpRequest class is now used in IE, whenever it is available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
the browser was able to enter in an infinite loop when working with multiple editors
in the same page. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
having problems with SpellerPages, causing some errors to be thrown when completing
the spell checking in some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
command was throwing an error if executed in an editor where its relative button
is not present in the toolbar.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
a generic document processor for &lt;OBJECT&gt; and &lt;EMBED&gt; tags.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
the issue where the placeholder icon for &lt;EMBED&gt; tags does not always show
up in IE7.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
the caret will not any more move to the previous line when selecting a Format style
inside an empty paragraph.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
dialogs using API calls which deals with the selection, like InsertHtml now can
be sure the selection will be placed in the correct position.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
IE, the first character of table captions where being lost on table creation.</li>
<li>The selection and cursor position was not being properly handled when creating some
elements like forms and tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2208">#2208</a>] Added
missing translations in Italian language file.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2096">#2096</a>] Added
the codepage to basexml file. Filenames with special chars should now display properly.</li>
</ul>
<h3>
Version 2.6 Beta 1</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers
and enhancing the editor usability.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong>
Adobe AIR</strong> compatibility.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support
for <strong>document.domain</strong> with automatic domain detection.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong>
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS,
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|&lt;minified
CSS styles". All internal CSS links are already using this feature. </li>
<li>New language file for <strong>Canadian French</strong>.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved
several "strict warning" messages in Firefox when running FCKeditor.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER
key will now work properly in IE with the cursor at the start of a formatted block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's
possible to define in the Styles that a Style (with an empty class) must be shown
selected only when no class is present in the current element, and selecting that
item will clear the current class (it does apply to any attribute, not only classes).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden
div.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned
&lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER
key will not any more break &lt;button&gt; elements at the beginning of paragraphs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor
was not loading on a specific unknown situation. The breaking point has been removed.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor
no longer hangs when operating on documents imported from Microsoft Word.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating
panels attached to a shared toolbar among multiple FCKeditor instances are no longer
misplaced when the editing areas are absolutely or relatively positioned.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog
is now enforced only when ForcePasteAsPlainText = true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes
the autogrow plugin didn't work properly in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External
toolbars are now properly sized in Opera.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking
on radio buttons or checkboxes in the editor in IE will no longer cause lockups
in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes
commands where executed even if the command itself was disabled.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button
to empty the box in the "Paste from Word" has been removed as it leads to confusion
for some users.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing
control elements in Firefox, Opera and Safari now works properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor
was surrounded by a &lt;div&gt; element that wasn't really needed.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form
control was moved in IE after creating it, then it did lose its name.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't
possible to change the type of an existing button.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation
now works inside table cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor
was entering on looping on some specific cases when dealing with invalid source
markup.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting
text into the "Find what" fields in the Find and Replace dialog would now activate
the find and replace buttons.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace
dialog will no longer display wrong starting positions for the match when there
are multiple and identical characters preceding the character at the real starting
point of the match.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
a JavaScript error which occurs in the Find/Replace dialog when the user presses
"Find" or "Replace" after the "No match found" message has appeared.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
breaks and spaces are now conserved when converting to and from the "Formatted"
format.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
the background color behind smiley icons and special characters in their corresponding
dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
error messages are now properly displayed in the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
and value fields in the selection box dialog will no longer extend beyond the dialog
limits when the user inputs a very long text or value for one of the selection options.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
issue where pressing Enter in an &lt;o:p&gt; tag in IE does not generate line breaks.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
issue where the image preview in image dialog sometimes doesn't display after selecting
the image from server browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
of depreciated "var").</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
removed closing tag: "?&gt;", so no additional whitespace added when files are included.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
integration: fixed issues with setting the editor height.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
returning an empty string.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
in IE will no longer turn the preceding normal whitespace into &amp;nbsp;.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
method now has an additional fifth parameter "customData" that will be sent to the
Execute method of the command for that menu item, allowing a single command to be
used for different menu items..</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
command now also removes the attributes from the cleaned text. The list of attributes
is configurable with FCKConfig.RemoveAttributes.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
warning message on Copy and Cut operation failure on IE due to paste permission
settings.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
to file browser has been changed to avoid requests containing double dots.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
failed to load from local filesystem in IE7.</li>
</ul>
<h3> <h3>
Version 2.5.1</h3> Version 2.5.1</h3>
<p> <p>

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -26,10 +26,10 @@
* file. * file.
*/ */
/* /**
The "body" styles should match your editor web site, mainly regarding * The "body" styles should match your editor web site, mainly regarding
background color and font family and size. * background color and font family and size.
*/ */
body body
{ {
@@ -50,10 +50,10 @@ a[href]
text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */ text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */
} }
/* /**
Just uncomment the following block if you want to avoid spaces between * Just uncomment the following block if you want to avoid spaces between
paragraphs. Remember to apply the same style in your output front end page. * paragraphs. Remember to apply the same style in your output front end page.
*/ */
/* /*
p, ul, li p, ul, li
@@ -63,12 +63,30 @@ p, ul, li
} }
*/ */
/**
* Uncomment the following block, or only selected lines if appropriate,
* if you have some style items that would break the styles combo box.
* You can also write other CSS overrides inside the style block below
* as needed and they will be applied to inside the style combo only.
*/
/* /*
The following are some sample styles used in the "Styles" toolbar command. .SC_Item *, .SC_ItemSelected *
You should instead remove them, and include the styles used by the site {
you are using the editor in. margin: 0px !important;
padding: 0px !important;
text-indent: 0px !important;
clip: auto !important;
position: static !important;
}
*/ */
/**
* The following are some sample styles used in the "Styles" toolbar command.
* You should instead remove them, and include the styles used by the site
* you are using the editor in.
*/
.Bold .Bold
{ {
font-weight: bold; font-weight: bold;

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -57,7 +57,7 @@
// Attention: FCKConfig must be available in the page. // Attention: FCKConfig must be available in the page.
function GetCommonDialogCss( prefix ) function GetCommonDialogCss( prefix )
{ {
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ; return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ;
} }
@@ -187,34 +187,7 @@ function OpenFileBrowser( url, width, height )
sOptions += ",left=" + iLeft ; sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ; sOptions += ",top=" + iTop ;
// The "PreserveSessionOnFileBrowser" because the above code could be window.open( url, 'FCKBrowseWindow', sOptions ) ;
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
{
// Detect Yahoo popup blocker.
try
{
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
oWindow.opener = window ;
}
catch(e)
{
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
}
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
window.open( url, 'FCKBrowseWindow', sOptions ) ;
} }
/** /**
@@ -334,5 +307,41 @@ function CopyAttributes( oSource, oDest, oSkipAttributes )
} }
} }
// The style: // The style:
oDest.style.cssText = oSource.style.cssText ; if ( oSource.style.cssText !== '' )
oDest.style.cssText = oSource.style.cssText ;
}
/**
* Replaces a tag with another one, keeping its contents:
* for example TD --> TH, and TH --> TD.
* input: the original node, and the new tag name
* http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
*/
function RenameNode( oNode , newTag )
{
// TODO: if the browser natively supports document.renameNode call it.
// does any browser currently support it in order to test?
// Only rename element nodes.
if ( oNode.nodeType != 1 )
return null ;
// If it's already correct exit here.
if ( oNode.nodeName == newTag )
return oNode ;
var oDoc = oNode.ownerDocument ;
// Create the new node
var newNode = oDoc.createElement( newTag ) ;
// Copy all attributes
CopyAttributes( oNode, newNode, {} ) ;
// Move children to the new node
FCKDomTools.MoveChildren( oNode, newNode ) ;
// Finally replace the node and return the new one
oNode.parentNode.replaceChild( newNode, oNode ) ;
return newNode ;
} }

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -78,8 +78,8 @@ window.onload = function()
border-left: #000000 1px solid; border-bottom: #000000 1px solid"> border-left: #000000 1px solid; border-bottom: #000000 1px solid">
<span fcklang="DlgAboutVersion">version</span> <span fcklang="DlgAboutVersion">version</span>
<br /> <br />
<b>2.6</b><br /> <b>2.6.4</b><br />
Build 18638</td> Build 21629</td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -105,7 +105,7 @@ window.onload = function()
<span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About" <span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
target="_blank">http://www.fckeditor.net/</a>. target="_blank">http://www.fckeditor.net/</a>.
<br /> <br />
Copyright &copy; 2003-2008 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a> Copyright &copy; 2003-2009 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
</td> </td>
<td align="center"> <td align="center">
<a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a> <a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -119,10 +119,7 @@ function Ok()
var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ; var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ;
if ( aNewAnchors.length == 0 ) if ( aNewAnchors.length == 0 )
{ aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
// Nothing was selected, so now just create a normal A
aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
}
else else
{ {
// Remove the fake href // Remove the fake href
@@ -136,7 +133,18 @@ function Ok()
oAnchor = aNewAnchors[i] ; oAnchor = aNewAnchors[i] ;
// Set the name // Set the name
oAnchor.name = sNewName ; if ( FCKBrowserInfo.IsIE )
{
// Setting anchor names directly in IE will trash the HTML code stored
// in FCKTempBin after undos. See #2263.
var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
oAnchor = replaceAnchor ;
}
else
oAnchor.name = sNewName ;
// IE does require special processing to show the Anchor's image // IE does require special processing to show the Anchor's image
// Opera doesn't allow to select empty anchors // Opera doesn't allow to select empty anchors

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -0,0 +1,396 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2009 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 ==
*
* Form dialog window.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="noindex, nofollow" name="robots" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script type="text/javascript">
var dialog = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
var FCKStyles = oEditor.FCKStyles ;
var FCKElementPath = oEditor.FCKElementPath ;
var FCKDomRange = oEditor.FCKDomRange ;
var FCKDomTools = oEditor.FCKDomTools ;
var FCKDomRangeIterator = oEditor.FCKDomRangeIterator ;
var FCKListsLib = oEditor.FCKListsLib ;
var AlwaysCreate = dialog.Args().CustomValue ;
String.prototype.IEquals = function()
{
var thisUpper = this.toUpperCase() ;
var aArgs = arguments ;
// The arguments could also be a single array.
if ( aArgs.length == 1 && aArgs[0].pop )
aArgs = aArgs[0] ;
for ( var i = 0 ; i < aArgs.length ; i++ )
{
if ( thisUpper == aArgs[i].toUpperCase() )
return true ;
}
return false ;
}
var CurrentContainers = [] ;
if ( !AlwaysCreate )
{
dialog.Selection.EnsureSelection() ;
CurrentContainers = FCKDomTools.GetSelectedDivContainers() ;
}
// Add some tabs
dialog.AddTab( 'General', FCKLang.DlgDivGeneralTab );
dialog.AddTab( 'Advanced', FCKLang.DlgDivAdvancedTab ) ;
function AddStyleOption( styleName )
{
var el = GetE( 'selStyle' ) ;
var opt = document.createElement( 'option' ) ;
opt.text = opt.value = styleName ;
if ( FCKBrowserInfo.IsIE )
el.add( opt ) ;
else
el.add( opt, null ) ;
}
function OnDialogTabChange( tabCode )
{
ShowE( 'divGeneral', tabCode == 'General' ) ;
ShowE( 'divAdvanced', tabCode == 'Advanced' ) ;
dialog.SetAutoSize( true ) ;
}
function GetNearestAncestorDirection( node )
{
var dir = 'ltr' ; // HTML default.
while ( ( node = node.parentNode ) )
{
if ( node.dir )
dir = node.dir ;
}
return dir ;
}
window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
dialog.SetOkButton( true ) ;
dialog.SetAutoSize( true ) ;
// Popuplate the style menu
var styles = FCKStyles.GetStyles() ;
var selectableStyles = {} ;
for ( var i in styles )
{
if ( ! /^_FCK_/.test( i ) && styles[i].Element == 'div' )
selectableStyles[i] = styles[i] ;
}
if ( CurrentContainers.length <= 1 )
{
var target = CurrentContainers[0] ;
var match = null ;
for ( var i in selectableStyles )
{
if ( target && styles[i].CheckElementRemovable( target, true ) )
match = i ;
}
if ( !match )
AddStyleOption( "" ) ;
for ( var i in selectableStyles )
AddStyleOption( i ) ;
if ( match )
GetE( 'selStyle' ).value = match ;
// Set the value for other inputs
if ( target )
{
GetE( 'txtClass' ).value = target.className ;
GetE( 'txtId' ).value = target.id ;
GetE( 'txtLang' ).value = target.lang ;
GetE( 'txtInlineStyle').value = target.style.cssText ;
GetE( 'txtTitle' ).value = target.title ;
GetE( 'selLangDir').value = target.dir || GetNearestAncestorDirection( target ) ;
}
}
else
{
GetE( 'txtId' ).disabled = true ;
AddStyleOption( "" ) ;
for ( var i in selectableStyles )
AddStyleOption( i ) ;
}
}
function CreateDiv()
{
var newBlocks = [] ;
var range = new FCKDomRange( FCK.EditorWindow ) ;
range.MoveToSelection() ;
var bookmark = range.CreateBookmark() ;
// Kludge for #1592: if the bookmark nodes are in the beginning of
// $tagName, then move them to the nearest block element in the
// $tagName.
if ( FCKBrowserInfo.IsIE )
{
var bStart = range.GetBookmarkNode( bookmark, true ) ;
var bEnd = range.GetBookmarkNode( bookmark, false ) ;
var cursor ;
if ( bStart
&& bStart.parentNode.nodeName.IEquals( 'div' )
&& !bStart.previousSibling )
{
cursor = bStart ;
while ( ( cursor = cursor.nextSibling ) )
{
if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
FCKDomTools.MoveNode( bStart, cursor, true ) ;
}
}
if ( bEnd
&& bEnd.parentNode.nodeName.IEquals( 'div' )
&& !bEnd.previousSibling )
{
cursor = bEnd ;
while ( ( cursor = cursor.nextSibling ) )
{
if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
{
if ( cursor.firstChild == bStart )
FCKDomTools.InsertAfterNode( bStart, bEnd ) ;
else
FCKDomTools.MoveNode( bEnd, cursor, true ) ;
}
}
}
}
var iterator = new FCKDomRangeIterator( range ) ;
var block ;
var paragraphs = [] ;
while ( ( block = iterator.GetNextParagraph() ) )
paragraphs.push( block ) ;
// Make sure all paragraphs have the same parent.
var commonParent = paragraphs[0].parentNode ;
var tmp = [] ;
for ( var i = 0 ; i < paragraphs.length ; i++ )
{
block = paragraphs[i] ;
commonParent = FCKDomTools.GetCommonParents( block.parentNode, commonParent ).pop() ;
}
// The common parent must not be the following tags: table, tbody, tr, ol, ul.
while ( commonParent.nodeName.IEquals( 'table', 'tbody', 'tr', 'ol', 'ul' ) )
commonParent = commonParent.parentNode ;
// Reconstruct the block list to be processed such that all resulting blocks
// satisfy parentNode == commonParent.
var lastBlock = null ;
while ( paragraphs.length > 0 )
{
block = paragraphs.shift() ;
while ( block.parentNode != commonParent )
block = block.parentNode ;
if ( block != lastBlock )
tmp.push( block ) ;
lastBlock = block ;
}
paragraphs = tmp ;
// Split the paragraphs into groups depending on their BlockLimit element.
var groups = [] ;
var lastBlockLimit = null ;
for ( var i = 0 ; i < paragraphs.length ; i++ )
{
block = paragraphs[i] ;
var elementPath = new FCKElementPath( block ) ;
if ( elementPath.BlockLimit != lastBlockLimit )
{
groups.push( [] ) ;
lastBlockLimit = elementPath.BlockLimit ;
}
groups[groups.length - 1].push( block ) ;
}
// Create a DIV container for each group.
for ( var i = 0 ; i < groups.length ; i++ )
{
var divNode = FCK.EditorDocument.createElement( 'div' ) ;
groups[i][0].parentNode.insertBefore( divNode, groups[i][0] ) ;
for ( var j = 0 ; j < groups[i].length ; j++ )
FCKDomTools.MoveNode( groups[i][j], divNode ) ;
newBlocks.push( divNode ) ;
}
range.MoveToBookmark( bookmark ) ;
range.Select() ;
FCK.Focus() ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
return newBlocks ;
}
function Ok()
{
oEditor.FCKUndo.SaveUndoStep() ;
if ( CurrentContainers.length < 1 )
CurrentContainers = CreateDiv();
var setValue = function( attrName, inputName )
{
var val = GetE( inputName ).value ;
for ( var i = 0 ; i < CurrentContainers.length ; i++ )
{
if ( val == '' )
CurrentContainers[i].removeAttribute( attrName ) ;
else
CurrentContainers[i].setAttribute( attrName, val ) ;
}
}
// Apply modifications to the DIV container according to dialog inputs.
if ( CurrentContainers.length == 1 )
{
setValue( 'class', 'txtClass' ) ;
setValue( 'id', 'txtId' ) ;
}
setValue( 'lang', 'txtLang' ) ;
if ( FCKBrowserInfo.IsIE )
{
for ( var i = 0 ; i < CurrentContainers.length ; i++ )
CurrentContainers[i].style.cssText = GetE( 'txtInlineStyle' ).value ;
}
else
setValue( 'style', 'txtInlineStyle' ) ;
setValue( 'title', 'txtTitle' ) ;
for ( var i = 0 ; i < CurrentContainers.length ; i++ )
{
var dir = GetE( 'selLangDir' ).value ;
var styleName = GetE( 'selStyle' ).value ;
if ( GetNearestAncestorDirection( CurrentContainers[i] ) != dir )
CurrentContainers[i].dir = dir ;
else
CurrentContainers[i].removeAttribute( 'dir' ) ;
if ( styleName )
FCKStyles.GetStyle( styleName ).ApplyToObject( CurrentContainers[i] ) ;
}
return true ;
}
</script>
</head>
<body style="overflow: hidden">
<div id="divGeneral">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<colgroup span="2">
<col width="49%" />
<col width="2%" />
<col width="49%" />
</colgroup>
<tr>
<td>
<span fcklang="DlgDivStyle">Style</span><br />
<select id="selStyle" style="width: 100%;">
</select>
</td>
<td>&nbsp;</td>
<td>
<span fcklang="DlgGenClass">Stylesheet Classes</span><br />
<input id="txtClass" style="width: 100%" type="text" />
</td>
</tr>
</table>
</div>
<div id="divAdvanced" style="display: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<colgroup span="2">
<col width="49%" />
<col width="2%" />
<col width="49%" />
</colgroup>
<tr>
<td>
<span fcklang="DlgGenId">Id</span><br />
<input style="width: 100%" type="text" id="txtId" />
</td>
<td>&nbsp;</td>
<td>
<span fcklang="DlgGenLangCode">Language Code</span><br />
<input style="width: 100%" type="text" id="txtLang" />
</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<span fcklang="DlgDivInlineStyle">Inline Style</span><br />
<input style="width: 100%" type="text" id="txtInlineStyle" />
</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<span fcklang="DlgGenTitle">Advisory Title</span><br />
<input style="width: 100%" type="text" id="txtTitle" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<span fcklang="DlgGenLangDir">Language Direction</span><br />
<select id="selLangDir">
<option fcklang="DlgGenLangDirLtr" value="ltr">Left to Right (LTR)
<option fcklang="DlgGenLangDirRtl" value="rtl">Right to Left (RTL)
</select>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -456,7 +456,7 @@ function SetUrl( url )
<tr> <tr>
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgDocDocType">Document Type Heading</span><br /> <span fcklang="DlgDocDocType">Document Type Heading</span><br />
<select id="selDocType" name="selDocType" onchange="CheckOther( this, 'txtDocType' );"> <select id="selDocType" onchange="CheckOther( this, 'txtDocType' );">
<option value="" selected="selected"></option> <option value="" selected="selected"></option>
<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
4.01 Transitional</option> 4.01 Transitional</option>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -97,7 +97,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<script type="text/javascript"> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ; document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script> </script>
</form> </form>
</div> </div>

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -236,6 +236,10 @@ function SetUrl( url, width, height )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@@ -288,5 +292,9 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -165,7 +165,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
<script type="text/javascript"> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ; document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script> </script>
</form> </form>
</div> </div>

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -447,6 +447,10 @@ function SetUrl( url, width, height, alt )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@@ -500,5 +504,9 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -34,9 +34,9 @@
var FCKTools = window.parent.FCKTools ; var FCKTools = window.parent.FCKTools ;
var FCKConfig = window.parent.FCKConfig ; var FCKConfig = window.parent.FCKConfig ;
// Sets the Skin CSS // Set the preview CSS
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ; document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ;
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss( '../' ) ) ) ; document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ;
if ( window.parent.FCKConfig.BaseHref.length > 0 ) if ( window.parent.FCKConfig.BaseHref.length > 0 )
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ; document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
@@ -50,7 +50,7 @@ window.onload = function()
</script> </script>
</head> </head>
<body style="color: #000000; background-color: #ffffff"> <body>
<div> <div>
<a id="lnkPreview" onclick="return false;" style="cursor: default"> <a id="lnkPreview" onclick="return false;" style="cursor: default">
<img id="imgPreview" onload="window.parent.UpdateOriginal();" <img id="imgPreview" onload="window.parent.UpdateOriginal();"

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -108,7 +108,9 @@
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br /> <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script>
</form> </form>
</div> </div>
<div id="divTarget" style="DISPLAY: none"> <div id="divTarget" style="DISPLAY: none">

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -77,36 +77,187 @@ oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
var oParser = new Object() ; var oParser = new Object() ;
oParser.ParseEMailUrl = function( emailUrl ) // This method simply returns the two inputs in numerical order. You can even
// provide strings, as the method would parseInt() the values.
oParser.SortNumerical = function(a, b)
{
return parseInt( a, 10 ) - parseInt( b, 10 ) ;
}
oParser.ParseEMailParams = function(sParams)
{
// Initialize the oEMailParams object.
var oEMailParams = new Object() ;
oEMailParams.Subject = '' ;
oEMailParams.Body = '' ;
var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ;
if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ;
aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ;
if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ;
return oEMailParams ;
}
// This method returns either an object containing the email info, or FALSE
// if the parameter is not an email link.
oParser.ParseEMailUri = function( sUrl )
{ {
// Initializes the EMailInfo object. // Initializes the EMailInfo object.
var oEMailInfo = new Object() ; var oEMailInfo = new Object() ;
oEMailInfo.Address = '' ; oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ; oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ; oEMailInfo.Body = '' ;
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
if ( oParts ) if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
{ {
// Set the e-mail address. // This seems to be an unprotected email link.
oEMailInfo.Address = oParts[1] ; var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
if ( aParts )
// Look for the optional e-mail parameters.
if ( oParts[2] )
{ {
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; // Set the e-mail address.
if ( oMatch ) oEMailInfo.Subject = decodeURIComponent( oMatch[2] ) ; oEMailInfo.Address = aParts[1] ;
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; // Look for the optional e-mail parameters.
if ( oMatch ) oEMailInfo.Body = decodeURIComponent( oMatch[2] ) ; if ( aParts[2] )
{
var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ;
oEMailInfo.Subject = oEMailParams.Subject ;
oEMailInfo.Body = oEMailParams.Body ;
}
}
return oEMailInfo ;
}
else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )
{
// This may be a protected email.
// Try to match the url against the EMailProtectionFunction.
var func = FCKConfig.EMailProtectionFunction ;
if ( func != null )
{
try
{
// Escape special chars.
func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;
// Define the possible keys.
var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;
// Get the order of the keys (hold them in the array <pos>) and
// the function replaced by regular expression patterns.
var sFunc = func ;
var pos = new Array() ;
for ( var i = 0 ; i < keys.length ; i ++ )
{
var rexp = new RegExp( keys[i] ) ;
var p = func.search( rexp ) ;
if ( p >= 0 )
{
sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;
pos[pos.length] = p + ':' + keys[i] ;
}
}
// Sort the available keys.
pos.sort( oParser.SortNumerical ) ;
// Replace the excaped single quotes in the url, such they do
// not affect the regexp afterwards.
aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;
// Create the regexp and execute it.
var rFunc = new RegExp( '^' + sFunc + '$' ) ;
var aMatch = rFunc.exec( aLinkInfo[2] ) ;
if ( aMatch )
{
var aInfo = new Array();
for ( var i = 1 ; i < aMatch.length ; i ++ )
{
var k = pos[i-1].match(/^\d+:(.+)$/) ;
aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;
}
// Fill the EMailInfo object that will be returned
oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;
oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;
oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;
return oEMailInfo ;
}
}
catch (e)
{
}
}
// Try to match the email against the encode protection.
var aMatch = aLinkInfo[2].match( /^(?:void\()?location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'\)?$/ ) ;
if ( aMatch )
{
// The link is encoded
oEMailInfo.Address = eval( aMatch[1] ) ;
if ( aMatch[2] )
{
var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ;
oEMailInfo.Subject = oEMailParams.Subject ;
oEMailInfo.Body = oEMailParams.Body ;
}
return oEMailInfo ;
} }
} }
return false;
return oEMailInfo ;
} }
oParser.CreateEMailUri = function( address, subject, body ) oParser.CreateEMailUri = function( address, subject, body )
{ {
// Switch for the EMailProtection setting.
switch ( FCKConfig.EMailProtection )
{
case 'function' :
var func = FCKConfig.EMailProtectionFunction ;
if ( func == null )
{
if ( FCKConfig.Debug )
{
alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ;
}
return '';
}
// Split the email address into name and domain parts.
var aAddressParts = address.split( '@', 2 ) ;
if ( aAddressParts[1] == undefined )
{
aAddressParts[1] = '' ;
}
// Replace the keys by their values (embedded in single quotes).
func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ;
func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ;
func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ;
func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ;
return 'javascript:' + func ;
case 'encode' :
var aParams = [] ;
var aAddressCode = [] ;
if ( subject.length > 0 )
aParams.push( 'subject='+ encodeURIComponent( subject ) ) ;
if ( body.length > 0 )
aParams.push( 'body=' + encodeURIComponent( body ) ) ;
for ( var i = 0 ; i < address.length ; i++ )
aAddressCode.push( address.charCodeAt( i ) ) ;
return 'javascript:void(location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\')' ;
}
// EMailProtection 'none'
var sBaseUri = 'mailto:' + address ; var sBaseUri = 'mailto:' + address ;
var sParams = '' ; var sParams = '' ;
@@ -263,28 +414,26 @@ function LoadSelection()
// Search for the protocol. // Search for the protocol.
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
if ( sProtocol ) // Search for a protected email link.
var oEMailInfo = oParser.ParseEMailUri( sHRef );
if ( oEMailInfo )
{
sType = 'email' ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else if ( sProtocol )
{ {
sProtocol = sProtocol[0].toLowerCase() ; sProtocol = sProtocol[0].toLowerCase() ;
GetE('cmbLinkProtocol').value = sProtocol ; GetE('cmbLinkProtocol').value = sProtocol ;
// Remove the protocol and get the remaining URL. // Remove the protocol and get the remaining URL.
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
sType = 'url' ;
if ( sProtocol == 'mailto:' ) // It is an e-mail link. GetE('txtUrl').value = sUrl ;
{
sType = 'email' ;
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else // It is a normal link.
{
sType = 'url' ;
GetE('txtUrl').value = sUrl ;
}
} }
else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link.
{ {
@@ -650,13 +799,17 @@ function BrowseServer()
function SetUrl( url ) function SetUrl( url )
{ {
document.getElementById('txtUrl').value = url ; GetE('txtUrl').value = url ;
OnUrlChange() ; OnUrlChange() ;
dialog.SetSelectedTab( 'Info' ) ; dialog.SetSelectedTab( 'Info' ) ;
} }
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@@ -709,6 +862,10 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -67,7 +67,7 @@ window.onload = function()
dialog.SetOkButton( true ) ; dialog.SetOkButton( true ) ;
dialog.SetAutoSize( true ) ; dialog.SetAutoSize( true ) ;
SelectField( 'txtStartPosition' ) ; SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ;
} }
function Ok() function Ok()

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -64,7 +64,7 @@ window.onload = function ()
var eFrameSpace = document.getElementById( 'xFrameSpace' ) ; var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' + eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"></iframe>' ; 'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
var oFrame = eFrameSpace.firstChild ; var oFrame = eFrameSpace.firstChild ;
@@ -87,6 +87,7 @@ window.onload = function ()
else else
{ {
document.getElementById('txtData').style.display = '' ; document.getElementById('txtData').style.display = '' ;
SelectField( 'txtData' ) ;
} }
if ( sPastingType != 'Word' ) if ( sPastingType != 'Word' )
@@ -187,7 +188,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
var html = oNode.innerHTML ; var html = oNode.innerHTML ;
html = html.replace(/<o:p>\s*<\/o:p>/g, '') ; html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ; html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
// Remove mso-xxx styles. // Remove mso-xxx styles.
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ; html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
@@ -224,6 +225,10 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
if ( bRemoveStyles ) if ( bRemoveStyles )
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ; html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
// Remove style, meta and link tags
html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
// Remove empty styles. // Remove empty styles.
html = html.replace( /\s*style="\s*"/gi, '' ) ; html = html.replace( /\s*style="\s*"/gi, '' ) ;
@@ -234,25 +239,28 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
// Remove Lang attributes // Remove Lang attributes
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ; html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ; html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
// Remove XML elements and declarations // Remove XML elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ; html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
// Remove w: tags with contents.
html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
// Remove Tags with XML namespace declarations: <o:p><\/o:p> // Remove Tags with XML namespace declarations: <o:p><\/o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ; html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
// Remove comments [SF BUG-1481861]. // Remove comments [SF BUG-1481861].
html = html.replace(/<\!--.*?-->/g, '' ) ; html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ; html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ; html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
// Remove "display:none" tags. // Remove "display:none" tags.
html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ; html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
// Remove language tags // Remove language tags
html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ; html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
@@ -267,8 +275,8 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ; html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
// Word likes to insert extra <font> tags, when using MSIE. (Wierd). // Word likes to insert extra <font> tags, when using MSIE. (Wierd).
html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' ); html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' ); html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
} }
else else
{ {
@@ -282,7 +290,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ; html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
// Transform <P> to <DIV> // Transform <P> to <DIV>
var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
html = html.replace( re, '<div$2<\/div>' ) ; html = html.replace( re, '<div$2<\/div>' ) ;
// Remove empty tags (three times, just to be sure). // Remove empty tags (three times, just to be sure).

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -34,6 +34,12 @@ var oEditor = dialog.InnerDialogLoaded() ;
var dialogArguments = dialog.Args() ; var dialogArguments = dialog.Args() ;
var FCKLang = oEditor.FCKLang ; var FCKLang = oEditor.FCKLang ;
var FCKDomTools = oEditor.FCKDomTools ;
var FCKDomRange = oEditor.FCKDomRange ;
var FCKListsLib = oEditor.FCKListsLib ;
var FCKTools = oEditor.FCKTools ;
var EditorDocument = oEditor.FCK.EditorDocument ;
var HighlightStyle = oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ) ;
dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ; dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ;
dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ; dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ;
@@ -51,38 +57,312 @@ function OnDialogTabChange( tabCode )
dialog.SetAutoSize( true ) ; dialog.SetAutoSize( true ) ;
} }
// Place a range at the start of document. GetNextNonEmptyTextNode = function( node, stopNode )
// This will be the starting point of our search.
var GlobalRange = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
function ResetGlobalRange()
{ {
GlobalRange.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ; while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 )
GlobalRange.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ; 1 ;
GlobalRange.Collapse( true ) ; return node ;
}
ResetGlobalRange() ;
var HighlightRange = null ;
function Highlight()
{
if ( HighlightRange )
ClearHighlight() ;
var cloneRange = GlobalRange.Clone() ;
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).ApplyToRange( cloneRange, false, true ) ;
HighlightRange = cloneRange ;
GlobalRange = HighlightRange.Clone() ;
} }
function ClearHighlight() CharacterCursor = function( arg )
{ {
if ( HighlightRange ) if ( arg.nodeType && arg.nodeType == 9 )
{ {
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).RemoveFromRange( HighlightRange, false, true ) ; this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ;
HighlightRange = null ; this._offset = 0 ;
this._doc = arg ;
}
else
{
this._textNode = arguments[0] ;
this._offset = arguments[1] ;
this._doc = FCKTools.GetElementDocument( arguments[0] ) ;
} }
} }
CharacterCursor.prototype =
{
GetCharacter : function()
{
return ( this._textNode && this._textNode.nodeValue.charAt( this._offset ) ) || null ;
},
// Non-normalized.
GetTextNode : function()
{
return this._textNode ;
},
// Non-normalized.
GetIndex : function()
{
return this._offset ;
},
// Return value means whehther we've crossed a line break or a paragraph boundary.
MoveNext : function()
{
if ( this._offset < this._textNode.length - 1 )
{
this._offset++ ;
return false ;
}
var crossed = false ;
var curNode = this._textNode ;
while ( ( curNode = FCKDomTools.GetNextSourceNode( curNode ) )
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
{
var tag = curNode.nodeName.toLowerCase() ;
if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
crossed = true ;
}
this._textNode = curNode ;
this._offset = 0 ;
return crossed ;
},
// Return value means whehther we've crossed a line break or a paragraph boundary.
MoveBack : function()
{
if ( this._offset > 0 && this._textNode.length > 0 )
{
this._offset = Math.min( this._offset - 1, this._textNode.length - 1 ) ;
return false ;
}
var crossed = false ;
var curNode = this._textNode ;
while ( ( curNode = FCKDomTools.GetPreviousSourceNode( curNode ) )
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
{
var tag = curNode.nodeName.toLowerCase() ;
if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
crossed = true ;
}
this._textNode = curNode ;
this._offset = curNode && curNode.length - 1 ;
return crossed ;
},
Clone : function()
{
return new CharacterCursor( this._textNode, this._offset ) ;
}
} ;
CharacterRange = function( initCursor, maxLength )
{
this._cursors = initCursor.push ? initCursor : [initCursor] ;
this._maxLength = maxLength ;
this._highlightRange = null ;
}
CharacterRange.prototype =
{
ToDomRange : function()
{
var firstCursor = this._cursors[0] ;
var lastCursor = this._cursors[ this._cursors.length - 1 ] ;
var domRange = new FCKDomRange( FCKTools.GetElementWindow( firstCursor.GetTextNode() ) ) ;
var w3cRange = domRange._Range = domRange.CreateRange() ;
w3cRange.setStart( firstCursor.GetTextNode(), firstCursor.GetIndex() ) ;
w3cRange.setEnd( lastCursor.GetTextNode(), lastCursor.GetIndex() + 1 ) ;
domRange._UpdateElementInfo() ;
return domRange ;
},
Highlight : function()
{
if ( this._cursors.length < 1 )
return ;
var domRange = this.ToDomRange() ;
HighlightStyle.ApplyToRange( domRange, false, true ) ;
this._highlightRange = domRange ;
var charRange = CharacterRange.CreateFromDomRange( domRange ) ;
var focusNode = domRange.StartNode ;
if ( focusNode.nodeType != 1 )
focusNode = focusNode.parentNode ;
FCKDomTools.ScrollIntoView( focusNode, false ) ;
this._cursors = charRange._cursors ;
},
RemoveHighlight : function()
{
if ( this._highlightRange )
{
HighlightStyle.RemoveFromRange( this._highlightRange, false, true ) ;
var charRange = CharacterRange.CreateFromDomRange( this._highlightRange ) ;
this._cursors = charRange._cursors ;
this._highlightRange = null ;
}
},
GetHighlightDomRange : function()
{
return this._highlightRange;
},
MoveNext : function()
{
var next = this._cursors[ this._cursors.length - 1 ].Clone() ;
var retval = next.MoveNext() ;
if ( retval )
this._cursors = [] ;
this._cursors.push( next ) ;
if ( this._cursors.length > this._maxLength )
this._cursors.shift() ;
return retval ;
},
MoveBack : function()
{
var prev = this._cursors[0].Clone() ;
var retval = prev.MoveBack() ;
if ( retval )
this._cursors = [] ;
this._cursors.unshift( prev ) ;
if ( this._cursors.length > this._maxLength )
this._cursors.pop() ;
return retval ;
},
GetEndCharacter : function()
{
if ( this._cursors.length < 1 )
return null ;
var retval = this._cursors[ this._cursors.length - 1 ].GetCharacter() ;
return retval ;
},
GetNextRange : function( len )
{
if ( this._cursors.length == 0 )
return null ;
var cur = this._cursors[ this._cursors.length - 1 ].Clone() ;
cur.MoveNext() ;
return new CharacterRange( cur, len ) ;
},
GetCursors : function()
{
return this._cursors ;
}
} ;
CharacterRange.CreateFromDomRange = function( domRange )
{
var w3cRange = domRange._Range ;
var startContainer = w3cRange.startContainer ;
var endContainer = w3cRange.endContainer ;
var startTextNode, startIndex, endTextNode, endIndex ;
if ( startContainer.nodeType == 3 )
{
startTextNode = startContainer ;
startIndex = w3cRange.startOffset ;
}
else if ( domRange.StartNode.nodeType == 3 )
{
startTextNode = domRange.StartNode ;
startIndex = 0 ;
}
else
{
startTextNode = GetNextNonEmptyTextNode( domRange.StartNode, domRange.StartNode.parentNode ) ;
if ( !startTextNode )
return null ;
startIndex = 0 ;
}
if ( endContainer.nodeType == 3 && w3cRange.endOffset > 0 )
{
endTextNode = endContainer ;
endIndex = w3cRange.endOffset - 1 ;
}
else
{
endTextNode = domRange.EndNode ;
while ( endTextNode.nodeType != 3 )
endTextNode = endTextNode.lastChild ;
endIndex = endTextNode.length - 1 ;
}
var cursors = [] ;
var current = new CharacterCursor( startTextNode, startIndex ) ;
cursors.push( current ) ;
if ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) && !domRange.CheckIsEmpty() )
{
do
{
current = current.Clone() ;
current.MoveNext() ;
cursors.push( current ) ;
}
while ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) ) ;
}
return new CharacterRange( cursors, cursors.length ) ;
}
// Knuth-Morris-Pratt Algorithm for stream input
KMP_NOMATCH = 0 ;
KMP_ADVANCED = 1 ;
KMP_MATCHED = 2 ;
KmpMatch = function( pattern, ignoreCase )
{
var overlap = [ -1 ] ;
for ( var i = 0 ; i < pattern.length ; i++ )
{
overlap.push( overlap[i] + 1 ) ;
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
}
this._Overlap = overlap ;
this._State = 0 ;
this._IgnoreCase = ( ignoreCase === true ) ;
if ( ignoreCase )
this.Pattern = pattern.toLowerCase();
else
this.Pattern = pattern ;
}
KmpMatch.prototype = {
FeedCharacter : function( c )
{
if ( this._IgnoreCase )
c = c.toLowerCase();
while ( true )
{
if ( c == this.Pattern.charAt( this._State ) )
{
this._State++ ;
if ( this._State == this.Pattern.length )
{
// found a match, start over, don't care about partial matches involving the current match
this._State = 0;
return KMP_MATCHED;
}
return KMP_ADVANCED ;
}
else if ( this._State == 0 )
return KMP_NOMATCH;
else
this._State = this._Overlap[ this._State ];
}
return null ;
},
Reset : function()
{
this._State = 0 ;
}
};
// Place a range at the start of document.
function OnLoad() function OnLoad()
{ {
// First of all, translate the dialog box texts. // First of all, translate the dialog box texts.
@@ -133,79 +413,15 @@ function GetMatchWord()
return !! ( GetE(idMap['CheckWord']).checked ) ; return !! ( GetE(idMap['CheckWord']).checked ) ;
} }
// Get the data pointed to by a bookmark. /* Is this character a unicode whitespace or a punctuation mark?
function GetData( bookmark ) * References:
{ * http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces)
var cursor = oEditor.FCK.EditorDocument.documentElement ; * http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks)
for ( var i = 0 ; i < bookmark.length ; i++ ) */
{ function CheckIsWordSeparator( c )
var target = bookmark[i] ;
var currentIndex = -1 ;
if ( cursor.nodeType != 3 )
{
for (var j = 0 ; j < cursor.childNodes.length ; j++ )
{
var candidate = cursor.childNodes[j] ;
if ( candidate.nodeType == 3 &&
candidate.previousSibling &&
candidate.previousSibling.nodeType == 3 )
continue ;
currentIndex++ ;
if ( currentIndex == target )
{
cursor = candidate ;
break ;
}
}
if ( currentIndex < target )
return null ;
}
else
{
if ( i != bookmark.length - 1 )
return null ;
while ( target >= cursor.length && cursor.nextSibling && cursor.nextSibling.nodeType == 3 )
{
target -= cursor.length ;
cursor = cursor.nextSibling ;
}
cursor = cursor.nodeValue.charAt( target ) ;
if ( cursor == "" )
cursor = null ;
}
}
return cursor ;
}
// With this function, we can treat the bookmark as an iterator for DFS.
function NextPosition( bookmark )
{
// See if there's anything further down the tree.
var next = bookmark.concat( [0] ) ;
if ( GetData( next ) != null )
return next ;
// Nothing down there? See if there's anything next to me.
var next = bookmark.slice( 0, bookmark.length - 1 ).concat( [ bookmark[ bookmark.length - 1 ] + 1 ] ) ;
if ( GetData( next ) != null )
return next ;
// Nothing even next to me? See if there's anything next to my ancestors.
for ( var i = bookmark.length - 1 ; i > 0 ; i-- )
{
var next = bookmark.slice( 0, i - 1 ).concat( [ bookmark[ i - 1 ] + 1 ] ) ;
if ( GetData( next ) != null )
return next ;
}
// There's absolutely nothing left to walk, return null.
return null ;
}
// Is this character a unicode whitespace?
// Reference: http://unicode.org/Public/UNIDATA/PropList.txt
function CheckIsWhitespace( c )
{ {
if ( !c )
return true;
var code = c.charCodeAt( 0 ); var code = c.charCodeAt( 0 );
if ( code >= 9 && code <= 0xd ) if ( code >= 9 && code <= 0xd )
return true; return true;
@@ -225,212 +441,103 @@ function CheckIsWhitespace( c )
case 0x3000: case 0x3000:
return true; return true;
default: default:
return false;
} }
return /[.,"'?!;:]/.test( c ) ;
} }
// Knuth-Morris-Pratt Algorithm for stream input FindRange = null ;
KMP_NOMATCH = 0 ;
KMP_ADVANCED = 1 ;
KMP_MATCHED = 2 ;
function KmpMatch( pattern, ignoreCase )
{
var overlap = [ -1 ] ;
for ( var i = 0 ; i < pattern.length ; i++ )
{
overlap.push( overlap[i] + 1 ) ;
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
}
this._Overlap = overlap ;
this._State = 0 ;
this._IgnoreCase = ( ignoreCase === true ) ;
if ( ignoreCase )
this.Pattern = pattern.toLowerCase();
else
this.Pattern = pattern ;
}
KmpMatch.prototype = {
"FeedCharacter" : function( c )
{
if ( this._IgnoreCase )
c = c.toLowerCase();
while ( true )
{
if ( c == this.Pattern.charAt( this._State ) )
{
this._State++ ;
if ( this._State == this.Pattern.length )
{
// found a match, start over, don't care about partial matches involving the current match
this._State = 0;
return KMP_MATCHED;
}
return KMP_ADVANCED ;
}
else if ( this._State == 0 )
return KMP_NOMATCH;
else
this._State = this._Overlap[ this._State ];
}
return null ;
},
"Reset" : function()
{
this._State = 0 ;
}
};
function _Find() function _Find()
{ {
// Start from the end of the current selection. var searchString = GetSearchString() ;
var matcher = new KmpMatch( GetSearchString(), ! GetCheckCase() ) ; if ( !FindRange )
var cursor = GlobalRange.CreateBookmark2().End ; FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ;
var matchState = KMP_NOMATCH ;
var matchBookmark = null ;
var matchBookmarkStart = [] ;
// Match finding.
while ( true )
{
// Perform KMP stream matching.
// - Reset KMP matcher if we encountered a block element.
var data = GetData( cursor ) ;
if ( data )
{
if ( data.tagName )
{
if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] )
{
matcher.Reset();
matchBookmarkStart = [] ;
}
}
else if ( data.charAt != undefined )
{
matchState = matcher.FeedCharacter(data) ;
// No possible match of any useful substring in the pattern for the currently scanned character.
// So delete any positional information.
if ( matchState == KMP_NOMATCH )
matchBookmarkStart = [] ;
// We've matched something, but it's not a complete match, so let's just mark down the position for backtracking later.
else if ( matchState == KMP_ADVANCED )
{
matchBookmarkStart.push( cursor.concat( [] ) ) ;
if ( matchBookmarkStart.length > matcher._State )
matchBookmarkStart.shift() ;
}
// Found a complete match! Mark down the ending position as well.
else if ( matchState == KMP_MATCHED )
{
// It is possible to get a KMP_MATCHED without KMP_ADVANCED when the match pattern is only 1 character.
// So need to check and mark down the starting position as well.
if ( matchBookmarkStart.length == 0 )
matchBookmarkStart = [cursor.concat( [] )] ;
matchBookmark = { 'Start' : matchBookmarkStart.shift(), 'End' : cursor.concat( [] ) } ;
matchBookmark.End[ matchBookmark.End.length - 1 ]++;
// Wait, do we have to match a whole word?
// If yes, carry out additional checks on what we've got.
if ( GetMatchWord() )
{
var startOk = false ;
var endOk = false ;
var start = matchBookmark.Start ;
var end = matchBookmark.End ;
if ( start[ start.length - 1 ] == 0 )
startOk = true ;
else
{
var cursorBeforeStart = start.slice( 0, start.length - 1 ) ;
cursorBeforeStart.push( start[ start.length - 1 ] - 1 ) ;
var dataBeforeStart = GetData( cursorBeforeStart ) ;
if ( dataBeforeStart == null || dataBeforeStart.charAt == undefined )
startOk = true ;
else if ( CheckIsWhitespace( dataBeforeStart ) )
startOk = true ;
}
// this is already one character beyond the last char, no need to move
var cursorAfterEnd = end ;
var dataAfterEnd = GetData( cursorAfterEnd );
if ( dataAfterEnd == null || dataAfterEnd.charAt == undefined )
endOk = true ;
else if ( CheckIsWhitespace( dataAfterEnd ) )
endOk = true ;
if ( startOk && endOk )
break ;
else
matcher.Reset() ;
}
else
break ;
}
}
}
// Perform DFS across the document, until we've reached the end.
cursor = NextPosition( cursor ) ;
if ( cursor == null )
break;
}
// If we've found a match, highlight the match.
if ( matchState == KMP_MATCHED )
{
GlobalRange.MoveToBookmark2( matchBookmark ) ;
Highlight() ;
var focus = GlobalRange._Range.endContainer ;
while ( focus && focus.nodeType != 1 )
focus = focus.parentNode ;
if ( focus )
{
if ( oEditor.FCKBrowserInfo.IsSafari )
oEditor.FCKDomTools.ScrollIntoView( focus, false ) ;
else
focus.scrollIntoView( false ) ;
}
return true ;
}
else else
{ {
ResetGlobalRange() ; FindRange.RemoveHighlight() ;
return false ; FindRange = FindRange.GetNextRange( searchString.length ) ;
} }
var matcher = new KmpMatch( searchString, ! GetCheckCase() ) ;
var matchState = KMP_NOMATCH ;
var character = '%' ;
while ( character != null )
{
while ( ( character = FindRange.GetEndCharacter() ) )
{
matchState = matcher.FeedCharacter( character ) ;
if ( matchState == KMP_MATCHED )
break ;
if ( FindRange.MoveNext() )
matcher.Reset() ;
}
if ( matchState == KMP_MATCHED )
{
if ( GetMatchWord() )
{
var cursors = FindRange.GetCursors() ;
var head = cursors[ cursors.length - 1 ].Clone() ;
var tail = cursors[0].Clone() ;
if ( !head.MoveNext() && !CheckIsWordSeparator( head.GetCharacter() ) )
continue ;
if ( !tail.MoveBack() && !CheckIsWordSeparator( tail.GetCharacter() ) )
continue ;
}
FindRange.Highlight() ;
return true ;
}
}
FindRange = null ;
return false ;
} }
function Find() function Find()
{ {
if ( ! _Find() ) if ( ! _Find() )
{
ClearHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
}
} }
function Replace() function Replace()
{ {
if ( GlobalRange.CheckIsCollapsed() ) var saveUndoStep = function( selectRange )
{ {
if (! _Find() ) var ieRange ;
{ if ( oEditor.FCKBrowserInfo.IsIE )
ClearHighlight() ; ieRange = document.selection.createRange() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
} selectRange.Select() ;
oEditor.FCKUndo.SaveUndoStep() ;
var cloneRange = selectRange.Clone() ;
cloneRange.Collapse( false ) ;
cloneRange.Select() ;
if ( ieRange )
setTimeout( function(){ ieRange.select() ; }, 1 ) ;
}
if ( FindRange && FindRange.GetHighlightDomRange() )
{
var range = FindRange.GetHighlightDomRange() ;
var bookmark = range.CreateBookmark() ;
FindRange.RemoveHighlight() ;
range.MoveToBookmark( bookmark ) ;
saveUndoStep( range ) ;
range.DeleteContents() ;
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
range._UpdateElementInfo() ;
FindRange = CharacterRange.CreateFromDomRange( range ) ;
} }
else else
{ {
oEditor.FCKUndo.SaveUndoStep() ; if ( ! _Find() )
GlobalRange.DeleteContents() ; {
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ; FindRange && FindRange.RemoveHighlight() ;
GlobalRange.Collapse( false ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
}
} }
} }
@@ -441,21 +548,34 @@ function ReplaceAll()
while ( _Find() ) while ( _Find() )
{ {
dialog.Selection.EnsureSelection() ; var range = FindRange.GetHighlightDomRange() ;
GlobalRange.DeleteContents() ; var bookmark = range.CreateBookmark() ;
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ; FindRange.RemoveHighlight() ;
GlobalRange.Collapse( false ) ; range.MoveToBookmark( bookmark) ;
range.DeleteContents() ;
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
range._UpdateElementInfo() ;
FindRange = CharacterRange.CreateFromDomRange( range ) ;
replaceCount++ ; replaceCount++ ;
} }
if ( replaceCount == 0 ) if ( replaceCount == 0 )
{ {
ClearHighlight() ; FindRange && FindRange.RemoveHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
} }
dialog.Cancel() ; dialog.Cancel() ;
} }
window.onunload = function(){ ClearHighlight() ; } window.onunload = function()
{
if ( FindRange )
{
FindRange.RemoveHighlight() ;
FindRange.ToDomRange().Select() ;
}
}
</script> </script>
</head> </head>
<body onload="OnLoad()" style="overflow: hidden"> <body onload="OnLoad()" style="overflow: hidden">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -132,7 +132,7 @@ function Ok()
<tr> <tr>
<td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td> <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
<td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td> <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow <td nowrap align="right"><input id="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
multiple selections</label></td> multiple selections</label></td>
</tr> </tr>
</table> </table>
@@ -143,20 +143,20 @@ function Ok()
<table width="100%"> <table width="100%">
<tr> <tr>
<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br> <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
<input id="txtText" style="WIDTH: 100%" type="text" name="txtText"> <input id="txtText" style="WIDTH: 100%" type="text">
</td> </td>
<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br> <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue"> <input id="txtValue" style="WIDTH: 100%" type="text">
</td> </td>
<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td> <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td> <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
</tr> </tr>
<tr> <tr>
<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);" <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
size="5" name="cmbText"></select> size="5"></select>
</td> </td>
<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);" <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
size="5" name="cmbValue"></select> size="5"></select>
</td> </td>
<td vAlign="top" colSpan="2"> <td vAlign="top" colSpan="2">
</td> </td>

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -52,7 +52,12 @@ function OnSpellerControlsLoad( controlsWindow )
function oSpeller_OnFinished( numberOCorrections ) function oSpeller_OnFinished( numberOCorrections )
{ {
if ( numberOCorrections > 0 ) if ( numberOCorrections > 0 )
oEditor.FCK.SetData( document.getElementById('txtHtml').value ) ; {
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ;
if ( oEditor.FCKBrowserInfo.IsIE )
oEditor.FCKSelection.Collapse( true ) ;
}
window.parent.Cancel() ; window.parent.Cancel() ;
} }

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -31,14 +31,13 @@
var dialog = window.parent ; var dialog = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ; var oEditor = dialog.InnerDialogLoaded() ;
var dialogArguments = dialog.Args() ;
// Gets the document DOM var FCKDomTools = oEditor.FCKDomTools ;
var oDOM = oEditor.FCK.EditorDocument ;
// Gets the table if there is one selected. // Gets the table if there is one selected.
var table ; var table ;
var e = dialog.Selection.GetSelectedElement() ; var e = dialog.Selection.GetSelectedElement() ;
var hasColumnHeaders ;
if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) ) if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ; e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
@@ -88,6 +87,36 @@ window.onload = function()
var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ; if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ;
hasColumnHeaders = true ;
// Check if all the first cells in every row are TH
for (var row=0; row<table.rows.length; row++)
{
// If just one cell isn't a TH then it isn't a header column
if ( table.rows[row].cells[0].nodeName != 'TH' )
{
hasColumnHeaders = false ;
break;
}
}
// Check if the table contains <thead>
if ((table.tHead !== null) )
{
if (hasColumnHeaders)
GetE('selHeaders').value = 'both' ;
else
GetE('selHeaders').value = 'row' ;
}
else
{
if (hasColumnHeaders)
GetE('selHeaders').value = 'col' ;
else
GetE('selHeaders').value = '' ;
}
document.getElementById('txtRows').disabled = true ; document.getElementById('txtRows').disabled = true ;
document.getElementById('txtColumns').disabled = true ; document.getElementById('txtColumns').disabled = true ;
SelectField( 'txtWidth' ) ; SelectField( 'txtWidth' ) ;
@@ -104,8 +133,11 @@ function Ok()
{ {
var bExists = ( table != null ) ; var bExists = ( table != null ) ;
var oDoc = oEditor.FCK.EditorDocument ;
oEditor.FCKUndo.SaveUndoStep() ;
if ( ! bExists ) if ( ! bExists )
table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ; table = oDoc.createElement( "TABLE" ) ;
// Removes the Width and Height styles // Removes the Width and Height styles
if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ; if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ;
@@ -129,7 +161,7 @@ function Ok()
{ {
if ( !eCaption ) if ( !eCaption )
{ {
eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ; eCaption = oDoc.createElement( 'CAPTION' ) ;
table.insertBefore( eCaption, table.firstChild ) ; table.insertBefore( eCaption, table.firstChild ) ;
} }
@@ -145,24 +177,133 @@ function Ok()
eCaption.parentNode.removeChild( eCaption ) ; eCaption.parentNode.removeChild( eCaption ) ;
} }
var headers = GetE('selHeaders').value ;
if ( bExists )
{
// Should we make a <thead>?
if ( table.tHead==null && (headers=='row' || headers=='both') )
{
var oThead = table.createTHead() ;
var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
var theRow= FCKDomTools.GetFirstChild( tbody, 'TR' ) ;
//now change TD to TH:
for (var i = 0; i<theRow.childNodes.length ; i++)
{
var th = RenameNode(theRow.childNodes[i], 'TH') ;
if (th != null)
th.scope='col' ;
}
oThead.appendChild( theRow ) ;
}
if ( table.tHead!==null && !(headers=='row' || headers=='both') )
{
// Move the row out of the THead and put it in the TBody:
var tHead = table.tHead ;
var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
var previousFirstRow = tbody.firstChild ;
while ( tHead.firstChild )
{
var theRow = tHead.firstChild ;
for (var i = 0; i < theRow.childNodes.length ; i++ )
{
var newCell = RenameNode( theRow.childNodes[i], 'TD' ) ;
if ( newCell != null )
newCell.removeAttribute( 'scope' ) ;
}
tbody.insertBefore( theRow, previousFirstRow ) ;
}
table.removeChild( tHead ) ;
}
// Should we make all first cells in a row TH?
if ( (!hasColumnHeaders) && (headers=='col' || headers=='both') )
{
for( var row=0 ; row < table.rows.length ; row++ )
{
var newCell = RenameNode(table.rows[row].cells[0], 'TH') ;
if ( newCell != null )
newCell.scope = 'row' ;
}
}
// Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
if ( (hasColumnHeaders) && !(headers=='col' || headers=='both') )
{
for( var row=0 ; row < table.rows.length ; row++ )
{
var oRow = table.rows[row] ;
if ( oRow.parentNode.nodeName == 'TBODY' )
{
var newCell = RenameNode(oRow.cells[0], 'TD') ;
if (newCell != null)
newCell.removeAttribute( 'scope' ) ;
}
}
}
}
if (! bExists) if (! bExists)
{ {
var iRows = document.getElementById('txtRows').value ; var iRows = GetE('txtRows').value ;
var iCols = document.getElementById('txtColumns').value ; var iCols = GetE('txtColumns').value ;
for ( var r = 0 ; r < iRows ; r++ ) var startRow = 0 ;
// Should we make a <thead> ?
if (headers=='row' || headers=='both')
{ {
startRow++ ;
var oThead = table.createTHead() ;
var oRow = table.insertRow(-1) ; var oRow = table.insertRow(-1) ;
oThead.appendChild(oRow);
for ( var c = 0 ; c < iCols ; c++ ) for ( var c = 0 ; c < iCols ; c++ )
{ {
var oCell = oRow.insertCell(-1) ; var oThcell = oDoc.createElement( 'TH' ) ;
oThcell.scope = 'col' ;
oRow.appendChild( oThcell ) ;
if ( oEditor.FCKBrowserInfo.IsGeckoLike )
oEditor.FCKTools.AppendBogusBr( oThcell ) ;
}
}
// Opera automatically creates a tbody when a thead has been added
var oTbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
if ( !oTbody )
{
// make TBODY if it doesn't exist
oTbody = oDoc.createElement( 'TBODY' ) ;
table.appendChild( oTbody ) ;
}
for ( var r = startRow ; r < iRows; r++ )
{
var oRow = oDoc.createElement( 'TR' ) ;
oTbody.appendChild(oRow) ;
var startCol = 0 ;
// Is the first column a header?
if (headers=='col' || headers=='both')
{
var oThcell = oDoc.createElement( 'TH' ) ;
oThcell.scope = 'row' ;
oRow.appendChild( oThcell ) ;
if ( oEditor.FCKBrowserInfo.IsGeckoLike )
oEditor.FCKTools.AppendBogusBr( oThcell ) ;
startCol++ ;
}
for ( var c = startCol ; c < iCols ; c++ )
{
// IE will leave the TH at the end of the row if we use now oRow.insertCell(-1)
var oCell = oDoc.createElement( 'TD' ) ;
oRow.appendChild( oCell ) ;
if ( oEditor.FCKBrowserInfo.IsGeckoLike ) if ( oEditor.FCKBrowserInfo.IsGeckoLike )
oEditor.FCKTools.AppendBogusBr( oCell ) ; oEditor.FCKTools.AppendBogusBr( oCell ) ;
} }
} }
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCK.InsertElement( table ) ; oEditor.FCK.InsertElement( table ) ;
} }
@@ -178,39 +319,44 @@ function Ok()
<table cellspacing="1" cellpadding="1" width="100%" border="0"> <table cellspacing="1" cellpadding="1" width="100%" border="0">
<tr> <tr>
<td valign="top"> <td valign="top">
<table cellspacing="0" cellpadding="0" border="0"> <table cellspacing="1" cellpadding="0" border="0">
<tr> <tr>
<td> <td>
<span fcklang="DlgTableRows">Rows</span>:</td> <span fcklang="DlgTableRows">Rows</span>:</td>
<td> <td>
&nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3" name="txtRows" &nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span fcklang="DlgTableColumns">Columns</span>:</td> <span fcklang="DlgTableColumns">Columns</span>:</td>
<td> <td>
&nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2" name="txtColumns" &nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
</tr> </tr>
<tr> <tr>
<td><span fcklang="DlgTableHeaders">Headers</span>:</td>
<td> <td>
&nbsp;</td> &nbsp;<select id="selHeaders">
<td> <option fcklang="DlgTableHeadersNone" value="">None</option>
&nbsp;</td> <option fcklang="DlgTableHeadersRow" value="row">First row</option>
<option fcklang="DlgTableHeadersColumn" value="col">First column</option>
<option fcklang="DlgTableHeadersBoth" value="both">Both</option>
</select>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span fcklang="DlgTableBorder">Border size</span>:</td> <span fcklang="DlgTableBorder">Border size</span>:</td>
<td> <td>
&nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1" name="txtBorder" &nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span fcklang="DlgTableAlign">Alignment</span>:</td> <span fcklang="DlgTableAlign">Alignment</span>:</td>
<td> <td>
&nbsp;<select id="selAlignment" name="selAlignment"> &nbsp;<select id="selAlignment">
<option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option> <option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option>
<option fcklang="DlgTableAlignLeft" value="left">Left</option> <option fcklang="DlgTableAlignLeft" value="left">Left</option>
<option fcklang="DlgTableAlignCenter" value="center">Center</option> <option fcklang="DlgTableAlignCenter" value="center">Center</option>
@@ -227,10 +373,10 @@ function Ok()
<td> <td>
<span fcklang="DlgTableWidth">Width</span>:</td> <span fcklang="DlgTableWidth">Width</span>:</td>
<td> <td>
&nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200" name="txtWidth" &nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
<td> <td>
&nbsp;<select id="selWidthType" name="selWidthType"> &nbsp;<select id="selWidthType">
<option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option> <option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
<option fcklang="DlgTableWidthPc" value="percent">percent</option> <option fcklang="DlgTableWidthPc" value="percent">percent</option>
</select></td> </select></td>
@@ -239,23 +385,18 @@ function Ok()
<td> <td>
<span fcklang="DlgTableHeight">Height</span>:</td> <span fcklang="DlgTableHeight">Height</span>:</td>
<td> <td>
&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /></td> &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" /></td>
<td> <td>
&nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td> &nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
</tr> </tr>
<tr> <tr>
<td> <td colspan="3">&nbsp;</td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgTableCellSpace">Cell spacing</span>:</td> <span fcklang="DlgTableCellSpace">Cell spacing</span>:</td>
<td> <td>
&nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1" name="txtCellSpacing" &nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
<td> <td>
&nbsp;</td> &nbsp;</td>
@@ -264,7 +405,7 @@ function Ok()
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgTableCellPad">Cell padding</span>:</td> <span fcklang="DlgTableCellPad">Cell padding</span>:</td>
<td> <td>
&nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1" name="txtCellPadding" &nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1"
onkeypress="return IsDigit(event);" /></td> onkeypress="return IsDigit(event);" /></td>
<td> <td>
&nbsp;</td> &nbsp;</td>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -32,8 +32,7 @@
var dialog = window.parent ; var dialog = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ; var oEditor = dialog.InnerDialogLoaded() ;
// Gets the document DOM var FCKDomTools = oEditor.FCKDomTools ;
var oDOM = oEditor.FCK.EditorDocument ;
// Array of selected Cells // Array of selected Cells
var aCells = oEditor.FCKTableHandler.GetSelectedCells() ; var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
@@ -74,13 +73,15 @@ function SetStartupValue()
GetE('txtCollSpan').value = GetAttribute( oCell, 'colSpan' ) ; GetE('txtCollSpan').value = GetAttribute( oCell, 'colSpan' ) ;
GetE('txtBackColor').value = GetAttribute( oCell, 'bgColor' ) ; GetE('txtBackColor').value = GetAttribute( oCell, 'bgColor' ) ;
GetE('txtBorderColor').value = GetAttribute( oCell, 'borderColor' ) ; GetE('txtBorderColor').value = GetAttribute( oCell, 'borderColor' ) ;
// GetE('cmbFontStyle').value = oCell.className ; GetE('selCellType').value = oCell.nodeName.toLowerCase() ;
} }
} }
// Fired when the user press the OK button // Fired when the user press the OK button
function Ok() function Ok()
{ {
oEditor.FCKUndo.SaveUndoStep() ;
for( i = 0 ; i < aCells.length ; i++ ) for( i = 0 ; i < aCells.length ; i++ )
{ {
if ( GetE('txtWidth').value.length > 0 ) if ( GetE('txtWidth').value.length > 0 )
@@ -100,7 +101,25 @@ function Ok()
SetAttribute( aCells[i], 'colSpan' , GetE('txtCollSpan').value ) ; SetAttribute( aCells[i], 'colSpan' , GetE('txtCollSpan').value ) ;
SetAttribute( aCells[i], 'bgColor' , GetE('txtBackColor').value ) ; SetAttribute( aCells[i], 'bgColor' , GetE('txtBackColor').value ) ;
SetAttribute( aCells[i], 'borderColor' , GetE('txtBorderColor').value ) ; SetAttribute( aCells[i], 'borderColor' , GetE('txtBorderColor').value ) ;
// SetAttribute( aCells[i], 'className' , GetE('cmbFontStyle').value ) ;
var cellType = GetE('selCellType').value ;
if ( aCells[i].nodeName.toLowerCase() != cellType )
aCells[i] = RenameNode( aCells[i], cellType ) ;
}
// The cells need to be reselected, otherwise the caret will appear inside the table borders (Gecko)
// or sent back to the beginning of the document (Opera and Safari).
// Strangely, IE works ok so no change is needed for IE.
if ( !oEditor.FCKBrowserInfo.IsIE )
{
var selection = oEditor.FCK.EditorWindow.getSelection() ;
selection.removeAllRanges() ;
for ( var i = 0 ; i < aCells.length ; i++ )
{
var range = oEditor.FCK.EditorDocument.createRange() ;
range.selectNode( aCells[i] ) ;
selection.addRange( range ) ;
}
} }
return true ; return true ;
@@ -138,7 +157,7 @@ function SelectColor( wich )
<span fcklang="DlgCellWidth">Width</span>:</td> <span fcklang="DlgCellWidth">Width</span>:</td>
<td> <td>
&nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4" &nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
size="3" name="txtWidth" />&nbsp;<select id="selWidthType" name="selWidthType"> size="3" />&nbsp;<select id="selWidthType">
<option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option> <option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>
<option fcklang="DlgCellWidthPc" value="percent">percent</option> <option fcklang="DlgCellWidthPc" value="percent">percent</option>
</select></td> </select></td>
@@ -147,7 +166,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellHeight">Height</span>:</td> <span fcklang="DlgCellHeight">Height</span>:</td>
<td> <td>
&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" />&nbsp;<span &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" />&nbsp;<span
fcklang="DlgCellWidthPx">pixels</span></td> fcklang="DlgCellWidthPx">pixels</span></td>
</tr> </tr>
<tr> <tr>
@@ -160,7 +179,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellWordWrap">Word Wrap</span>:</td> <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
<td> <td>
&nbsp;<select id="selWordWrap" name="selAlignment"> &nbsp;<select id="selWordWrap">
<option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option> <option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
<option fcklang="DlgCellWordWrapNo" value="false">No</option> <option fcklang="DlgCellWordWrapNo" value="false">No</option>
</select></td> </select></td>
@@ -175,7 +194,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td> <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
<td> <td>
&nbsp;<select id="selHAlign" name="selAlignment"> &nbsp;<select id="selHAlign">
<option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option> <option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellHorAlignLeft" value="left">Left</option> <option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
<option fcklang="DlgCellHorAlignCenter" value="center">Center</option> <option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
@@ -186,7 +205,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td> <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
<td> <td>
&nbsp;<select id="selVAlign" name="selAlignment"> &nbsp;<select id="selVAlign">
<option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option> <option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellVerAlignTop" value="top">Top</option> <option fcklang="DlgCellVerAlignTop" value="top">Top</option>
<option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option> <option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
@@ -200,13 +219,30 @@ function SelectColor( wich )
&nbsp;&nbsp;&nbsp;</td> &nbsp;&nbsp;&nbsp;</td>
<td align="right"> <td align="right">
<table cellspacing="0" cellpadding="0" border="0"> <table cellspacing="0" cellpadding="0" border="0">
<tr>
<td nowrap="nowrap">
<span fcklang="DlgCellType">Cell Type</span>:</td>
<td colspan="2">
&nbsp; <select id="selCellType">
<option fcklang="DlgCellTypeData" value="td" />Data
<option fcklang="DlgCellTypeHeader" value="th" />Header
</select>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr> <tr>
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellRowSpan">Rows Span</span>:</td> <span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
<td> <td>
&nbsp; &nbsp;
<input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2" <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
name="txtRows"></td> ></td>
<td> <td>
</td> </td>
</tr> </tr>
@@ -216,7 +252,7 @@ function SelectColor( wich )
<td> <td>
&nbsp; &nbsp;
<input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2" <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
size="2" name="txtColumns"></td> size="2"></td>
<td> <td>
</td> </td>
</tr> </tr>
@@ -232,7 +268,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellBackColor">Background Color</span>:</td> <span fcklang="DlgCellBackColor">Background Color</span>:</td>
<td> <td>
&nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td> &nbsp;<input id="txtBackColor" type="text" size="8" /></td>
<td> <td>
&nbsp; &nbsp;
<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td> <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
@@ -241,7 +277,7 @@ function SelectColor( wich )
<td nowrap="nowrap"> <td nowrap="nowrap">
<span fcklang="DlgCellBorderColor">Border Color</span>:</td> <span fcklang="DlgCellBorderColor">Border Color</span>:</td>
<td> <td>
&nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td> &nbsp;<input id="txtBorderColor" type="text" size="8" /></td>
<td> <td>
&nbsp; &nbsp;
<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td> <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -27,6 +27,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" /> <meta name="robots" content="noindex, nofollow" />
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
// Domain relaxation logic. // Domain relaxation logic.
(function() (function()
{ {
@@ -84,7 +86,7 @@ window.focus() ;
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ; document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
// Sets the language direction. // Sets the language direction.
var langDir = document.documentElement.dir = E.FCKLang.Dir ; var langDir = E.FCKLang.Dir ;
// For IE6-, the fck_dialog_ie6.js is loaded, used to fix limitations in the browser. // For IE6-, the fck_dialog_ie6.js is loaded, used to fix limitations in the browser.
if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 ) if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
@@ -190,6 +192,19 @@ var Sizer = function()
} }
} }
/**
* IE6 has a similar bug where it sometimes thinks $('contents') has an
* offsetHeight of 0 (#2114).
*/
if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
{
var originalRefreshContainerSize = retval.RefreshContainerSize ;
retval.RefreshContainerSize = function()
{
FCKTools.SetTimeout( originalRefreshContainerSize, 1, retval ) ;
}
}
window.onresize = function() window.onresize = function()
{ {
retval.RefreshContainerSize() ; retval.RefreshContainerSize() ;
@@ -232,10 +247,13 @@ var Throbber = function()
var throbberParent = $( 'throbberBlock' ) ; var throbberParent = $( 'throbberBlock' ) ;
// Create the throbber blocks. if (throbberParent.childNodes.length == 0)
var classIds = [ 1,2,3,4,5,4,3,2 ] ; {
while ( classIds.length > 0 ) // Create the throbber blocks.
throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ; var classIds = [ 1,2,3,4,5,4,3,2 ] ;
while ( classIds.length > 0 )
throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ;
}
// Center the throbber. // Center the throbber.
var frm = $( 'contents' ) ; var frm = $( 'contents' ) ;
@@ -248,6 +266,10 @@ var Throbber = function()
// Show it. // Show it.
throbberParent.style.visibility = '' ; throbberParent.style.visibility = '' ;
// Hide tabs and buttons:
$( 'Tabs' ).style.visibility = 'hidden' ;
$( 'PopupButtons' ).style.visibility = 'hidden' ;
// Setup the animation interval. // Setup the animation interval.
timer = setInterval( updateThrobber, 100 ) ; timer = setInterval( updateThrobber, 100 ) ;
}, },
@@ -260,9 +282,11 @@ var Throbber = function()
timer = null ; timer = null ;
} }
var throbberParent = document.getElementById( 'throbberBlock' ) ; $( 'throbberBlock' ).style.visibility = 'hidden' ;
if ( throbberParent )
FCKDomTools.RemoveNode( throbberParent ) ; // Show tabs and buttons:
$( 'Tabs' ).style.visibility = '' ;
$( 'PopupButtons' ).style.visibility = '' ;
} }
} ; } ;
}() ; }() ;
@@ -385,6 +409,11 @@ var Selection =
*/ */
EnsureSelection : function() EnsureSelection : function()
{ {
// Move the focus to the Cancel button so even if the dialog contains a
// contentEditable element the selection is properly restored in the editor #2496
window.focus() ;
$( 'btnCancel' ).focus() ;
FCK.Selection.Restore() ; FCK.Selection.Restore() ;
}, },
@@ -549,6 +578,8 @@ var onReadyRegister = function()
// Program entry point. // Program entry point.
window.Init = function() window.Init = function()
{ {
$( 'contents' ).dir = langDir;
// Start the throbber timer. // Start the throbber timer.
Throbber.Show( 1000 ) ; Throbber.Show( 1000 ) ;
@@ -617,7 +648,7 @@ var onReadyRegister = function()
E.FCKLanguageManager.TranslatePage( document ) ; E.FCKLanguageManager.TranslatePage( document ) ;
// Create the IFRAME that holds the dialog contents. // Create the IFRAME that holds the dialog contents.
$( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"></iframe>' ; $( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"><\/iframe>' ;
} ; } ;
window.InnerDialogLoaded = function() window.InnerDialogLoaded = function()
@@ -727,6 +758,7 @@ var onReadyRegister = function()
} }
} ; } ;
})() ; })() ;
// ]]>
</script> </script>
</head> </head>
<body onload="Init();" class="PopupBody"> <body onload="Init();" class="PopupBody">
@@ -734,7 +766,9 @@ var onReadyRegister = function()
<div id="header"> <div id="header">
<div id="TitleArea" class="PopupTitle PopupTitleBorder"> <div id="TitleArea" class="PopupTitle PopupTitleBorder">
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
document.write( Args().Title ) ; document.write( Args().Title ) ;
// ]]>
</script> </script>
<div id="closeButton" onclick="Cancel();"></div> <div id="closeButton" onclick="Cancel();"></div>
</div> </div>
@@ -772,12 +806,14 @@ document.write( Args().Title ) ;
<div class="cover" id="cover" style="display:none"></div> <div class="cover" id="cover" style="display:none"></div>
<div id="throbberBlock" style="position: absolute; visibility: hidden"></div> <div id="throbberBlock" style="position: absolute; visibility: hidden"></div>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
// Set the class name for language direction. // Set the class name for language direction.
document.body.className += ' ' + langDir ; document.body.className += ' ' + langDir ;
var cover = $( 'cover' ) ; var cover = $( 'cover' ) ;
cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ; cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ;
FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ; FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;
// ]]>
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -29,6 +29,37 @@
<meta http-equiv="Cache-Control" content="public"> <meta http-equiv="Cache-Control" content="public">
<script type="text/javascript"> <script type="text/javascript">
// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
// without security.fileuri.strict_origin_policy disabled.
if ( document.location.protocol == 'file:' )
{
try
{
window.parent.document.domain ;
}
catch ( e )
{
window.addEventListener( 'load', function()
{
document.body.innerHTML = '\
<div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
<p>\
<b>Your browser security settings don\'t allow FCKeditor to be opened from\
the local filesystem.<\/b>\
<\/p>\
<p>\
Please open the <b>about:config<\/b> page and disable the\
&quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\
<\/p>\
<p>\
Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
for more information.\
<\/p>\
<\/div>' ;
}, false ) ;
}
}
// Save a reference to the default domain. // Save a reference to the default domain.
var FCK_ORIGINAL_DOMAIN ; var FCK_ORIGINAL_DOMAIN ;
@@ -134,9 +165,16 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ; FCKConfig_PreProcess() ;
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // Load the full debug script.
var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + 'css/', 'html{min-height:100%}table.FCK__ShowTableBorders,table.FCK__ShowTableBorders td,table.FCK__ShowTableBorders th{border:#d3d3d3 1px solid}form{border:1px dotted #F00;padding:2px}.FCK__Flash{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_flashlogo.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__Anchor{border:1px dotted #00F;background-position:center center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;width:16px;height:15px;vertical-align:middle}.FCK__AnchorC{border:1px dotted #00F;background-position:1px center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}a[name]{border:1px dotted #00F;background-position:0 center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}.FCK__PageBreak{background-position:center center;background-image:url(images/fck_pagebreak.gif);background-repeat:no-repeat;clear:both;display:block;float:none;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;border-right:0;border-left:0;height:5px}.FCK__InputHidden{width:19px;height:18px;background-image:url(images/fck_hiddenfield.gif);background-repeat:no-repeat;vertical-align:text-bottom;background-position:center center}.FCK__ShowBlocks p,.FCK__ShowBlocks div,.FCK__ShowBlocks pre,.FCK__ShowBlocks address,.FCK__ShowBlocks blockquote,.FCK__ShowBlocks h1,.FCK__ShowBlocks h2,.FCK__ShowBlocks h3,.FCK__ShowBlocks h4,.FCK__ShowBlocks h5,.FCK__ShowBlocks h6{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px;padding-left:8px}.FCK__ShowBlocks p{background-image:url(images/block_p.png)}.FCK__ShowBlocks div{background-image:url(images/block_div.png)}.FCK__ShowBlocks pre{background-image:url(images/block_pre.png)}.FCK__ShowBlocks address{background-image:url(images/block_address.png)}.FCK__ShowBlocks blockquote{background-image:url(images/block_blockquote.png)}.FCK__ShowBlocks h1{background-image:url(images/block_h1.png)}.FCK__ShowBlocks h2{background-image:url(images/block_h2.png)}.FCK__ShowBlocks h3{background-image:url(images/block_h3.png)}.FCK__ShowBlocks h4{background-image:url(images/block_h4.png)}.FCK__ShowBlocks h5{background-image:url(images/block_h5.png)}.FCK__ShowBlocks h6{background-image:url(images/block_h6.png)}' ) ; if ( FCKConfig.Debug )
var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + 'css/', 'table:not([border]),table:not([border]) > tr > td,table:not([border]) > tr > th,table:not([border]) > tbody > tr > td,table:not([border]) > tbody > tr > th,table:not([border]) > thead > tr > td,table:not([border]) > thead > tr > th,table:not([border]) > tfoot > tr > td,table:not([border]) > tfoot > tr > th,table[border=\"0\"],table[border=\"0\"] > tr > td,table[border=\"0\"] > tr > th,table[border=\"0\"] > tbody > tr > td,table[border=\"0\"] > tbody > tr > th,table[border=\"0\"] > thead > tr > td,table[border=\"0\"] > thead > tr > th,table[border=\"0\"] > tfoot > tr > td,table[border=\"0\"] > tfoot > tr > th{border:#d3d3d3 1px dotted}' ) ; LoadScript( '_source/internals/fckdebug.js' ) ;
</script>
<script type="text/javascript">
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'html{min-height:100%}table.FCK__ShowTableBorders,table.FCK__ShowTableBorders td,table.FCK__ShowTableBorders th{border:#d3d3d3 1px solid}form{border:1px dotted #F00;padding:2px}.FCK__Flash{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_flashlogo.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__UnknownObject{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_plugin.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__Anchor{border:1px dotted #00F;background-position:center center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;width:16px;height:15px;vertical-align:middle}.FCK__AnchorC{border:1px dotted #00F;background-position:1px center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}a[name]{border:1px dotted #00F;background-position:0 center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}.FCK__PageBreak{background-position:center center;background-image:url(images/fck_pagebreak.gif);background-repeat:no-repeat;clear:both;display:block;float:none;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;border-right:0;border-left:0;height:5px}.FCK__InputHidden{width:19px;height:18px;background-image:url(images/fck_hiddenfield.gif);background-repeat:no-repeat;vertical-align:text-bottom;background-position:center center}.FCK__ShowBlocks p,.FCK__ShowBlocks div,.FCK__ShowBlocks pre,.FCK__ShowBlocks address,.FCK__ShowBlocks blockquote,.FCK__ShowBlocks h1,.FCK__ShowBlocks h2,.FCK__ShowBlocks h3,.FCK__ShowBlocks h4,.FCK__ShowBlocks h5,.FCK__ShowBlocks h6{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px;padding-left:8px}.FCK__ShowBlocks p{background-image:url(images/block_p.png)}.FCK__ShowBlocks div{background-image:url(images/block_div.png)}.FCK__ShowBlocks pre{background-image:url(images/block_pre.png)}.FCK__ShowBlocks address{background-image:url(images/block_address.png)}.FCK__ShowBlocks blockquote{background-image:url(images/block_blockquote.png)}.FCK__ShowBlocks h1{background-image:url(images/block_h1.png)}.FCK__ShowBlocks h2{background-image:url(images/block_h2.png)}.FCK__ShowBlocks h3{background-image:url(images/block_h3.png)}.FCK__ShowBlocks h4{background-image:url(images/block_h4.png)}.FCK__ShowBlocks h5{background-image:url(images/block_h5.png)}.FCK__ShowBlocks h6{background-image:url(images/block_h6.png)}' ) ;
var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'table:not([border]),table:not([border]) > tr > td,table:not([border]) > tr > th,table:not([border]) > tbody > tr > td,table:not([border]) > tbody > tr > th,table:not([border]) > thead > tr > td,table:not([border]) > thead > tr > th,table:not([border]) > tfoot > tr > td,table:not([border]) > tfoot > tr > th,table[border=\"0\"],table[border=\"0\"] > tr > td,table[border=\"0\"] > tr > th,table[border=\"0\"] > tbody > tr > td,table[border=\"0\"] > tbody > tr > th,table[border=\"0\"] > thead > tr > td,table[border=\"0\"] > thead > tr > th,table[border=\"0\"] > tfoot > tr > td,table[border=\"0\"] > tfoot > tr > th{border:#d3d3d3 1px dotted}' ) ;
// Popup the debug window if debug mode is set to true. It guarantees that the // Popup the debug window if debug mode is set to true. It guarantees that the
// first debug message will not be lost. // first debug message will not be lost.
@@ -215,7 +253,8 @@ function WaitForActive( editorInstance, newStatus )
if ( FCKBrowserInfo.IsGecko ) if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCKTools.RunFunction( window.onresize ) ;
_AttachFormSubmitToAPI() ; if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -31,6 +31,37 @@
@Packager.RemoveLine --> @Packager.RemoveLine -->
<script type="text/javascript"> <script type="text/javascript">
// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
// without security.fileuri.strict_origin_policy disabled.
if ( document.location.protocol == 'file:' )
{
try
{
window.parent.document.domain ;
}
catch ( e )
{
window.addEventListener( 'load', function()
{
document.body.innerHTML = '\
<div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
<p>\
<b>Your browser security settings don\'t allow FCKeditor to be opened from\
the local filesystem.<\/b>\
<\/p>\
<p>\
Please open the <b>about:config<\/b> page and disable the\
&quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\
<\/p>\
<p>\
Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
for more information.\
<\/p>\
<\/div>' ;
}, false ) ;
}
}
// Save a reference to the default domain. // Save a reference to the default domain.
var FCK_ORIGINAL_DOMAIN ; var FCK_ORIGINAL_DOMAIN ;
@@ -103,7 +134,7 @@ LoadScript( '_source/internals/fck.js' ) ;
LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ; LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fckconfig.js' ) ; LoadScript( '_source/internals/fckconfig.js' ) ;
LoadScript( '_source/internals/fckdebug.js' ) ; LoadScript( '_source/internals/fckdebug_empty.js' ) ;
LoadScript( '_source/internals/fckdomtools.js' ) ; LoadScript( '_source/internals/fckdomtools.js' ) ;
LoadScript( '_source/internals/fcktools.js' ) ; LoadScript( '_source/internals/fcktools.js' ) ;
LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ; LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
@@ -237,12 +268,19 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ; FCKConfig_PreProcess() ;
var FCK_InternalCSS = FCKConfig.FullBasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine // Load the full debug script.
var FCK_ShowTableBordersCSS = FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine if ( FCKConfig.Debug )
LoadScript( '_source/internals/fckdebug.js' ) ;
</script>
<script type="text/javascript">
var FCK_InternalCSS = FCKConfig.BasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine
var FCK_ShowTableBordersCSS = FCKConfig.BasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine
/* @Packager.RemoveLine /* @Packager.RemoveLine
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + 'css/', 'html{min-height:100%}table.FCK__ShowTableBorders,table.FCK__ShowTableBorders td,table.FCK__ShowTableBorders th{border:#d3d3d3 1px solid}form{border:1px dotted #F00;padding:2px}.FCK__Flash{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_flashlogo.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__Anchor{border:1px dotted #00F;background-position:center center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;width:16px;height:15px;vertical-align:middle}.FCK__AnchorC{border:1px dotted #00F;background-position:1px center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}a[name]{border:1px dotted #00F;background-position:0 center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}.FCK__PageBreak{background-position:center center;background-image:url(images/fck_pagebreak.gif);background-repeat:no-repeat;clear:both;display:block;float:none;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;border-right:0;border-left:0;height:5px}.FCK__InputHidden{width:19px;height:18px;background-image:url(images/fck_hiddenfield.gif);background-repeat:no-repeat;vertical-align:text-bottom;background-position:center center}.FCK__ShowBlocks p,.FCK__ShowBlocks div,.FCK__ShowBlocks pre,.FCK__ShowBlocks address,.FCK__ShowBlocks blockquote,.FCK__ShowBlocks h1,.FCK__ShowBlocks h2,.FCK__ShowBlocks h3,.FCK__ShowBlocks h4,.FCK__ShowBlocks h5,.FCK__ShowBlocks h6{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px;padding-left:8px}.FCK__ShowBlocks p{background-image:url(images/block_p.png)}.FCK__ShowBlocks div{background-image:url(images/block_div.png)}.FCK__ShowBlocks pre{background-image:url(images/block_pre.png)}.FCK__ShowBlocks address{background-image:url(images/block_address.png)}.FCK__ShowBlocks blockquote{background-image:url(images/block_blockquote.png)}.FCK__ShowBlocks h1{background-image:url(images/block_h1.png)}.FCK__ShowBlocks h2{background-image:url(images/block_h2.png)}.FCK__ShowBlocks h3{background-image:url(images/block_h3.png)}.FCK__ShowBlocks h4{background-image:url(images/block_h4.png)}.FCK__ShowBlocks h5{background-image:url(images/block_h5.png)}.FCK__ShowBlocks h6{background-image:url(images/block_h6.png)}' ) ; var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'html{min-height:100%}table.FCK__ShowTableBorders,table.FCK__ShowTableBorders td,table.FCK__ShowTableBorders th{border:#d3d3d3 1px solid}form{border:1px dotted #F00;padding:2px}.FCK__Flash{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_flashlogo.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__UnknownObject{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_plugin.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__Anchor{border:1px dotted #00F;background-position:center center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;width:16px;height:15px;vertical-align:middle}.FCK__AnchorC{border:1px dotted #00F;background-position:1px center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}a[name]{border:1px dotted #00F;background-position:0 center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}.FCK__PageBreak{background-position:center center;background-image:url(images/fck_pagebreak.gif);background-repeat:no-repeat;clear:both;display:block;float:none;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;border-right:0;border-left:0;height:5px}.FCK__InputHidden{width:19px;height:18px;background-image:url(images/fck_hiddenfield.gif);background-repeat:no-repeat;vertical-align:text-bottom;background-position:center center}.FCK__ShowBlocks p,.FCK__ShowBlocks div,.FCK__ShowBlocks pre,.FCK__ShowBlocks address,.FCK__ShowBlocks blockquote,.FCK__ShowBlocks h1,.FCK__ShowBlocks h2,.FCK__ShowBlocks h3,.FCK__ShowBlocks h4,.FCK__ShowBlocks h5,.FCK__ShowBlocks h6{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px;padding-left:8px}.FCK__ShowBlocks p{background-image:url(images/block_p.png)}.FCK__ShowBlocks div{background-image:url(images/block_div.png)}.FCK__ShowBlocks pre{background-image:url(images/block_pre.png)}.FCK__ShowBlocks address{background-image:url(images/block_address.png)}.FCK__ShowBlocks blockquote{background-image:url(images/block_blockquote.png)}.FCK__ShowBlocks h1{background-image:url(images/block_h1.png)}.FCK__ShowBlocks h2{background-image:url(images/block_h2.png)}.FCK__ShowBlocks h3{background-image:url(images/block_h3.png)}.FCK__ShowBlocks h4{background-image:url(images/block_h4.png)}.FCK__ShowBlocks h5{background-image:url(images/block_h5.png)}.FCK__ShowBlocks h6{background-image:url(images/block_h6.png)}' ) ;
var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + 'css/', 'table:not([border]),table:not([border]) > tr > td,table:not([border]) > tr > th,table:not([border]) > tbody > tr > td,table:not([border]) > tbody > tr > th,table:not([border]) > thead > tr > td,table:not([border]) > thead > tr > th,table:not([border]) > tfoot > tr > td,table:not([border]) > tfoot > tr > th,table[border=\"0\"],table[border=\"0\"] > tr > td,table[border=\"0\"] > tr > th,table[border=\"0\"] > tbody > tr > td,table[border=\"0\"] > tbody > tr > th,table[border=\"0\"] > thead > tr > td,table[border=\"0\"] > thead > tr > th,table[border=\"0\"] > tfoot > tr > td,table[border=\"0\"] > tfoot > tr > th{border:#d3d3d3 1px dotted}' ) ; var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'table:not([border]),table:not([border]) > tr > td,table:not([border]) > tr > th,table:not([border]) > tbody > tr > td,table:not([border]) > tbody > tr > th,table:not([border]) > thead > tr > td,table:not([border]) > thead > tr > th,table:not([border]) > tfoot > tr > td,table:not([border]) > tfoot > tr > th,table[border=\"0\"],table[border=\"0\"] > tr > td,table[border=\"0\"] > tr > th,table[border=\"0\"] > tbody > tr > td,table[border=\"0\"] > tbody > tr > th,table[border=\"0\"] > thead > tr > td,table[border=\"0\"] > thead > tr > th,table[border=\"0\"] > tfoot > tr > td,table[border=\"0\"] > tfoot > tr > th{border:#d3d3d3 1px dotted}' ) ;
@Packager.RemoveLine */ @Packager.RemoveLine */
// Popup the debug window if debug mode is set to true. It guarantees that the // Popup the debug window if debug mode is set to true. It guarantees that the
@@ -322,7 +360,8 @@ function WaitForActive( editorInstance, newStatus )
if ( FCKBrowserInfo.IsGecko ) if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCKTools.RunFunction( window.onresize ) ;
_AttachFormSubmitToAPI() ; if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -23,28 +23,25 @@
body body
{ {
background-color: #f1f1f1; background-color: #f1f1e3;
margin-top:0;
margin-bottom:0;
} }
form form
{ {
margin: 0px 0px 0px 0px ; margin: 0;
padding: 0px 0px 0px 0px ; padding: 0;
} }
.Frame .Frame
{ {
background-color: #f1f1f1; background-color: #f1f1e3;
border-color: #f1f1f1; border: thin inset #f1f1e3;
border-right: thin inset;
border-top: thin inset;
border-left: thin inset;
border-bottom: thin inset;
} }
body.FileArea body.FileArea
{ {
background-color: #ffffff; background-color: #ffffff;
margin: 10px; margin: 10px;
} }
@@ -70,12 +67,9 @@ body, td, input, select
.Button, button .Button, button
{ {
border-right: #737357 1px solid;
border-top: #737357 1px solid;
border-left: #737357 1px solid;
color: #3b3b1f; color: #3b3b1f;
border-bottom: #737357 1px solid; border: #737357 1px solid;
background-color: #bfbfbf; background-color: #c7c78f;
} }
.FolderListCurrentFolder img .FolderListCurrentFolder img
@@ -87,3 +81,7 @@ body, td, input, select
{ {
background-image: url(images/Folder.gif); background-image: url(images/Folder.gif);
} }
.fullHeight {
height: 100%;
}

View File

@@ -1,7 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!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 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -27,7 +28,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/fckxml.js"></script> <script type="text/javascript" src="js/fckxml.js"></script>
<script language="javascript"> <script type="text/javascript">
// Automatically detect the correct document.domain (#1919). // Automatically detect the correct document.domain (#1919).
(function() (function()
{ {
@@ -41,7 +42,8 @@
var test = window.opener.document.domain ; var test = window.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -23,6 +23,7 @@
--> -->
<html> <html>
<head> <head>
<title>Folder path</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript"> <script type="text/javascript">
@@ -39,7 +40,8 @@
var test = window.top.opener.document.domain ; var test = window.top.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;
@@ -58,12 +60,6 @@
} }
})() ; })() ;
function OnResize()
{
divName.style.width = "1px" ;
divName.style.width = tdName.offsetWidth + "px" ;
}
function SetCurrentFolder( resourceType, folderPath ) function SetCurrentFolder( resourceType, folderPath )
{ {
document.getElementById('tdName').innerHTML = folderPath ; document.getElementById('tdName').innerHTML = folderPath ;
@@ -76,8 +72,8 @@ window.onload = function()
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td> <td>
<button style="WIDTH: 100%" type="button"> <button style="WIDTH: 100%" type="button">
@@ -87,7 +83,7 @@ window.onload = function()
<td>&nbsp;</td> <td>&nbsp;</td>
<td id="tdName" width="100%" nowrap class="ActualFolder">/</td> <td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><img height="8" src="images/ButtonArrow.gif" width="12"></td> <td><img height="8" src="images/ButtonArrow.gif" width="12" alt=""></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</table> </table>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -23,10 +23,11 @@
--> -->
<html> <html>
<head> <head>
<title>Create Folder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
function SetCurrentFolder( resourceType, folderPath ) function SetCurrentFolder( resourceType, folderPath )
{ {
@@ -93,8 +94,8 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td> <td>
<button type="button" style="WIDTH: 100%" onclick="CreateFolder();"> <button type="button" style="WIDTH: 100%" onclick="CreateFolder();">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -24,10 +24,11 @@
--> -->
<html> <html>
<head> <head>
<title>Folders</title>
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
var sActiveFolder ; var sActiveFolder ;
@@ -66,12 +67,12 @@ oListManager.AddItem = function( folderName, folderPath )
// Add the folder icon cell. // Add the folder icon cell.
var oCell = oRow.insertCell(-1) ; var oCell = oRow.insertCell(-1) ;
oCell.width = 16 ; oCell.width = 16 ;
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ; oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"><\/a>' ;
// Add the folder name cell. // Add the folder name cell.
oCell = oRow.insertCell(-1) ; oCell = oRow.insertCell(-1) ;
oCell.noWrap = true ; oCell.noWrap = true ;
oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ; oCell.innerHTML = '&nbsp;' + sLink + folderName + '<\/a>' ;
this.TableRows[ folderPath ] = oRow ; this.TableRows[ folderPath ] = oRow ;
} }
@@ -186,7 +187,7 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10"> <body class="FileArea">
<table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr id="trUp" style="DISPLAY: none"> <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 width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -21,9 +21,10 @@
* *
* This page shows all resources available in a folder in the File Browser. * This page shows all resources available in a folder in the File Browser.
--> -->
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<link href="browser.css" type="text/css" rel="stylesheet" /> <title>Resources</title>
<link href="browser.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -23,10 +23,11 @@
--> -->
<html> <html>
<head> <head>
<title>Available types</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
function SetResourceType( type ) function SetResourceType( type )
{ {
@@ -42,21 +43,24 @@ var aTypes = [
window.onload = function() window.onload = function()
{ {
var oCombo = document.getElementById('cmbType') ;
oCombo.innerHTML = '' ;
for ( var i = 0 ; i < aTypes.length ; i++ ) for ( var i = 0 ; i < aTypes.length ; i++ )
{ {
if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType ) if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType )
AddSelectOption( document.getElementById('cmbType'), aTypes[i][1], aTypes[i][0] ) ; AddSelectOption( oCombo, aTypes[i][1], aTypes[i][0] ) ;
} }
} }
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td nowrap> <td nowrap>
Resource Type<BR> Resource Type<BR>
<select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);"> <select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
<option>&nbsp;
</select> </select>
</td> </td>
</tr> </tr>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -21,11 +21,11 @@
* *
* Page used to upload new files in the current folder. * Page used to upload new files in the current folder.
--> -->
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<title>File Upload</title> <title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet" /> <link href="browser.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">
@@ -95,9 +95,9 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body bottommargin="0" topmargin="0"> <body>
<form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();"> <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0"> <table class="fullHeight" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr> <tr>
<td nowrap="nowrap"> <td nowrap="nowrap">
<span id="eUploadMessage">Upload a new file in this folder</span><br> <span id="eUploadMessage">Upload a new file in this folder</span><br>

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -35,7 +35,8 @@
var test = window.top.opener.document.domain ; var test = window.top.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

@@ -1,6 +1,6 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -61,7 +61,25 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{ {
if ( oXmlHttp.readyState == 4 ) if ( oXmlHttp.readyState == 4 )
{ {
if ( ( oXmlHttp.status != 200 && oXmlHttp.status != 304 ) || oXmlHttp.responseXML == null || oXmlHttp.responseXML.firstChild == null ) 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' + 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' + 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
@@ -70,7 +88,7 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
return ; return ;
} }
oFCKXml.DOMDocument = oXmlHttp.responseXML ; oFCKXml.DOMDocument = oXml ;
asyncFunctionPointer( oFCKXml ) ; asyncFunctionPointer( oFCKXml ) ;
} }
} }

View File

@@ -1,62 +1,63 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This file include the functions that create the base XML output. ' This file include the functions that create the base XML output.
%> %>
<% <%
Sub SetXmlHeaders() Sub SetXmlHeaders()
' Cleans the response buffer. ' Cleans the response buffer.
Response.Clear() Response.Clear()
' Prevent the browser from caching the result. ' Prevent the browser from caching the result.
Response.CacheControl = "no-cache" Response.CacheControl = "no-cache"
' Set the response format. ' Set the response format.
Response.CharSet = "UTF-8" Response.CodePage = 65001
Response.ContentType = "text/xml" Response.CharSet = "UTF-8"
End Sub Response.ContentType = "text/xml"
End Sub
Sub CreateXmlHeader( command, resourceType, currentFolder, url )
' Create the XML document header. Sub CreateXmlHeader( command, resourceType, currentFolder, url )
Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>" ' Create the XML document header.
Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
' Create the main "Connector" node.
Response.Write "<Connector command=""" & command & """ resourceType=""" & resourceType & """>" ' Create the main "Connector" node.
Response.Write "<Connector command=""" & command & """ resourceType=""" & resourceType & """>"
' Add the current folder node.
Response.Write "<CurrentFolder path=""" & ConvertToXmlAttribute( currentFolder ) & """ url=""" & ConvertToXmlAttribute( url ) & """ />" ' Add the current folder node.
End Sub Response.Write "<CurrentFolder path=""" & ConvertToXmlAttribute( currentFolder ) & """ url=""" & ConvertToXmlAttribute( url ) & """ />"
End Sub
Sub CreateXmlFooter()
Response.Write "</Connector>" Sub CreateXmlFooter()
End Sub Response.Write "</Connector>"
End Sub
Sub SendError( number, text )
SetXmlHeaders Sub SendError( number, text )
SetXmlHeaders
' Create the XML document header.
Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>" ' Create the XML document header.
Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
Response.Write "<Connector><Error number=""" & number & """ text=""" & Server.HTMLEncode( text ) & """ /></Connector>"
Response.Write "<Connector><Error number=""" & number & """ text=""" & Server.HTMLEncode( text ) & """ /></Connector>"
Response.End
End Sub Response.End
%> End Sub
%>

View File

@@ -1,353 +1,353 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' These are the classes used to handle ASP upload without using third ' These are the classes used to handle ASP upload without using third
' part components (OCX/DLL). ' part components (OCX/DLL).
%> %>
<% <%
'********************************************** '**********************************************
' File: NetRube_Upload.asp ' File: NetRube_Upload.asp
' Version: NetRube Upload Class Version 2.3 Build 20070528 ' Version: NetRube Upload Class Version 2.3 Build 20070528
' Author: NetRube ' Author: NetRube
' Email: NetRube@126.com ' Email: NetRube@126.com
' Date: 05/28/2007 ' Date: 05/28/2007
' Comments: The code for the Upload. ' Comments: The code for the Upload.
' This can free usage, but please ' This can free usage, but please
' not to delete this copyright information. ' not to delete this copyright information.
' If you have a modification version, ' If you have a modification version,
' Please send out a duplicate to me. ' Please send out a duplicate to me.
'********************************************** '**********************************************
' 文件名: NetRube_Upload.asp ' 文件名: NetRube_Upload.asp
' 版本: NetRube Upload Class Version 2.3 Build 20070528 ' 版本: NetRube Upload Class Version 2.3 Build 20070528
' 作者: NetRube(网络乡巴佬) ' 作者: NetRube(网络乡巴佬)
' 电子邮件: NetRube@126.com ' 电子邮件: NetRube@126.com
' 日期: 2007年05月28日 ' 日期: 2007年05月28日
' 声明: 文件上传类 ' 声明: 文件上传类
' 本上传类可以自由使用,但请保留此版权声明信息 ' 本上传类可以自由使用,但请保留此版权声明信息
' 如果您对本上传类进行修改增强, ' 如果您对本上传类进行修改增强,
' 请发送一份给俺。 ' 请发送一份给俺。
'********************************************** '**********************************************
Class NetRube_Upload Class NetRube_Upload
Public File, Form Public File, Form
Private oSourceData Private oSourceData
Private nMaxSize, nErr, sAllowed, sDenied, sHtmlExtensions Private nMaxSize, nErr, sAllowed, sDenied, sHtmlExtensions
Private Sub Class_Initialize Private Sub Class_Initialize
nErr = 0 nErr = 0
nMaxSize = 1048576 nMaxSize = 1048576
Set File = Server.CreateObject("Scripting.Dictionary") Set File = Server.CreateObject("Scripting.Dictionary")
File.CompareMode = 1 File.CompareMode = 1
Set Form = Server.CreateObject("Scripting.Dictionary") Set Form = Server.CreateObject("Scripting.Dictionary")
Form.CompareMode = 1 Form.CompareMode = 1
Set oSourceData = Server.CreateObject("ADODB.Stream") Set oSourceData = Server.CreateObject("ADODB.Stream")
oSourceData.Type = 1 oSourceData.Type = 1
oSourceData.Mode = 3 oSourceData.Mode = 3
oSourceData.Open oSourceData.Open
End Sub End Sub
Private Sub Class_Terminate Private Sub Class_Terminate
Form.RemoveAll Form.RemoveAll
Set Form = Nothing Set Form = Nothing
File.RemoveAll File.RemoveAll
Set File = Nothing Set File = Nothing
oSourceData.Close oSourceData.Close
Set oSourceData = Nothing Set oSourceData = Nothing
End Sub End Sub
Public Property Get Version Public Property Get Version
Version = "NetRube Upload Class Version 2.3 Build 20070528" Version = "NetRube Upload Class Version 2.3 Build 20070528"
End Property End Property
Public Property Get ErrNum Public Property Get ErrNum
ErrNum = nErr ErrNum = nErr
End Property End Property
Public Property Let MaxSize(nSize) Public Property Let MaxSize(nSize)
nMaxSize = nSize nMaxSize = nSize
End Property End Property
Public Property Let Allowed(sExt) Public Property Let Allowed(sExt)
sAllowed = sExt sAllowed = sExt
End Property End Property
Public Property Let Denied(sExt) Public Property Let Denied(sExt)
sDenied = sExt sDenied = sExt
End Property End Property
Public Property Let HtmlExtensions(sExt) Public Property Let HtmlExtensions(sExt)
sHtmlExtensions = sExt sHtmlExtensions = sExt
End Property End Property
Public Sub GetData Public Sub GetData
Dim aCType Dim aCType
aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";") aCType = Split(Request.ServerVariables("HTTP_CONTENT_TYPE"), ";")
if ( uBound(aCType) < 0 ) then if ( uBound(aCType) < 0 ) then
nErr = 1 nErr = 1
Exit Sub Exit Sub
end if end if
If aCType(0) <> "multipart/form-data" Then If aCType(0) <> "multipart/form-data" Then
nErr = 1 nErr = 1
Exit Sub Exit Sub
End If End If
Dim nTotalSize Dim nTotalSize
nTotalSize = Request.TotalBytes nTotalSize = Request.TotalBytes
If nTotalSize < 1 Then If nTotalSize < 1 Then
nErr = 2 nErr = 2
Exit Sub Exit Sub
End If End If
If nMaxSize > 0 And nTotalSize > nMaxSize Then If nMaxSize > 0 And nTotalSize > nMaxSize Then
nErr = 3 nErr = 3
Exit Sub Exit Sub
End If End If
'Thankful long(yrl031715@163.com) 'Thankful long(yrl031715@163.com)
'Fix upload large file. 'Fix upload large file.
'********************************************** '**********************************************
' 修正作者long ' 修正作者long
' 联系邮件: yrl031715@163.com ' 联系邮件: yrl031715@163.com
' 修正时间2007年5月6日 ' 修正时间2007年5月6日
' 修正说明由于iis6的Content-Length 头信息中包含的请求长度超过了 AspMaxRequestEntityAllowed 的值默认200K, IIS 将返回一个 403 错误信息. ' 修正说明由于iis6的Content-Length 头信息中包含的请求长度超过了 AspMaxRequestEntityAllowed 的值默认200K, IIS 将返回一个 403 错误信息.
' 直接导致在iis6下调试FCKeditor上传功能时一旦文件超过200K,上传文件时文件管理器失去响应,受此影响,文件的快速上传功能也存在在缺陷。 ' 直接导致在iis6下调试FCKeditor上传功能时一旦文件超过200K,上传文件时文件管理器失去响应,受此影响,文件的快速上传功能也存在在缺陷。
' 在参考 宝玉 的 Asp无组件上传带进度条 演示程序后作出如下修改以修正在iis6下的错误。 ' 在参考 宝玉 的 Asp无组件上传带进度条 演示程序后作出如下修改以修正在iis6下的错误。
Dim nTotalBytes, nPartBytes, ReadBytes Dim nTotalBytes, nPartBytes, ReadBytes
ReadBytes = 0 ReadBytes = 0
nTotalBytes = Request.TotalBytes nTotalBytes = Request.TotalBytes
'循环分块读取 '循环分块读取
Do While ReadBytes < nTotalBytes Do While ReadBytes < nTotalBytes
'分块读取 '分块读取
nPartBytes = 64 * 1024 '分成每块64k nPartBytes = 64 * 1024 '分成每块64k
If nPartBytes + ReadBytes > nTotalBytes Then If nPartBytes + ReadBytes > nTotalBytes Then
nPartBytes = nTotalBytes - ReadBytes nPartBytes = nTotalBytes - ReadBytes
End If End If
oSourceData.Write Request.BinaryRead(nPartBytes) oSourceData.Write Request.BinaryRead(nPartBytes)
ReadBytes = ReadBytes + nPartBytes ReadBytes = ReadBytes + nPartBytes
Loop Loop
'********************************************** '**********************************************
oSourceData.Position = 0 oSourceData.Position = 0
Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary Dim oTotalData, oFormStream, sFormHeader, sFormName, bCrLf, nBoundLen, nFormStart, nFormEnd, nPosStart, nPosEnd, sBoundary
oTotalData = oSourceData.Read oTotalData = oSourceData.Read
bCrLf = ChrB(13) & ChrB(10) bCrLf = ChrB(13) & ChrB(10)
sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1) sBoundary = MidB(oTotalData, 1, InStrB(1, oTotalData, bCrLf) - 1)
nBoundLen = LenB(sBoundary) + 2 nBoundLen = LenB(sBoundary) + 2
nFormStart = nBoundLen nFormStart = nBoundLen
Set oFormStream = Server.CreateObject("ADODB.Stream") Set oFormStream = Server.CreateObject("ADODB.Stream")
Do While (nFormStart + 2) < nTotalSize Do While (nFormStart + 2) < nTotalSize
nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3 nFormEnd = InStrB(nFormStart, oTotalData, bCrLf & bCrLf) + 3
With oFormStream With oFormStream
.Type = 1 .Type = 1
.Mode = 3 .Mode = 3
.Open .Open
oSourceData.Position = nFormStart oSourceData.Position = nFormStart
oSourceData.CopyTo oFormStream, nFormEnd - nFormStart oSourceData.CopyTo oFormStream, nFormEnd - nFormStart
.Position = 0 .Position = 0
.Type = 2 .Type = 2
.CharSet = "UTF-8" .CharSet = "UTF-8"
sFormHeader = .ReadText sFormHeader = .ReadText
.Close .Close
End With End With
nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1 nFormStart = InStrB(nFormEnd, oTotalData, sBoundary) - 1
nPosStart = InStr(22, sFormHeader, " name=", 1) + 7 nPosStart = InStr(22, sFormHeader, " name=", 1) + 7
nPosEnd = InStr(nPosStart, sFormHeader, """") nPosEnd = InStr(nPosStart, sFormHeader, """")
sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) sFormName = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
If InStr(45, sFormHeader, " filename=", 1) > 0 Then If InStr(45, sFormHeader, " filename=", 1) > 0 Then
Set File(sFormName) = New NetRube_FileInfo Set File(sFormName) = New NetRube_FileInfo
File(sFormName).FormName = sFormName File(sFormName).FormName = sFormName
File(sFormName).Start = nFormEnd File(sFormName).Start = nFormEnd
File(sFormName).Size = nFormStart - nFormEnd - 2 File(sFormName).Size = nFormStart - nFormEnd - 2
nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11 nPosStart = InStr(nPosEnd, sFormHeader, " filename=", 1) + 11
nPosEnd = InStr(nPosStart, sFormHeader, """") nPosEnd = InStr(nPosStart, sFormHeader, """")
File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) File(sFormName).ClientPath = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1) File(sFormName).Name = Mid(File(sFormName).ClientPath, InStrRev(File(sFormName).ClientPath, "\") + 1)
File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1)) File(sFormName).Ext = LCase(Mid(File(sFormName).Name, InStrRev(File(sFormName).Name, ".") + 1))
nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14 nPosStart = InStr(nPosEnd, sFormHeader, "Content-Type: ", 1) + 14
nPosEnd = InStr(nPosStart, sFormHeader, vbCr) nPosEnd = InStr(nPosStart, sFormHeader, vbCr)
File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart) File(sFormName).MIME = Mid(sFormHeader, nPosStart, nPosEnd - nPosStart)
Else Else
With oFormStream With oFormStream
.Type = 1 .Type = 1
.Mode = 3 .Mode = 3
.Open .Open
oSourceData.Position = nFormEnd oSourceData.Position = nFormEnd
oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2 oSourceData.CopyTo oFormStream, nFormStart - nFormEnd - 2
.Position = 0 .Position = 0
.Type = 2 .Type = 2
.CharSet = "UTF-8" .CharSet = "UTF-8"
Form(sFormName) = .ReadText Form(sFormName) = .ReadText
.Close .Close
End With End With
End If End If
nFormStart = nFormStart + nBoundLen nFormStart = nFormStart + nBoundLen
Loop Loop
oTotalData = "" oTotalData = ""
Set oFormStream = Nothing Set oFormStream = Nothing
End Sub End Sub
Public Sub SaveAs(sItem, sFileName) Public Sub SaveAs(sItem, sFileName)
If File(sItem).Size < 1 Then If File(sItem).Size < 1 Then
nErr = 2 nErr = 2
Exit Sub Exit Sub
End If End If
If Not IsAllowed(File(sItem).Ext) Then If Not IsAllowed(File(sItem).Ext) Then
nErr = 4 nErr = 4
Exit Sub Exit Sub
End If End If
If InStr( LCase( sFileName ), "::$data" ) > 0 Then If InStr( LCase( sFileName ), "::$data" ) > 0 Then
nErr = 4 nErr = 4
Exit Sub Exit Sub
End If End If
Dim sFileExt, iFileSize Dim sFileExt, iFileSize
sFileExt = File(sItem).Ext sFileExt = File(sItem).Ext
iFileSize = File(sItem).Size iFileSize = File(sItem).Size
' Check XSS. ' Check XSS.
If Not IsHtmlExtension( sFileExt ) Then If Not IsHtmlExtension( sFileExt ) Then
' Calculate the size of data to load (max 1Kb). ' Calculate the size of data to load (max 1Kb).
Dim iXSSSize Dim iXSSSize
iXSSSize = iFileSize iXSSSize = iFileSize
If iXSSSize > 1024 Then If iXSSSize > 1024 Then
iXSSSize = 1024 iXSSSize = 1024
End If End If
' Read the data. ' Read the data.
Dim sData Dim sData
oSourceData.Position = File(sItem).Start oSourceData.Position = File(sItem).Start
sData = oSourceData.Read( iXSSSize ) ' Byte Array sData = oSourceData.Read( iXSSSize ) ' Byte Array
sData = ByteArray2Text( sData ) ' String sData = ByteArray2Text( sData ) ' String
' Sniff HTML data. ' Sniff HTML data.
If SniffHtml( sData ) Then If SniffHtml( sData ) Then
nErr = 4 nErr = 4
Exit Sub Exit Sub
End If End If
End If End If
Dim oFileStream Dim oFileStream
Set oFileStream = Server.CreateObject("ADODB.Stream") Set oFileStream = Server.CreateObject("ADODB.Stream")
With oFileStream With oFileStream
.Type = 1 .Type = 1
.Mode = 3 .Mode = 3
.Open .Open
oSourceData.Position = File(sItem).Start oSourceData.Position = File(sItem).Start
oSourceData.CopyTo oFileStream, File(sItem).Size oSourceData.CopyTo oFileStream, File(sItem).Size
.Position = 0 .Position = 0
.SaveToFile sFileName, 2 .SaveToFile sFileName, 2
.Close .Close
End With End With
Set oFileStream = Nothing Set oFileStream = Nothing
End Sub End Sub
Private Function IsAllowed(sExt) Private Function IsAllowed(sExt)
Dim oRE Dim oRE
Set oRE = New RegExp Set oRE = New RegExp
oRE.IgnoreCase = True oRE.IgnoreCase = True
oRE.Global = True oRE.Global = True
If sDenied = "" Then If sDenied = "" Then
oRE.Pattern = sAllowed oRE.Pattern = sAllowed
IsAllowed = (sAllowed = "") Or oRE.Test(sExt) IsAllowed = (sAllowed = "") Or oRE.Test(sExt)
Else Else
oRE.Pattern = sDenied oRE.Pattern = sDenied
IsAllowed = Not oRE.Test(sExt) IsAllowed = Not oRE.Test(sExt)
End If End If
Set oRE = Nothing Set oRE = Nothing
End Function End Function
Private Function IsHtmlExtension( sExt ) Private Function IsHtmlExtension( sExt )
If sHtmlExtensions = "" Then If sHtmlExtensions = "" Then
Exit Function Exit Function
End If End If
Dim oRE Dim oRE
Set oRE = New RegExp Set oRE = New RegExp
oRE.IgnoreCase = True oRE.IgnoreCase = True
oRE.Global = True oRE.Global = True
oRE.Pattern = sHtmlExtensions oRE.Pattern = sHtmlExtensions
IsHtmlExtension = oRE.Test(sExt) IsHtmlExtension = oRE.Test(sExt)
Set oRE = Nothing Set oRE = Nothing
End Function End Function
Private Function SniffHtml( sData ) Private Function SniffHtml( sData )
Dim oRE Dim oRE
Set oRE = New RegExp Set oRE = New RegExp
oRE.IgnoreCase = True oRE.IgnoreCase = True
oRE.Global = True oRE.Global = True
Dim aPatterns Dim aPatterns
aPatterns = Array( "<!DOCTYPE\W*X?HTML", "<(body|head|html|img|pre|script|table|title)", "type\s*=\s*[\'""]?\s*(?:\w*/)?(?:ecma|java)", "(?:href|src|data)\s*=\s*[\'""]?\s*(?:ecma|java)script:", "url\s*\(\s*[\'""]?\s*(?:ecma|java)script:" ) aPatterns = Array( "<!DOCTYPE\W*X?HTML", "<(body|head|html|img|pre|script|table|title)", "type\s*=\s*[\'""]?\s*(?:\w*/)?(?:ecma|java)", "(?:href|src|data)\s*=\s*[\'""]?\s*(?:ecma|java)script:", "url\s*\(\s*[\'""]?\s*(?:ecma|java)script:" )
Dim i Dim i
For i = 0 to UBound( aPatterns ) For i = 0 to UBound( aPatterns )
oRE.Pattern = aPatterns( i ) oRE.Pattern = aPatterns( i )
If oRE.Test( sData ) Then If oRE.Test( sData ) Then
SniffHtml = True SniffHtml = True
Exit Function Exit Function
End If End If
Next Next
SniffHtml = False SniffHtml = False
End Function End Function
' Thanks to http://www.ericphelps.com/q193998/index.htm ' Thanks to http://www.ericphelps.com/q193998/index.htm
Private Function ByteArray2Text(varByteArray) Private Function ByteArray2Text(varByteArray)
Dim strData, strBuffer, lngCounter Dim strData, strBuffer, lngCounter
strData = "" strData = ""
strBuffer = "" strBuffer = ""
For lngCounter = 0 to UBound(varByteArray) For lngCounter = 0 to UBound(varByteArray)
strBuffer = strBuffer & Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1))) strBuffer = strBuffer & Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1)))
'Keep strBuffer at 1k bytes maximum 'Keep strBuffer at 1k bytes maximum
If lngCounter Mod 1024 = 0 Then If lngCounter Mod 1024 = 0 Then
strData = strData & strBuffer strData = strData & strBuffer
strBuffer = "" strBuffer = ""
End If End If
Next Next
ByteArray2Text = strData & strBuffer ByteArray2Text = strData & strBuffer
End Function End Function
End Class End Class
Class NetRube_FileInfo Class NetRube_FileInfo
Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start Dim FormName, ClientPath, Path, Name, Ext, Content, Size, MIME, Start
End Class End Class
%> %>

View File

@@ -1,198 +1,198 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This file include the functions that handle the Command requests ' This file include the functions that handle the Command requests
' in the ASP Connector. ' in the ASP Connector.
%> %>
<% <%
Sub GetFolders( resourceType, currentFolder ) Sub GetFolders( resourceType, currentFolder )
' Map the virtual path to the local server path. ' Map the virtual path to the local server path.
Dim sServerDir Dim sServerDir
sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFolders" ) sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFolders" )
' Open the "Folders" node. ' Open the "Folders" node.
Response.Write "<Folders>" Response.Write "<Folders>"
Dim oFSO, oCurrentFolder, oFolders, oFolder Dim oFSO, oCurrentFolder, oFolders, oFolder
Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
if not (oFSO.FolderExists( sServerDir ) ) then if not (oFSO.FolderExists( sServerDir ) ) then
Set oFSO = Nothing Set oFSO = Nothing
SendError 102, currentFolder SendError 102, currentFolder
end if end if
Set oCurrentFolder = oFSO.GetFolder( sServerDir ) Set oCurrentFolder = oFSO.GetFolder( sServerDir )
Set oFolders = oCurrentFolder.SubFolders Set oFolders = oCurrentFolder.SubFolders
For Each oFolder in oFolders For Each oFolder in oFolders
Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />" Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />"
Next Next
Set oFSO = Nothing Set oFSO = Nothing
' Close the "Folders" node. ' Close the "Folders" node.
Response.Write "</Folders>" Response.Write "</Folders>"
End Sub End Sub
Sub GetFoldersAndFiles( resourceType, currentFolder ) Sub GetFoldersAndFiles( resourceType, currentFolder )
' Map the virtual path to the local server path. ' Map the virtual path to the local server path.
Dim sServerDir Dim sServerDir
sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFoldersAndFiles" ) sServerDir = ServerMapFolder( resourceType, currentFolder, "GetFoldersAndFiles" )
Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile Dim oFSO, oCurrentFolder, oFolders, oFolder, oFiles, oFile
Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
if not (oFSO.FolderExists( sServerDir ) ) then if not (oFSO.FolderExists( sServerDir ) ) then
Set oFSO = Nothing Set oFSO = Nothing
SendError 102, currentFolder SendError 102, currentFolder
end if end if
Set oCurrentFolder = oFSO.GetFolder( sServerDir ) Set oCurrentFolder = oFSO.GetFolder( sServerDir )
Set oFolders = oCurrentFolder.SubFolders Set oFolders = oCurrentFolder.SubFolders
Set oFiles = oCurrentFolder.Files Set oFiles = oCurrentFolder.Files
' Open the "Folders" node. ' Open the "Folders" node.
Response.Write "<Folders>" Response.Write "<Folders>"
For Each oFolder in oFolders For Each oFolder in oFolders
Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />" Response.Write "<Folder name=""" & ConvertToXmlAttribute( oFolder.name ) & """ />"
Next Next
' Close the "Folders" node. ' Close the "Folders" node.
Response.Write "</Folders>" Response.Write "</Folders>"
' Open the "Files" node. ' Open the "Files" node.
Response.Write "<Files>" Response.Write "<Files>"
For Each oFile in oFiles For Each oFile in oFiles
Dim iFileSize Dim iFileSize
iFileSize = Round( oFile.size / 1024 ) iFileSize = Round( oFile.size / 1024 )
If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1 If ( iFileSize < 1 AND oFile.size <> 0 ) Then iFileSize = 1
Response.Write "<File name=""" & ConvertToXmlAttribute( oFile.name ) & """ size=""" & iFileSize & """ />" Response.Write "<File name=""" & ConvertToXmlAttribute( oFile.name ) & """ size=""" & iFileSize & """ />"
Next Next
' Close the "Files" node. ' Close the "Files" node.
Response.Write "</Files>" Response.Write "</Files>"
End Sub End Sub
Sub CreateFolder( resourceType, currentFolder ) Sub CreateFolder( resourceType, currentFolder )
Dim sErrorNumber Dim sErrorNumber
Dim sNewFolderName Dim sNewFolderName
sNewFolderName = Request.QueryString( "NewFolderName" ) sNewFolderName = Request.QueryString( "NewFolderName" )
sNewFolderName = SanitizeFolderName( sNewFolderName ) sNewFolderName = SanitizeFolderName( sNewFolderName )
If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0 ) Then If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0 ) Then
sErrorNumber = "102" sErrorNumber = "102"
Else Else
' Map the virtual path to the local server path of the current folder. ' Map the virtual path to the local server path of the current folder.
Dim sServerDir Dim sServerDir
sServerDir = ServerMapFolder( resourceType, CombinePaths(currentFolder, sNewFolderName), "CreateFolder" ) sServerDir = ServerMapFolder( resourceType, CombineLocalPaths(currentFolder, sNewFolderName), "CreateFolder" )
On Error Resume Next On Error Resume Next
CreateServerFolder sServerDir CreateServerFolder sServerDir
Dim iErrNumber, sErrDescription Dim iErrNumber, sErrDescription
iErrNumber = err.number iErrNumber = err.number
sErrDescription = err.Description sErrDescription = err.Description
On Error Goto 0 On Error Goto 0
Select Case iErrNumber Select Case iErrNumber
Case 0 Case 0
sErrorNumber = "0" sErrorNumber = "0"
Case 52 Case 52
sErrorNumber = "102" ' Invalid Folder Name. sErrorNumber = "102" ' Invalid Folder Name.
Case 70 Case 70
sErrorNumber = "103" ' Security Error. sErrorNumber = "103" ' Security Error.
Case 76 Case 76
sErrorNumber = "102" ' Path too long. sErrorNumber = "102" ' Path too long.
Case Else Case Else
sErrorNumber = "110" sErrorNumber = "110"
End Select End Select
End If End If
' Create the "Error" node. ' Create the "Error" node.
Response.Write "<Error number=""" & sErrorNumber & """ originalNumber=""" & iErrNumber & """ originalDescription=""" & ConvertToXmlAttribute( sErrDescription ) & """ />" Response.Write "<Error number=""" & sErrorNumber & """ originalNumber=""" & iErrNumber & """ originalDescription=""" & ConvertToXmlAttribute( sErrDescription ) & """ />"
End Sub End Sub
Sub FileUpload( resourceType, currentFolder, sCommand ) Sub FileUpload( resourceType, currentFolder, sCommand )
Dim oUploader Dim oUploader
Set oUploader = New NetRube_Upload Set oUploader = New NetRube_Upload
oUploader.MaxSize = 0 oUploader.MaxSize = 0
oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType ) oUploader.Allowed = ConfigAllowedExtensions.Item( resourceType )
oUploader.Denied = ConfigDeniedExtensions.Item( resourceType ) oUploader.Denied = ConfigDeniedExtensions.Item( resourceType )
oUploader.HtmlExtensions = ConfigHtmlExtensions oUploader.HtmlExtensions = ConfigHtmlExtensions
oUploader.GetData oUploader.GetData
Dim sErrorNumber Dim sErrorNumber
sErrorNumber = "0" sErrorNumber = "0"
Dim sFileName, sOriginalFileName, sExtension Dim sFileName, sOriginalFileName, sExtension
sFileName = "" sFileName = ""
If oUploader.ErrNum > 0 Then If oUploader.ErrNum > 0 Then
sErrorNumber = "202" sErrorNumber = "202"
Else Else
' Map the virtual path to the local server path. ' Map the virtual path to the local server path.
Dim sServerDir Dim sServerDir
sServerDir = ServerMapFolder( resourceType, currentFolder, sCommand ) sServerDir = ServerMapFolder( resourceType, currentFolder, sCommand )
Dim oFSO Dim oFSO
Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" ) Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
if not (oFSO.FolderExists( sServerDir ) ) then if not (oFSO.FolderExists( sServerDir ) ) then
sErrorNumber = "102" sErrorNumber = "102"
else else
' Get the uploaded file name. ' Get the uploaded file name.
sFileName = oUploader.File( "NewFile" ).Name sFileName = oUploader.File( "NewFile" ).Name
sExtension = oUploader.File( "NewFile" ).Ext sExtension = oUploader.File( "NewFile" ).Ext
sFileName = SanitizeFileName( sFileName ) sFileName = SanitizeFileName( sFileName )
sOriginalFileName = sFileName sOriginalFileName = sFileName
Dim iCounter Dim iCounter
iCounter = 0 iCounter = 0
Do While ( True ) Do While ( True )
Dim sFilePath Dim sFilePath
sFilePath = sServerDir & sFileName sFilePath = CombineLocalPaths(sServerDir, sFileName)
If ( oFSO.FileExists( sFilePath ) ) Then If ( oFSO.FileExists( sFilePath ) ) Then
iCounter = iCounter + 1 iCounter = iCounter + 1
sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension sFileName = RemoveExtension( sOriginalFileName ) & "(" & iCounter & ")." & sExtension
sErrorNumber = "201" sErrorNumber = "201"
Else Else
oUploader.SaveAs "NewFile", sFilePath oUploader.SaveAs "NewFile", sFilePath
If oUploader.ErrNum > 0 Then sErrorNumber = "202" If oUploader.ErrNum > 0 Then sErrorNumber = "202"
Exit Do Exit Do
End If End If
Loop Loop
end if end if
End If End If
Set oUploader = Nothing Set oUploader = Nothing
dim sFileUrl dim sFileUrl
sFileUrl = CombinePaths( GetResourceTypePath( resourceType, sCommand ) , currentFolder ) sFileUrl = CombinePaths( GetResourceTypePath( resourceType, sCommand ) , currentFolder )
sFileUrl = CombinePaths( sFileUrl, sFileName ) sFileUrl = CombinePaths( sFileUrl, sFileName )
SendUploadResults sErrorNumber, sFileUrl, sFileName, "" SendUploadResults sErrorNumber, sFileUrl, sFileName, ""
End Sub End Sub
%> %>

View File

@@ -1,128 +1,128 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' Configuration file for the File Manager Connector for ASP. ' Configuration file for the File Manager Connector for ASP.
%> %>
<% <%
' SECURITY: You must explicitly enable this "connector" (set it to "True"). ' SECURITY: You must explicitly enable this "connector" (set it to "True").
' WARNING: don't just set "ConfigIsEnabled = true", you must be sure that only ' WARNING: don't just set "ConfigIsEnabled = true", you must be sure that only
' authenticated users can access this file or use some kind of session checking. ' authenticated users can access this file or use some kind of session checking.
Dim ConfigIsEnabled Dim ConfigIsEnabled
ConfigIsEnabled = False ConfigIsEnabled = False
' Path to user files relative to the document root. ' Path to user files relative to the document root.
' This setting is preserved only for backward compatibility. ' This setting is preserved only for backward compatibility.
' You should look at the settings for each resource type to get the full potential ' You should look at the settings for each resource type to get the full potential
Dim ConfigUserFilesPath Dim ConfigUserFilesPath
ConfigUserFilesPath = "/userfiles/" ConfigUserFilesPath = "/userfiles/"
' Due to security issues with Apache modules, it is recommended to leave the ' Due to security issues with Apache modules, it is recommended to leave the
' following setting enabled. ' following setting enabled.
Dim ConfigForceSingleExtension Dim ConfigForceSingleExtension
ConfigForceSingleExtension = true ConfigForceSingleExtension = true
' What the user can do with this connector ' What the user can do with this connector
Dim ConfigAllowedCommands Dim ConfigAllowedCommands
ConfigAllowedCommands = "QuickUpload|FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder" ConfigAllowedCommands = "QuickUpload|FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder"
' Allowed Resource Types ' Allowed Resource Types
Dim ConfigAllowedTypes Dim ConfigAllowedTypes
ConfigAllowedTypes = "File|Image|Flash|Media" ConfigAllowedTypes = "File|Image|Flash|Media"
' For security, HTML is allowed in the first Kb of data for files having the ' For security, HTML is allowed in the first Kb of data for files having the
' following extensions only. ' following extensions only.
Dim ConfigHtmlExtensions Dim ConfigHtmlExtensions
ConfigHtmlExtensions = "html|htm|xml|xsd|txt|js" ConfigHtmlExtensions = "html|htm|xml|xsd|txt|js"
' '
' Configuration settings for each Resource Type ' Configuration settings for each Resource Type
' '
' - AllowedExtensions: the possible extensions that can be allowed. ' - AllowedExtensions: the possible extensions that can be allowed.
' If it is empty then any file type can be uploaded. ' If it is empty then any file type can be uploaded.
' '
' - DeniedExtensions: The extensions that won't be allowed. ' - DeniedExtensions: The extensions that won't be allowed.
' If it is empty then no restrictions are done here. ' If it is empty then no restrictions are done here.
' '
' For a file to be uploaded it has to fulfill both the AllowedExtensions ' For a file to be uploaded it has to fulfill both the AllowedExtensions
' and DeniedExtensions (that's it: not being denied) conditions. ' and DeniedExtensions (that's it: not being denied) conditions.
' '
' - FileTypesPath: the virtual folder relative to the document root where ' - FileTypesPath: the virtual folder relative to the document root where
' these resources will be located. ' these resources will be located.
' Attention: It must start and end with a slash: '/' ' Attention: It must start and end with a slash: '/'
' '
' - FileTypesAbsolutePath: the physical path to the above folder. It must be ' - FileTypesAbsolutePath: the physical path to the above folder. It must be
' an absolute path. ' an absolute path.
' If it's an empty string then it will be autocalculated. ' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias. ' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. ' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'FileTypesPath' must point to the same directory. ' Attention: The above 'FileTypesPath' must point to the same directory.
' Attention: It must end with a slash: '/' ' Attention: It must end with a slash: '/'
' '
' - QuickUploadPath: the virtual folder relative to the document root where ' - QuickUploadPath: the virtual folder relative to the document root where
' these resources will be uploaded using the Upload tab in the resources ' these resources will be uploaded using the Upload tab in the resources
' dialogs. ' dialogs.
' Attention: It must start and end with a slash: '/' ' Attention: It must start and end with a slash: '/'
' '
' - QuickUploadAbsolutePath: the physical path to the above folder. It must be ' - QuickUploadAbsolutePath: the physical path to the above folder. It must be
' an absolute path. ' an absolute path.
' If it's an empty string then it will be autocalculated. ' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias. ' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. ' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'QuickUploadPath' must point to the same directory. ' Attention: The above 'QuickUploadPath' must point to the same directory.
' Attention: It must end with a slash: '/' ' Attention: It must end with a slash: '/'
' '
Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath
Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" ) Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" ) Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" ) Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" ) Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" )
Set ConfigQuickUploadPath = CreateObject( "Scripting.Dictionary" ) Set ConfigQuickUploadPath = CreateObject( "Scripting.Dictionary" )
Set ConfigQuickUploadAbsolutePath = CreateObject( "Scripting.Dictionary" ) Set ConfigQuickUploadAbsolutePath = CreateObject( "Scripting.Dictionary" )
ConfigAllowedExtensions.Add "File", "7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip" ConfigAllowedExtensions.Add "File", "7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip"
ConfigDeniedExtensions.Add "File", "" ConfigDeniedExtensions.Add "File", ""
ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/" ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/"
ConfigFileTypesAbsolutePath.Add "File", "" ConfigFileTypesAbsolutePath.Add "File", ""
ConfigQuickUploadPath.Add "File", ConfigUserFilesPath ConfigQuickUploadPath.Add "File", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "File", "" ConfigQuickUploadAbsolutePath.Add "File", ""
ConfigAllowedExtensions.Add "Image", "bmp|gif|jpeg|jpg|png" ConfigAllowedExtensions.Add "Image", "bmp|gif|jpeg|jpg|png"
ConfigDeniedExtensions.Add "Image", "" ConfigDeniedExtensions.Add "Image", ""
ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/" ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/"
ConfigFileTypesAbsolutePath.Add "Image", "" ConfigFileTypesAbsolutePath.Add "Image", ""
ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Image", "" ConfigQuickUploadAbsolutePath.Add "Image", ""
ConfigAllowedExtensions.Add "Flash", "swf|flv" ConfigAllowedExtensions.Add "Flash", "swf|flv"
ConfigDeniedExtensions.Add "Flash", "" ConfigDeniedExtensions.Add "Flash", ""
ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/" ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/"
ConfigFileTypesAbsolutePath.Add "Flash", "" ConfigFileTypesAbsolutePath.Add "Flash", ""
ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Flash", "" ConfigQuickUploadAbsolutePath.Add "Flash", ""
ConfigAllowedExtensions.Add "Media", "aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv" ConfigAllowedExtensions.Add "Media", "aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv"
ConfigDeniedExtensions.Add "Media", "" ConfigDeniedExtensions.Add "Media", ""
ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/" ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/"
ConfigFileTypesAbsolutePath.Add "Media", "" ConfigFileTypesAbsolutePath.Add "Media", ""
ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Media", "" ConfigQuickUploadAbsolutePath.Add "Media", ""
%> %>

View File

@@ -1,88 +1,88 @@
<%@ CodePage=65001 Language="VBScript"%> <%@ CodePage=65001 Language="VBScript"%>
<% <%
Option Explicit Option Explicit
Response.Buffer = True Response.Buffer = True
%> %>
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This is the File Manager Connector for ASP. ' This is the File Manager Connector for ASP.
%> %>
<!--#include file="config.asp"--> <!--#include file="config.asp"-->
<!--#include file="util.asp"--> <!--#include file="util.asp"-->
<!--#include file="io.asp"--> <!--#include file="io.asp"-->
<!--#include file="basexml.asp"--> <!--#include file="basexml.asp"-->
<!--#include file="commands.asp"--> <!--#include file="commands.asp"-->
<!--#include file="class_upload.asp"--> <!--#include file="class_upload.asp"-->
<% <%
If ( ConfigIsEnabled = False ) Then If ( ConfigIsEnabled = False ) Then
SendError 1, "This connector is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file" SendError 1, "This connector is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file"
End If End If
DoResponse DoResponse
Sub DoResponse() Sub DoResponse()
Dim sCommand, sResourceType, sCurrentFolder Dim sCommand, sResourceType, sCurrentFolder
' Get the main request information. ' Get the main request information.
sCommand = Request.QueryString("Command") sCommand = Request.QueryString("Command")
sResourceType = Request.QueryString("Type") sResourceType = Request.QueryString("Type")
If ( sResourceType = "" ) Then sResourceType = "File" If ( sResourceType = "" ) Then sResourceType = "File"
sCurrentFolder = GetCurrentFolder() sCurrentFolder = GetCurrentFolder()
' Check if it is an allowed command ' Check if it is an allowed command
if ( Not IsAllowedCommand( sCommand ) ) then if ( Not IsAllowedCommand( sCommand ) ) then
SendError 1, "The """ & sCommand & """ command isn't allowed" SendError 1, "The """ & sCommand & """ command isn't allowed"
end if end if
' Check if it is an allowed resource type. ' Check if it is an allowed resource type.
if ( Not IsAllowedType( sResourceType ) ) Then if ( Not IsAllowedType( sResourceType ) ) Then
SendError 1, "The """ & sResourceType & """ resource type isn't allowed" SendError 1, "The """ & sResourceType & """ resource type isn't allowed"
end if end if
' File Upload doesn't have to Return XML, so it must be intercepted before anything. ' File Upload doesn't have to Return XML, so it must be intercepted before anything.
If ( sCommand = "FileUpload" ) Then If ( sCommand = "FileUpload" ) Then
FileUpload sResourceType, sCurrentFolder, sCommand FileUpload sResourceType, sCurrentFolder, sCommand
Exit Sub Exit Sub
End If End If
SetXmlHeaders SetXmlHeaders
CreateXmlHeader sCommand, sResourceType, sCurrentFolder, GetUrlFromPath( sResourceType, sCurrentFolder, sCommand) CreateXmlHeader sCommand, sResourceType, sCurrentFolder, GetUrlFromPath( sResourceType, sCurrentFolder, sCommand)
' Execute the required command. ' Execute the required command.
Select Case sCommand Select Case sCommand
Case "GetFolders" Case "GetFolders"
GetFolders sResourceType, sCurrentFolder GetFolders sResourceType, sCurrentFolder
Case "GetFoldersAndFiles" Case "GetFoldersAndFiles"
GetFoldersAndFiles sResourceType, sCurrentFolder GetFoldersAndFiles sResourceType, sCurrentFolder
Case "CreateFolder" Case "CreateFolder"
CreateFolder sResourceType, sCurrentFolder CreateFolder sResourceType, sCurrentFolder
End Select End Select
CreateXmlFooter CreateXmlFooter
Response.End Response.End
End Sub End Sub
%> %>

View File

@@ -1,254 +1,237 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This file include IO specific functions used by the ASP Connector. ' This file include IO specific functions used by the ASP Connector.
%> %>
<% <%
function CombinePaths( sBasePath, sFolder) function CombinePaths( sBasePath, sFolder)
CombinePaths = RemoveFromEnd( sBasePath, "/" ) & "/" & RemoveFromStart( sFolder, "/" ) sFolder = replace(sFolder, "\", "/")
end function CombinePaths = RemoveFromEnd( sBasePath, "/" ) & "/" & RemoveFromStart( sFolder, "/" )
end function
Function GetResourceTypePath( resourceType, sCommand )
if ( sCommand = "QuickUpload") then function CombineLocalPaths( sBasePath, sFolder)
GetResourceTypePath = ConfigQuickUploadPath.Item( resourceType ) sFolder = replace(sFolder, "/", "\")
else ' The RemoveFrom* functions use RegExp, so we must escape the \
GetResourceTypePath = ConfigFileTypesPath.Item( resourceType ) CombineLocalPaths = RemoveFromEnd( sBasePath, "\\" ) & "\" & RemoveFromStart( sFolder, "\\" )
end if end function
end Function
Function GetResourceTypePath( resourceType, sCommand )
Function GetResourceTypeDirectory( resourceType, sCommand ) if ( sCommand = "QuickUpload") then
if ( sCommand = "QuickUpload") then GetResourceTypePath = ConfigQuickUploadPath.Item( resourceType )
else
if ( ConfigQuickUploadAbsolutePath.Item( resourceType ) <> "" ) then GetResourceTypePath = ConfigFileTypesPath.Item( resourceType )
GetResourceTypeDirectory = ConfigQuickUploadAbsolutePath.Item( resourceType ) end if
else end Function
' Map the "UserFiles" path to a local directory.
GetResourceTypeDirectory = Server.MapPath( ConfigQuickUploadPath.Item( resourceType ) ) Function GetResourceTypeDirectory( resourceType, sCommand )
end if if ( sCommand = "QuickUpload") then
else
if ( ConfigFileTypesAbsolutePath.Item( resourceType ) <> "" ) then if ( ConfigQuickUploadAbsolutePath.Item( resourceType ) <> "" ) then
GetResourceTypeDirectory = ConfigFileTypesAbsolutePath.Item( resourceType ) GetResourceTypeDirectory = ConfigQuickUploadAbsolutePath.Item( resourceType )
else else
' Map the "UserFiles" path to a local directory. ' Map the "UserFiles" path to a local directory.
GetResourceTypeDirectory = Server.MapPath( ConfigFileTypesPath.Item( resourceType ) ) GetResourceTypeDirectory = Server.MapPath( ConfigQuickUploadPath.Item( resourceType ) )
end if end if
end if else
end Function if ( ConfigFileTypesAbsolutePath.Item( resourceType ) <> "" ) then
GetResourceTypeDirectory = ConfigFileTypesAbsolutePath.Item( resourceType )
Function GetUrlFromPath( resourceType, folderPath, sCommand ) else
GetUrlFromPath = CombinePaths( GetResourceTypePath( resourceType, sCommand ), folderPath ) ' Map the "UserFiles" path to a local directory.
End Function GetResourceTypeDirectory = Server.MapPath( ConfigFileTypesPath.Item( resourceType ) )
end if
Function RemoveExtension( fileName ) end if
RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 ) end Function
End Function
Function GetUrlFromPath( resourceType, folderPath, sCommand )
Function ServerMapFolder( resourceType, folderPath, sCommand ) GetUrlFromPath = CombinePaths( GetResourceTypePath( resourceType, sCommand ), folderPath )
Dim sResourceTypePath End Function
' Get the resource type directory.
sResourceTypePath = GetResourceTypeDirectory( resourceType, sCommand ) Function RemoveExtension( fileName )
RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 )
' Ensure that the directory exists. End Function
CreateServerFolder sResourceTypePath
Function ServerMapFolder( resourceType, folderPath, sCommand )
' Return the resource type directory combined with the required path. Dim sResourceTypePath
ServerMapFolder = CombinePaths( sResourceTypePath, folderPath ) ' Get the resource type directory.
End Function sResourceTypePath = GetResourceTypeDirectory( resourceType, sCommand )
Sub CreateServerFolder( folderPath ) ' Ensure that the directory exists.
Dim oFSO CreateServerFolder sResourceTypePath
Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
' Return the resource type directory combined with the required path.
Dim sParent ServerMapFolder = CombineLocalPaths( sResourceTypePath, folderPath )
sParent = oFSO.GetParentFolderName( folderPath ) End Function
' Check if the parent exists, or create it. Sub CreateServerFolder( folderPath )
If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent ) Dim oFSO
Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
If ( oFSO.FolderExists( folderPath ) = False ) Then
On Error resume next Dim sParent
oFSO.CreateFolder( folderPath ) sParent = oFSO.GetParentFolderName( folderPath )
if err.number<>0 then ' If folderPath is a network path (\\server\folder\) then sParent is an empty string.
dim sErrorNumber ' Get out.
Dim iErrNumber, sErrDescription if (sParent = "") then exit sub
iErrNumber = err.number
sErrDescription = err.Description ' Check if the parent exists, or create it.
If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )
On Error Goto 0
If ( oFSO.FolderExists( folderPath ) = False ) Then
Select Case iErrNumber On Error resume next
Case 52 oFSO.CreateFolder( folderPath )
sErrorNumber = "102" ' Invalid Folder Name.
Case 70 if err.number<>0 then
sErrorNumber = "103" ' Security Error. dim sErrorNumber
Case 76 Dim iErrNumber, sErrDescription
sErrorNumber = "102" ' Path too long. iErrNumber = err.number
Case Else sErrDescription = err.Description
sErrorNumber = "110"
End Select On Error Goto 0
SendError sErrorNumber, "CreateServerFolder(" & folderPath & ") : " & sErrDescription Select Case iErrNumber
end if Case 52
sErrorNumber = "102" ' Invalid Folder Name.
End If Case 70
sErrorNumber = "103" ' Security Error.
Set oFSO = Nothing Case 76
End Sub sErrorNumber = "102" ' Path too long.
Case Else
Function IsAllowedExt( extension, resourceType ) sErrorNumber = "110"
Dim oRE End Select
Set oRE = New RegExp
oRE.IgnoreCase = True SendError sErrorNumber, "CreateServerFolder(" & folderPath & ") : " & sErrDescription
oRE.Global = True end if
Dim sAllowed, sDenied End If
sAllowed = ConfigAllowedExtensions.Item( resourceType )
sDenied = ConfigDeniedExtensions.Item( resourceType ) Set oFSO = Nothing
End Sub
IsAllowedExt = True
Function IsAllowedExt( extension, resourceType )
If sDenied <> "" Then Dim oRE
oRE.Pattern = sDenied Set oRE = New RegExp
IsAllowedExt = Not oRE.Test( extension ) oRE.IgnoreCase = True
End If oRE.Global = True
If IsAllowedExt And sAllowed <> "" Then Dim sAllowed, sDenied
oRE.Pattern = sAllowed sAllowed = ConfigAllowedExtensions.Item( resourceType )
IsAllowedExt = oRE.Test( extension ) sDenied = ConfigDeniedExtensions.Item( resourceType )
End If
IsAllowedExt = True
Set oRE = Nothing
End Function If sDenied <> "" Then
oRE.Pattern = sDenied
Function IsAllowedType( resourceType ) IsAllowedExt = Not oRE.Test( extension )
Dim oRE End If
Set oRE = New RegExp
oRE.IgnoreCase = True If IsAllowedExt And sAllowed <> "" Then
oRE.Global = True oRE.Pattern = sAllowed
oRE.Pattern = "^(" & ConfigAllowedTypes & ")$" IsAllowedExt = oRE.Test( extension )
End If
IsAllowedType = oRE.Test( resourceType )
Set oRE = Nothing
Set oRE = Nothing End Function
End Function
Function IsAllowedType( resourceType )
Function IsAllowedCommand( sCommand ) Dim oRE
Dim oRE Set oRE = New RegExp
Set oRE = New RegExp oRE.IgnoreCase = False
oRE.IgnoreCase = True oRE.Global = True
oRE.Global = True oRE.Pattern = "^(" & ConfigAllowedTypes & ")$"
oRE.Pattern = "^(" & ConfigAllowedCommands & ")$"
IsAllowedType = oRE.Test( resourceType )
IsAllowedCommand = oRE.Test( sCommand )
Set oRE = Nothing
Set oRE = Nothing End Function
End Function
Function IsAllowedCommand( sCommand )
function GetCurrentFolder() Dim oRE
dim sCurrentFolder Set oRE = New RegExp
sCurrentFolder = Request.QueryString("CurrentFolder") oRE.IgnoreCase = True
If ( sCurrentFolder = "" ) Then sCurrentFolder = "/" oRE.Global = True
oRE.Pattern = "^(" & ConfigAllowedCommands & ")$"
' Check the current folder syntax (must begin and start with a slash).
If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/" IsAllowedCommand = oRE.Test( sCommand )
If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder
Set oRE = Nothing
' Check for invalid folder paths (..) End Function
If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sCurrentFolder, "\" ) <> 0) Then
SendError 102, "" function GetCurrentFolder()
End If dim sCurrentFolder
sCurrentFolder = Request.QueryString("CurrentFolder")
GetCurrentFolder = sCurrentFolder If ( sCurrentFolder = "" ) Then sCurrentFolder = "/"
end function
' Check the current folder syntax (must begin and start with a slash).
' Do a cleanup of the folder name to avoid possible problems If ( Right( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = sCurrentFolder & "/"
function SanitizeFolderName( sNewFolderName ) If ( Left( sCurrentFolder, 1 ) <> "/" ) Then sCurrentFolder = "/" & sCurrentFolder
Dim oRegex
Set oRegex = New RegExp ' Check for invalid folder paths (..)
oRegex.Global = True If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sCurrentFolder, "\" ) <> 0) Then
SendError 102, ""
' remove . \ / | : ? * " < > and control characters End If
oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)"
SanitizeFolderName = oRegex.Replace( sNewFolderName, "_" ) GetCurrentFolder = sCurrentFolder
end function
Set oRegex = Nothing
end function ' Do a cleanup of the folder name to avoid possible problems
function SanitizeFolderName( sNewFolderName )
' Do a cleanup of the file name to avoid possible problems Dim oRegex
function SanitizeFileName( sNewFileName ) Set oRegex = New RegExp
Dim oRegex oRegex.Global = True
Set oRegex = New RegExp
oRegex.Global = True ' remove . \ / | : ? * " < > and control characters
oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)"
if ( ConfigForceSingleExtension = True ) then SanitizeFolderName = oRegex.Replace( sNewFolderName, "_" )
oRegex.Pattern = "\.(?![^.]*$)"
sNewFileName = oRegex.Replace( sNewFileName, "_" ) Set oRegex = Nothing
end if end function
' remove \ / | : ? * " < > and control characters ' Do a cleanup of the file name to avoid possible problems
oRegex.Pattern = "(\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)" function SanitizeFileName( sNewFileName )
SanitizeFileName = oRegex.Replace( sNewFileName, "_" ) Dim oRegex
Set oRegex = New RegExp
Set oRegex = Nothing oRegex.Global = True
end function
if ( ConfigForceSingleExtension = True ) then
' This is the function that sends the results of the uploading process. oRegex.Pattern = "\.(?![^.]*$)"
Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg ) sNewFileName = oRegex.Replace( sNewFileName, "_" )
Response.Clear end if
Response.Write "<script type=""text/javascript"">"
Response.Write "(function()" ' remove \ / | : ? * " < > and control characters
Response.Write "{" oRegex.Pattern = "(\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)"
Response.Write "var d = document.domain ;" SanitizeFileName = oRegex.Replace( sNewFileName, "_" )
Response.Write " while ( true )" Set oRegex = Nothing
Response.Write " {" end function
' Test if we can access a parent property.
Response.Write " try" ' This is the function that sends the results of the uploading process.
Response.Write " {" Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg )
Response.Write " var test = window.top.opener.document.domain ;" Response.Clear
Response.Write " break ;" Response.Write "<script type=""text/javascript"">"
Response.Write " }" ' Minified version of the document.domain automatic fix script (#1919).
Response.Write " catch( e ) {}" ' The original script can be found at _dev/domain_fix_template.js
Response.Write "(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();"
' Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
Response.Write " d = d.replace( /.*?(?:\.|$)/, '' ) ;" Response.Write "window.parent.OnUploadCompleted(" & errorNumber & ",""" & Replace( fileUrl, """", "\""" ) & """,""" & Replace( fileName, """", "\""" ) & """,""" & Replace( customMsg , """", "\""" ) & """) ;"
Response.Write "</script>"
Response.Write " if ( d.length == 0 )" Response.End
' It was not able to detect the domain. End Sub
Response.Write " break ;"
Response.Write "" %>
Response.Write " try"
Response.Write " {"
Response.Write " document.domain = d ;"
Response.Write " }"
Response.Write " catch (e)"
Response.Write " {"
Response.Write " break ;"
Response.Write " }"
Response.Write " }"
Response.Write "})() ;"
Response.Write "window.parent.OnUploadCompleted(" & errorNumber & ",""" & Replace( fileUrl, """", "\""" ) & """,""" & Replace( fileName, """", "\""" ) & """,""" & Replace( customMsg , """", "\""" ) & """) ;"
Response.Write "</script>"
Response.End
End Sub
%>

View File

@@ -1,65 +1,65 @@
<%@ CodePage=65001 Language="VBScript"%> <%@ CodePage=65001 Language="VBScript"%>
<% <%
Option Explicit Option Explicit
Response.Buffer = True Response.Buffer = True
%> %>
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This is the "File Uploader" for ASP. ' This is the "File Uploader" for ASP.
%> %>
<!--#include file="config.asp"--> <!--#include file="config.asp"-->
<!--#include file="util.asp"--> <!--#include file="util.asp"-->
<!--#include file="io.asp"--> <!--#include file="io.asp"-->
<!--#include file="commands.asp"--> <!--#include file="commands.asp"-->
<!--#include file="class_upload.asp"--> <!--#include file="class_upload.asp"-->
<% <%
Sub SendError( number, text ) Sub SendError( number, text )
SendUploadResults number, "", "", text SendUploadResults number, "", "", text
End Sub End Sub
' Check if this uploader has been enabled. ' Check if this uploader has been enabled.
If ( ConfigIsEnabled = False ) Then If ( ConfigIsEnabled = False ) Then
SendUploadResults "1", "", "", "This file uploader is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file" SendUploadResults "1", "", "", "This file uploader is disabled. Please check the ""editor/filemanager/connectors/asp/config.asp"" file"
End If End If
Dim sCommand, sResourceType, sCurrentFolder Dim sCommand, sResourceType, sCurrentFolder
sCommand = "QuickUpload" sCommand = "QuickUpload"
sResourceType = Request.QueryString("Type") sResourceType = Request.QueryString("Type")
If ( sResourceType = "" ) Then sResourceType = "File" If ( sResourceType = "" ) Then sResourceType = "File"
sCurrentFolder = GetCurrentFolder() sCurrentFolder = GetCurrentFolder()
' Is Upload enabled? ' Is Upload enabled?
if ( Not IsAllowedCommand( sCommand ) ) then if ( Not IsAllowedCommand( sCommand ) ) then
SendUploadResults "1", "", "", "The """ & sCommand & """ command isn't allowed" SendUploadResults "1", "", "", "The """ & sCommand & """ command isn't allowed"
end if end if
' Check if it is an allowed resource type. ' Check if it is an allowed resource type.
if ( Not IsAllowedType( sResourceType ) ) Then if ( Not IsAllowedType( sResourceType ) ) Then
SendUploadResults "1", "", "", "The " & sResourceType & " resource type isn't allowed" SendUploadResults "1", "", "", "The " & sResourceType & " resource type isn't allowed"
end if end if
FileUpload sResourceType, sCurrentFolder, sCommand FileUpload sResourceType, sCurrentFolder, sCommand
%> %>

View File

@@ -1,55 +1,55 @@
<% <%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 Frederico Caldeira Knabben ' Copyright (C) 2003-2009 Frederico Caldeira Knabben
' '
' == BEGIN LICENSE == ' == BEGIN LICENSE ==
' '
' Licensed under the terms of any of the following licenses at your ' Licensed under the terms of any of the following licenses at your
' choice: ' choice:
' '
' - GNU General Public License Version 2 or later (the "GPL") ' - GNU General Public License Version 2 or later (the "GPL")
' http://www.gnu.org/licenses/gpl.html ' http://www.gnu.org/licenses/gpl.html
' '
' - GNU Lesser General Public License Version 2.1 or later (the "LGPL") ' - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
' http://www.gnu.org/licenses/lgpl.html ' http://www.gnu.org/licenses/lgpl.html
' '
' - Mozilla Public License Version 1.1 or later (the "MPL") ' - Mozilla Public License Version 1.1 or later (the "MPL")
' http://www.mozilla.org/MPL/MPL-1.1.html ' http://www.mozilla.org/MPL/MPL-1.1.html
' '
' == END LICENSE == ' == END LICENSE ==
' '
' This file include generic functions used by the ASP Connector. ' This file include generic functions used by the ASP Connector.
%> %>
<% <%
Function RemoveFromStart( sourceString, charToRemove ) Function RemoveFromStart( sourceString, charToRemove )
Dim oRegex Dim oRegex
Set oRegex = New RegExp Set oRegex = New RegExp
oRegex.Pattern = "^" & charToRemove & "+" oRegex.Pattern = "^" & charToRemove & "+"
RemoveFromStart = oRegex.Replace( sourceString, "" ) RemoveFromStart = oRegex.Replace( sourceString, "" )
End Function End Function
Function RemoveFromEnd( sourceString, charToRemove ) Function RemoveFromEnd( sourceString, charToRemove )
Dim oRegex Dim oRegex
Set oRegex = New RegExp Set oRegex = New RegExp
oRegex.Pattern = charToRemove & "+$" oRegex.Pattern = charToRemove & "+$"
RemoveFromEnd = oRegex.Replace( sourceString, "" ) RemoveFromEnd = oRegex.Replace( sourceString, "" )
End Function End Function
Function ConvertToXmlAttribute( value ) Function ConvertToXmlAttribute( value )
ConvertToXmlAttribute = Replace( value, "&", "&amp;" ) ConvertToXmlAttribute = Replace( value, "&", "&amp;" )
End Function End Function
Function InArray( value, sourceArray ) Function InArray( value, sourceArray )
Dim i Dim i
For i = 0 to UBound( sourceArray ) For i = 0 to UBound( sourceArray )
If sourceArray(i) = value Then If sourceArray(i) = value Then
InArray = True InArray = True
Exit Function Exit Function
End If End If
Next Next
InArray = False InArray = False
End Function End Function
%> %>

View File

@@ -1,98 +1,98 @@
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %> <%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %>
<%-- <%--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* Configuration file for the File Browser Connector for ASP.NET. * Configuration file for the File Browser Connector for ASP.NET.
--%> --%>
<script runat="server"> <script runat="server">
/** /**
* This function must check the user session to be sure that he/she is * This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser. * authorized to upload and access files in the File Browser.
*/ */
private bool CheckAuthentication() private bool CheckAuthentication()
{ {
// WARNING : DO NOT simply return "true". By doing so, you are allowing // WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement // "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as... // some kind of session validation here. Even something very simple as...
// //
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true ); // return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
// //
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system. // user logs in your system.
return false; return false;
} }
public override void SetConfig() public override void SetConfig()
{ {
// SECURITY: You must explicitly enable this "connector". (Set it to "true"). // SECURITY: You must explicitly enable this "connector". (Set it to "true").
Enabled = CheckAuthentication(); Enabled = CheckAuthentication();
// URL path to user files. // URL path to user files.
UserFilesPath = "/userfiles/"; UserFilesPath = "/userfiles/";
// The connector tries to resolve the above UserFilesPath automatically. // The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the // Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory. // Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = ""; UserFilesAbsolutePath = "";
// Due to security issues with Apache modules, it is recommended to leave the // Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled. // following setting enabled.
ForceSingleExtension = true; ForceSingleExtension = true;
// Allowed Resource Types // Allowed Resource Types
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" }; AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
// For security, HTML is allowed in the first Kb of data for files having the // For security, HTML is allowed in the first Kb of data for files having the
// following extensions only. // following extensions only.
HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" }; HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };
TypeConfig[ "File" ].AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" }; TypeConfig[ "File" ].AllowedExtensions = new string[] { "7z", "aiff", "asf", "avi", "bmp", "csv", "doc", "fla", "flv", "gif", "gz", "gzip", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "ods", "odt", "pdf", "png", "ppt", "pxd", "qt", "ram", "rar", "rm", "rmi", "rmvb", "rtf", "sdc", "sitd", "swf", "sxc", "sxw", "tar", "tgz", "tif", "tiff", "txt", "vsd", "wav", "wma", "wmv", "xls", "xml", "zip" };
TypeConfig[ "File" ].DeniedExtensions = new string[] { }; TypeConfig[ "File" ].DeniedExtensions = new string[] { };
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/"; TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" ); TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%"; TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" ); TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" }; TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
TypeConfig[ "Image" ].DeniedExtensions = new string[] { }; TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/"; TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" ); TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%"; TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" ); TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" }; TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { }; TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/"; TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" ); TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%"; TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" ); TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Media" ].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" }; TypeConfig[ "Media" ].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" };
TypeConfig[ "Media" ].DeniedExtensions = new string[] { }; TypeConfig[ "Media" ].DeniedExtensions = new string[] { };
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/"; TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" ); TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%"; TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" ); TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
} }
</script> </script>

View File

@@ -1,32 +1,32 @@
<%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Connector" AutoEventWireup="false" %> <%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Connector" AutoEventWireup="false" %>
<%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %> <%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %>
<%-- <%--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the File Browser Connector for ASP.NET. * This is the File Browser Connector for ASP.NET.
* *
* The code of this page if included in the FCKeditor.Net package, * The code of this page if included in the FCKeditor.Net package,
* in the FredCK.FCKeditorV2.dll assembly file. So to use it you must * in the FredCK.FCKeditorV2.dll assembly file. So to use it you must
* include that DLL in your "bin" directory. * include that DLL in your "bin" directory.
* *
* To download the FCKeditor.Net package, go to our official web site: * To download the FCKeditor.Net package, go to our official web site:
* http://www.fckeditor.net * http://www.fckeditor.net
--%> --%>
<FCKeditor:Config id="Config" runat="server"></FCKeditor:Config> <FCKeditor:Config id="Config" runat="server"></FCKeditor:Config>

View File

@@ -1,32 +1,32 @@
<%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Uploader" AutoEventWireup="false" %> <%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Uploader" AutoEventWireup="false" %>
<%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %> <%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %>
<%-- <%--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the Uploader for ASP.NET. * This is the Uploader for ASP.NET.
* *
* The code of this page if included in the FCKeditor.Net package, * The code of this page if included in the FCKeditor.Net package,
* in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must
* include that DLL in your "bin" directory. * include that DLL in your "bin" directory.
* *
* To download the FCKeditor.Net package, go to our official web site: * To download the FCKeditor.Net package, go to our official web site:
* http://www.fckeditor.net * http://www.fckeditor.net
--%> --%>
<FCKeditor:Config id="Config" runat="server"></FCKeditor:Config> <FCKeditor:Config id="Config" runat="server"></FCKeditor:Config>

View File

@@ -1,273 +1,273 @@
<cfcomponent name="ImageObject"> <cfcomponent name="ImageObject">
<!--- <!---
ImageObject.cfc written by Rick Root (rick@webworksllc.com) ImageObject.cfc written by Rick Root (rick@webworksllc.com)
Related Web Sites: Related Web Sites:
- http://www.opensourcecf.com/imagecfc (home page) - http://www.opensourcecf.com/imagecfc (home page)
This is an object oriented interface to the original This is an object oriented interface to the original
ImageCFC. ImageCFC.
Example Code: Example Code:
io = createObject("component","ImageObject"); io = createObject("component","ImageObject");
io.setOption("defaultJpegCompression",95); io.setOption("defaultJpegCompression",95);
io.init("#ExpandPath(".")#/emily.jpg"); io.init("#ExpandPath(".")#/emily.jpg");
io.scaleWidth(500); io.scaleWidth(500);
io.save("#ExpandPath(".")#/imagex1.jpg"); io.save("#ExpandPath(".")#/imagex1.jpg");
io.flipHorizontal(); io.flipHorizontal();
io.save("#ExpandPath(".")#/imagex2.jpg"); io.save("#ExpandPath(".")#/imagex2.jpg");
io.revert(); io.revert();
io.filterFastBlur(2,5); io.filterFastBlur(2,5);
io.save("#ExpandPath(".")#/imagex3.jpg"); io.save("#ExpandPath(".")#/imagex3.jpg");
io.revert(); io.revert();
io.filterPosterize(32); io.filterPosterize(32);
io.save("#ExpandPath(".")#/imagex4.jpg"); io.save("#ExpandPath(".")#/imagex4.jpg");
LICENSE LICENSE
------- -------
Copyright (c) 2006, Rick Root <rick@webworksllc.com> Copyright (c) 2006, Rick Root <rick@webworksllc.com>
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the without modification, are permitted provided that the
following conditions are met: following conditions are met:
- Redistributions of source code must retain the above - Redistributions of source code must retain the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer. following disclaimer.
- Redistributions in binary form must reproduce the above - Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other following disclaimer in the documentation and/or other
materials provided with the distribution. materials provided with the distribution.
- Neither the name of the Webworks, LLC. nor the names of - Neither the name of the Webworks, LLC. nor the names of
its contributors may be used to endorse or promote products its contributors may be used to endorse or promote products
derived from this software without specific prior written derived from this software without specific prior written
permission. permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---> --->
<cfset variables.img = ""> <cfset variables.img = "">
<cfset variables.revertimg = ""> <cfset variables.revertimg = "">
<cfset variables.imageCFC = createObject("component","image")> <cfset variables.imageCFC = createObject("component","image")>
<cfset variables.imageInfo = structNew()> <cfset variables.imageInfo = structNew()>
<cfset variables.imageInfo.width = 0> <cfset variables.imageInfo.width = 0>
<cfset variables.imageInfo.height = 0> <cfset variables.imageInfo.height = 0>
<cfset variables.imageInfo.colorModel = ""> <cfset variables.imageInfo.colorModel = "">
<cfset variables.imageInfo.colorspace = ""> <cfset variables.imageInfo.colorspace = "">
<cfset variables.imageInfo.objColorModel = ""> <cfset variables.imageInfo.objColorModel = "">
<cfset variables.imageInfo.objColorspace = ""> <cfset variables.imageInfo.objColorspace = "">
<cfset variables.imageInfo.sampleModel = ""> <cfset variables.imageInfo.sampleModel = "">
<cfset variables.imageInfo.imageType = 0> <cfset variables.imageInfo.imageType = 0>
<cfset variables.imageInfo.misc = ""> <cfset variables.imageInfo.misc = "">
<cfset variables.imageInfo.canModify = false> <cfset variables.imageInfo.canModify = false>
<cfset variables.imageCFC.setOption("throwonerror",true)> <cfset variables.imageCFC.setOption("throwonerror",true)>
<!--- <!---
init(filename) Initialize object from a file. init(filename) Initialize object from a file.
init(width, height) Initialize with a blank image init(width, height) Initialize with a blank image
init(bufferedImage) Initiailize with an existing object init(bufferedImage) Initiailize with an existing object
---> --->
<cffunction name="init" access="public" output="false" returnType="void"> <cffunction name="init" access="public" output="false" returnType="void">
<cfargument name="arg1" type="any" required="yes"> <cfargument name="arg1" type="any" required="yes">
<cfargument name="arg2" type="any" required="no"> <cfargument name="arg2" type="any" required="no">
<cfif isDefined("arg2") and isNumeric(arg1) and isNumeric(arg2)> <cfif isDefined("arg2") and isNumeric(arg1) and isNumeric(arg2)>
<cfset arg1 = javacast("int",int(arg1))> <cfset arg1 = javacast("int",int(arg1))>
<cfset arg2 = javacast("int",int(arg2))> <cfset arg2 = javacast("int",int(arg2))>
<cfset variables.img = createObject("java","java.awt.image.BufferedImage")> <cfset variables.img = createObject("java","java.awt.image.BufferedImage")>
<cfset variables.img.init(arg1,arg2,variables.img.TYPE_INT_RGB)> <cfset variables.img.init(arg1,arg2,variables.img.TYPE_INT_RGB)>
<cfelseif arg1.getClass().getName() eq "java.awt.image.BufferedImage"> <cfelseif arg1.getClass().getName() eq "java.awt.image.BufferedImage">
<cfset variables.img = arg1> <cfset variables.img = arg1>
<cfelseif isSimpleValue(arg1) and len(arg1) gt 0> <cfelseif isSimpleValue(arg1) and len(arg1) gt 0>
<cfset imageResults = variables.imageCFC.readImage(arg1, "no")> <cfset imageResults = variables.imageCFC.readImage(arg1, "no")>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfelse> <cfelse>
<cfthrow message="Object Instantiation Error" detail="You have attempted to initialize ooimage.cfc with invalid arguments. Please consult the documentation for correct initialization arguments."> <cfthrow message="Object Instantiation Error" detail="You have attempted to initialize ooimage.cfc with invalid arguments. Please consult the documentation for correct initialization arguments.">
</cfif> </cfif>
<cfif variables.revertimg eq ""> <cfif variables.revertimg eq "">
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
</cfif> </cfif>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
<cfreturn> <cfreturn>
</cffunction> </cffunction>
<cffunction name="flipHorizontal" access="public" output="true" returnType="void" hint="Flip an image horizontally."> <cffunction name="flipHorizontal" access="public" output="true" returnType="void" hint="Flip an image horizontally.">
<cfset var imageResults = imageCFC.flipHorizontal(variables.img,"","")> <cfset var imageResults = imageCFC.flipHorizontal(variables.img,"","")>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="getImageInfo" access="public" output="true" returntype="struct" hint="Returns image information."> <cffunction name="getImageInfo" access="public" output="true" returntype="struct" hint="Returns image information.">
<cfreturn variables.imageInfo> <cfreturn variables.imageInfo>
</cffunction> </cffunction>
<cffunction name="getImageObject" access="public" output="true" returntype="struct" hint="Returns a java Buffered Image Object."> <cffunction name="getImageObject" access="public" output="true" returntype="struct" hint="Returns a java Buffered Image Object.">
<cfreturn variables.img> <cfreturn variables.img>
</cffunction> </cffunction>
<cffunction name="flipVertical" access="public" output="true" returntype="void" hint="Flop an image vertically."> <cffunction name="flipVertical" access="public" output="true" returntype="void" hint="Flop an image vertically.">
<cfset var imageResults = imageCFC.flipVertical(variables.img,"","")> <cfset var imageResults = imageCFC.flipVertical(variables.img,"","")>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="scaleWidth" access="public" output="true" returntype="void" hint="Scale an image to a specific width."> <cffunction name="scaleWidth" access="public" output="true" returntype="void" hint="Scale an image to a specific width.">
<cfargument name="newWidth" required="yes" type="numeric"> <cfargument name="newWidth" required="yes" type="numeric">
<cfset var imageResults = imageCFC.scaleWidth(variables.img,"","", newWidth)> <cfset var imageResults = imageCFC.scaleWidth(variables.img,"","", newWidth)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="scaleHeight" access="public" output="true" returntype="void" hint="Scale an image to a specific height."> <cffunction name="scaleHeight" access="public" output="true" returntype="void" hint="Scale an image to a specific height.">
<cfargument name="newHeight" required="yes" type="numeric"> <cfargument name="newHeight" required="yes" type="numeric">
<cfset var imageResults = imageCFC.scaleHeight(variables.img,"","", newHeight)> <cfset var imageResults = imageCFC.scaleHeight(variables.img,"","", newHeight)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="resize" access="public" output="true" returntype="void" hint="Resize an image to a specific width and height."> <cffunction name="resize" access="public" output="true" returntype="void" hint="Resize an image to a specific width and height.">
<cfargument name="newWidth" required="yes" type="numeric"> <cfargument name="newWidth" required="yes" type="numeric">
<cfargument name="newHeight" required="yes" type="numeric"> <cfargument name="newHeight" required="yes" type="numeric">
<cfargument name="preserveAspect" required="no" type="boolean" default="FALSE"> <cfargument name="preserveAspect" required="no" type="boolean" default="FALSE">
<cfargument name="cropToExact" required="no" type="boolean" default="FALSE"> <cfargument name="cropToExact" required="no" type="boolean" default="FALSE">
<cfset var imageResults = imageCFC.resize(variables.img,"","",newWidth,newHeight,preserveAspect,cropToExact)> <cfset var imageResults = imageCFC.resize(variables.img,"","",newWidth,newHeight,preserveAspect,cropToExact)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="crop" access="public" output="true" returntype="void" hint="Crop an image."> <cffunction name="crop" access="public" output="true" returntype="void" hint="Crop an image.">
<cfargument name="fromX" required="yes" type="numeric"> <cfargument name="fromX" required="yes" type="numeric">
<cfargument name="fromY" required="yes" type="numeric"> <cfargument name="fromY" required="yes" type="numeric">
<cfargument name="newWidth" required="yes" type="numeric"> <cfargument name="newWidth" required="yes" type="numeric">
<cfargument name="newHeight" required="yes" type="numeric"> <cfargument name="newHeight" required="yes" type="numeric">
<cfset var imageResults = imageCFC.crop(variables.img,"","",fromX,fromY,newWidth,newHeight)> <cfset var imageResults = imageCFC.crop(variables.img,"","",fromX,fromY,newWidth,newHeight)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="rotate" access="public" output="true" returntype="void" hint="Rotate an image (+/-)90, (+/-)180, or (+/-)270 degrees."> <cffunction name="rotate" access="public" output="true" returntype="void" hint="Rotate an image (+/-)90, (+/-)180, or (+/-)270 degrees.">
<cfargument name="degrees" required="yes" type="numeric"> <cfargument name="degrees" required="yes" type="numeric">
<cfset var imageResults = imageCFC.rotate(variables.img,"","",degrees)> <cfset var imageResults = imageCFC.rotate(variables.img,"","",degrees)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="setOption" access="public" output="true" returnType="void" hint="Sets values for allowed CFC options."> <cffunction name="setOption" access="public" output="true" returnType="void" hint="Sets values for allowed CFC options.">
<cfargument name="key" type="string" required="yes"> <cfargument name="key" type="string" required="yes">
<cfargument name="val" type="string" required="yes"> <cfargument name="val" type="string" required="yes">
<cfif lcase(trim(key)) eq "throwonerror"> <cfif lcase(trim(key)) eq "throwonerror">
<cfthrow message="Option Configuration Error" detail="You cannot set the throwOnError option when using ImageObject.cfc"> <cfthrow message="Option Configuration Error" detail="You cannot set the throwOnError option when using ImageObject.cfc">
</cfif> </cfif>
<cfset imageCFC.setOption(key, val)> <cfset imageCFC.setOption(key, val)>
</cffunction> </cffunction>
<cffunction name="getOption" access="public" output="true" returnType="any" hint="Returns the current value for the specified CFC option."> <cffunction name="getOption" access="public" output="true" returnType="any" hint="Returns the current value for the specified CFC option.">
<cfargument name="key" type="string" required="yes"> <cfargument name="key" type="string" required="yes">
<cfreturn imageCFC.getOption(key)> <cfreturn imageCFC.getOption(key)>
</cffunction> </cffunction>
<cffunction name="filterFastBlur" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images."> <cffunction name="filterFastBlur" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images.">
<cfargument name="blurAmount" required="yes" type="numeric"> <cfargument name="blurAmount" required="yes" type="numeric">
<cfargument name="iterations" required="yes" type="numeric"> <cfargument name="iterations" required="yes" type="numeric">
<cfset var imageResults = imageCFC.filterFastBlur(variables.img,"","",blurAmount,iterations)> <cfset var imageResults = imageCFC.filterFastBlur(variables.img,"","",blurAmount,iterations)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="filterSharpen" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images."> <cffunction name="filterSharpen" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images.">
<cfset var imageResults = imageCFC.filterSharpen(variables.img,"","")> <cfset var imageResults = imageCFC.filterSharpen(variables.img,"","")>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="filterPosterize" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images."> <cffunction name="filterPosterize" access="public" output="true" returntype="void" hint="Internal method used for flipping and flopping images.">
<cfargument name="amount" required="yes" type="string"> <cfargument name="amount" required="yes" type="string">
<cfset var imageResults = imageCFC.filterPosterize(variables.img,"","",amount)> <cfset var imageResults = imageCFC.filterPosterize(variables.img,"","",amount)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="addText" access="public" output="true" returntype="void" hint="Add text to an image."> <cffunction name="addText" access="public" output="true" returntype="void" hint="Add text to an image.">
<cfargument name="x" required="yes" type="numeric"> <cfargument name="x" required="yes" type="numeric">
<cfargument name="y" required="yes" type="numeric"> <cfargument name="y" required="yes" type="numeric">
<cfargument name="fontDetails" required="yes" type="struct"> <cfargument name="fontDetails" required="yes" type="struct">
<cfargument name="content" required="yes" type="String"> <cfargument name="content" required="yes" type="String">
<cfset var imageResults = imageCFC.addText(variables.img,"","",x,y,fontDetails,content)> <cfset var imageResults = imageCFC.addText(variables.img,"","",x,y,fontDetails,content)>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="watermark" access="public" output="false" returnType="void"> <cffunction name="watermark" access="public" output="false" returnType="void">
<cfargument name="wmImage" required="yes" type="Any"> <cfargument name="wmImage" required="yes" type="Any">
<cfargument name="alpha" required="yes" type="numeric"> <cfargument name="alpha" required="yes" type="numeric">
<cfargument name="placeAtX" required="yes" type="numeric"> <cfargument name="placeAtX" required="yes" type="numeric">
<cfargument name="placeAtY" required="yes" type="numeric"> <cfargument name="placeAtY" required="yes" type="numeric">
<cfset var imageResults = ""> <cfset var imageResults = "">
<cfif isSimpleValue(wmImage)> <cfif isSimpleValue(wmImage)>
<!--- filename or URL ---> <!--- filename or URL --->
<cfset imageResults = imageCFC.watermark(variables.img,"","",wmImage,alpha,placeAtX,placeAtY)> <cfset imageResults = imageCFC.watermark(variables.img,"","",wmImage,alpha,placeAtX,placeAtY)>
<cfelse> <cfelse>
<!--- must be a java object ---> <!--- must be a java object --->
<cfset imageResults = imageCFC.watermark(variables.img,wmImage,"","",alpha,placeAtX,placeAtY)> <cfset imageResults = imageCFC.watermark(variables.img,wmImage,"","",alpha,placeAtX,placeAtY)>
</cfif> </cfif>
<cfset variables.revertimg = variables.img> <cfset variables.revertimg = variables.img>
<cfset variables.img = imageResults.img> <cfset variables.img = imageResults.img>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
<cffunction name="save" access="public" output="false" returnType="void"> <cffunction name="save" access="public" output="false" returnType="void">
<cfargument name="filename" type="string" required="no"> <cfargument name="filename" type="string" required="no">
<cfargument name="jpegCompression" type="numeric" required="no"> <cfargument name="jpegCompression" type="numeric" required="no">
<cfif isDefined("arguments.jpegCompression") and isNumeric(arguments.jpegCompression)> <cfif isDefined("arguments.jpegCompression") and isNumeric(arguments.jpegCompression)>
<cfset imageCFC.writeImage(filename,variables.img,jpegCompression)> <cfset imageCFC.writeImage(filename,variables.img,jpegCompression)>
<cfelse> <cfelse>
<cfset imageCFC.writeImage(filename,variables.img)> <cfset imageCFC.writeImage(filename,variables.img)>
</cfif> </cfif>
</cffunction> </cffunction>
<cffunction name="revert" access="public" output="true" returntype="void" hint="Undo the previous manipulation."> <cffunction name="revert" access="public" output="true" returntype="void" hint="Undo the previous manipulation.">
<cfset variables.img = variables.revertimg> <cfset variables.img = variables.revertimg>
<cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")> <cfset variables.imageInfo = imageCFC.getImageInfo(variables.img,"")>
</cffunction> </cffunction>
</cfcomponent> </cfcomponent>

View File

@@ -1,315 +1,315 @@
<cfsetting enablecfoutputonly="yes" showdebugoutput="no"> <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* File Browser connector for ColdFusion 5. * File Browser connector for ColdFusion 5.
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de) * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
* *
* Note: * Note:
* FCKeditor requires that the connector responds with UTF-8 encoded XML. * FCKeditor requires that the connector responds with UTF-8 encoded XML.
* As ColdFusion 5 does not fully support UTF-8 encoding, we force ASCII * As ColdFusion 5 does not fully support UTF-8 encoding, we force ASCII
* file and folder names in this connector to allow CF5 send a UTF-8 * file and folder names in this connector to allow CF5 send a UTF-8
* encoded response - code points under 127 in UTF-8 are stored using a * encoded response - code points under 127 in UTF-8 are stored using a
* single byte, using the same encoding as ASCII, which is damn handy. * single byte, using the same encoding as ASCII, which is damn handy.
* This is all grand for the English speakers, like meself, but I dunno * This is all grand for the English speakers, like meself, but I dunno
* how others are gonna take to it. Well, the previous version of this * how others are gonna take to it. Well, the previous version of this
* connector already did this with file names and nobody seemed to mind, * connector already did this with file names and nobody seemed to mind,
* so fingers-crossed nobody will mind their folder names being munged too. * so fingers-crossed nobody will mind their folder names being munged too.
* *
---> --->
<cfparam name="url.command"> <cfparam name="url.command">
<cfparam name="url.type"> <cfparam name="url.type">
<cfparam name="url.currentFolder"> <cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually ---> <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm"> <cfinclude template="config.cfm">
<cfscript> <cfscript>
userFilesPath = config.userFilesPath; userFilesPath = config.userFilesPath;
if ( userFilesPath eq "" ) if ( userFilesPath eq "" )
{ {
userFilesPath = "/userfiles/"; userFilesPath = "/userfiles/";
} }
// make sure the user files path is correctly formatted // make sure the user files path is correctly formatted
userFilesPath = replace(userFilesPath, "\", "/", "ALL"); userFilesPath = replace(userFilesPath, "\", "/", "ALL");
userFilesPath = replace(userFilesPath, '//', '/', 'ALL'); userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
if ( right(userFilesPath,1) NEQ "/" ) if ( right(userFilesPath,1) NEQ "/" )
{ {
userFilesPath = userFilesPath & "/"; userFilesPath = userFilesPath & "/";
} }
if ( left(userFilesPath,1) NEQ "/" ) if ( left(userFilesPath,1) NEQ "/" )
{ {
userFilesPath = "/" & userFilesPath; userFilesPath = "/" & userFilesPath;
} }
// make sure the current folder is correctly formatted // make sure the current folder is correctly formatted
url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
if ( right(url.currentFolder,1) neq "/" ) if ( right(url.currentFolder,1) neq "/" )
{ {
url.currentFolder = url.currentFolder & "/"; url.currentFolder = url.currentFolder & "/";
} }
if ( left(url.currentFolder,1) neq "/" ) if ( left(url.currentFolder,1) neq "/" )
{ {
url.currentFolder = "/" & url.currentFolder; url.currentFolder = "/" & url.currentFolder;
} }
if ( find("/",getBaseTemplatePath()) neq 0 ) if ( find("/",getBaseTemplatePath()) neq 0 )
{ {
fs = "/"; fs = "/";
} }
else else
{ {
fs = "\"; fs = "\";
} }
// Get the base physical path to the web root for this application. The code to determine the path automatically assumes that // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
// the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
// virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. // virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
if ( len(config.serverPath) ) if ( len(config.serverPath) )
{ {
serverPath = config.serverPath; serverPath = config.serverPath;
if ( right(serverPath,1) neq fs ) if ( right(serverPath,1) neq fs )
{ {
serverPath = serverPath & fs; serverPath = serverPath & fs;
} }
} }
else else
{ {
serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all"); serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
} }
rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ; rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ;
xmlContent = ""; // append to this string to build content xmlContent = ""; // append to this string to build content
</cfscript> </cfscript>
<cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") > <cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
<cfif isDefined( "Config.FileTypesAbsolutePath" ) <cfif isDefined( "Config.FileTypesAbsolutePath" )
and structkeyexists( Config.FileTypesAbsolutePath, url.type ) and structkeyexists( Config.FileTypesAbsolutePath, url.type )
and Len( Config.FileTypesAbsolutePath[url.type] )> and Len( Config.FileTypesAbsolutePath[url.type] )>
<cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder> <cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder>
<cfelse> <cfelse>
<cftry> <cftry>
<cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder> <cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder>
<!--- Catch: Parameter 1 of function ExpandPath must be a relative path ---> <!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
<cfcatch type="any"> <cfcatch type="any">
<cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder> <cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder>
</cfcatch> </cfcatch>
</cftry> </cftry>
</cfif> </cfif>
<cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) > <cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) >
<!--- get rid of double directory separators ---> <!--- get rid of double directory separators --->
<cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") > <cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
<cfif not config.enabled> <cfif not config.enabled>
<cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/connectors/cfm/config.cfm' file"" />"> <cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/connectors/cfm/config.cfm' file"" />">
<cfelseif find("..",url.currentFolder) or find("\",url.currentFolder)> <cfelseif find("..",url.currentFolder) or find("\",url.currentFolder)>
<cfset xmlContent = "<Error number=""102"" />"> <cfset xmlContent = "<Error number=""102"" />">
<cfelseif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)> <cfelseif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)>
<cfset xmlContent = '<Error number="1" text="The &quot;' & url.command & '&quot; command isn''t allowed" />'> <cfset xmlContent = '<Error number="1" text="The &quot;' & url.command & '&quot; command isn''t allowed" />'>
<cfelseif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)> <cfelseif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)>
<cfset xmlContent = '<Error number="1" text="The &quot;' & url.type & '&quot; type isn''t allowed" />'> <cfset xmlContent = '<Error number="1" text="The &quot;' & url.type & '&quot; type isn''t allowed" />'>
</cfif> </cfif>
<cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )> <cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )>
<cfif not len(xmlContent) and not directoryexists(resourceTypeDirectory)> <cfif not len(xmlContent) and not directoryexists(resourceTypeDirectory)>
<!--- create directories in physical path if they don't already exist ---> <!--- create directories in physical path if they don't already exist --->
<cfset currentPath = ""> <cfset currentPath = "">
<cftry> <cftry>
<cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#"> <cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#">
<cfif currentPath eq "" and fs eq "\"> <cfif currentPath eq "" and fs eq "\">
<!--- Without checking this, we would have in Windows \C:\ ---> <!--- Without checking this, we would have in Windows \C:\ --->
<cfif not directoryExists(name)> <cfif not directoryExists(name)>
<cfdirectory action="create" directory="#name#" mode="755"> <cfdirectory action="create" directory="#name#" mode="755">
</cfif> </cfif>
<cfelse> <cfelse>
<cfif not directoryExists(currentPath & fs & name)> <cfif not directoryExists(currentPath & fs & name)>
<cfdirectory action="create" directory="#currentPath##fs##name#" mode="755"> <cfdirectory action="create" directory="#currentPath##fs##name#" mode="755">
</cfif> </cfif>
</cfif> </cfif>
<cfif fs eq "\" and currentPath eq ""> <cfif fs eq "\" and currentPath eq "">
<cfset currentPath = name> <cfset currentPath = name>
<cfelse> <cfelse>
<cfset currentPath = currentPath & fs & name> <cfset currentPath = currentPath & fs & name>
</cfif> </cfif>
</cfloop> </cfloop>
<cfcatch type="any"> <cfcatch type="any">
<!--- this should only occur as a result of a permissions problem ---> <!--- this should only occur as a result of a permissions problem --->
<cfset xmlContent = "<Error number=""103"" />"> <cfset xmlContent = "<Error number=""103"" />">
</cfcatch> </cfcatch>
</cftry> </cftry>
</cfif> </cfif>
<cfif not len(xmlContent)> <cfif not len(xmlContent)>
<!--- no errors thus far - run command ---> <!--- no errors thus far - run command --->
<!--- we need to know the physical path to the current folder for all commands ---> <!--- we need to know the physical path to the current folder for all commands --->
<cfset currentFolderPath = userFilesServerPath> <cfset currentFolderPath = userFilesServerPath>
<cfswitch expression="#url.command#"> <cfswitch expression="#url.command#">
<cfcase value="FileUpload"> <cfcase value="FileUpload">
<cfset config_included = true > <cfset config_included = true >
<cfinclude template="cf5_upload.cfm"> <cfinclude template="cf5_upload.cfm">
<cfabort> <cfabort>
</cfcase> </cfcase>
<cfcase value="GetFolders"> <cfcase value="GetFolders">
<!--- Sort directories first, name ascending ---> <!--- Sort directories first, name ascending --->
<cfdirectory <cfdirectory
action="list" action="list"
directory="#currentFolderPath#" directory="#currentFolderPath#"
name="qDir" name="qDir"
sort="type,name"> sort="type,name">
<cfscript> <cfscript>
i=1; i=1;
folders = ""; folders = "";
while( i lte qDir.recordCount ) { while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "FILE" )) if( not compareNoCase( qDir.type[i], "FILE" ))
break; break;
if( not listFind(".,..", qDir.name[i]) ) if( not listFind(".,..", qDir.name[i]) )
folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />'; folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />';
i=i+1; i=i+1;
} }
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>'; xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
</cfscript> </cfscript>
</cfcase> </cfcase>
<cfcase value="GetFoldersAndFiles"> <cfcase value="GetFoldersAndFiles">
<!--- Sort directories first, name ascending ---> <!--- Sort directories first, name ascending --->
<cfdirectory <cfdirectory
action="list" action="list"
directory="#currentFolderPath#" directory="#currentFolderPath#"
name="qDir" name="qDir"
sort="type,name"> sort="type,name">
<cfscript> <cfscript>
i=1; i=1;
folders = ""; folders = "";
files = ""; files = "";
while( i lte qDir.recordCount ) { while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) { if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />'; folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />';
} else if( not compareNoCase( qDir.type[i], "FILE" ) ) { } else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
fileSizeKB = round(qDir.size[i] / 1024); fileSizeKB = round(qDir.size[i] / 1024);
files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />'; files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />';
} }
i=i+1; i=i+1;
} }
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>'; xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
xmlContent = xmlContent & '<Files>' & files & '</Files>'; xmlContent = xmlContent & '<Files>' & files & '</Files>';
</cfscript> </cfscript>
</cfcase> </cfcase>
<cfcase value="CreateFolder"> <cfcase value="CreateFolder">
<cfparam name="url.newFolderName" default=""> <cfparam name="url.newFolderName" default="">
<cfscript> <cfscript>
newFolderName = url.newFolderName; newFolderName = url.newFolderName;
if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) { if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
// Munge folder name same way as we do the filename // Munge folder name same way as we do the filename
// This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8 // This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all"); newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
newFolderName = reReplace(newFolderName, "_{2,}", "_", "all"); newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all"); newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all"); newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
} }
</cfscript> </cfscript>
<cfif not len(newFolderName) or len(newFolderName) gt 255> <cfif not len(newFolderName) or len(newFolderName) gt 255>
<cfset errorNumber = 102> <cfset errorNumber = 102>
<cfelseif directoryExists(currentFolderPath & newFolderName)> <cfelseif directoryExists(currentFolderPath & newFolderName)>
<cfset errorNumber = 101> <cfset errorNumber = 101>
<cfelseif reFind("^\.\.",newFolderName)> <cfelseif reFind("^\.\.",newFolderName)>
<cfset errorNumber = 103> <cfset errorNumber = 103>
<cfelse> <cfelse>
<cfset errorNumber = 0> <cfset errorNumber = 0>
<cftry> <cftry>
<cfdirectory <cfdirectory
action="create" action="create"
directory="#currentFolderPath##newFolderName#" directory="#currentFolderPath##newFolderName#"
mode="755"> mode="755">
<cfcatch> <cfcatch>
<!--- <!---
un-resolvable error numbers in ColdFusion: un-resolvable error numbers in ColdFusion:
* 102 : Invalid folder name. * 102 : Invalid folder name.
* 103 : You have no permissions to create the folder. * 103 : You have no permissions to create the folder.
---> --->
<cfset errorNumber = 110> <cfset errorNumber = 110>
</cfcatch> </cfcatch>
</cftry> </cftry>
</cfif> </cfif>
<cfset xmlContent = xmlContent & '<Error number="#errorNumber#" />'> <cfset xmlContent = xmlContent & '<Error number="#errorNumber#" />'>
</cfcase> </cfcase>
<cfdefaultcase> <cfdefaultcase>
<cfthrow type="fckeditor.connector" message="Illegal command: #url.command#"> <cfthrow type="fckeditor.connector" message="Illegal command: #url.command#">
</cfdefaultcase> </cfdefaultcase>
</cfswitch> </cfswitch>
</cfif> </cfif>
<cfscript> <cfscript>
xmlHeader = '<?xml version="1.0" encoding="utf-8" ?><Connector command="#url.command#" resourceType="#url.type#">'; xmlHeader = '<?xml version="1.0" encoding="utf-8" ?><Connector command="#url.command#" resourceType="#url.type#">';
xmlHeader = xmlHeader & '<CurrentFolder path="#url.currentFolder#" url="#resourceTypeUrl##url.currentFolder#" />'; xmlHeader = xmlHeader & '<CurrentFolder path="#url.currentFolder#" url="#resourceTypeUrl##url.currentFolder#" />';
xmlFooter = '</Connector>'; xmlFooter = '</Connector>';
</cfscript> </cfscript>
<cfheader name="Expires" value="#GetHttpTimeString(Now())#"> <cfheader name="Expires" value="#GetHttpTimeString(Now())#">
<cfheader name="Pragma" value="no-cache"> <cfheader name="Pragma" value="no-cache">
<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate"> <cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
<cfcontent reset="true" type="text/xml; charset=UTF-8"> <cfcontent reset="true" type="text/xml; charset=UTF-8">
<cfoutput>#xmlHeader##xmlContent##xmlFooter#</cfoutput> <cfoutput>#xmlHeader##xmlContent##xmlFooter#</cfoutput>

View File

@@ -1,328 +1,299 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the "File Uploader" for ColdFusion 5. * This is the "File Uploader" for ColdFusion 5.
* Based on connector.cfm by Mark Woods (mark@thickpaddy.com) * Based on connector.cfm by Mark Woods (mark@thickpaddy.com)
* *
* Note: * Note:
* FCKeditor requires that the connector responds with UTF-8 encoded XML. * FCKeditor requires that the connector responds with UTF-8 encoded XML.
* As ColdFusion 5 does not fully support UTF-8 encoding, we force ASCII * As ColdFusion 5 does not fully support UTF-8 encoding, we force ASCII
* file and folder names in this connector to allow CF5 send a UTF-8 * file and folder names in this connector to allow CF5 send a UTF-8
* encoded response - code points under 127 in UTF-8 are stored using a * encoded response - code points under 127 in UTF-8 are stored using a
* single byte, using the same encoding as ASCII, which is damn handy. * single byte, using the same encoding as ASCII, which is damn handy.
* This is all grand for the English speakers, like meself, but I dunno * This is all grand for the English speakers, like meself, but I dunno
* how others are gonna take to it. Well, the previous version of this * how others are gonna take to it. Well, the previous version of this
* connector already did this with file names and nobody seemed to mind, * connector already did this with file names and nobody seemed to mind,
* so fingers-crossed nobody will mind their folder names being munged too. * so fingers-crossed nobody will mind their folder names being munged too.
* *
---> --->
<cfparam name="url.command" default="QuickUpload"> <cfparam name="url.command" default="QuickUpload">
<cfparam name="url.type" default="File"> <cfparam name="url.type" default="File">
<cfparam name="url.currentFolder" default="/"> <cfparam name="url.currentFolder" default="/">
<cfif not isDefined("config_included")> <cfif not isDefined("config_included")>
<cfinclude template="config.cfm"> <cfinclude template="config.cfm">
</cfif> </cfif>
<cfscript> <cfscript>
function SendUploadResults(errorNumber, fileUrl, fileName, customMsg) function SendUploadResults(errorNumber, fileUrl, fileName, customMsg)
{ {
WriteOutput('<script type="text/javascript">'); WriteOutput('<script type="text/javascript">');
WriteOutput("(function()"& // Minified version of the document.domain automatic fix script (#1919).
"{"& // The original script can be found at _dev/domain_fix_template.js
" var d = document.domain ;"& WriteOutput("(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();");
""& WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' );
" while ( true )"& WriteOutput('</script>');
" {"& }
// Test if we can access a parent property. </cfscript>
" try"&
" {"& <cfif NOT config.enabled>
" var test = window.top.opener.document.domain ;"& <cfset SendUploadResults(1, "", "", "This file uploader is disabled. Please check the ""editor/filemanager/connectors/cfm/config.cfm"" file")>
" break ;"& <cfabort>
" }"& </cfif>
" catch( e ) {}"&
""& <cfif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)>
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... <cfset SendUploadResults(1, "", "", "The """ & url.command & """ command isn't allowed")>
" d = d.replace( /.*?(?:\.|$)/, '' ) ;"& <cfabort>
""& </cfif>
" if ( d.length == 0 )"&
// It was not able to detect the domain. <cfif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)>
" break ;"& <cfset SendUploadResults(1, "", "", "The """ & url.type & """ type isn't allowed")>
""& <cfabort>
" try"& </cfif>
" {"&
" document.domain = d ;"& <cfif find( "..", url.currentFolder) or find( "\", url.currentFolder)>
" }"& <cfset SendUploadResults(102)>
" catch (e)"& <cfabort>
" {"& </cfif>
" break ;"&
" }"& <cfscript>
" }"& userFilesPath = config.userFilesPath;
"})() ;");
if ( userFilesPath eq "" ) {
WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' ); userFilesPath = "/userfiles/";
WriteOutput('</script>'); }
}
</cfscript> // make sure the user files path is correctly formatted
userFilesPath = replace(userFilesPath, "\", "/", "ALL");
<cfif NOT config.enabled> userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
<cfset SendUploadResults(1, "", "", "This file uploader is disabled. Please check the ""editor/filemanager/connectors/cfm/config.cfm"" file")> if ( right(userFilesPath,1) NEQ "/" ) {
<cfabort> userFilesPath = userFilesPath & "/";
</cfif> }
if ( left(userFilesPath,1) NEQ "/" ) {
<cfif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)> userFilesPath = "/" & userFilesPath;
<cfset SendUploadResults(1, "", "", "The """ & url.command & """ command isn't allowed")> }
<cfabort>
</cfif> // make sure the current folder is correctly formatted
url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
<cfif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)> url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
<cfset SendUploadResults(1, "", "", "The """ & url.type & """ type isn't allowed")> if ( right(url.currentFolder,1) neq "/" ) {
<cfabort> url.currentFolder = url.currentFolder & "/";
</cfif> }
if ( left(url.currentFolder,1) neq "/" ) {
<cfif find( "..", url.currentFolder) or find( "\", url.currentFolder)> url.currentFolder = "/" & url.currentFolder;
<cfset SendUploadResults(102)> }
<cfabort>
</cfif> if (find("/",getBaseTemplatePath())) {
fs = "/";
<cfscript> } else {
userFilesPath = config.userFilesPath; fs = "\";
}
if ( userFilesPath eq "" ) {
userFilesPath = "/userfiles/"; // Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
} // the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
// virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
// make sure the user files path is correctly formatted if ( len(config.serverPath) ) {
userFilesPath = replace(userFilesPath, "\", "/", "ALL"); serverPath = config.serverPath;
userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
if ( right(userFilesPath,1) NEQ "/" ) { if ( right(serverPath,1) neq fs ) {
userFilesPath = userFilesPath & "/"; serverPath = serverPath & fs;
} }
if ( left(userFilesPath,1) NEQ "/" ) { } else {
userFilesPath = "/" & userFilesPath; serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
} }
// make sure the current folder is correctly formatted rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ;
url.currentFolder = replace(url.currentFolder, "\", "/", "ALL"); </cfscript>
url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL'); <cfif url.command eq "QuickUpload">
if ( right(url.currentFolder,1) neq "/" ) { <cfset resourceTypeUrl = rereplace( replace( Config.QuickUploadPath[url.type], fs, "/", "all"), "/$", "") >
url.currentFolder = url.currentFolder & "/"; <cfif isDefined( "Config.QuickUploadAbsolutePath" )
} and structkeyexists( Config.QuickUploadAbsolutePath, url.type )
if ( left(url.currentFolder,1) neq "/" ) { and Len( Config.QuickUploadAbsolutePath[url.type] )>
url.currentFolder = "/" & url.currentFolder; <cfset userFilesServerPath = Config.QuickUploadAbsolutePath[url.type] & url.currentFolder>
} <cfelse>
<cftry>
if (find("/",getBaseTemplatePath())) { <cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder>
fs = "/"; <!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
} else { <cfcatch type="any">
fs = "\"; <cfset userFilesServerPath = rootPath & Config.QuickUploadPath[url.type] & url.currentFolder>
} </cfcatch>
</cftry>
// Get the base physical path to the web root for this application. The code to determine the path automatically assumes that </cfif>
// the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a <cfelse>
// virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary. <cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
if ( len(config.serverPath) ) { <cfif isDefined( "Config.FileTypesAbsolutePath" )
serverPath = config.serverPath; and structkeyexists( Config.FileTypesAbsolutePath, url.type )
and Len( Config.FileTypesAbsolutePath[url.type] )>
if ( right(serverPath,1) neq fs ) { <cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder>
serverPath = serverPath & fs; <cfelse>
} <cftry>
} else { <cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder>
serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all"); <!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
} <cfcatch type="any">
<cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder>
rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ; </cfcatch>
</cfscript> </cftry>
<cfif url.command eq "QuickUpload"> </cfif>
<cfset resourceTypeUrl = rereplace( replace( Config.QuickUploadPath[url.type], fs, "/", "all"), "/$", "") > </cfif>
<cfif isDefined( "Config.QuickUploadAbsolutePath" )
and structkeyexists( Config.QuickUploadAbsolutePath, url.type ) <cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) >
and Len( Config.QuickUploadAbsolutePath[url.type] )> <!--- get rid of double directory separators --->
<cfset userFilesServerPath = Config.QuickUploadAbsolutePath[url.type] & url.currentFolder> <cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
<cfelse>
<cftry> <!--- create resource type directory if not exists --->
<cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder> <cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )>
<!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
<cfcatch type="any"> <cfif not directoryexists( resourceTypeDirectory )>
<cfset userFilesServerPath = rootPath & Config.QuickUploadPath[url.type] & url.currentFolder>
</cfcatch> <cfset currentPath = "">
</cftry> <cftry>
</cfif> <cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#">
<cfelse> <cfif currentPath eq "" and fs eq "\">
<cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") > <!--- Without checking this, we would have in Windows \C:\ --->
<cfif isDefined( "Config.FileTypesAbsolutePath" ) <cfif not directoryExists(name)>
and structkeyexists( Config.FileTypesAbsolutePath, url.type ) <cfdirectory action="create" directory="#name#" mode="755">
and Len( Config.FileTypesAbsolutePath[url.type] )> </cfif>
<cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder> <cfelse>
<cfelse> <cfif not directoryExists(currentPath & fs & name)>
<cftry> <cfdirectory action="create" directory="#currentPath##fs##name#" mode="755">
<cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder> </cfif>
<!--- Catch: Parameter 1 of function ExpandPath must be a relative path ---> </cfif>
<cfcatch type="any">
<cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder> <cfif fs eq "\" and currentPath eq "">
</cfcatch> <cfset currentPath = name>
</cftry> <cfelse>
</cfif> <cfset currentPath = currentPath & fs & name>
</cfif> </cfif>
</cfloop>
<cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) >
<!--- get rid of double directory separators ---> <cfcatch type="any">
<cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
<!--- this should only occur as a result of a permissions problem --->
<!--- create resource type directory if not exists ---> <cfset SendUploadResults(103)>
<cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )> <cfabort>
<cfif not directoryexists( resourceTypeDirectory )> </cfcatch>
<cfset currentPath = ""> </cftry>
<cftry> </cfif>
<cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#">
<cfif currentPath eq "" and fs eq "\"> <cfset currentFolderPath = userFilesServerPath>
<!--- Without checking this, we would have in Windows \C:\ ---> <cfset resourceType = url.type>
<cfif not directoryExists(name)>
<cfdirectory action="create" directory="#name#" mode="755"> <cfset fileName = "">
</cfif> <cfset fileExt = "">
<cfelse>
<cfif not directoryExists(currentPath & fs & name)> <!--- Can be overwritten. The last value will be sent with the result --->
<cfdirectory action="create" directory="#currentPath##fs##name#" mode="755"> <cfset customMsg = "">
</cfif>
</cfif> <cftry>
<!--- first upload the file with an unique filename --->
<cfif fs eq "\" and currentPath eq ""> <cffile action="upload"
<cfset currentPath = name> fileField="NewFile"
<cfelse> destination="#currentFolderPath#"
<cfset currentPath = currentPath & fs & name> nameConflict="makeunique"
</cfif> mode="644"
</cfloop> attributes="normal">
<cfcatch type="any"> <cfif cffile.fileSize EQ 0>
<cfthrow>
<!--- this should only occur as a result of a permissions problem ---> </cfif>
<cfset SendUploadResults(103)>
<cfabort> <cfset lAllowedExtensions = config.allowedExtensions[#resourceType#]>
<cfset lDeniedExtensions = config.deniedExtensions[#resourceType#]>
</cfcatch>
<cfif ( len(lAllowedExtensions) and not listFindNoCase(lAllowedExtensions,cffile.ServerFileExt) )
</cftry> or ( len(lDeniedExtensions) and listFindNoCase(lDeniedExtensions,cffile.ServerFileExt) )>
</cfif>
<cfset errorNumber = "202">
<cfset currentFolderPath = userFilesServerPath> <cffile action="delete" file="#cffile.ServerDirectory##fs##cffile.ServerFile#">
<cfset resourceType = url.type>
<cfelse>
<cfset fileName = "">
<cfset fileExt = ""> <cfscript>
errorNumber = 0;
<!--- Can be overwritten. The last value will be sent with the result ---> fileName = cffile.ClientFileName ;
<cfset customMsg = ""> fileExt = cffile.ServerFileExt ;
fileExisted = false ;
<cftry>
<!--- first upload the file with an unique filename ---> // munge filename for html download. Only a-z, 0-9, _, - and . are allowed
<cffile action="upload" if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) {
fileField="NewFile" fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL");
destination="#currentFolderPath#" fileName = reReplace(fileName, "_{2,}", "_", "ALL");
nameConflict="makeunique" fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL");
mode="644" fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL");
attributes="normal"> }
<cfif cffile.fileSize EQ 0> // remove additional dots from file name
<cfthrow> if( isDefined("Config.ForceSingleExtension") and Config.ForceSingleExtension )
</cfif> fileName = replace( fileName, '.', "_", "all" ) ;
<cfset lAllowedExtensions = config.allowedExtensions[#resourceType#]> // When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename.
<cfset lDeniedExtensions = config.deniedExtensions[#resourceType#]> if( compare( cffile.ServerFileName, fileName ) ) {
counter = 0;
<cfif ( len(lAllowedExtensions) and not listFindNoCase(lAllowedExtensions,cffile.ServerFileExt) ) tmpFileName = fileName;
or ( len(lDeniedExtensions) and listFindNoCase(lDeniedExtensions,cffile.ServerFileExt) )> while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) {
fileExisted = true ;
<cfset errorNumber = "202"> counter = counter + 1 ;
<cffile action="delete" file="#cffile.ServerDirectory##fs##cffile.ServerFile#"> fileName = tmpFileName & '(#counter#)' ;
}
<cfelse> }
</cfscript>
<cfscript>
errorNumber = 0; <!--- Rename the uploaded file, if neccessary --->
fileName = cffile.ClientFileName ; <cfif compare(cffile.ServerFileName,fileName)>
fileExt = cffile.ServerFileExt ;
fileExisted = false ; <cfif fileExisted>
<cfset errorNumber = "201">
// munge filename for html download. Only a-z, 0-9, _, - and . are allowed </cfif>
if( reFind("[^A-Za-z0-9_\-\.]", fileName) ) { <cffile
fileName = reReplace(fileName, "[^A-Za-z0-9\-\.]", "_", "ALL"); action="rename"
fileName = reReplace(fileName, "_{2,}", "_", "ALL"); source="#currentFolderPath##cffile.ServerFileName#.#cffile.ServerFileExt#"
fileName = reReplace(fileName, "([^_]+)_+$", "\1", "ALL"); destination="#currentFolderPath##fileName#.#fileExt#"
fileName = reReplace(fileName, "$_([^_]+)$", "\1", "ALL"); mode="644"
} attributes="normal">
// remove additional dots from file name </cfif>
if( isDefined("Config.ForceSingleExtension") and Config.ForceSingleExtension )
fileName = replace( fileName, '.', "_", "all" ) ; </cfif>
// When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. <cfcatch type="any">
if( compare( cffile.ServerFileName, fileName ) ) {
counter = 0; <cfset errorNumber = "1">
tmpFileName = fileName; <cfset customMsg = cfcatch.message >
while( fileExists("#currentFolderPath##fileName#.#fileExt#") ) {
fileExisted = true ; </cfcatch>
counter = counter + 1 ; </cftry>
fileName = tmpFileName & '(#counter#)' ;
} <cfif errorNumber EQ 0>
} <!--- file was uploaded succesfully --->
</cfscript> <cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', "", "")>
<cfabort>
<!--- Rename the uploaded file, if neccessary ---> <cfelseif errorNumber EQ 201>
<cfif compare(cffile.ServerFileName,fileName)> <!--- file was changed (201), submit the new filename --->
<cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', replace( fileName & "." & fileExt, "'", "\'", "ALL"), customMsg)>
<cfif fileExisted> <cfabort>
<cfset errorNumber = "201"> <cfelse>
</cfif> <!--- An error occured(202). Submit only the error code and a message (if available). --->
<cffile <cfset SendUploadResults(errorNumber, '', '', customMsg)>
action="rename" <cfabort>
source="#currentFolderPath##cffile.ServerFileName#.#cffile.ServerFileExt#" </cfif>
destination="#currentFolderPath##fileName#.#fileExt#"
mode="644"
attributes="normal">
</cfif>
</cfif>
<cfcatch type="any">
<cfset errorNumber = "1">
<cfset customMsg = cfcatch.message >
</cfcatch>
</cftry>
<cfif errorNumber EQ 0>
<!--- file was uploaded succesfully --->
<cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', "", "")>
<cfabort>
<cfelseif errorNumber EQ 201>
<!--- file was changed (201), submit the new filename --->
<cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', replace( fileName & "." & fileExt, "'", "\'", "ALL"), customMsg)>
<cfabort>
<cfelse>
<!--- An error occured(202). Submit only the error code and a message (if available). --->
<cfset SendUploadResults(errorNumber, '', '', customMsg)>
<cfabort>
</cfif>

View File

@@ -1,68 +1,68 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This file include the functions that create the base XML output by the ColdFusion Connector (MX 6.0 and above). * This file include the functions that create the base XML output by the ColdFusion Connector (MX 6.0 and above).
---> --->
<cffunction name="SetXmlHeaders" returntype="void"> <cffunction name="SetXmlHeaders" returntype="void">
<cfheader name="Expires" value="#GetHttpTimeString(Now())#"> <cfheader name="Expires" value="#GetHttpTimeString(Now())#">
<cfheader name="Pragma" value="no-cache"> <cfheader name="Pragma" value="no-cache">
<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate"> <cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
<cfcontent reset="true" type="text/xml; charset=UTF-8"> <cfcontent reset="true" type="text/xml; charset=UTF-8">
</cffunction> </cffunction>
<cffunction name="CreateXmlHeader" returntype="void" output="true"> <cffunction name="CreateXmlHeader" returntype="void" output="true">
<cfargument name="command" required="true"> <cfargument name="command" required="true">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfargument name="currentFolder" required="true"> <cfargument name="currentFolder" required="true">
<cfset SetXmlHeaders()> <cfset SetXmlHeaders()>
<cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput> <cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput>
<cfoutput><Connector command="#ARGUMENTS.command#" resourceType="#ARGUMENTS.resourceType#"></cfoutput> <cfoutput><Connector command="#ARGUMENTS.command#" resourceType="#ARGUMENTS.resourceType#"></cfoutput>
<cfoutput><CurrentFolder path="#HTMLEditFormat(ARGUMENTS.currentFolder)#" url="#HTMLEditFormat( GetUrlFromPath( resourceType, currentFolder, command ) )#" /></cfoutput> <cfoutput><CurrentFolder path="#HTMLEditFormat(ARGUMENTS.currentFolder)#" url="#HTMLEditFormat( GetUrlFromPath( resourceType, currentFolder, command ) )#" /></cfoutput>
<cfset REQUEST.HeaderSent = true> <cfset REQUEST.HeaderSent = true>
</cffunction> </cffunction>
<cffunction name="CreateXmlFooter" returntype="void" output="true"> <cffunction name="CreateXmlFooter" returntype="void" output="true">
<cfoutput></Connector></cfoutput> <cfoutput></Connector></cfoutput>
</cffunction> </cffunction>
<cffunction name="SendError" returntype="void" output="true"> <cffunction name="SendError" returntype="void" output="true">
<cfargument name="number" required="true" type="Numeric"> <cfargument name="number" required="true" type="Numeric">
<cfargument name="text" required="true"> <cfargument name="text" required="true">
<cfif isDefined("REQUEST.HeaderSent") and REQUEST.HeaderSent> <cfif isDefined("REQUEST.HeaderSent") and REQUEST.HeaderSent>
<cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )> <cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )>
<cfset CreateXmlFooter() > <cfset CreateXmlFooter() >
<cfelse> <cfelse>
<cfset SetXmlHeaders()> <cfset SetXmlHeaders()>
<cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput> <cfoutput><?xml version="1.0" encoding="utf-8" ?></cfoutput>
<cfoutput><Connector></cfoutput> <cfoutput><Connector></cfoutput>
<cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )> <cfset SendErrorNode( ARGUMENTS.number, ARGUMENTS.text )>
<cfset CreateXmlFooter() > <cfset CreateXmlFooter() >
</cfif> </cfif>
<cfabort> <cfabort>
</cffunction> </cffunction>
<cffunction name="SendErrorNode" returntype="void" output="true"> <cffunction name="SendErrorNode" returntype="void" output="true">
<cfargument name="number" required="true" type="Numeric"> <cfargument name="number" required="true" type="Numeric">
<cfargument name="text" required="true"> <cfargument name="text" required="true">
<cfoutput><Error number="#ARGUMENTS.number#" text="#htmleditformat(ARGUMENTS.text)#" /></cfoutput> <cfoutput><Error number="#ARGUMENTS.number#" text="#htmleditformat(ARGUMENTS.text)#" /></cfoutput>
</cffunction> </cffunction>

View File

@@ -1,230 +1,230 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This file include the functions that handle the Command requests * This file include the functions that handle the Command requests
* in the ColdFusion Connector (MX 6.0 and above). * in the ColdFusion Connector (MX 6.0 and above).
---> --->
<cffunction name="FileUpload" returntype="void" output="true"> <cffunction name="FileUpload" returntype="void" output="true">
<cfargument name="resourceType" type="string" required="yes" default=""> <cfargument name="resourceType" type="string" required="yes" default="">
<cfargument name="currentFolder" type="string" required="yes" default=""> <cfargument name="currentFolder" type="string" required="yes" default="">
<cfargument name="sCommand" type="string" required="yes" default=""> <cfargument name="sCommand" type="string" required="yes" default="">
<cfset var sFileName = ""> <cfset var sFileName = "">
<cfset var sFilePart = ""> <cfset var sFilePart = "">
<cfset var sFileExt = ""> <cfset var sFileExt = "">
<cfset var sFileUrl = ""> <cfset var sFileUrl = "">
<cfset var sTempDir = ""> <cfset var sTempDir = "">
<cfset var sTempFilePath = ""> <cfset var sTempFilePath = "">
<cfset var errorNumber = 0> <cfset var errorNumber = 0>
<cfset var customMsg = 0> <cfset var customMsg = 0>
<cfset var counter = 0> <cfset var counter = 0>
<cfset var destination = ""> <cfset var destination = "">
<cftry> <cftry>
<cfif isDefined( "REQUEST.Config.TempDirectory" )> <cfif isDefined( "REQUEST.Config.TempDirectory" )>
<cfset sTempDir = REQUEST.Config.TempDirectory> <cfset sTempDir = REQUEST.Config.TempDirectory>
<cfelse> <cfelse>
<cfset sTempDir = GetTempDirectory()> <cfset sTempDir = GetTempDirectory()>
</cfif> </cfif>
<cfif NOT DirectoryExists (sTempDir)> <cfif NOT DirectoryExists (sTempDir)>
<cfthrow message="Invalid temporary directory: #sTempDir#"> <cfthrow message="Invalid temporary directory: #sTempDir#">
</cfif> </cfif>
<cffile action="UPLOAD" filefield="NewFile" destination="#sTempDir#" nameconflict="makeunique" mode="0755" /> <cffile action="UPLOAD" filefield="NewFile" destination="#sTempDir#" nameconflict="makeunique" mode="0755" />
<cfset sTempFilePath = CFFILE.ServerDirectory & REQUEST.fs & CFFILE.ServerFile> <cfset sTempFilePath = CFFILE.ServerDirectory & REQUEST.fs & CFFILE.ServerFile>
<!--- Map the virtual path to the local server path. ---> <!--- Map the virtual path to the local server path. --->
<cfset sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, ARGUMENTS.sCommand) > <cfset sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, ARGUMENTS.sCommand) >
<!--- Get the uploaded file name. ---> <!--- Get the uploaded file name. --->
<cfset sFileName = SanitizeFileName( CFFILE.ClientFile ) > <cfset sFileName = SanitizeFileName( CFFILE.ClientFile ) >
<cfset sOriginalFileName = sFileName > <cfset sOriginalFileName = sFileName >
<cfif isDefined( "REQUEST.Config.SecureImageUploads" ) and REQUEST.Config.SecureImageUploads> <cfif isDefined( "REQUEST.Config.SecureImageUploads" ) and REQUEST.Config.SecureImageUploads>
<cfif not IsImageValid( sTempFilePath, CFFILE.ClientFileExt )> <cfif not IsImageValid( sTempFilePath, CFFILE.ClientFileExt )>
<cftry> <cftry>
<cffile action="delete" file="#sTempFilePath#"> <cffile action="delete" file="#sTempFilePath#">
<cfcatch type="any"> <cfcatch type="any">
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfthrow errorcode="202" type="fckeditor"> <cfthrow errorcode="202" type="fckeditor">
</cfif> </cfif>
</cfif> </cfif>
<cfif isDefined( "REQUEST.Config.HtmlExtensions" ) and not listFindNoCase( REQUEST.Config.HtmlExtensions, CFFILE.ClientFileExt )> <cfif isDefined( "REQUEST.Config.HtmlExtensions" ) and not listFindNoCase( REQUEST.Config.HtmlExtensions, CFFILE.ClientFileExt )>
<cfif DetectHtml( sTempFilePath )> <cfif DetectHtml( sTempFilePath )>
<cftry> <cftry>
<cffile action="delete" file="#sTempFilePath#"> <cffile action="delete" file="#sTempFilePath#">
<cfcatch type="any"> <cfcatch type="any">
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfthrow errorcode="202" type="fckeditor"> <cfthrow errorcode="202" type="fckeditor">
</cfif> </cfif>
</cfif> </cfif>
<cfif not IsAllowedExt( CFFILE.ClientFileExt, ARGUMENTS.resourceType )> <cfif not IsAllowedExt( CFFILE.ClientFileExt, ARGUMENTS.resourceType )>
<cftry> <cftry>
<cffile action="delete" file="#sTempFilePath#"> <cffile action="delete" file="#sTempFilePath#">
<cfcatch type="any"> <cfcatch type="any">
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfthrow errorcode="202" type="fckeditor"> <cfthrow errorcode="202" type="fckeditor">
</cfif> </cfif>
<!--- When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. ---> <!--- When the original filename already exists, add numbers (0), (1), (2), ... at the end of the filename. --->
<cfscript> <cfscript>
sFileExt = GetExtension( sFileName ) ; sFileExt = GetExtension( sFileName ) ;
sFilePart = RemoveExtension( sFileName ); sFilePart = RemoveExtension( sFileName );
while( fileExists( sServerDir & sFileName ) ) while( fileExists( sServerDir & sFileName ) )
{ {
counter = counter + 1; counter = counter + 1;
sFileName = sFilePart & '(#counter#).' & CFFILE.ClientFileExt; sFileName = sFilePart & '(#counter#).' & CFFILE.ClientFileExt;
errorNumber = 201; errorNumber = 201;
} }
</cfscript> </cfscript>
<cfset destination = sServerDir & sFileName> <cfset destination = sServerDir & sFileName>
<cflock name="#destination#" timeout="30" type="Exclusive"> <cflock name="#destination#" timeout="30" type="Exclusive">
<cftry> <cftry>
<cffile action="move" source="#sTempFilePath#" destination="#destination#" mode="755"> <cffile action="move" source="#sTempFilePath#" destination="#destination#" mode="755">
<!--- omit CF 6.1 error during moving uploaded file, just copy that file instead of moving ---> <!--- omit CF 6.1 error during moving uploaded file, just copy that file instead of moving --->
<cfcatch type="any"> <cfcatch type="any">
<cffile action="copy" source="#sTempFilePath#" destination="#destination#" mode="755"> <cffile action="copy" source="#sTempFilePath#" destination="#destination#" mode="755">
</cfcatch> </cfcatch>
</cftry> </cftry>
</cflock> </cflock>
<cfset sFileUrl = CombinePaths( GetResourceTypePath( ARGUMENTS.resourceType, sCommand ) , ARGUMENTS.currentFolder ) > <cfset sFileUrl = CombinePaths( GetResourceTypePath( ARGUMENTS.resourceType, sCommand ) , ARGUMENTS.currentFolder ) >
<cfset sFileUrl = CombinePaths( sFileUrl , sFileName ) > <cfset sFileUrl = CombinePaths( sFileUrl , sFileName ) >
<cfcatch type="fckeditor"> <cfcatch type="fckeditor">
<cfset errorNumber = CFCATCH.ErrorCode> <cfset errorNumber = CFCATCH.ErrorCode>
</cfcatch> </cfcatch>
<cfcatch type="any"> <cfcatch type="any">
<cfset errorNumber = "1"> <cfset errorNumber = "1">
<cfset customMsg = CFCATCH.Message > <cfset customMsg = CFCATCH.Message >
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfset SendUploadResults( errorNumber, sFileUrl, sFileName, customMsg ) > <cfset SendUploadResults( errorNumber, sFileUrl, sFileName, customMsg ) >
</cffunction> </cffunction>
<cffunction name="GetFolders" returntype="void" output="true"> <cffunction name="GetFolders" returntype="void" output="true">
<cfargument name="resourceType" type="String" required="true"> <cfargument name="resourceType" type="String" required="true">
<cfargument name="currentFolder" type="String" required="true"> <cfargument name="currentFolder" type="String" required="true">
<cfset var i = 1> <cfset var i = 1>
<cfset var folders = ""> <cfset var folders = "">
<!--- Map the virtual path to the local server path ---> <!--- Map the virtual path to the local server path --->
<cfset var sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, "GetFolders" ) > <cfset var sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, "GetFolders" ) >
<!--- Sort directories first, name ascending ---> <!--- Sort directories first, name ascending --->
<cfdirectory action="list" directory="#sServerDir#" name="qDir" sort="type,name"> <cfdirectory action="list" directory="#sServerDir#" name="qDir" sort="type,name">
<cfscript> <cfscript>
while( i lte qDir.recordCount ) while( i lte qDir.recordCount )
{ {
if( compareNoCase( qDir.type[i], "FILE" ) and not listFind( ".,..", qDir.name[i] ) ) if( compareNoCase( qDir.type[i], "FILE" ) and not listFind( ".,..", qDir.name[i] ) )
{ {
folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />' ; folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />' ;
} }
i = i + 1; i = i + 1;
} }
</cfscript> </cfscript>
<cfoutput><Folders>#folders#</Folders></cfoutput> <cfoutput><Folders>#folders#</Folders></cfoutput>
</cffunction> </cffunction>
<cffunction name="GetFoldersAndfiles" returntype="void" output="true"> <cffunction name="GetFoldersAndfiles" returntype="void" output="true">
<cfargument name="resourceType" type="String" required="true"> <cfargument name="resourceType" type="String" required="true">
<cfargument name="currentFolder" type="String" required="true"> <cfargument name="currentFolder" type="String" required="true">
<cfset var i = 1> <cfset var i = 1>
<cfset var folders = ""> <cfset var folders = "">
<cfset var files = ""> <cfset var files = "">
<!--- Map the virtual path to the local server path ---> <!--- Map the virtual path to the local server path --->
<cfset var sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, "GetFolders" ) > <cfset var sServerDir = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, "GetFolders" ) >
<!--- Sort directories first, name ascending ---> <!--- Sort directories first, name ascending --->
<cfdirectory action="list" directory="#sServerDir#" name="qDir" sort="type,name"> <cfdirectory action="list" directory="#sServerDir#" name="qDir" sort="type,name">
<cfscript> <cfscript>
while( i lte qDir.recordCount ) while( i lte qDir.recordCount )
{ {
if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind( ".,..", qDir.name[i] ) ) if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind( ".,..", qDir.name[i] ) )
{ {
folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />' ; folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />' ;
} }
else if( not compareNoCase( qDir.type[i], "FILE" ) ) else if( not compareNoCase( qDir.type[i], "FILE" ) )
{ {
fileSizeKB = round(qDir.size[i] / 1024) ; fileSizeKB = round(qDir.size[i] / 1024) ;
files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />' ; files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />' ;
} }
i = i + 1 ; i = i + 1 ;
} }
</cfscript> </cfscript>
<cfoutput><Folders>#folders#</Folders></cfoutput> <cfoutput><Folders>#folders#</Folders></cfoutput>
<cfoutput><Files>#files#</Files></cfoutput> <cfoutput><Files>#files#</Files></cfoutput>
</cffunction> </cffunction>
<cffunction name="CreateFolder" returntype="void" output="true"> <cffunction name="CreateFolder" returntype="void" output="true">
<cfargument name="resourceType" required="true" type="string"> <cfargument name="resourceType" required="true" type="string">
<cfargument name="currentFolder" required="true" type="string"> <cfargument name="currentFolder" required="true" type="string">
<cfset var sNewFolderName = url.newFolderName > <cfset var sNewFolderName = url.newFolderName >
<cfset var sServerDir = "" > <cfset var sServerDir = "" >
<cfset var errorNumber = 0> <cfset var errorNumber = 0>
<cfset var sErrorMsg = ""> <cfset var sErrorMsg = "">
<cfset var currentFolderPath = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, 'CreateFolder' )> <cfset var currentFolderPath = ServerMapFolder( ARGUMENTS.resourceType, ARGUMENTS.currentFolder, 'CreateFolder' )>
<cfparam name="url.newFolderName" default=""> <cfparam name="url.newFolderName" default="">
<cfscript> <cfscript>
sNewFolderName = SanitizeFolderName( sNewFolderName ) ; sNewFolderName = SanitizeFolderName( sNewFolderName ) ;
</cfscript> </cfscript>
<cfif not len( sNewFolderName ) or len( sNewFolderName ) gt 255> <cfif not len( sNewFolderName ) or len( sNewFolderName ) gt 255>
<cfset errorNumber = 102> <cfset errorNumber = 102>
<cfelseif directoryExists( currentFolderPath & sNewFolderName )> <cfelseif directoryExists( currentFolderPath & sNewFolderName )>
<cfset errorNumber = 101> <cfset errorNumber = 101>
<cfelseif find( "..", sNewFolderName )> <cfelseif find( "..", sNewFolderName )>
<cfset errorNumber = 103> <cfset errorNumber = 103>
<cfelse> <cfelse>
<cfset errorNumber = 0> <cfset errorNumber = 0>
<!--- Map the virtual path to the local server path of the current folder. ---> <!--- Map the virtual path to the local server path of the current folder. --->
<cfset sServerDir = currentFolderPath & sNewFolderName > <cfset sServerDir = currentFolderPath & sNewFolderName >
<cftry> <cftry>
<cfdirectory action="create" directory="#currentFolderPath##sNewFolderName#" mode="755"> <cfdirectory action="create" directory="#currentFolderPath##sNewFolderName#" mode="755">
<cfcatch type="any"> <cfcatch type="any">
<!--- <!---
un-resolvable error numbers in ColdFusion: un-resolvable error numbers in ColdFusion:
* 102 : Invalid folder name. * 102 : Invalid folder name.
* 103 : You have no permissions to create the folder. * 103 : You have no permissions to create the folder.
---> --->
<cfset errorNumber = 110> <cfset errorNumber = 110>
</cfcatch> </cfcatch>
</cftry> </cftry>
</cfif> </cfif>
<cfoutput><Error number="#errorNumber#" originalDescription="#HTMLEditFormat(sErrorMsg)#" /></cfoutput> <cfoutput><Error number="#errorNumber#" originalDescription="#HTMLEditFormat(sErrorMsg)#" /></cfoutput>
</cffunction> </cffunction>

View File

@@ -1,89 +1,89 @@
<cfsetting enablecfoutputonly="yes" showdebugoutput="no"> <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* File Browser connector for ColdFusion (MX 6.0 and above). * File Browser connector for ColdFusion (MX 6.0 and above).
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de) * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
* *
---> --->
<cfparam name="url.command"> <cfparam name="url.command">
<cfparam name="url.type"> <cfparam name="url.type">
<cfparam name="url.currentFolder"> <cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually ---> <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm"> <cfinclude template="config.cfm">
<cfinclude template="cf_util.cfm"> <cfinclude template="cf_util.cfm">
<cfinclude template="cf_io.cfm"> <cfinclude template="cf_io.cfm">
<cfinclude template="cf_basexml.cfm"> <cfinclude template="cf_basexml.cfm">
<cfinclude template="cf_commands.cfm"> <cfinclude template="cf_commands.cfm">
<cfif not Config.Enabled> <cfif not Config.Enabled>
<cfset SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )> <cfset SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
</cfif> </cfif>
<cfset REQUEST.Config = Config> <cfset REQUEST.Config = Config>
<cfif find( "/", getBaseTemplatePath() ) > <cfif find( "/", getBaseTemplatePath() ) >
<cfset REQUEST.Fs = "/"> <cfset REQUEST.Fs = "/">
<cfelse> <cfelse>
<cfset REQUEST.Fs = "\"> <cfset REQUEST.Fs = "\">
</cfif> </cfif>
<cfset DoResponse() > <cfset DoResponse() >
<cffunction name="DoResponse" output="true" returntype="void"> <cffunction name="DoResponse" output="true" returntype="void">
<!--- Get the main request informaiton. ---> <!--- Get the main request informaiton. --->
<cfset var sCommand = "#URL.Command#" > <cfset var sCommand = "#URL.Command#" >
<cfset var sResourceType = URL.Type > <cfset var sResourceType = URL.Type >
<cfset var sCurrentFolder = GetCurrentFolder() > <cfset var sCurrentFolder = GetCurrentFolder() >
<!--- Check if it is an allowed command ---> <!--- Check if it is an allowed command --->
<cfif not IsAllowedCommand( sCommand ) > <cfif not IsAllowedCommand( sCommand ) >
<cfset SendError( 1, "The """ & sCommand & """ command isn't allowed" ) > <cfset SendError( 1, "The """ & sCommand & """ command isn't allowed" ) >
</cfif> </cfif>
<!--- Check if it is an allowed type. ---> <!--- Check if it is an allowed type. --->
<cfif not IsAllowedType( sResourceType ) > <cfif not IsAllowedType( sResourceType ) >
<cfset SendError( 1, 'Invalid type specified' ) > <cfset SendError( 1, 'Invalid type specified' ) >
</cfif> </cfif>
<!--- File Upload doesn't have to Return XML, so it must be intercepted before anything. ---> <!--- File Upload doesn't have to Return XML, so it must be intercepted before anything. --->
<cfif sCommand eq "FileUpload"> <cfif sCommand eq "FileUpload">
<cfset FileUpload( sResourceType, sCurrentFolder, sCommand )> <cfset FileUpload( sResourceType, sCurrentFolder, sCommand )>
<cfabort> <cfabort>
</cfif> </cfif>
<cfset CreateXmlHeader( sCommand, sResourceType, sCurrentFolder )> <cfset CreateXmlHeader( sCommand, sResourceType, sCurrentFolder )>
<!--- Execute the required command. ---> <!--- Execute the required command. --->
<cfif sCommand eq "GetFolders"> <cfif sCommand eq "GetFolders">
<cfset GetFolders( sResourceType, sCurrentFolder ) > <cfset GetFolders( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "GetFoldersAndFiles"> <cfelseif sCommand eq "GetFoldersAndFiles">
<cfset GetFoldersAndFiles( sResourceType, sCurrentFolder ) > <cfset GetFoldersAndFiles( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "CreateFolder"> <cfelseif sCommand eq "CreateFolder">
<cfset CreateFolder( sResourceType, sCurrentFolder ) > <cfset CreateFolder( sResourceType, sCurrentFolder ) >
</cfif> </cfif>
<cfset CreateXmlFooter()> <cfset CreateXmlFooter()>
<cfexit> <cfexit>
</cffunction> </cffunction>

View File

@@ -1,319 +1,291 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This file include IO specific functions used by the ColdFusion Connector (MX 6.0 and above). * This file include IO specific functions used by the ColdFusion Connector (MX 6.0 and above).
* *
---> --->
<cffunction name="CombinePaths" returntype="String" output="true"> <cffunction name="CombinePaths" returntype="String" output="true">
<cfargument name="sBasePath" required="true"> <cfargument name="sBasePath" required="true">
<cfargument name="sFolder" required="true"> <cfargument name="sFolder" required="true">
<cfset sBasePath = RemoveFromEnd( sBasePath, "/" )> <cfset sBasePath = RemoveFromEnd( sBasePath, "/" )>
<cfset sBasePath = RemoveFromEnd( sBasePath, "\" )> <cfset sBasePath = RemoveFromEnd( sBasePath, "\" )>
<cfreturn sBasePath & "/" & RemoveFromStart( ARGUMENTS.sFolder, '/' )> <cfreturn sBasePath & "/" & RemoveFromStart( ARGUMENTS.sFolder, '/' )>
</cffunction> </cffunction>
<cffunction name="GetResourceTypePath" returntype="String" output="false"> <cffunction name="GetResourceTypePath" returntype="String" output="false">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfargument name="sCommand" required="true"> <cfargument name="sCommand" required="true">
<cfif ARGUMENTS.sCommand eq "QuickUpload"> <cfif ARGUMENTS.sCommand eq "QuickUpload">
<cfreturn REQUEST.Config['QuickUploadPath'][ARGUMENTS.resourceType]> <cfreturn REQUEST.Config['QuickUploadPath'][ARGUMENTS.resourceType]>
<cfelse> <cfelse>
<cfreturn REQUEST.Config['FileTypesPath'][ARGUMENTS.resourceType]> <cfreturn REQUEST.Config['FileTypesPath'][ARGUMENTS.resourceType]>
</cfif> </cfif>
</cffunction> </cffunction>
<cffunction name="GetResourceTypeDirectory" returntype="String" output="false"> <cffunction name="GetResourceTypeDirectory" returntype="String" output="false">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfargument name="sCommand" required="true"> <cfargument name="sCommand" required="true">
<cfif ARGUMENTS.sCommand eq "QuickUpload"> <cfif ARGUMENTS.sCommand eq "QuickUpload">
<cfif isDefined( "REQUEST.Config.QuickUploadAbsolutePath" ) <cfif isDefined( "REQUEST.Config.QuickUploadAbsolutePath" )
and structkeyexists( REQUEST.Config.QuickUploadAbsolutePath, ARGUMENTS.resourceType ) and structkeyexists( REQUEST.Config.QuickUploadAbsolutePath, ARGUMENTS.resourceType )
and Len( REQUEST.Config.QuickUploadAbsolutePath[ARGUMENTS.resourceType] )> and Len( REQUEST.Config.QuickUploadAbsolutePath[ARGUMENTS.resourceType] )>
<cfreturn REQUEST.Config.QuickUploadAbsolutePath[ARGUMENTS.resourceType]> <cfreturn REQUEST.Config.QuickUploadAbsolutePath[ARGUMENTS.resourceType]>
</cfif> </cfif>
<cfreturn expandpath( REQUEST.Config.QuickUploadPath[ARGUMENTS.resourceType] )> <cfreturn expandpath( REQUEST.Config.QuickUploadPath[ARGUMENTS.resourceType] )>
<cfelse> <cfelse>
<cfif isDefined( "REQUEST.Config.FileTypesAbsolutePath" ) <cfif isDefined( "REQUEST.Config.FileTypesAbsolutePath" )
and structkeyexists( REQUEST.Config.FileTypesAbsolutePath, ARGUMENTS.resourceType ) and structkeyexists( REQUEST.Config.FileTypesAbsolutePath, ARGUMENTS.resourceType )
and Len( REQUEST.Config.FileTypesAbsolutePath[ARGUMENTS.resourceType] )> and Len( REQUEST.Config.FileTypesAbsolutePath[ARGUMENTS.resourceType] )>
<cfreturn REQUEST.Config.FileTypesAbsolutePath[ARGUMENTS.resourceType]> <cfreturn REQUEST.Config.FileTypesAbsolutePath[ARGUMENTS.resourceType]>
</cfif> </cfif>
<cfreturn expandpath( REQUEST.Config.FileTypesPath[ARGUMENTS.resourceType] )> <cfreturn expandpath( REQUEST.Config.FileTypesPath[ARGUMENTS.resourceType] )>
</cfif> </cfif>
</cffunction> </cffunction>
<cffunction name="GetUrlFromPath" returntype="String" output="false"> <cffunction name="GetUrlFromPath" returntype="String" output="false">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfargument name="folderPath" required="true"> <cfargument name="folderPath" required="true">
<cfargument name="sCommand" required="true"> <cfargument name="sCommand" required="true">
<cfreturn CombinePaths( GetResourceTypePath( ARGUMENTS.resourceType, ARGUMENTS.sCommand ), ARGUMENTS.folderPath )> <cfreturn CombinePaths( GetResourceTypePath( ARGUMENTS.resourceType, ARGUMENTS.sCommand ), ARGUMENTS.folderPath )>
</cffunction> </cffunction>
<cffunction name="RemoveExtension" output="false" returntype="String"> <cffunction name="RemoveExtension" output="false" returntype="String">
<cfargument name="fileName" required="true"> <cfargument name="fileName" required="true">
<cfset var pos = find( ".", reverse ( ARGUMENTS.fileName ) )> <cfset var pos = find( ".", reverse ( ARGUMENTS.fileName ) )>
<cfreturn mid( ARGUMENTS.fileName, 1, Len( ARGUMENTS.fileName ) - pos ) > <cfreturn mid( ARGUMENTS.fileName, 1, Len( ARGUMENTS.fileName ) - pos ) >
</cffunction> </cffunction>
<cffunction name="GetExtension" output="false" returntype="String"> <cffunction name="GetExtension" output="false" returntype="String">
<cfargument name="fileName" required="true"> <cfargument name="fileName" required="true">
<cfset var pos = find( ".", reverse ( ARGUMENTS.fileName ) )> <cfset var pos = find( ".", reverse ( ARGUMENTS.fileName ) )>
<cfif not pos> <cfif not pos>
<cfreturn ""> <cfreturn "">
</cfif> </cfif>
<cfreturn mid( ARGUMENTS.fileName, pos, Len( ARGUMENTS.fileName ) - pos ) > <cfreturn mid( ARGUMENTS.fileName, pos, Len( ARGUMENTS.fileName ) - pos ) >
</cffunction> </cffunction>
<cffunction name="ServerMapFolder" returntype="String" output="false"> <cffunction name="ServerMapFolder" returntype="String" output="false">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfargument name="folderPath" required="true"> <cfargument name="folderPath" required="true">
<cfargument name="sCommand" required="true"> <cfargument name="sCommand" required="true">
<!--- Get the resource type directory. ---> <!--- Get the resource type directory. --->
<cfset var sResourceTypePath = GetResourceTypeDirectory( ARGUMENTS.resourceType, ARGUMENTS.sCommand ) > <cfset var sResourceTypePath = GetResourceTypeDirectory( ARGUMENTS.resourceType, ARGUMENTS.sCommand ) >
<!--- Ensure that the directory exists. ---> <!--- Ensure that the directory exists. --->
<cfset var sErrorMsg = CreateServerFolder( sResourceTypePath ) > <cfset var sErrorMsg = CreateServerFolder( sResourceTypePath ) >
<cfif sErrorMsg neq ''> <cfif sErrorMsg neq ''>
<cfset SendError( 1, 'Error creating folder "' & sResourceTypePath & '" (' & sErrorMsg & ')' )> <cfset SendError( 1, 'Error creating folder "' & sResourceTypePath & '" (' & sErrorMsg & ')' )>
</cfif> </cfif>
<!--- Return the resource type directory combined with the required path. ---> <!--- Return the resource type directory combined with the required path. --->
<cfreturn CombinePaths( sResourceTypePath , ARGUMENTS.folderPath )> <cfreturn CombinePaths( sResourceTypePath , ARGUMENTS.folderPath )>
</cffunction> </cffunction>
<cffunction name="GetParentFolder" returntype="string" output="false"> <cffunction name="GetParentFolder" returntype="string" output="false">
<cfargument name="folderPath" required="true"> <cfargument name="folderPath" required="true">
<cfreturn rereplace(ARGUMENTS.folderPath, "[/\\\\][^/\\\\]+[/\\\\]?$", "")> <cfreturn rereplace(ARGUMENTS.folderPath, "[/\\\\][^/\\\\]+[/\\\\]?$", "")>
</cffunction> </cffunction>
<cffunction name="CreateServerFolder" returntype="String" output="false"> <cffunction name="CreateServerFolder" returntype="String" output="false">
<cfargument name="folderPath"> <cfargument name="folderPath">
<!--- Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms ---> <!--- Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms --->
<cfset folderPath = rereplace(ARGUMENTS.folderPath, "//+", "/", "all")> <cfset folderPath = rereplace(ARGUMENTS.folderPath, "//+", "/", "all")>
<cfif directoryexists(ARGUMENTS.folderPath) or fileexists(ARGUMENTS.folderPath)> <cfif directoryexists(ARGUMENTS.folderPath) or fileexists(ARGUMENTS.folderPath)>
<cfreturn ""> <cfreturn "">
<cfelse> <cfelse>
<cftry> <cftry>
<cfdirectory action="create" mode="0755" directory="#ARGUMENTS.folderPath#"> <cfdirectory action="create" mode="0755" directory="#ARGUMENTS.folderPath#">
<cfcatch type="any"> <cfcatch type="any">
<cfreturn CFCATCH.Message> <cfreturn CFCATCH.Message>
</cfcatch> </cfcatch>
</cftry> </cftry>
</cfif> </cfif>
<cfreturn ""> <cfreturn "">
</cffunction> </cffunction>
<cffunction name="IsAllowedExt" returntype="boolean" output="false"> <cffunction name="IsAllowedExt" returntype="boolean" output="false">
<cfargument name="sExtension" required="true"> <cfargument name="sExtension" required="true">
<cfargument name="resourceType" required="true"> <cfargument name="resourceType" required="true">
<cfif isDefined( "REQUEST.Config.AllowedExtensions." & ARGUMENTS.resourceType ) <cfif isDefined( "REQUEST.Config.AllowedExtensions." & ARGUMENTS.resourceType )
and listLen( REQUEST.Config.AllowedExtensions[ARGUMENTS.resourceType] ) and listLen( REQUEST.Config.AllowedExtensions[ARGUMENTS.resourceType] )
and not listFindNoCase( REQUEST.Config.AllowedExtensions[ARGUMENTS.resourceType], ARGUMENTS.sExtension )> and not listFindNoCase( REQUEST.Config.AllowedExtensions[ARGUMENTS.resourceType], ARGUMENTS.sExtension )>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfif isDefined( "REQUEST.Config.DeniedExtensions." & ARGUMENTS.resourceType ) <cfif isDefined( "REQUEST.Config.DeniedExtensions." & ARGUMENTS.resourceType )
and listLen( REQUEST.Config.DeniedExtensions[ARGUMENTS.resourceType] ) and listLen( REQUEST.Config.DeniedExtensions[ARGUMENTS.resourceType] )
and listFindNoCase( REQUEST.Config.DeniedExtensions[ARGUMENTS.resourceType], ARGUMENTS.sExtension )> and listFindNoCase( REQUEST.Config.DeniedExtensions[ARGUMENTS.resourceType], ARGUMENTS.sExtension )>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfreturn true> <cfreturn true>
</cffunction> </cffunction>
<cffunction name="IsAllowedType" returntype="boolean" output="false"> <cffunction name="IsAllowedType" returntype="boolean" output="false">
<cfargument name="resourceType"> <cfargument name="resourceType">
<cfif not listFindNoCase( REQUEST.Config.ConfigAllowedTypes, ARGUMENTS.resourceType )> <cfif not listFindNoCase( REQUEST.Config.ConfigAllowedTypes, ARGUMENTS.resourceType )>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfreturn true> <cfreturn true>
</cffunction> </cffunction>
<cffunction name="IsAllowedCommand" returntype="boolean" output="true"> <cffunction name="IsAllowedCommand" returntype="boolean" output="true">
<cfargument name="sCommand" required="true" type="String"> <cfargument name="sCommand" required="true" type="String">
<cfif not listFindNoCase( REQUEST.Config.ConfigAllowedCommands, ARGUMENTS.sCommand )> <cfif not listFindNoCase( REQUEST.Config.ConfigAllowedCommands, ARGUMENTS.sCommand )>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfreturn true> <cfreturn true>
</cffunction> </cffunction>
<cffunction name="GetCurrentFolder" returntype="String" output="true"> <cffunction name="GetCurrentFolder" returntype="String" output="true">
<cfset var sCurrentFolder = "/"> <cfset var sCurrentFolder = "/">
<cfif isDefined( "URL.CurrentFolder" )> <cfif isDefined( "URL.CurrentFolder" )>
<cfset sCurrentFolder = URL.CurrentFolder> <cfset sCurrentFolder = URL.CurrentFolder>
</cfif> </cfif>
<!--- Check the current folder syntax (must begin and start with a slash). ---> <!--- Check the current folder syntax (must begin and start with a slash). --->
<cfif not refind( "/$", sCurrentFolder)> <cfif not refind( "/$", sCurrentFolder)>
<cfset sCurrentFolder = sCurrentFolder & "/"> <cfset sCurrentFolder = sCurrentFolder & "/">
</cfif> </cfif>
<cfif not refind( "^/", sCurrentFolder )> <cfif not refind( "^/", sCurrentFolder )>
<cfset sCurrentFolder = "/" & sCurrentFolder> <cfset sCurrentFolder = "/" & sCurrentFolder>
</cfif> </cfif>
<!--- Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms ---> <!--- Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms --->
<cfset sCurrentFolder = rereplace( sCurrentFolder, "//+", "/", "all" )> <cfset sCurrentFolder = rereplace( sCurrentFolder, "//+", "/", "all" )>
<cfif find( "..", sCurrentFolder) or find( "\", sCurrentFolder) > <cfif find( "..", sCurrentFolder) or find( "\", sCurrentFolder) >
<cfset SendError( 102, "" )> <cfset SendError( 102, "" )>
</cfif> </cfif>
<cfreturn sCurrentFolder> <cfreturn sCurrentFolder>
</cffunction> </cffunction>
<cffunction name="SanitizeFolderName" returntype="String" output="false"> <cffunction name="SanitizeFolderName" returntype="String" output="false">
<cfargument name="sNewFolderName" required="true"> <cfargument name="sNewFolderName" required="true">
<!--- Do a cleanup of the folder name to avoid possible problems ---> <!--- Do a cleanup of the folder name to avoid possible problems --->
<!--- Remove . \ / | : ? * " < > and control characters ---> <!--- Remove . \ / | : ? * " < > and control characters --->
<cfset sNewFolderName = rereplace( sNewFolderName, '\.+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )> <cfset sNewFolderName = rereplace( sNewFolderName, '\.+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )>
<cfreturn sNewFolderName> <cfreturn sNewFolderName>
</cffunction> </cffunction>
<cffunction name="BinaryFileRead" returntype="String" output="true"> <cffunction name="BinaryFileRead" returntype="String" output="true">
<cfargument name="fileName" required="true" type="string"> <cfargument name="fileName" required="true" type="string">
<cfargument name="bytes" required="true" type="Numeric"> <cfargument name="bytes" required="true" type="Numeric">
<cfscript> <cfscript>
var chunk = ""; var chunk = "";
var fileReaderClass = ""; var fileReaderClass = "";
var fileReader = ""; var fileReader = "";
var file = ""; var file = "";
var done = false; var done = false;
var counter = 0; var counter = 0;
var byteArray = ""; var byteArray = "";
if( not fileExists( ARGUMENTS.fileName ) ) if( not fileExists( ARGUMENTS.fileName ) )
{ {
return "" ; return "" ;
} }
if (REQUEST.CFVersion gte 8) if (REQUEST.CFVersion gte 8)
{ {
file = FileOpen( ARGUMENTS.fileName, "readbinary" ) ; file = FileOpen( ARGUMENTS.fileName, "readbinary" ) ;
byteArray = FileRead( file, 1024 ) ; byteArray = FileRead( file, 1024 ) ;
chunk = toString( toBinary( toBase64( byteArray ) ) ) ; chunk = toString( toBinary( toBase64( byteArray ) ) ) ;
FileClose( file ) ; FileClose( file ) ;
} }
else else
{ {
fileReaderClass = createObject("java", "java.io.FileInputStream"); fileReaderClass = createObject("java", "java.io.FileInputStream");
fileReader = fileReaderClass.init(fileName); fileReader = fileReaderClass.init(fileName);
while(not done) while(not done)
{ {
char = fileReader.read(); char = fileReader.read();
counter = counter + 1; counter = counter + 1;
if ( char eq -1 or counter eq ARGUMENTS.bytes) if ( char eq -1 or counter eq ARGUMENTS.bytes)
{ {
done = true; done = true;
} }
else else
{ {
chunk = chunk & chr(char) ; chunk = chunk & chr(char) ;
} }
} }
} }
</cfscript> </cfscript>
<cfreturn chunk> <cfreturn chunk>
</cffunction> </cffunction>
<cffunction name="SendUploadResults" returntype="String" output="true"> <cffunction name="SendUploadResults" returntype="String" output="true">
<cfargument name="errorNumber" required="true" type="Numeric"> <cfargument name="errorNumber" required="true" type="Numeric">
<cfargument name="fileUrl" required="false" type="String" default=""> <cfargument name="fileUrl" required="false" type="String" default="">
<cfargument name="fileName" required="false" type="String" default=""> <cfargument name="fileName" required="false" type="String" default="">
<cfargument name="customMsg" required="false" type="String" default=""> <cfargument name="customMsg" required="false" type="String" default="">
<cfoutput> <!--- Minified version of the document.domain automatic fix script (#1919).
<script type="text/javascript"> The original script can be found at _dev/domain_fix_template.js --->
(function() <cfoutput>
{ <script type="text/javascript">
var d = document.domain ; (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
window.parent.OnUploadCompleted( #errorNumber#, "#JSStringFormat(fileUrl)#", "#JSStringFormat(fileName)#", "#JSStringFormat(customMsg)#" );
while ( true ) </script>
{ </cfoutput>
// Test if we can access a parent property. <cfabort>
try </cffunction>
{
var test = window.top.opener.document.domain ; <cffunction name="SanitizeFileName" returntype="String" output="false">
break ; <cfargument name="sNewFileName" required="true">
}
catch( e ) {} <cfif isDefined("REQUEST.Config.ForceSingleExtension") and REQUEST.Config.ForceSingleExtension>
<cfset sNewFileName = rereplace( sNewFileName, '\.(?![^.]*$)', "_", "all" )>
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... </cfif>
d = d.replace( /.*?(?:\.|$)/, '' ) ;
<!--- Do a cleanup of the file name to avoid possible problems --->
if ( d.length == 0 ) <!--- Remove \ / | : ? * " < > and control characters --->
break ; // It was not able to detect the domain. <cfset sNewFileName = rereplace( sNewFileName, '\\[.]+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )>
try <cfreturn sNewFileName>
{ </cffunction>
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
window.parent.OnUploadCompleted( #errorNumber#, "#JSStringFormat(fileUrl)#", "#JSStringFormat(fileName)#", "#JSStringFormat(customMsg)#" );
</script>
</cfoutput>
<cfabort>
</cffunction>
<cffunction name="SanitizeFileName" returntype="String" output="false">
<cfargument name="sNewFileName" required="true">
<cfif isDefined("REQUEST.Config.ForceSingleExtension") and REQUEST.Config.ForceSingleExtension>
<cfset sNewFileName = rereplace( sNewFileName, '\.(?![^.]*$)', "_", "all" )>
</cfif>
<!--- Do a cleanup of the file name to avoid possible problems --->
<!--- Remove \ / | : ? * " < > and control characters --->
<cfset sNewFileName = rereplace( sNewFileName, '\\[.]+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )>
<cfreturn sNewFileName>
</cffunction>

View File

@@ -1,72 +1,72 @@
<cfsetting enablecfoutputonly="yes" showdebugoutput="no"> <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* File Browser connector for ColdFusion (MX 6.0 and above). * File Browser connector for ColdFusion (MX 6.0 and above).
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de) * (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
---> --->
<cfparam name="url.type" default="File"> <cfparam name="url.type" default="File">
<cfparam name="url.currentFolder" default="/"> <cfparam name="url.currentFolder" default="/">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually ---> <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm"> <cfinclude template="config.cfm">
<cfinclude template="cf_util.cfm"> <cfinclude template="cf_util.cfm">
<cfinclude template="cf_io.cfm"> <cfinclude template="cf_io.cfm">
<cfinclude template="cf_commands.cfm"> <cfinclude template="cf_commands.cfm">
<cffunction name="SendError" returntype="void" output="true"> <cffunction name="SendError" returntype="void" output="true">
<cfargument name="number" required="true" type="Numeric"> <cfargument name="number" required="true" type="Numeric">
<cfargument name="text" required="true"> <cfargument name="text" required="true">
<cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )> <cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )>
</cffunction> </cffunction>
<cfset REQUEST.Config = Config> <cfset REQUEST.Config = Config>
<cfif find( "/", getBaseTemplatePath() ) > <cfif find( "/", getBaseTemplatePath() ) >
<cfset REQUEST.Fs = "/"> <cfset REQUEST.Fs = "/">
<cfelse> <cfelse>
<cfset REQUEST.Fs = "\"> <cfset REQUEST.Fs = "\">
</cfif> </cfif>
<cfif not Config.Enabled> <cfif not Config.Enabled>
<cfset SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )> <cfset SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
</cfif> </cfif>
<cfset sCommand = 'QuickUpload'> <cfset sCommand = 'QuickUpload'>
<cfset sType = "File"> <cfset sType = "File">
<cfif isDefined( "URL.Type" )> <cfif isDefined( "URL.Type" )>
<cfset sType = URL.Type> <cfset sType = URL.Type>
</cfif> </cfif>
<cfset sCurrentFolder = GetCurrentFolder()> <cfset sCurrentFolder = GetCurrentFolder()>
<!--- Is enabled the upload? ---> <!--- Is enabled the upload? --->
<cfif not IsAllowedCommand( sCommand )> <cfif not IsAllowedCommand( sCommand )>
<cfset SendUploadResults( "1", "", "", "The """ & sCommand & """ command isn't allowed" )> <cfset SendUploadResults( "1", "", "", "The """ & sCommand & """ command isn't allowed" )>
</cfif> </cfif>
<!--- Check if it is an allowed type. ---> <!--- Check if it is an allowed type. --->
<cfif not IsAllowedType( sType )> <cfif not IsAllowedType( sType )>
<cfset SendUploadResults( "1", "", "", "Invalid type specified" ) > <cfset SendUploadResults( "1", "", "", "Invalid type specified" ) >
</cfif> </cfif>
<cfset FileUpload( sType, sCurrentFolder, sCommand )> <cfset FileUpload( sType, sCurrentFolder, sCommand )>

View File

@@ -1,131 +1,131 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This file include generic functions used by the ColdFusion Connector (MX 6.0 and above). * This file include generic functions used by the ColdFusion Connector (MX 6.0 and above).
---> --->
<cffunction name="RemoveFromStart" output="false" returntype="String"> <cffunction name="RemoveFromStart" output="false" returntype="String">
<cfargument name="sourceString" type="String"> <cfargument name="sourceString" type="String">
<cfargument name="charToRemove" type="String"> <cfargument name="charToRemove" type="String">
<cfif left(ARGUMENTS.sourceString, 1) eq ARGUMENTS.charToRemove> <cfif left(ARGUMENTS.sourceString, 1) eq ARGUMENTS.charToRemove>
<cfreturn mid( ARGUMENTS.sourceString, 2, len(ARGUMENTS.sourceString) -1 )> <cfreturn mid( ARGUMENTS.sourceString, 2, len(ARGUMENTS.sourceString) -1 )>
</cfif> </cfif>
<cfreturn ARGUMENTS.sourceString> <cfreturn ARGUMENTS.sourceString>
</cffunction> </cffunction>
<cffunction name="RemoveFromEnd" output="false" returntype="String"> <cffunction name="RemoveFromEnd" output="false" returntype="String">
<cfargument name="sourceString" type="String"> <cfargument name="sourceString" type="String">
<cfargument name="charToRemove" type="String"> <cfargument name="charToRemove" type="String">
<cfif right(ARGUMENTS.sourceString, 1) eq ARGUMENTS.charToRemove> <cfif right(ARGUMENTS.sourceString, 1) eq ARGUMENTS.charToRemove>
<cfreturn mid( ARGUMENTS.sourceString, 1, len(ARGUMENTS.sourceString) -1 )> <cfreturn mid( ARGUMENTS.sourceString, 1, len(ARGUMENTS.sourceString) -1 )>
</cfif> </cfif>
<cfreturn ARGUMENTS.sourceString> <cfreturn ARGUMENTS.sourceString>
</cffunction> </cffunction>
<!--- <!---
Check file content. Check file content.
Currently this function validates only image files. Currently this function validates only image files.
Returns false if file is invalid. Returns false if file is invalid.
detectionLevel: detectionLevel:
0 = none 0 = none
1 = check image size for images, 1 = check image size for images,
2 = use DetectHtml for images 2 = use DetectHtml for images
----> ---->
<cffunction name="IsImageValid" returntype="boolean" output="true"> <cffunction name="IsImageValid" returntype="boolean" output="true">
<cfargument name="filePath" required="true" type="String"> <cfargument name="filePath" required="true" type="String">
<cfargument name="extension" required="true" type="String"> <cfargument name="extension" required="true" type="String">
<cfset var imageCFC = ""> <cfset var imageCFC = "">
<cfset var imageInfo = ""> <cfset var imageInfo = "">
<cfif not ListFindNoCase("gif,jpeg,jpg,png,swf,psd,bmp,iff,tiff,tif,swc,jpc,jp2,jpx,jb2,xmb,wbmp", ARGUMENTS.extension)> <cfif not ListFindNoCase("gif,jpeg,jpg,png,swf,psd,bmp,iff,tiff,tif,swc,jpc,jp2,jpx,jb2,xmb,wbmp", ARGUMENTS.extension)>
<cfreturn true> <cfreturn true>
</cfif> </cfif>
<cftry> <cftry>
<cfif REQUEST.CFVersion gte 8> <cfif REQUEST.CFVersion gte 8>
<cfset objImage = ImageRead(ARGUMENTS.filePath) > <cfset objImage = ImageRead(ARGUMENTS.filePath) >
<cfset imageInfo = ImageInfo(objImage)> <cfset imageInfo = ImageInfo(objImage)>
<!--- <cfimage action="info" source="#ARGUMENTS.filePath#" structName="imageInfo" /> ---> <!--- <cfimage action="info" source="#ARGUMENTS.filePath#" structName="imageInfo" /> --->
<cfelse> <cfelse>
<cfset imageCFC = createObject("component", "image")> <cfset imageCFC = createObject("component", "image")>
<cfset imageInfo = imageCFC.getImageInfo("", ARGUMENTS.filePath)> <cfset imageInfo = imageCFC.getImageInfo("", ARGUMENTS.filePath)>
</cfif> </cfif>
<cfif imageInfo.height lte 0 or imageInfo.width lte 0> <cfif imageInfo.height lte 0 or imageInfo.width lte 0>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfcatch type="any"> <cfcatch type="any">
<cfreturn false> <cfreturn false>
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfreturn true> <cfreturn true>
</cffunction> </cffunction>
<!--- <!---
Detect HTML in the first KB to prevent against potential security issue with Detect HTML in the first KB to prevent against potential security issue with
IE/Safari/Opera file type auto detection bug. IE/Safari/Opera file type auto detection bug.
Returns true if file contain insecure HTML code at the beginning. Returns true if file contain insecure HTML code at the beginning.
---> --->
<cffunction name="DetectHtml" output="false" returntype="boolean"> <cffunction name="DetectHtml" output="false" returntype="boolean">
<cfargument name="filePath" required="true" type="String"> <cfargument name="filePath" required="true" type="String">
<cfset var tags = "<body,<head,<html,<img,<pre,<script,<table,<title"> <cfset var tags = "<body,<head,<html,<img,<pre,<script,<table,<title">
<cfset var chunk = lcase( Trim( BinaryFileRead( ARGUMENTS.filePath, 1024 ) ) )> <cfset var chunk = lcase( Trim( BinaryFileRead( ARGUMENTS.filePath, 1024 ) ) )>
<cfif not Len(chunk)> <cfif not Len(chunk)>
<cfreturn false> <cfreturn false>
</cfif> </cfif>
<cfif refind('<!doctype\W*x?html', chunk)> <cfif refind('<!doctype\W*x?html', chunk)>
<cfreturn true> <cfreturn true>
</cfif> </cfif>
<cfloop index = "tag" list = "#tags#"> <cfloop index = "tag" list = "#tags#">
<cfif find( tag, chunk )> <cfif find( tag, chunk )>
<cfreturn true> <cfreturn true>
</cfif> </cfif>
</cfloop> </cfloop>
<!--- type = javascript ---> <!--- type = javascript --->
<cfif refind('type\s*=\s*[''"]?\s*(?:\w*/)?(?:ecma|java)', chunk)> <cfif refind('type\s*=\s*[''"]?\s*(?:\w*/)?(?:ecma|java)', chunk)>
<cfreturn true> <cfreturn true>
</cfif> > </cfif> >
<!--- href = javascript ---> <!--- href = javascript --->
<!--- src = javascript ---> <!--- src = javascript --->
<!--- data = javascript ---> <!--- data = javascript --->
<cfif refind('(?:href|src|data)\s*=\s*[\''"]?\s*(?:ecma|java)script:', chunk)> <cfif refind('(?:href|src|data)\s*=\s*[\''"]?\s*(?:ecma|java)script:', chunk)>
<cfreturn true> <cfreturn true>
</cfif> </cfif>
<!--- url(javascript ---> <!--- url(javascript --->
<cfif refind('url\s*\(\s*[\''"]?\s*(?:ecma|java)script:', chunk)> <cfif refind('url\s*\(\s*[\''"]?\s*(?:ecma|java)script:', chunk)>
<cfreturn true> <cfreturn true>
</cfif> </cfif>
<cfreturn false> <cfreturn false>
</cffunction> </cffunction>

View File

@@ -1,189 +1,189 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* Configuration file for the ColdFusion Connector (all versions). * Configuration file for the ColdFusion Connector (all versions).
---> --->
<cfscript> <cfscript>
Config = StructNew() ; Config = StructNew() ;
// SECURITY: You must explicitly enable this "connector". (Set enabled to "true") // SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
Config.Enabled = false ; Config.Enabled = false ;
// Path to uploaded files relative to the document root. // Path to uploaded files relative to the document root.
Config.UserFilesPath = "/userfiles/" ; Config.UserFilesPath = "/userfiles/" ;
// Use this to force the server path if FCKeditor is not running directly off // Use this to force the server path if FCKeditor is not running directly off
// the root of the application or the FCKeditor directory in the URL is a virtual directory // the root of the application or the FCKeditor directory in the URL is a virtual directory
// or a symbolic link / junction // or a symbolic link / junction
// Example: C:\inetpub\wwwroot\myDocs\ // Example: C:\inetpub\wwwroot\myDocs\
Config.ServerPath = "" ; Config.ServerPath = "" ;
// Due to security issues with Apache modules, it is recommended to leave the // Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled. // following setting enabled.
Config.ForceSingleExtension = true ; Config.ForceSingleExtension = true ;
// Perform additional checks for image files - if set to true, validate image size // Perform additional checks for image files - if set to true, validate image size
// (This feature works in MX 6.0 and above) // (This feature works in MX 6.0 and above)
Config.SecureImageUploads = true; Config.SecureImageUploads = true;
// What the user can do with this connector // What the user can do with this connector
Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ; Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ;
//Allowed Resource Types //Allowed Resource Types
Config.ConfigAllowedTypes = "File,Image,Flash,Media" ; Config.ConfigAllowedTypes = "File,Image,Flash,Media" ;
// For security, HTML is allowed in the first Kb of data for files having the // For security, HTML is allowed in the first Kb of data for files having the
// following extensions only. // following extensions only.
// (This feature works in MX 6.0 and above)) // (This feature works in MX 6.0 and above))
Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ; Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ;
//Due to known issues with GetTempDirectory function, it is //Due to known issues with GetTempDirectory function, it is
//recommended to set this vairiable to a valid directory //recommended to set this vairiable to a valid directory
//instead of using the GetTempDirectory function //instead of using the GetTempDirectory function
//(used by MX 6.0 and above) //(used by MX 6.0 and above)
Config.TempDirectory = GetTempDirectory(); Config.TempDirectory = GetTempDirectory();
// Configuration settings for each Resource Type // Configuration settings for each Resource Type
// //
// - AllowedExtensions: the possible extensions that can be allowed. // - AllowedExtensions: the possible extensions that can be allowed.
// If it is empty then any file type can be uploaded. // If it is empty then any file type can be uploaded.
// - DeniedExtensions: The extensions that won't be allowed. // - DeniedExtensions: The extensions that won't be allowed.
// If it is empty then no restrictions are done here. // If it is empty then no restrictions are done here.
// //
// For a file to be uploaded it has to fulfill both the AllowedExtensions // For a file to be uploaded it has to fulfill both the AllowedExtensions
// and DeniedExtensions (that's it: not being denied) conditions. // and DeniedExtensions (that's it: not being denied) conditions.
// //
// - FileTypesPath: the virtual folder relative to the document root where // - FileTypesPath: the virtual folder relative to the document root where
// these resources will be located. // these resources will be located.
// Attention: It must start and end with a slash: '/' // Attention: It must start and end with a slash: '/'
// //
// - FileTypesAbsolutePath: the physical path to the above folder. It must be // - FileTypesAbsolutePath: the physical path to the above folder. It must be
// an absolute path. // an absolute path.
// If it's an empty string then it will be autocalculated. // If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias. // Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'FileTypesPath' must point to the same directory. // Attention: The above 'FileTypesPath' must point to the same directory.
// Attention: It must end with a slash: '/' // Attention: It must end with a slash: '/'
// //
// //
// - QuickUploadPath: the virtual folder relative to the document root where // - QuickUploadPath: the virtual folder relative to the document root where
// these resources will be uploaded using the Upload tab in the resources // these resources will be uploaded using the Upload tab in the resources
// dialogs. // dialogs.
// Attention: It must start and end with a slash: '/' // Attention: It must start and end with a slash: '/'
// //
// - QuickUploadAbsolutePath: the physical path to the above folder. It must be // - QuickUploadAbsolutePath: the physical path to the above folder. It must be
// an absolute path. // an absolute path.
// If it's an empty string then it will be autocalculated. // If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias. // Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'QuickUploadPath' must point to the same directory. // Attention: The above 'QuickUploadPath' must point to the same directory.
// Attention: It must end with a slash: '/' // Attention: It must end with a slash: '/'
Config.AllowedExtensions = StructNew() ; Config.AllowedExtensions = StructNew() ;
Config.DeniedExtensions = StructNew() ; Config.DeniedExtensions = StructNew() ;
Config.FileTypesPath = StructNew() ; Config.FileTypesPath = StructNew() ;
Config.FileTypesAbsolutePath = StructNew() ; Config.FileTypesAbsolutePath = StructNew() ;
Config.QuickUploadPath = StructNew() ; Config.QuickUploadPath = StructNew() ;
Config.QuickUploadAbsolutePath = StructNew() ; Config.QuickUploadAbsolutePath = StructNew() ;
Config.AllowedExtensions["File"] = "7z,aiff,asf,avi,bmp,csv,doc,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xml,zip" ; Config.AllowedExtensions["File"] = "7z,aiff,asf,avi,bmp,csv,doc,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xml,zip" ;
Config.DeniedExtensions["File"] = "" ; Config.DeniedExtensions["File"] = "" ;
Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ; Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ;
Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ; Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ;
Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ; Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ;
Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ; Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ;
Config.AllowedExtensions["Image"] = "bmp,gif,jpeg,jpg,png" ; Config.AllowedExtensions["Image"] = "bmp,gif,jpeg,jpg,png" ;
Config.DeniedExtensions["Image"] = "" ; Config.DeniedExtensions["Image"] = "" ;
Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ; Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ;
Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ; Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ;
Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ; Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ;
Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ; Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ;
Config.AllowedExtensions["Flash"] = "swf,flv" ; Config.AllowedExtensions["Flash"] = "swf,flv" ;
Config.DeniedExtensions["Flash"] = "" ; Config.DeniedExtensions["Flash"] = "" ;
Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ; Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ;
Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ; Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ;
Config.QuickUploadPath["Flash"] = Config.FileTypesPath["Flash"] ; Config.QuickUploadPath["Flash"] = Config.FileTypesPath["Flash"] ;
Config.QuickUploadAbsolutePath["Flash"] = Config.FileTypesAbsolutePath["Flash"] ; Config.QuickUploadAbsolutePath["Flash"] = Config.FileTypesAbsolutePath["Flash"] ;
Config.AllowedExtensions["Media"] = "aiff,asf,avi,bmp,fla,flv,gif,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,png,qt,ram,rm,rmi,rmvb,swf,tif,tiff,wav,wma,wmv" ; Config.AllowedExtensions["Media"] = "aiff,asf,avi,bmp,fla,flv,gif,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,png,qt,ram,rm,rmi,rmvb,swf,tif,tiff,wav,wma,wmv" ;
Config.DeniedExtensions["Media"] = "" ; Config.DeniedExtensions["Media"] = "" ;
Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ; Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ;
Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ; Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ;
Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ; Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ;
Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ; Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ;
</cfscript> </cfscript>
<cftry> <cftry>
<!--- code to maintain backwards compatibility with previous version of cfm connector ---> <!--- code to maintain backwards compatibility with previous version of cfm connector --->
<cfif isDefined("application.userFilesPath")> <cfif isDefined("application.userFilesPath")>
<cflock scope="application" type="readonly" timeout="5"> <cflock scope="application" type="readonly" timeout="5">
<cfset config.userFilesPath = application.userFilesPath> <cfset config.userFilesPath = application.userFilesPath>
</cflock> </cflock>
<cfelseif isDefined("server.userFilesPath")> <cfelseif isDefined("server.userFilesPath")>
<cflock scope="server" type="readonly" timeout="5"> <cflock scope="server" type="readonly" timeout="5">
<cfset config.userFilesPath = server.userFilesPath> <cfset config.userFilesPath = server.userFilesPath>
</cflock> </cflock>
</cfif> </cfif>
<!--- look for config struct in application and server scopes ---> <!--- look for config struct in application and server scopes --->
<cfif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)> <cfif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
<cflock scope="application" type="readonly" timeout="5"> <cflock scope="application" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(application.FCKeditor)> <cfset variables.FCKeditor = duplicate(application.FCKeditor)>
</cflock> </cflock>
<cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)> <cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
<cflock scope="server" type="readonly" timeout="5"> <cflock scope="server" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(server.FCKeditor)> <cfset variables.FCKeditor = duplicate(server.FCKeditor)>
</cflock> </cflock>
</cfif> </cfif>
<!--- catch potential "The requested scope application has not been enabled" exception ---> <!--- catch potential "The requested scope application has not been enabled" exception --->
<cfcatch type="any"> <cfcatch type="any">
</cfcatch> </cfcatch>
</cftry> </cftry>
<cfif isDefined("FCKeditor")> <cfif isDefined("FCKeditor")>
<!--- copy key values from external to local config (i.e. override default config as required) ---> <!--- copy key values from external to local config (i.e. override default config as required) --->
<cfscript> <cfscript>
function structCopyKeys(stFrom, stTo) { function structCopyKeys(stFrom, stTo) {
for ( key in stFrom ) { for ( key in stFrom ) {
if ( isStruct(stFrom[key]) ) { if ( isStruct(stFrom[key]) ) {
structCopyKeys(stFrom[key],stTo[key]); structCopyKeys(stFrom[key],stTo[key]);
} else { } else {
stTo[key] = stFrom[key]; stTo[key] = stFrom[key];
} }
} }
} }
structCopyKeys(FCKeditor, config); structCopyKeys(FCKeditor, config);
</cfscript> </cfscript>
</cfif> </cfif>

View File

@@ -1,32 +1,32 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* File Browser connector for ColdFusion (all versions). * File Browser connector for ColdFusion (all versions).
* *
---> --->
<cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )> <cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )>
<cfif REQUEST.CFVersion lte 5> <cfif REQUEST.CFVersion lte 5>
<cfinclude template="cf5_connector.cfm"> <cfinclude template="cf5_connector.cfm">
<cfelse> <cfelse>
<cfinclude template="cf_connector.cfm"> <cfinclude template="cf_connector.cfm">
</cfif> </cfif>
<cfabort> <cfabort>

View File

@@ -1,31 +1,31 @@
<cfsetting enablecfoutputonly="Yes"> <cfsetting enablecfoutputonly="Yes">
<!--- <!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the "File Uploader" for ColdFusion (all versions). * This is the "File Uploader" for ColdFusion (all versions).
* *
---> --->
<cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )> <cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )>
<cfif REQUEST.CFVersion lte 5> <cfif REQUEST.CFVersion lte 5>
<cfinclude template="cf5_upload.cfm"> <cfinclude template="cf5_upload.cfm">
<cfelse> <cfelse>
<cfinclude template="cf_upload.cfm"> <cfinclude template="cf_upload.cfm">
</cfif> </cfif>

View File

@@ -1,65 +1,65 @@
[//lasso [//lasso
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* Configuration file for the File Manager Connector for Lasso. * Configuration file for the File Manager Connector for Lasso.
*/ */
/*..................................................................... /*.....................................................................
The connector uses the file tags, which require authentication. Enter a The connector uses the file tags, which require authentication. Enter a
valid username and password from Lasso admin for a group with file tags valid username and password from Lasso admin for a group with file tags
permissions for uploads and the path you define in UserFilesPath below. permissions for uploads and the path you define in UserFilesPath below.
*/ */
var('connection') = array( var('connection') = array(
-username='xxxxxxxx', -username='xxxxxxxx',
-password='xxxxxxxx' -password='xxxxxxxx'
); );
/*..................................................................... /*.....................................................................
Set the base path for files that users can upload and browse (relative Set the base path for files that users can upload and browse (relative
to server root). to server root).
Set which file extensions are allowed and/or denied for each file type. Set which file extensions are allowed and/or denied for each file type.
*/ */
var('config') = map( var('config') = map(
'Enabled' = false, 'Enabled' = false,
'UserFilesPath' = '/userfiles/', 'UserFilesPath' = '/userfiles/',
'Subdirectories' = map( 'Subdirectories' = map(
'File' = 'File/', 'File' = 'File/',
'Image' = 'Image/', 'Image' = 'Image/',
'Flash' = 'Flash/', 'Flash' = 'Flash/',
'Media' = 'Media/' 'Media' = 'Media/'
), ),
'AllowedExtensions' = map( 'AllowedExtensions' = map(
'File' = array('7z','aiff','asf','avi','bmp','csv','doc','fla','flv','gif','gz','gzip','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','ods','odt','pdf','png','ppt','pxd','qt','ram','rar','rm','rmi','rmvb','rtf','sdc','sitd','swf','sxc','sxw','tar','tgz','tif','tiff','txt','vsd','wav','wma','wmv','xls','xml','zip'), 'File' = array('7z','aiff','asf','avi','bmp','csv','doc','fla','flv','gif','gz','gzip','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','ods','odt','pdf','png','ppt','pxd','qt','ram','rar','rm','rmi','rmvb','rtf','sdc','sitd','swf','sxc','sxw','tar','tgz','tif','tiff','txt','vsd','wav','wma','wmv','xls','xml','zip'),
'Image' = array('bmp','gif','jpeg','jpg','png'), 'Image' = array('bmp','gif','jpeg','jpg','png'),
'Flash' = array('swf','flv'), 'Flash' = array('swf','flv'),
'Media' = array('aiff','asf','avi','bmp','fla','flv','gif','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','png','qt','ram','rm','rmi','rmvb','swf','tif','tiff','wav','wma','wmv') 'Media' = array('aiff','asf','avi','bmp','fla','flv','gif','jpeg','jpg','mid','mov','mp3','mp4','mpc','mpeg','mpg','png','qt','ram','rm','rmi','rmvb','swf','tif','tiff','wav','wma','wmv')
), ),
'DeniedExtensions' = map( 'DeniedExtensions' = map(
'File' = array(), 'File' = array(),
'Image' = array(), 'Image' = array(),
'Flash' = array(), 'Flash' = array(),
'Media' = array() 'Media' = array()
) )
); );
] ]

View File

@@ -1,322 +1,322 @@
[//lasso [//lasso
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the File Manager Connector for Lasso. * This is the File Manager Connector for Lasso.
*/ */
/*..................................................................... /*.....................................................................
Include global configuration. See config.lasso for details. Include global configuration. See config.lasso for details.
*/ */
include('config.lasso'); include('config.lasso');
/*..................................................................... /*.....................................................................
Translate current date/time to GMT for custom header. Translate current date/time to GMT for custom header.
*/ */
var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT'); var('headerDate') = date_localtogmt(date)->format('%a, %d %b %Y %T GMT');
/*..................................................................... /*.....................................................................
Convert query string parameters to variables and initialize output. Convert query string parameters to variables and initialize output.
*/ */
var( var(
'Command' = action_param('Command'), 'Command' = action_param('Command'),
'Type' = action_param('Type'), 'Type' = action_param('Type'),
'CurrentFolder' = action_param('CurrentFolder'), 'CurrentFolder' = action_param('CurrentFolder'),
'ServerPath' = action_param('ServerPath'), 'ServerPath' = action_param('ServerPath'),
'NewFolderName' = action_param('NewFolderName'), 'NewFolderName' = action_param('NewFolderName'),
'NewFile' = null, 'NewFile' = null,
'NewFileName' = string, 'NewFileName' = string,
'OrigFilePath' = string, 'OrigFilePath' = string,
'NewFilePath' = string, 'NewFilePath' = string,
'commandData' = string, 'commandData' = string,
'folders' = '\t<Folders>\n', 'folders' = '\t<Folders>\n',
'files' = '\t<Files>\n', 'files' = '\t<Files>\n',
'errorNumber' = integer, 'errorNumber' = integer,
'responseType' = 'xml', 'responseType' = 'xml',
'uploadResult' = '0' 'uploadResult' = '0'
); );
/*..................................................................... /*.....................................................................
Custom tag sets the HTML response. Custom tag sets the HTML response.
*/ */
define_tag( define_tag(
'htmlreply', 'htmlreply',
-namespace='fck_', -namespace='fck_',
-priority='replace', -priority='replace',
-required='uploadResult', -required='uploadResult',
-optional='NewFilePath', -optional='NewFilePath',
-type='string', -type='string',
-description='Sets the HTML response for the FCKEditor File Upload feature.' -description='Sets the HTML response for the FCKEditor File Upload feature.'
); );
$__html_reply__ = '\ $__html_reply__ = '\
<script type="text/javascript"> <script type="text/javascript">
(function() (function()
{ {
var d = document.domain ; var d = document.domain ;
while ( true ) while ( true )
{ {
// Test if we can access a parent property. // Test if we can access a parent property.
try try
{ {
var test = window.top.opener.document.domain ; var test = window.top.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\\.|$)/, "" ) ; d = d.replace( /.*?(?:\\.|$)/, "" ) ;
if ( d.length == 0 ) if ( d.length == 0 )
break ; // It was not able to detect the domain. break ; // It was not able to detect the domain.
try try
{ {
document.domain = d ; document.domain = d ;
} }
catch (e) catch (e)
{ {
break ; break ;
} }
} }
})() ; })() ;
'; ';
if($uploadResult == '0' || $uploadResult == '201'); if($uploadResult == '0' || $uploadResult == '201');
$__html_reply__ = $__html_reply__ + '\ $__html_reply__ = $__html_reply__ + '\
window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\'); window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
</script> </script>
'; ';
else; else;
$__html_reply__ = $__html_reply__ + '\ $__html_reply__ = $__html_reply__ + '\
window.parent.OnUploadCompleted(' + $uploadResult + '); window.parent.OnUploadCompleted(' + $uploadResult + ');
</script> </script>
'; ';
/if; /if;
/define_tag; /define_tag;
/*..................................................................... /*.....................................................................
Calculate the path to the current folder. Calculate the path to the current folder.
*/ */
$ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath');
var('currentFolderURL' = $ServerPath var('currentFolderURL' = $ServerPath
+ $config->find('Subdirectories')->find(action_param('Type')) + $config->find('Subdirectories')->find(action_param('Type'))
+ $CurrentFolder + $CurrentFolder
); );
if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\')); if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
if($Command == 'FileUpload'); if($Command == 'FileUpload');
$responseType = 'html'; $responseType = 'html';
$uploadResult = '102'; $uploadResult = '102';
fck_htmlreply( fck_htmlreply(
-uploadResult=$uploadResult -uploadResult=$uploadResult
); );
else; else;
$errorNumber = 102; $errorNumber = 102;
$commandData += '<Error number="' + $errorNumber + '" />\n'; $commandData += '<Error number="' + $errorNumber + '" />\n';
/if; /if;
else; else;
/*..................................................................... /*.....................................................................
Build the appropriate response per the 'Command' parameter. Wrap the Build the appropriate response per the 'Command' parameter. Wrap the
entire process in an inline for file tag permissions. entire process in an inline for file tag permissions.
*/ */
inline($connection); inline($connection);
select($Command); select($Command);
/*............................................................. /*.............................................................
List all subdirectories in the 'Current Folder' directory. List all subdirectories in the 'Current Folder' directory.
*/ */
case('GetFolders'); case('GetFolders');
$commandData += '\t<Folders>\n'; $commandData += '\t<Folders>\n';
iterate(file_listdirectory($currentFolderURL), local('this')); iterate(file_listdirectory($currentFolderURL), local('this'));
#this->endswith('/') ? $commandData += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n'; #this->endswith('/') ? $commandData += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n';
/iterate; /iterate;
$commandData += '\t</Folders>\n'; $commandData += '\t</Folders>\n';
/*............................................................. /*.............................................................
List both files and folders in the 'Current Folder' directory. List both files and folders in the 'Current Folder' directory.
Include the file sizes in kilobytes. Include the file sizes in kilobytes.
*/ */
case('GetFoldersAndFiles'); case('GetFoldersAndFiles');
iterate(file_listdirectory($currentFolderURL), local('this')); iterate(file_listdirectory($currentFolderURL), local('this'));
if(#this->endswith('/')); if(#this->endswith('/'));
$folders += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n'; $folders += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n';
else; else;
local('size') = file_getsize($currentFolderURL + #this) / 1024; local('size') = file_getsize($currentFolderURL + #this) / 1024;
$files += '\t\t<File name="' + #this + '" size="' + #size + '" />\n'; $files += '\t\t<File name="' + #this + '" size="' + #size + '" />\n';
/if; /if;
/iterate; /iterate;
$folders += '\t</Folders>\n'; $folders += '\t</Folders>\n';
$files += '\t</Files>\n'; $files += '\t</Files>\n';
$commandData += $folders + $files; $commandData += $folders + $files;
/*............................................................. /*.............................................................
Create a directory 'NewFolderName' within the 'Current Folder.' Create a directory 'NewFolderName' within the 'Current Folder.'
*/ */
case('CreateFolder'); case('CreateFolder');
$NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); $NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
var('newFolder' = $currentFolderURL + $NewFolderName + '/'); var('newFolder' = $currentFolderURL + $NewFolderName + '/');
file_create($newFolder); file_create($newFolder);
/*......................................................... /*.........................................................
Map Lasso's file error codes to FCKEditor's error codes. Map Lasso's file error codes to FCKEditor's error codes.
*/ */
select(file_currenterror( -errorcode)); select(file_currenterror( -errorcode));
case(0); case(0);
$errorNumber = 0; $errorNumber = 0;
case( -9983); case( -9983);
$errorNumber = 101; $errorNumber = 101;
case( -9976); case( -9976);
$errorNumber = 102; $errorNumber = 102;
case( -9977); case( -9977);
$errorNumber = 102; $errorNumber = 102;
case( -9961); case( -9961);
$errorNumber = 103; $errorNumber = 103;
case; case;
$errorNumber = 110; $errorNumber = 110;
/select; /select;
$commandData += '<Error number="' + $errorNumber + '" />\n'; $commandData += '<Error number="' + $errorNumber + '" />\n';
/*............................................................. /*.............................................................
Process an uploaded file. Process an uploaded file.
*/ */
case('FileUpload'); case('FileUpload');
/*......................................................... /*.........................................................
This is the only command that returns an HTML response. This is the only command that returns an HTML response.
*/ */
$responseType = 'html'; $responseType = 'html';
/*......................................................... /*.........................................................
Was a file actually uploaded? Was a file actually uploaded?
*/ */
if(file_uploads->size); if(file_uploads->size);
$NewFile = file_uploads->get(1); $NewFile = file_uploads->get(1);
else; else;
$uploadResult = '202'; $uploadResult = '202';
/if; /if;
if($uploadResult == '0'); if($uploadResult == '0');
/*..................................................... /*.....................................................
Split the file's extension from the filename in order Split the file's extension from the filename in order
to follow the API's naming convention for duplicate to follow the API's naming convention for duplicate
files. (Test.txt, Test(1).txt, Test(2).txt, etc.) files. (Test.txt, Test(1).txt, Test(2).txt, etc.)
*/ */
$NewFileName = $NewFile->find('OrigName'); $NewFileName = $NewFile->find('OrigName');
$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); $NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
$OrigFilePath = $currentFolderURL + $NewFileName; $OrigFilePath = $currentFolderURL + $NewFileName;
$NewFilePath = $OrigFilePath; $NewFilePath = $OrigFilePath;
local('fileExtension') = '.' + $NewFile->find('OrigExtension'); local('fileExtension') = '.' + $NewFile->find('OrigExtension');
#fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_'); #fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&; local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
/*..................................................... /*.....................................................
Make sure the file extension is allowed. Make sure the file extension is allowed.
*/ */
if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension'));
$uploadResult = '202'; $uploadResult = '202';
else; else;
/*................................................. /*.................................................
Rename the target path until it is unique. Rename the target path until it is unique.
*/ */
while(file_exists($NewFilePath)); while(file_exists($NewFilePath));
$NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension; $NewFilePath = $currentFolderURL + #shortFileName + '(' + loop_count + ')' + #fileExtension;
/while; /while;
/*................................................. /*.................................................
Copy the uploaded file to its final location. Copy the uploaded file to its final location.
*/ */
file_copy($NewFile->find('path'), $NewFilePath); file_copy($NewFile->find('path'), $NewFilePath);
/*................................................. /*.................................................
Set the error code for the response. Note whether Set the error code for the response. Note whether
the file had to be renamed. the file had to be renamed.
*/ */
select(file_currenterror( -errorcode)); select(file_currenterror( -errorcode));
case(0); case(0);
$OrigFilePath != $NewFilePath ? $uploadResult = 201; $OrigFilePath != $NewFilePath ? $uploadResult = 201;
case; case;
$uploadResult = file_currenterror( -errorcode); $uploadResult = file_currenterror( -errorcode);
/select; /select;
/if; /if;
/if; /if;
fck_htmlreply( fck_htmlreply(
-uploadResult=$uploadResult, -uploadResult=$uploadResult,
-NewFilePath=$NewFilePath -NewFilePath=$NewFilePath
); );
/select; /select;
/inline; /inline;
/if; /if;
/*..................................................................... /*.....................................................................
Send a custom header for xml responses. Send a custom header for xml responses.
*/ */
if($responseType == 'xml'); if($responseType == 'xml');
header; header;
] ]
HTTP/1.0 200 OK HTTP/1.0 200 OK
Date: [$headerDate] Date: [$headerDate]
Server: Lasso Professional [lasso_version( -lassoversion)] Server: Lasso Professional [lasso_version( -lassoversion)]
Expires: Mon, 26 Jul 1997 05:00:00 GMT Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: [$headerDate] Last-Modified: [$headerDate]
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache Pragma: no-cache
Keep-Alive: timeout=15, max=98 Keep-Alive: timeout=15, max=98
Connection: Keep-Alive Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8 Content-Type: text/xml; charset=utf-8
[//lasso [//lasso
/header; /header;
/* /*
Set the content type encoding for Lasso. Set the content type encoding for Lasso.
*/ */
content_type('text/xml; charset=utf-8'); content_type('text/xml; charset=utf-8');
/* /*
Wrap the response as XML and output. Wrap the response as XML and output.
*/ */
$__html_reply__ = '\ $__html_reply__ = '\
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Connector command="' + $Command + '" resourceType="' + $Type + '">'; <Connector command="' + $Command + '" resourceType="' + $Type + '">';
if($errorNumber != '102'); if($errorNumber != '102');
$__html_reply__ += '<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />'; $__html_reply__ += '<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />';
/if; /if;
$__html_reply__ += $commandData + ' $__html_reply__ += $commandData + '
</Connector>'; </Connector>';
/if; /if;
] ]

View File

@@ -1,191 +1,168 @@
[//lasso [//lasso
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
* Licensed under the terms of any of the following licenses at your * Licensed under the terms of any of the following licenses at your
* choice: * choice:
* *
* - GNU General Public License Version 2 or later (the "GPL") * - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
* *
* - Mozilla Public License Version 1.1 or later (the "MPL") * - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html * http://www.mozilla.org/MPL/MPL-1.1.html
* *
* == END LICENSE == * == END LICENSE ==
* *
* This is the "File Uploader" for Lasso. * This is the "File Uploader" for Lasso.
*/ */
/*..................................................................... /*.....................................................................
Include global configuration. See config.lasso for details. Include global configuration. See config.lasso for details.
*/ */
include('config.lasso'); include('config.lasso');
/*..................................................................... /*.....................................................................
Convert query string parameters to variables and initialize output. Convert query string parameters to variables and initialize output.
*/ */
var( var(
'Type' = action_param('Type'), 'Type' = action_param('Type'),
'CurrentFolder' = action_param('CurrentFolder'), 'CurrentFolder' = action_param('CurrentFolder'),
'ServerPath' = action_param('ServerPath'), 'ServerPath' = action_param('ServerPath'),
'NewFile' = null, 'NewFile' = null,
'NewFileName' = string, 'NewFileName' = string,
'OrigFilePath' = string, 'OrigFilePath' = string,
'NewFilePath' = string, 'NewFilePath' = string,
'errorNumber' = 0, 'errorNumber' = 0,
'customMsg' = '' 'customMsg' = ''
); );
$Type == '' ? $Type = 'File'; $Type == '' ? $Type = 'File';
/*..................................................................... /*.....................................................................
Calculate the path to the current folder. Calculate the path to the current folder.
*/ */
$ServerPath == '' ? $ServerPath = $config->find('UserFilesPath'); $ServerPath == '' ? $ServerPath = $config->find('UserFilesPath');
var('currentFolderURL' = $ServerPath var('currentFolderURL' = $ServerPath
+ $config->find('Subdirectories')->find(action_param('Type')) + $config->find('Subdirectories')->find(action_param('Type'))
+ action_param('CurrentFolder') + action_param('CurrentFolder')
); );
/*..................................................................... /*.....................................................................
Custom tag sets the HTML response. Custom tag sets the HTML response.
*/ */
define_tag( define_tag(
'sendresults', 'sendresults',
-namespace='fck_', -namespace='fck_',
-priority='replace', -priority='replace',
-required='errorNumber', -required='errorNumber',
-type='integer', -type='integer',
-optional='fileUrl', -optional='fileUrl',
-type='string', -type='string',
-optional='fileName', -optional='fileName',
-type='string', -type='string',
-optional='customMsg', -optional='customMsg',
-type='string', -type='string',
-description='Sets the HTML response for the FCKEditor Quick Upload feature.' -description='Sets the HTML response for the FCKEditor Quick Upload feature.'
); );
$__html_reply__ = '\
<script type="text/javascript"> $__html_reply__ = '<script type="text/javascript">';
(function()
{ // Minified version of the document.domain automatic fix script (#1919).
var d = document.domain ; // The original script can be found at _dev/domain_fix_template.js
// Note: in Lasso replace \ with \\
while ( true ) $__html_reply__ = $__html_reply__ + "(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();";
{
// Test if we can access a parent property. $__html_reply__ = $__html_reply__ + '\
try window.parent.OnUploadCompleted(' + #errorNumber + ',"'
{ + string_replace(#fileUrl, -find='"', -replace='\\"') + '","'
var test = window.top.opener.document.domain ; + string_replace(#fileName, -find='"', -replace='\\"') + '","'
break ; + string_replace(#customMsg, -find='"', -replace='\\"') + '");
} </script>
catch( e ) {} ';
/define_tag;
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\\.|$)/, "" ) ; if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
$errorNumber = 102;
if ( d.length == 0 ) /if;
break ; // It was not able to detect the domain.
if($config->find('Enabled'));
try /*.................................................................
{ Process an uploaded file.
document.domain = d ; */
} inline($connection);
catch (e) /*.............................................................
{ Was a file actually uploaded?
break ; */
} if($errorNumber != '102');
} file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202;
})() ; /if;
window.parent.OnUploadCompleted(' + #errorNumber + ',"'
+ string_replace(#fileUrl, -find='"', -replace='\\"') + '","' if($errorNumber == 0);
+ string_replace(#fileName, -find='"', -replace='\\"') + '","' /*.........................................................
+ string_replace(#customMsg, -find='"', -replace='\\"') + '"); Split the file's extension from the filename in order
</script> to follow the API's naming convention for duplicate
'; files. (Test.txt, Test(1).txt, Test(2).txt, etc.)
/define_tag; */
$NewFileName = $NewFile->find('OrigName');
if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\')); $OrigFilePath = $currentFolderURL + $NewFileName;
$errorNumber = 102; $NewFilePath = $OrigFilePath;
/if; local('fileExtension') = '.' + $NewFile->find('OrigExtension');
local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
if($config->find('Enabled'));
/*.................................................................
Process an uploaded file. /*.........................................................
*/ Make sure the file extension is allowed.
inline($connection); */
/*.............................................................
Was a file actually uploaded? if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension'));
*/ $errorNumber = 202;
if($errorNumber != '102'); else;
file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; /*.....................................................
/if; Rename the target path until it is unique.
*/
if($errorNumber == 0); while(file_exists($NewFilePath));
/*......................................................... $NewFileName = #shortFileName + '(' + loop_count + ')' + #fileExtension;
Split the file's extension from the filename in order $NewFilePath = $currentFolderURL + $NewFileName;
to follow the API's naming convention for duplicate /while;
files. (Test.txt, Test(1).txt, Test(2).txt, etc.)
*/
$NewFileName = $NewFile->find('OrigName'); /*.....................................................
$OrigFilePath = $currentFolderURL + $NewFileName; Copy the uploaded file to its final location.
$NewFilePath = $OrigFilePath; */
local('fileExtension') = '.' + $NewFile->find('OrigExtension'); file_copy($NewFile->find('path'), $NewFilePath);
local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
/*.....................................................
/*......................................................... Set the error code for the response.
Make sure the file extension is allowed. */
*/ select(file_currenterror( -errorcode));
case(0);
if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension')); $OrigFilePath != $NewFilePath ? $errorNumber = 201;
$errorNumber = 202; case;
else; $errorNumber = 202;
/*..................................................... /select;
Rename the target path until it is unique. /if;
*/ /if;
while(file_exists($NewFilePath)); /inline;
$NewFileName = #shortFileName + '(' + loop_count + ')' + #fileExtension; else;
$NewFilePath = $currentFolderURL + $NewFileName; $errorNumber = 1;
/while; $customMsg = 'This file uploader is disabled. Please check the "editor/filemanager/upload/lasso/config.lasso" file.';
/if;
/*..................................................... fck_sendresults(
Copy the uploaded file to its final location. -errorNumber=$errorNumber,
*/ -fileUrl=$NewFilePath,
file_copy($NewFile->find('path'), $NewFilePath); -fileName=$NewFileName,
-customMsg=$customMsg
);
/*..................................................... ]
Set the error code for the response.
*/
select(file_currenterror( -errorcode));
case(0);
$OrigFilePath != $NewFilePath ? $errorNumber = 201;
case;
$errorNumber = 202;
/select;
/if;
/if;
/inline;
else;
$errorNumber = 1;
$customMsg = 'This file uploader is disabled. Please check the "editor/filemanager/upload/lasso/config.lasso" file.';
/if;
fck_sendresults(
-errorNumber=$errorNumber,
-fileUrl=$NewFilePath,
-fileName=$NewFileName,
-customMsg=$customMsg
);
]

View File

@@ -1,63 +1,63 @@
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
sub CreateXmlHeader sub CreateXmlHeader
{ {
local($command,$resourceType,$currentFolder) = @_; local($command,$resourceType,$currentFolder) = @_;
# Create the XML document header. # Create the XML document header.
print '<?xml version="1.0" encoding="utf-8" ?>'; print '<?xml version="1.0" encoding="utf-8" ?>';
# Create the main "Connector" node. # Create the main "Connector" node.
print '<Connector command="' . $command . '" resourceType="' . $resourceType . '">'; print '<Connector command="' . $command . '" resourceType="' . $resourceType . '">';
# Add the current folder node. # Add the current folder node.
print '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType,$currentFolder)) . '" />'; print '<CurrentFolder path="' . ConvertToXmlAttribute($currentFolder) . '" url="' . ConvertToXmlAttribute(GetUrlFromPath($resourceType,$currentFolder)) . '" />';
} }
sub CreateXmlFooter sub CreateXmlFooter
{ {
print '</Connector>'; print '</Connector>';
} }
sub SendError sub SendError
{ {
local( $number, $text ) = @_; local( $number, $text ) = @_;
print << "_HTML_HEAD_"; print << "_HTML_HEAD_";
Content-Type:text/xml; charset=utf-8 Content-Type:text/xml; charset=utf-8
Pragma: no-cache Pragma: no-cache
Cache-Control: no-cache Cache-Control: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT Expires: Thu, 01 Dec 1994 16:00:00 GMT
_HTML_HEAD_ _HTML_HEAD_
# Create the XML document header # Create the XML document header
print '<?xml version="1.0" encoding="utf-8" ?>' ; print '<?xml version="1.0" encoding="utf-8" ?>' ;
print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ; print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;
exit ; exit ;
} }
1; 1;

View File

@@ -1,214 +1,187 @@
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
sub GetFolders sub GetFolders
{ {
local($resourceType, $currentFolder) = @_; local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path. # Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder); $sServerDir = &ServerMapFolder($resourceType, $currentFolder);
print "<Folders>"; # Open the "Folders" node. print "<Folders>"; # Open the "Folders" node.
opendir(DIR,"$sServerDir"); opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR)); @files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR); closedir(DIR);
foreach $sFile (@files) { foreach $sFile (@files) {
if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) { if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) {
$cnv_filename = &ConvertToXmlAttribute($sFile); $cnv_filename = &ConvertToXmlAttribute($sFile);
print '<Folder name="' . $cnv_filename . '" />'; print '<Folder name="' . $cnv_filename . '" />';
} }
} }
print "</Folders>"; # Close the "Folders" node. print "</Folders>"; # Close the "Folders" node.
} }
sub GetFoldersAndFiles sub GetFoldersAndFiles
{ {
local($resourceType, $currentFolder) = @_; local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path. # Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder); $sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Initialize the output buffers for "Folders" and "Files". # Initialize the output buffers for "Folders" and "Files".
$sFolders = '<Folders>'; $sFolders = '<Folders>';
$sFiles = '<Files>'; $sFiles = '<Files>';
opendir(DIR,"$sServerDir"); opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR)); @files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR); closedir(DIR);
foreach $sFile (@files) { foreach $sFile (@files) {
if($sFile ne '.' && $sFile ne '..') { if($sFile ne '.' && $sFile ne '..') {
if(-d "$sServerDir$sFile") { if(-d "$sServerDir$sFile") {
$cnv_filename = &ConvertToXmlAttribute($sFile); $cnv_filename = &ConvertToXmlAttribute($sFile);
$sFolders .= '<Folder name="' . $cnv_filename . '" />' ; $sFolders .= '<Folder name="' . $cnv_filename . '" />' ;
} else { } else {
($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2]; ($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2];
if($iFileSize > 0) { if($iFileSize > 0) {
$iFileSize = int($iFileSize / 1024); $iFileSize = int($iFileSize / 1024);
if($iFileSize < 1) { if($iFileSize < 1) {
$iFileSize = 1; $iFileSize = 1;
} }
} }
$cnv_filename = &ConvertToXmlAttribute($sFile); $cnv_filename = &ConvertToXmlAttribute($sFile);
$sFiles .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ; $sFiles .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ;
} }
} }
} }
print $sFolders ; print $sFolders ;
print '</Folders>'; # Close the "Folders" node. print '</Folders>'; # Close the "Folders" node.
print $sFiles ; print $sFiles ;
print '</Files>'; # Close the "Files" node. print '</Files>'; # Close the "Files" node.
} }
sub CreateFolder sub CreateFolder
{ {
local($resourceType, $currentFolder) = @_; local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ; $sErrorNumber = '0' ;
$sErrorMsg = '' ; $sErrorMsg = '' ;
if($FORM{'NewFolderName'} ne "") { if($FORM{'NewFolderName'} ne "") {
$sNewFolderName = $FORM{'NewFolderName'}; $sNewFolderName = $FORM{'NewFolderName'};
$sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g; $sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
# Map the virtual path to the local server path of the current folder. # Map the virtual path to the local server path of the current folder.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder); $sServerDir = &ServerMapFolder($resourceType, $currentFolder);
if(-w $sServerDir) { if(-w $sServerDir) {
$sServerDir .= $sNewFolderName; $sServerDir .= $sNewFolderName;
$sErrorMsg = &CreateServerFolder($sServerDir); $sErrorMsg = &CreateServerFolder($sServerDir);
if($sErrorMsg == 0) { if($sErrorMsg == 0) {
$sErrorNumber = '0'; $sErrorNumber = '0';
} elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') { } elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') {
$sErrorNumber = '102'; #// Path too long. $sErrorNumber = '102'; #// Path too long.
} else { } else {
$sErrorNumber = '110'; $sErrorNumber = '110';
} }
} else { } else {
$sErrorNumber = '103'; $sErrorNumber = '103';
} }
} else { } else {
$sErrorNumber = '102' ; $sErrorNumber = '102' ;
} }
# Create the "Error" node. # Create the "Error" node.
$cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg); $cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg);
print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />'; print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
} }
sub FileUpload sub FileUpload
{ {
eval("use File::Copy;"); eval("use File::Copy;");
local($resourceType, $currentFolder) = @_; local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ; $sErrorNumber = '0' ;
$sFileName = '' ; $sFileName = '' ;
if($new_fname) { if($new_fname) {
# Map the virtual path to the local server path. # Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder); $sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Get the uploaded file name. # Get the uploaded file name.
$sFileName = $new_fname; $sFileName = $new_fname;
$sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g; $sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
$sOriginalFileName = $sFileName; $sOriginalFileName = $sFileName;
$iCounter = 0; $iCounter = 0;
while(1) { while(1) {
$sFilePath = $sServerDir . $sFileName; $sFilePath = $sServerDir . $sFileName;
if(-e $sFilePath) { if(-e $sFilePath) {
$iCounter++ ; $iCounter++ ;
($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName); ($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName);
$sFileName = $BaseName . '(' . $iCounter . ').' . $ext; $sFileName = $BaseName . '(' . $iCounter . ').' . $ext;
$sErrorNumber = '201'; $sErrorNumber = '201';
} else { } else {
copy("$img_dir/$new_fname","$sFilePath"); copy("$img_dir/$new_fname","$sFilePath");
if (defined $CHMOD_ON_UPLOAD) { if (defined $CHMOD_ON_UPLOAD) {
if ($CHMOD_ON_UPLOAD) { if ($CHMOD_ON_UPLOAD) {
umask(000); umask(000);
chmod($CHMOD_ON_UPLOAD,$sFilePath); chmod($CHMOD_ON_UPLOAD,$sFilePath);
} }
} }
else { else {
umask(000); umask(000);
chmod(0777,$sFilePath); chmod(0777,$sFilePath);
} }
unlink("$img_dir/$new_fname"); unlink("$img_dir/$new_fname");
last; last;
} }
} }
} else { } else {
$sErrorNumber = '202' ; $sErrorNumber = '202' ;
} }
$sFileName =~ s/"/\\"/g; $sFileName =~ s/"/\\"/g;
SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, ''); SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, '');
} }
sub SendUploadResults sub SendUploadResults
{ {
local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_; local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_;
print <<EOF; # Minified version of the document.domain automatic fix script (#1919).
Content-type: text/html # The original script can be found at _dev/domain_fix_template.js
# Note: in Perl replace \ with \\ and $ with \$
<script type="text/javascript"> print <<EOF;
// Automatically detect the correct document.domain (#1919). Content-type: text/html
(function()
{ <script type="text/javascript">
var d = document.domain ; (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|\$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
while ( true ) EOF
{ print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;';
// Test if we can access a parent property. print '</script>';
try exit ;
{ }
var test = window.top.opener.document.domain ;
break ; 1;
}
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 ;
}
}
})() ;
EOF
print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;';
print '</script>';
exit ;
}
1;

View File

@@ -1,136 +1,136 @@
#!/usr/bin/env perl #!/usr/bin/env perl
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
## ##
# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. # 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). ## START: Hack for Windows (Not important to understand the editor code... Perl specific).
if(Windows_check()) { if(Windows_check()) {
chdir(GetScriptPath($0)); chdir(GetScriptPath($0));
} }
sub Windows_check sub Windows_check
{ {
# IIS,PWS(NT/95) # IIS,PWS(NT/95)
$www_server_os = $^O; $www_server_os = $^O;
# Win98 & NT(SP4) # Win98 & NT(SP4)
if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
# AnHTTPd/Omni/IIS # AnHTTPd/Omni/IIS
if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
# Win Apache # Win Apache
if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
if($www_server_os=~ /win/i) { return(1); } if($www_server_os=~ /win/i) { return(1); }
return(0); return(0);
} }
sub GetScriptPath { sub GetScriptPath {
local($path) = @_; local($path) = @_;
if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
$path; $path;
} }
## END: Hack for IIS ## END: Hack for IIS
require 'util.pl'; require 'util.pl';
require 'io.pl'; require 'io.pl';
require 'basexml.pl'; require 'basexml.pl';
require 'commands.pl'; require 'commands.pl';
require 'upload_fck.pl'; require 'upload_fck.pl';
## ##
# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. # SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
## ##
&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ; &SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ;
&read_input(); &read_input();
if($FORM{'ServerPath'} ne "") { if($FORM{'ServerPath'} ne "") {
$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
$GLOBALS{'UserFilesPath'} .= '/' ; $GLOBALS{'UserFilesPath'} .= '/' ;
} }
} else { } else {
$GLOBALS{'UserFilesPath'} = '/userfiles/'; $GLOBALS{'UserFilesPath'} = '/userfiles/';
} }
# Map the "UserFiles" path to a local directory. # Map the "UserFiles" path to a local directory.
$rootpath = &GetRootPath(); $rootpath = &GetRootPath();
$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
&DoResponse(); &DoResponse();
sub DoResponse sub DoResponse
{ {
if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") { if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") {
return ; return ;
} }
# Get the main request informaiton. # Get the main request informaiton.
$sCommand = $FORM{'Command'}; $sCommand = $FORM{'Command'};
$sResourceType = $FORM{'Type'}; $sResourceType = $FORM{'Type'};
$sCurrentFolder = $FORM{'CurrentFolder'}; $sCurrentFolder = $FORM{'CurrentFolder'};
# Check the current folder syntax (must begin and start with a slash). # Check the current folder syntax (must begin and start with a slash).
if(!($sCurrentFolder =~ /\/$/)) { if(!($sCurrentFolder =~ /\/$/)) {
$sCurrentFolder .= '/'; $sCurrentFolder .= '/';
} }
if(!($sCurrentFolder =~ /^\//)) { if(!($sCurrentFolder =~ /^\//)) {
$sCurrentFolder = '/' . $sCurrentFolder; $sCurrentFolder = '/' . $sCurrentFolder;
} }
# Check for invalid folder paths (..) # Check for invalid folder paths (..)
if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) { if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
SendError( 102, "" ) ; SendError( 102, "" ) ;
} }
# File Upload doesn't have to Return XML, so it must be intercepted before anything. # File Upload doesn't have to Return XML, so it must be intercepted before anything.
if($sCommand eq 'FileUpload') { if($sCommand eq 'FileUpload') {
FileUpload($sResourceType,$sCurrentFolder); FileUpload($sResourceType,$sCurrentFolder);
return ; return ;
} }
print << "_HTML_HEAD_"; print << "_HTML_HEAD_";
Content-Type:text/xml; charset=utf-8 Content-Type:text/xml; charset=utf-8
Pragma: no-cache Pragma: no-cache
Cache-Control: no-cache Cache-Control: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT Expires: Thu, 01 Dec 1994 16:00:00 GMT
_HTML_HEAD_ _HTML_HEAD_
&CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder); &CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder);
# Execute the required command. # Execute the required command.
if($sCommand eq 'GetFolders') { if($sCommand eq 'GetFolders') {
&GetFolders($sResourceType,$sCurrentFolder); &GetFolders($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'GetFoldersAndFiles') { } elsif($sCommand eq 'GetFoldersAndFiles') {
&GetFoldersAndFiles($sResourceType,$sCurrentFolder); &GetFoldersAndFiles($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'CreateFolder') { } elsif($sCommand eq 'CreateFolder') {
&CreateFolder($sResourceType,$sCurrentFolder); &CreateFolder($sResourceType,$sCurrentFolder);
} }
&CreateXmlFooter(); &CreateXmlFooter();
exit ; exit ;
} }

View File

@@ -1,141 +1,141 @@
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
sub GetUrlFromPath sub GetUrlFromPath
{ {
local($resourceType, $folderPath) = @_; local($resourceType, $folderPath) = @_;
if($resourceType eq '') { if($resourceType eq '') {
$rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/'); $rmpath = &RemoveFromEnd($GLOBALS{'UserFilesPath'},'/');
return("$rmpath$folderPath"); return("$rmpath$folderPath");
} else { } else {
return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath"); return("$GLOBALS{'UserFilesPath'}$resourceType$folderPath");
} }
} }
sub RemoveExtension sub RemoveExtension
{ {
local($fileName) = @_; local($fileName) = @_;
local($path, $base, $ext); local($path, $base, $ext);
if($fileName !~ /\./) { if($fileName !~ /\./) {
$fileName .= '.'; $fileName .= '.';
} }
if($fileName =~ /([^\\\/]*)\.(.*)$/) { if($fileName =~ /([^\\\/]*)\.(.*)$/) {
$base = $1; $base = $1;
$ext = $2; $ext = $2;
if($fileName =~ /(.*)$base\.$ext$/) { if($fileName =~ /(.*)$base\.$ext$/) {
$path = $1; $path = $1;
} }
} }
return($path,$base,$ext); return($path,$base,$ext);
} }
sub ServerMapFolder sub ServerMapFolder
{ {
local($resourceType,$folderPath) = @_; local($resourceType,$folderPath) = @_;
# Get the resource type directory. # Get the resource type directory.
$sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/'; $sResourceTypePath = $GLOBALS{'UserFilesDirectory'} . $resourceType . '/';
# Ensure that the directory exists. # Ensure that the directory exists.
&CreateServerFolder($sResourceTypePath); &CreateServerFolder($sResourceTypePath);
# Return the resource type directory combined with the required path. # Return the resource type directory combined with the required path.
$rmpath = &RemoveFromStart($folderPath,'/'); $rmpath = &RemoveFromStart($folderPath,'/');
return("$sResourceTypePath$rmpath"); return("$sResourceTypePath$rmpath");
} }
sub GetParentFolder sub GetParentFolder
{ {
local($folderPath) = @_; local($folderPath) = @_;
$folderPath =~ s/[\/][^\/]+[\/]?$//g; $folderPath =~ s/[\/][^\/]+[\/]?$//g;
return $folderPath; return $folderPath;
} }
sub CreateServerFolder sub CreateServerFolder
{ {
local($folderPath) = @_; local($folderPath) = @_;
$sParent = &GetParentFolder($folderPath); $sParent = &GetParentFolder($folderPath);
# Check if the parent exists, or create it. # Check if the parent exists, or create it.
if(!(-e $sParent)) { if(!(-e $sParent)) {
$sErrorMsg = &CreateServerFolder($sParent); $sErrorMsg = &CreateServerFolder($sParent);
if($sErrorMsg == 1) { if($sErrorMsg == 1) {
return(1); return(1);
} }
} }
if(!(-e $folderPath)) { if(!(-e $folderPath)) {
if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) { if (defined $CHMOD_ON_FOLDER_CREATE && !$CHMOD_ON_FOLDER_CREATE) {
mkdir("$folderPath"); mkdir("$folderPath");
} }
else { else {
umask(000); umask(000);
if (defined $CHMOD_ON_FOLDER_CREATE) { if (defined $CHMOD_ON_FOLDER_CREATE) {
mkdir("$folderPath",$CHMOD_ON_FOLDER_CREATE); mkdir("$folderPath",$CHMOD_ON_FOLDER_CREATE);
} }
else { else {
mkdir("$folderPath",0777); mkdir("$folderPath",0777);
} }
} }
return(0); return(0);
} else { } else {
return(1); return(1);
} }
} }
sub GetRootPath sub GetRootPath
{ {
#use Cwd; #use Cwd;
# my $dir = getcwd; # my $dir = getcwd;
# print $dir; # print $dir;
# $dir =~ s/$ENV{'DOCUMENT_ROOT'}//g; # $dir =~ s/$ENV{'DOCUMENT_ROOT'}//g;
# print $dir; # print $dir;
# return($dir); # return($dir);
# $wk = $0; # $wk = $0;
# $wk =~ s/\/connector\.cgi//g; # $wk =~ s/\/connector\.cgi//g;
# if($wk) { # if($wk) {
# $current_dir = $wk; # $current_dir = $wk;
# } else { # } else {
# $current_dir = `pwd`; # $current_dir = `pwd`;
# } # }
# return($current_dir); # return($current_dir);
use Cwd; use Cwd;
if($ENV{'DOCUMENT_ROOT'}) { if($ENV{'DOCUMENT_ROOT'}) {
$dir = $ENV{'DOCUMENT_ROOT'}; $dir = $ENV{'DOCUMENT_ROOT'};
} else { } else {
my $dir = getcwd; my $dir = getcwd;
$workdir =~ s/\/connector\.cgi//g; $workdir =~ s/\/connector\.cgi//g;
$dir =~ s/$workdir//g; $dir =~ s/$workdir//g;
} }
return($dir); return($dir);
} }
1; 1;

View File

@@ -1,117 +1,117 @@
#!/usr/bin/env perl #!/usr/bin/env perl
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
## ##
# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file. # 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). ## START: Hack for Windows (Not important to understand the editor code... Perl specific).
if(Windows_check()) { if(Windows_check()) {
chdir(GetScriptPath($0)); chdir(GetScriptPath($0));
} }
sub Windows_check sub Windows_check
{ {
# IIS,PWS(NT/95) # IIS,PWS(NT/95)
$www_server_os = $^O; $www_server_os = $^O;
# Win98 & NT(SP4) # Win98 & NT(SP4)
if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; } if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
# AnHTTPd/Omni/IIS # AnHTTPd/Omni/IIS
if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; } if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
# Win Apache # Win Apache
if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; } if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
if($www_server_os=~ /win/i) { return(1); } if($www_server_os=~ /win/i) { return(1); }
return(0); return(0);
} }
sub GetScriptPath { sub GetScriptPath {
local($path) = @_; local($path) = @_;
if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; } if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
$path; $path;
} }
## END: Hack for IIS ## END: Hack for IIS
require 'util.pl'; require 'util.pl';
require 'io.pl'; require 'io.pl';
require 'basexml.pl'; require 'basexml.pl';
require 'commands.pl'; require 'commands.pl';
require 'upload_fck.pl'; require 'upload_fck.pl';
## ##
# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR. # SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
## ##
&SendUploadResults(1, '', '', 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/upload.cgi" file' ) ; &SendUploadResults(1, '', '', 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/upload.cgi" file' ) ;
&read_input(); &read_input();
if($FORM{'ServerPath'} ne "") { if($FORM{'ServerPath'} ne "") {
$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'}; $GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) { if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
$GLOBALS{'UserFilesPath'} .= '/' ; $GLOBALS{'UserFilesPath'} .= '/' ;
} }
} else { } else {
$GLOBALS{'UserFilesPath'} = '/userfiles/'; $GLOBALS{'UserFilesPath'} = '/userfiles/';
} }
# Map the "UserFiles" path to a local directory. # Map the "UserFiles" path to a local directory.
$rootpath = &GetRootPath(); $rootpath = &GetRootPath();
$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'}; $GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
&DoResponse(); &DoResponse();
sub DoResponse sub DoResponse
{ {
# Get the main request information. # Get the main request information.
$sCommand = 'FileUpload'; #$FORM{'Command'}; $sCommand = 'FileUpload'; #$FORM{'Command'};
$sResourceType = $FORM{'Type'}; $sResourceType = $FORM{'Type'};
$sCurrentFolder = $FORM{'CurrentFolder'}; $sCurrentFolder = $FORM{'CurrentFolder'};
if ($sResourceType eq '') { if ($sResourceType eq '') {
$sResourceType = 'File' ; $sResourceType = 'File' ;
} }
if ($sCurrentFolder eq '') { if ($sCurrentFolder eq '') {
$sCurrentFolder = '/' ; $sCurrentFolder = '/' ;
} }
# Check the current folder syntax (must begin and start with a slash). # Check the current folder syntax (must begin and start with a slash).
if(!($sCurrentFolder =~ /\/$/)) { if(!($sCurrentFolder =~ /\/$/)) {
$sCurrentFolder .= '/'; $sCurrentFolder .= '/';
} }
if(!($sCurrentFolder =~ /^\//)) { if(!($sCurrentFolder =~ /^\//)) {
$sCurrentFolder = '/' . $sCurrentFolder; $sCurrentFolder = '/' . $sCurrentFolder;
} }
# Check for invalid folder paths (..) # Check for invalid folder paths (..)
if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) { if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
SendError( 102, "" ) ; SendError( 102, "" ) ;
} }
# File Upload doesn't have to Return XML, so it must be intercepted before anything. # File Upload doesn't have to Return XML, so it must be intercepted before anything.
if($sCommand eq 'FileUpload') { if($sCommand eq 'FileUpload') {
FileUpload($sResourceType,$sCurrentFolder); FileUpload($sResourceType,$sCurrentFolder);
return ; return ;
} }
} }

View File

@@ -1,68 +1,68 @@
##### #####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net # FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben # Copyright (C) 2003-2009 Frederico Caldeira Knabben
# #
# == BEGIN LICENSE == # == BEGIN LICENSE ==
# #
# Licensed under the terms of any of the following licenses at your # Licensed under the terms of any of the following licenses at your
# choice: # choice:
# #
# - GNU General Public License Version 2 or later (the "GPL") # - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html # http://www.gnu.org/licenses/gpl.html
# #
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") # - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html # http://www.gnu.org/licenses/lgpl.html
# #
# - Mozilla Public License Version 1.1 or later (the "MPL") # - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html # http://www.mozilla.org/MPL/MPL-1.1.html
# #
# == END LICENSE == # == END LICENSE ==
# #
# This is the File Manager Connector for Perl. # This is the File Manager Connector for Perl.
##### #####
sub RemoveFromStart sub RemoveFromStart
{ {
local($sourceString, $charToRemove) = @_; local($sourceString, $charToRemove) = @_;
$sPattern = '^' . $charToRemove . '+' ; $sPattern = '^' . $charToRemove . '+' ;
$sourceString =~ s/^$charToRemove+//g; $sourceString =~ s/^$charToRemove+//g;
return $sourceString; return $sourceString;
} }
sub RemoveFromEnd sub RemoveFromEnd
{ {
local($sourceString, $charToRemove) = @_; local($sourceString, $charToRemove) = @_;
$sPattern = $charToRemove . '+$' ; $sPattern = $charToRemove . '+$' ;
$sourceString =~ s/$charToRemove+$//g; $sourceString =~ s/$charToRemove+$//g;
return $sourceString; return $sourceString;
} }
sub ConvertToXmlAttribute sub ConvertToXmlAttribute
{ {
local($value) = @_; local($value) = @_;
return $value; return $value;
# return utf8_encode(htmlspecialchars($value)); # return utf8_encode(htmlspecialchars($value));
} }
sub specialchar_cnv sub specialchar_cnv
{ {
local($ch) = @_; local($ch) = @_;
$ch =~ s/&/&amp;/g; # & $ch =~ s/&/&amp;/g; # &
$ch =~ s/\"/&quot;/g; #" $ch =~ s/\"/&quot;/g; #"
$ch =~ s/\'/&#39;/g; # ' $ch =~ s/\'/&#39;/g; # '
$ch =~ s/</&lt;/g; # < $ch =~ s/</&lt;/g; # <
$ch =~ s/>/&gt;/g; # > $ch =~ s/>/&gt;/g; # >
return($ch); return($ch);
} }
sub JS_cnv sub JS_cnv
{ {
local($ch) = @_; local($ch) = @_;
$ch =~ s/\"/\\\"/g; #" $ch =~ s/\"/\\\"/g; #"
return($ch); return($ch);
} }
1; 1;

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *
@@ -154,6 +154,8 @@ function GetRootPath()
global $_SERVER; global $_SERVER;
} }
$sRealPath = realpath( './' ) ; $sRealPath = realpath( './' ) ;
// #2124 ensure that no slash is at the end
$sRealPath = rtrim($sRealPath,"\\/");
$sSelfPath = $_SERVER['PHP_SELF'] ; $sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ; $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
@@ -277,40 +279,13 @@ function SanitizeFileName( $sNewFileName )
// This is the function that sends the results of the uploading process. // This is the function that sends the results of the uploading process.
function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' ) function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
{ {
// Minified version of the document.domain automatic fix script (#1919).
// The original script can be found at _dev/domain_fix_template.js
echo <<<EOF echo <<<EOF
<script type="text/javascript"> <script type="text/javascript">
(function() (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
{
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 ;
}
}
})() ;
EOF; EOF;
$rpl = array( '\\' => '\\\\', '"' => '\\"' ) ; $rpl = array( '\\' => '\\\\', '"' => '\\"' ) ;
echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ; echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ;
echo '</script>' ; echo '</script>' ;

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2009 Frederico Caldeira Knabben
* *
* == BEGIN LICENSE == * == BEGIN LICENSE ==
* *

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