2
0
forked from Wavyzz/dolibarr

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:
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:
AdoDb-Date 0.21 Modified BSD License Yes Date convertion
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_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

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">
<!--
* 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 ==
*

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">
<!--
* 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 ==
*

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">
<!--
* 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 ==
*
@@ -33,261 +33,138 @@
<h1>
FCKeditor ChangeLog - What's New?</h1>
<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>
Version 2.6.4</h3>
<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>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2777">#2777</a>] Merging
cells between table header and body is no longer possible.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2815">#2815</a>] Fixed
WSC issues at slow connection speed. Added SSL support.</li>
<li>Language file updates for the following languages:
<ul>
<li>Chinese (Traditional)</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2846">#2846</a>] French</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/2824">#2824</a>] Russian</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2811">#2811</a>] Turkish</li>
</ul>
</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/2757">#2757</a>] Fixed
a minor bug which causes selection positions to be improperly restored during undos
and redos.</li>
</ul>
<h3>
Version 2.6 Beta 1</h3>
Version 2.6.4 Beta</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>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2685">#2685</a>] Integration
with "WebSpellChecker", a <strong>zero installation and free spell checker</strong>
provided by SpellChecker.net. This is now the default spell checker in the editor
(requires internet connection). All previous spell checking solutions are still
available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2430">#2430</a>] In the
table dialog it's possible to create header cells in the first row (included in
a thead element) or the first column of the table. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/822">#822</a>] The table
cell dialog allows switching between normal data cells or header cells (TD vs. TH).
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2515">#2515</a>] New language
file for Icelandic.</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
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2381">#2381</a>] Protected
the editor from duplicate iframes</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1752">#1752</a>] Fixed
the issue with tablecommands plugin and undefined tagName.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2333">#2333</a>] The &amp;gt;
character inside text wasn't encoded in Opera and Safari.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2467">#2467</a>] Fixed
JavaScript error with the fit window command in source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2472">#2472</a>] Splitting
a TH will create a two TH, not a TH and a TD.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1891">#1891</a>] Removed
unnecessary name attributes in dialogs. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/798">#798</a>, <a target="_blank"
href="http://dev.fckeditor.net/ticket/2495">#2495</a>] If an image was placed inside
a container with dimensions or floating it wasn't possible to edit its properties
from the toolbar or context menu.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1982">#1982</a>] Submenus
in IE7 now are shown properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2496">#2496</a>] Using
the Paste dialogs in IE might insert the content at the start of the editor.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2349">#2496</a>] Fixed
RTL dialog layout in Internet Explorer.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2488">#2488</a>] Fixed
the issue where email links in IE would take the browser to a new page in addition
to calling up the email client.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2519">#2519</a>] Fixed
race condition at registering the FCKeditorAPI object in multiple editor scenarios.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2525">#2525</a>] Fixed
JavaScript error in Google Chrome when StartupShowBlocks is set to true.</li>
<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>
<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>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2634">#2634</a>] Fixed
two obsolete references to Array::AddItem() instances still in the code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2679">#2679</a>] Fixed
infinite loop problems with FCKDomRangeIterator class which causes some commands
to hang when applied to certain document structures.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2649">#2649</a>] Fixed
a JavaScript error in IE when user tries to search with the "Match whole word" option
enabled and the matched word is at exactly the end of document.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2603">#2603</a>] Changed
the <a href="http://docs.fckeditor.net/EMailProtection">EMailProtection</a> to "none"
for better compatibility.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2612">#2612</a>] The 'ForcePasteAsPlainText'
configuration option didn't work correctly in Safari and Chrome.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2696">#2696</a>] Fixed
non-working autogrow plugin.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2753">#2753</a>] Fixed
occasional exceptions in the dragersizetable plugin with IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2653">#2653</a>] and [<a
target="_blank" href="http://dev.fckeditor.net/ticket/2733">#2733</a>] Enable undo
of changes to tables and table cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1865">#1865</a>] The context
menu is now working properly over the last row in a table with thead. Thanks to
Koen Willems.</li>
</ul>
<p>
<a href="_whatsnew_history.html">See previous versions history</a>
</p>
<a href="_whatsnew_history.html">See previous versions history</a></p>
</body>
</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">
<!--
* 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 ==
*
@@ -32,6 +32,549 @@
<body>
<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>
Version 2.5.1</h3>
<p>

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -26,10 +26,10 @@
* file.
*/
/*
The "body" styles should match your editor web site, mainly regarding
background color and font family and size.
*/
/**
* The "body" styles should match your editor web site, mainly regarding
* background color and font family and size.
*/
body
{
@@ -50,10 +50,10 @@ a[href]
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
paragraphs. Remember to apply the same style in your output front end page.
*/
/**
* Just uncomment the following block if you want to avoid spaces between
* paragraphs. Remember to apply the same style in your output front end page.
*/
/*
p, ul, li
@@ -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.
You should instead remove them, and include the styles used by the site
you are using the editor in.
.SC_Item *, .SC_ItemSelected *
{
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
{
font-weight: bold;

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -57,7 +57,7 @@
// Attention: FCKConfig must be available in the page.
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}' ;
}
@@ -187,34 +187,7 @@ function OpenFileBrowser( url, width, height )
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
// The "PreserveSessionOnFileBrowser" because the above code could be
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
{
// Detect Yahoo popup blocker.
try
{
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
oWindow.opener = window ;
}
catch(e)
{
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
}
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
window.open( url, 'FCKBrowseWindow', sOptions ) ;
window.open( url, 'FCKBrowseWindow', sOptions ) ;
}
/**
@@ -334,5 +307,41 @@ function CopyAttributes( oSource, oDest, oSkipAttributes )
}
}
// 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">
<!--
* 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 ==
*
@@ -78,8 +78,8 @@ window.onload = function()
border-left: #000000 1px solid; border-bottom: #000000 1px solid">
<span fcklang="DlgAboutVersion">version</span>
<br />
<b>2.6</b><br />
Build 18638</td>
<b>2.6.4</b><br />
Build 21629</td>
</tr>
</table>
</td>
@@ -105,7 +105,7 @@ window.onload = function()
<span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
target="_blank">http://www.fckeditor.net/</a>.
<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 align="center">
<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" >
<!--
* 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 ==
*
@@ -119,10 +119,7 @@ function Ok()
var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ;
if ( aNewAnchors.length == 0 )
{
// Nothing was selected, so now just create a normal A
aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
}
aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
else
{
// Remove the fake href
@@ -136,7 +133,18 @@ function Ok()
oAnchor = aNewAnchors[i] ;
// 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
// Opera doesn't allow to select empty anchors

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

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">
<!--
* 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 ==
*
@@ -456,7 +456,7 @@ function SetUrl( url )
<tr>
<td nowrap="nowrap">
<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='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
4.01 Transitional</option>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -97,7 +97,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<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>
</form>
</div>

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -236,6 +236,10 @@ function SetUrl( url, width, height )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber )
{
case 0 : // No errors
@@ -288,5 +292,9 @@ function CheckUpload()
return false ;
}
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ;
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -165,7 +165,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br />
<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
<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>
</form>
</div>

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -447,6 +447,10 @@ function SetUrl( url, width, height, alt )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber )
{
case 0 : // No errors
@@ -500,5 +504,9 @@ function CheckUpload()
return false ;
}
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ;
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -34,9 +34,9 @@
var FCKTools = window.parent.FCKTools ;
var FCKConfig = window.parent.FCKConfig ;
// Sets the Skin CSS
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss( '../' ) ) ) ;
// Set the preview CSS
document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ;
document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ;
if ( window.parent.FCKConfig.BaseHref.length > 0 )
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
@@ -50,7 +50,7 @@ window.onload = function()
</script>
</head>
<body style="color: #000000; background-color: #ffffff">
<body>
<div>
<a id="lnkPreview" onclick="return false;" style="cursor: default">
<img id="imgPreview" onload="window.parent.UpdateOriginal();"

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -108,7 +108,9 @@
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
<br />
<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>
</div>
<div id="divTarget" style="DISPLAY: none">

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -77,36 +77,187 @@ oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
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.
var oEMailInfo = new Object() ;
oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ;
oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ;
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
if ( oParts )
var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
{
// Set the e-mail address.
oEMailInfo.Address = oParts[1] ;
// Look for the optional e-mail parameters.
if ( oParts[2] )
// This seems to be an unprotected email link.
var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
if ( aParts )
{
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Subject = decodeURIComponent( oMatch[2] ) ;
// Set the e-mail address.
oEMailInfo.Address = aParts[1] ;
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Body = decodeURIComponent( oMatch[2] ) ;
// Look for the optional e-mail parameters.
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 oEMailInfo ;
return false;
}
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 sParams = '' ;
@@ -263,28 +414,26 @@ function LoadSelection()
// Search for the protocol.
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() ;
GetE('cmbLinkProtocol').value = sProtocol ;
// Remove the protocol and get the remaining URL.
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
if ( sProtocol == 'mailto:' ) // It is an e-mail link.
{
sType = 'email' ;
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else // It is a normal link.
{
sType = 'url' ;
GetE('txtUrl').value = sUrl ;
}
sType = 'url' ;
GetE('txtUrl').value = sUrl ;
}
else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link.
{
@@ -650,13 +799,17 @@ function BrowseServer()
function SetUrl( url )
{
document.getElementById('txtUrl').value = url ;
GetE('txtUrl').value = url ;
OnUrlChange() ;
dialog.SetSelectedTab( 'Info' ) ;
}
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber )
{
case 0 : // No errors
@@ -709,6 +862,10 @@ function CheckUpload()
return false ;
}
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ;
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*
@@ -67,7 +67,7 @@ window.onload = function()
dialog.SetOkButton( true ) ;
dialog.SetAutoSize( true ) ;
SelectField( 'txtStartPosition' ) ;
SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ;
}
function Ok()

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -64,7 +64,7 @@ window.onload = function ()
var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
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 ;
@@ -87,6 +87,7 @@ window.onload = function ()
else
{
document.getElementById('txtData').style.display = '' ;
SelectField( 'txtData' ) ;
}
if ( sPastingType != 'Word' )
@@ -187,7 +188,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
var html = oNode.innerHTML ;
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.
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
@@ -224,6 +225,10 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
if ( bRemoveStyles )
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.
html = html.replace( /\s*style="\s*"/gi, '' ) ;
@@ -234,25 +239,28 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
// Remove Lang attributes
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
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>
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
// 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( /<H\d>\s*<\/H\d>/gi, '' ) ;
// 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
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>' ) ;
// 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)><EM>(.*?)<\/EM><\/\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>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
}
else
{
@@ -282,7 +290,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/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>' ) ;
// 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" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -34,6 +34,12 @@ var oEditor = dialog.InnerDialogLoaded() ;
var dialogArguments = dialog.Args() ;
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( 'Replace', FCKLang.DlgReplaceTitle ) ;
@@ -51,38 +57,312 @@ function OnDialogTabChange( tabCode )
dialog.SetAutoSize( true ) ;
}
// Place a range at the start of document.
// This will be the starting point of our search.
var GlobalRange = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
function ResetGlobalRange()
GetNextNonEmptyTextNode = function( node, stopNode )
{
GlobalRange.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ;
GlobalRange.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ;
GlobalRange.Collapse( true ) ;
}
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() ;
while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 )
1 ;
return node ;
}
function ClearHighlight()
CharacterCursor = function( arg )
{
if ( HighlightRange )
if ( arg.nodeType && arg.nodeType == 9 )
{
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).RemoveFromRange( HighlightRange, false, true ) ;
HighlightRange = null ;
this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ;
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()
{
// First of all, translate the dialog box texts.
@@ -133,79 +413,15 @@ function GetMatchWord()
return !! ( GetE(idMap['CheckWord']).checked ) ;
}
// Get the data pointed to by a bookmark.
function GetData( bookmark )
{
var cursor = oEditor.FCK.EditorDocument.documentElement ;
for ( var i = 0 ; i < bookmark.length ; i++ )
{
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 )
/* Is this character a unicode whitespace or a punctuation mark?
* References:
* http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces)
* http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks)
*/
function CheckIsWordSeparator( c )
{
if ( !c )
return true;
var code = c.charCodeAt( 0 );
if ( code >= 9 && code <= 0xd )
return true;
@@ -225,212 +441,103 @@ function CheckIsWhitespace( c )
case 0x3000:
return true;
default:
return false;
}
return /[.,"'?!;:]/.test( c ) ;
}
// Knuth-Morris-Pratt Algorithm for stream input
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 ;
}
};
FindRange = null ;
function _Find()
{
// Start from the end of the current selection.
var matcher = new KmpMatch( GetSearchString(), ! GetCheckCase() ) ;
var cursor = GlobalRange.CreateBookmark2().End ;
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 ;
}
var searchString = GetSearchString() ;
if ( !FindRange )
FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ;
else
{
ResetGlobalRange() ;
return false ;
FindRange.RemoveHighlight() ;
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()
{
if ( ! _Find() )
{
ClearHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
}
}
function Replace()
{
if ( GlobalRange.CheckIsCollapsed() )
var saveUndoStep = function( selectRange )
{
if (! _Find() )
{
ClearHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
}
var ieRange ;
if ( oEditor.FCKBrowserInfo.IsIE )
ieRange = document.selection.createRange() ;
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
{
oEditor.FCKUndo.SaveUndoStep() ;
GlobalRange.DeleteContents() ;
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ;
GlobalRange.Collapse( false ) ;
if ( ! _Find() )
{
FindRange && FindRange.RemoveHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
}
}
}
@@ -441,21 +548,34 @@ function ReplaceAll()
while ( _Find() )
{
dialog.Selection.EnsureSelection() ;
GlobalRange.DeleteContents() ;
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ;
GlobalRange.Collapse( false ) ;
var range = FindRange.GetHighlightDomRange() ;
var bookmark = range.CreateBookmark() ;
FindRange.RemoveHighlight() ;
range.MoveToBookmark( bookmark) ;
range.DeleteContents() ;
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
range._UpdateElementInfo() ;
FindRange = CharacterRange.CreateFromDomRange( range ) ;
replaceCount++ ;
}
if ( replaceCount == 0 )
{
ClearHighlight() ;
FindRange && FindRange.RemoveHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
}
dialog.Cancel() ;
}
window.onunload = function(){ ClearHighlight() ; }
window.onunload = function()
{
if ( FindRange )
{
FindRange.RemoveHighlight() ;
FindRange.ToDomRange().Select() ;
}
}
</script>
</head>
<body onload="OnLoad()" style="overflow: hidden">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*
@@ -132,7 +132,7 @@ function Ok()
<tr>
<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 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>
</tr>
</table>
@@ -143,20 +143,20 @@ function Ok()
<table width="100%">
<tr>
<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 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 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>
</tr>
<tr>
<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 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 vAlign="top" colSpan="2">
</td>

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*
@@ -52,7 +52,12 @@ function OnSpellerControlsLoad( controlsWindow )
function oSpeller_OnFinished( numberOCorrections )
{
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() ;
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*
@@ -31,14 +31,13 @@
var dialog = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;
var dialogArguments = dialog.Args() ;
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
var FCKDomTools = oEditor.FCKDomTools ;
// Gets the table if there is one selected.
var table ;
var e = dialog.Selection.GetSelectedElement() ;
var hasColumnHeaders ;
if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
@@ -88,6 +87,36 @@ window.onload = function()
var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
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('txtColumns').disabled = true ;
SelectField( 'txtWidth' ) ;
@@ -104,8 +133,11 @@ function Ok()
{
var bExists = ( table != null ) ;
var oDoc = oEditor.FCK.EditorDocument ;
oEditor.FCKUndo.SaveUndoStep() ;
if ( ! bExists )
table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
table = oDoc.createElement( "TABLE" ) ;
// Removes the Width and Height styles
if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ;
@@ -129,7 +161,7 @@ function Ok()
{
if ( !eCaption )
{
eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ;
eCaption = oDoc.createElement( 'CAPTION' ) ;
table.insertBefore( eCaption, table.firstChild ) ;
}
@@ -145,24 +177,133 @@ function Ok()
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)
{
var iRows = document.getElementById('txtRows').value ;
var iCols = document.getElementById('txtColumns').value ;
var iRows = GetE('txtRows').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) ;
oThead.appendChild(oRow);
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 )
oEditor.FCKTools.AppendBogusBr( oCell ) ;
}
}
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCK.InsertElement( table ) ;
}
@@ -178,39 +319,44 @@ function Ok()
<table cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<table cellspacing="1" cellpadding="0" border="0">
<tr>
<td>
<span fcklang="DlgTableRows">Rows</span>:</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>
</tr>
<tr>
<td>
<span fcklang="DlgTableColumns">Columns</span>:</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>
</tr>
<tr>
<td><span fcklang="DlgTableHeaders">Headers</span>:</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
&nbsp;<select id="selHeaders">
<option fcklang="DlgTableHeadersNone" value="">None</option>
<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>
<td>
<span fcklang="DlgTableBorder">Border size</span>:</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>
</tr>
<tr>
<td>
<span fcklang="DlgTableAlign">Alignment</span>:</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="DlgTableAlignLeft" value="left">Left</option>
<option fcklang="DlgTableAlignCenter" value="center">Center</option>
@@ -227,10 +373,10 @@ function Ok()
<td>
<span fcklang="DlgTableWidth">Width</span>:</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>
<td>
&nbsp;<select id="selWidthType" name="selWidthType">
&nbsp;<select id="selWidthType">
<option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
<option fcklang="DlgTableWidthPc" value="percent">percent</option>
</select></td>
@@ -239,23 +385,18 @@ function Ok()
<td>
<span fcklang="DlgTableHeight">Height</span>:</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>
&nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td nowrap="nowrap">
<span fcklang="DlgTableCellSpace">Cell spacing</span>:</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>
<td>
&nbsp;</td>
@@ -264,7 +405,7 @@ function Ok()
<td nowrap="nowrap">
<span fcklang="DlgTableCellPad">Cell padding</span>:</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>
<td>
&nbsp;</td>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*
@@ -32,8 +32,7 @@
var dialog = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;
// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;
var FCKDomTools = oEditor.FCKDomTools ;
// Array of selected Cells
var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
@@ -74,13 +73,15 @@ function SetStartupValue()
GetE('txtCollSpan').value = GetAttribute( oCell, 'colSpan' ) ;
GetE('txtBackColor').value = GetAttribute( oCell, 'bgColor' ) ;
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
function Ok()
{
oEditor.FCKUndo.SaveUndoStep() ;
for( i = 0 ; i < aCells.length ; i++ )
{
if ( GetE('txtWidth').value.length > 0 )
@@ -100,7 +101,25 @@ function Ok()
SetAttribute( aCells[i], 'colSpan' , GetE('txtCollSpan').value ) ;
SetAttribute( aCells[i], 'bgColor' , GetE('txtBackColor').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 ;
@@ -138,7 +157,7 @@ function SelectColor( wich )
<span fcklang="DlgCellWidth">Width</span>:</td>
<td>
&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="DlgCellWidthPc" value="percent">percent</option>
</select></td>
@@ -147,7 +166,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellHeight">Height</span>:</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>
</tr>
<tr>
@@ -160,7 +179,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
<td>
&nbsp;<select id="selWordWrap" name="selAlignment">
&nbsp;<select id="selWordWrap">
<option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
<option fcklang="DlgCellWordWrapNo" value="false">No</option>
</select></td>
@@ -175,7 +194,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
<td>
&nbsp;<select id="selHAlign" name="selAlignment">
&nbsp;<select id="selHAlign">
<option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
<option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
@@ -186,7 +205,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
<td>
&nbsp;<select id="selVAlign" name="selAlignment">
&nbsp;<select id="selVAlign">
<option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
<option fcklang="DlgCellVerAlignTop" value="top">Top</option>
<option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
@@ -200,13 +219,30 @@ function SelectColor( wich )
&nbsp;&nbsp;&nbsp;</td>
<td align="right">
<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>
<td nowrap="nowrap">
<span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
<td>
&nbsp;
<input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
name="txtRows"></td>
></td>
<td>
</td>
</tr>
@@ -216,7 +252,7 @@ function SelectColor( wich )
<td>
&nbsp;
<input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
size="2" name="txtColumns"></td>
size="2"></td>
<td>
</td>
</tr>
@@ -232,7 +268,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellBackColor">Background Color</span>:</td>
<td>
&nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
&nbsp;<input id="txtBackColor" type="text" size="8" /></td>
<td>
&nbsp;
<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
@@ -241,7 +277,7 @@ function SelectColor( wich )
<td nowrap="nowrap">
<span fcklang="DlgCellBorderColor">Border Color</span>:</td>
<td>
&nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>
&nbsp;<input id="txtBorderColor" type="text" size="8" /></td>
<td>
&nbsp;
<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">
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
* 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 ==
*

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*

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">
<!--
* 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 ==
*
@@ -27,6 +27,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script type="text/javascript">
// <![CDATA[
// Domain relaxation logic.
(function()
{
@@ -84,7 +86,7 @@ window.focus() ;
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
// 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.
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()
{
retval.RefreshContainerSize() ;
@@ -232,10 +247,13 @@ var Throbber = function()
var throbberParent = $( 'throbberBlock' ) ;
// Create the throbber blocks.
var classIds = [ 1,2,3,4,5,4,3,2 ] ;
while ( classIds.length > 0 )
throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ;
if (throbberParent.childNodes.length == 0)
{
// Create the throbber blocks.
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.
var frm = $( 'contents' ) ;
@@ -248,6 +266,10 @@ var Throbber = function()
// Show it.
throbberParent.style.visibility = '' ;
// Hide tabs and buttons:
$( 'Tabs' ).style.visibility = 'hidden' ;
$( 'PopupButtons' ).style.visibility = 'hidden' ;
// Setup the animation interval.
timer = setInterval( updateThrobber, 100 ) ;
},
@@ -260,9 +282,11 @@ var Throbber = function()
timer = null ;
}
var throbberParent = document.getElementById( 'throbberBlock' ) ;
if ( throbberParent )
FCKDomTools.RemoveNode( throbberParent ) ;
$( 'throbberBlock' ).style.visibility = 'hidden' ;
// Show tabs and buttons:
$( 'Tabs' ).style.visibility = '' ;
$( 'PopupButtons' ).style.visibility = '' ;
}
} ;
}() ;
@@ -385,6 +409,11 @@ var Selection =
*/
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() ;
},
@@ -549,6 +578,8 @@ var onReadyRegister = function()
// Program entry point.
window.Init = function()
{
$( 'contents' ).dir = langDir;
// Start the throbber timer.
Throbber.Show( 1000 ) ;
@@ -617,7 +648,7 @@ var onReadyRegister = function()
E.FCKLanguageManager.TranslatePage( document ) ;
// 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()
@@ -727,6 +758,7 @@ var onReadyRegister = function()
}
} ;
})() ;
// ]]>
</script>
</head>
<body onload="Init();" class="PopupBody">
@@ -734,7 +766,9 @@ var onReadyRegister = function()
<div id="header">
<div id="TitleArea" class="PopupTitle PopupTitleBorder">
<script type="text/javascript">
// <![CDATA[
document.write( Args().Title ) ;
// ]]>
</script>
<div id="closeButton" onclick="Cancel();"></div>
</div>
@@ -772,12 +806,14 @@ document.write( Args().Title ) ;
<div class="cover" id="cover" style="display:none"></div>
<div id="throbberBlock" style="position: absolute; visibility: hidden"></div>
<script type="text/javascript">
// <![CDATA[
// Set the class name for language direction.
document.body.className += ' ' + langDir ;
var cover = $( 'cover' ) ;
cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ;
FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;
// ]]>
</script>
</body>
</html>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -29,6 +29,37 @@
<meta http-equiv="Cache-Control" content="public">
<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.
var FCK_ORIGINAL_DOMAIN ;
@@ -134,9 +165,16 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ;
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor
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_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}' ) ;
// Load the full debug script.
if ( FCKConfig.Debug )
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
// first debug message will not be lost.
@@ -215,7 +253,8 @@ function WaitForActive( editorInstance, newStatus )
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ;
_AttachFormSubmitToAPI() ;
if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -31,6 +31,37 @@
@Packager.RemoveLine -->
<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.
var FCK_ORIGINAL_DOMAIN ;
@@ -103,7 +134,7 @@ LoadScript( '_source/internals/fck.js' ) ;
LoadScript( '_source/internals/fck_' + sSuffix + '.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/fcktools.js' ) ;
LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
@@ -237,12 +268,19 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ;
var FCK_InternalCSS = FCKConfig.FullBasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine
var FCK_ShowTableBordersCSS = FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine
// Load the full debug script.
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
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor
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_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}' ) ;
// 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}' ) ;
@Packager.RemoveLine */
// 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 )
FCKTools.RunFunction( window.onresize ) ;
_AttachFormSubmitToAPI() ;
if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -23,28 +23,25 @@
body
{
background-color: #f1f1f1;
background-color: #f1f1e3;
margin-top:0;
margin-bottom:0;
}
form
{
margin: 0px 0px 0px 0px ;
padding: 0px 0px 0px 0px ;
margin: 0;
padding: 0;
}
.Frame
{
background-color: #f1f1f1;
border-color: #f1f1f1;
border-right: thin inset;
border-top: thin inset;
border-left: thin inset;
border-bottom: thin inset;
background-color: #f1f1e3;
border: thin inset #f1f1e3;
}
body.FileArea
{
background-color: #ffffff;
margin: 10px;
}
@@ -70,12 +67,9 @@ body, td, input, select
.Button, button
{
border-right: #737357 1px solid;
border-top: #737357 1px solid;
border-left: #737357 1px solid;
color: #3b3b1f;
border-bottom: #737357 1px solid;
background-color: #bfbfbf;
border: #737357 1px solid;
background-color: #c7c78f;
}
.FolderListCurrentFolder img
@@ -87,3 +81,7 @@ body, td, input, select
{
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
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -27,7 +28,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/fckxml.js"></script>
<script language="javascript">
<script type="text/javascript">
// Automatically detect the correct document.domain (#1919).
(function()
{
@@ -41,7 +42,8 @@
var test = window.opener.document.domain ;
break ;
}
catch( e ) {}
catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -24,10 +24,11 @@
-->
<html>
<head>
<title>Folders</title>
<link href="browser.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript">
<script type="text/javascript">
var sActiveFolder ;
@@ -66,12 +67,12 @@ oListManager.AddItem = function( folderName, folderPath )
// Add the folder icon cell.
var oCell = oRow.insertCell(-1) ;
oCell.width = 16 ;
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ;
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"><\/a>' ;
// Add the folder name cell.
oCell = oRow.insertCell(-1) ;
oCell.noWrap = true ;
oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ;
oCell.innerHTML = '&nbsp;' + sLink + folderName + '<\/a>' ;
this.TableRows[ folderPath ] = oRow ;
}
@@ -186,7 +187,7 @@ window.onload = function()
}
</script>
</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">
<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>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -21,9 +21,10 @@
*
* This page shows all resources available in a folder in the File Browser.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<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">
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">

View File

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

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* 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 ==
*
@@ -21,11 +21,11 @@
*
* Page used to upload new files in the current folder.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet" />
<link href="browser.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
@@ -95,9 +95,9 @@ window.onload = function()
}
</script>
</head>
<body bottommargin="0" topmargin="0">
<body>
<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>
<td nowrap="nowrap">
<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
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -35,7 +35,8 @@
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

@@ -1,6 +1,6 @@
/*
* 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 ==
*
@@ -61,7 +61,25 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{
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' +
'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
@@ -70,7 +88,7 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
return ;
}
oFCKXml.DOMDocument = oXmlHttp.responseXML ;
oFCKXml.DOMDocument = oXml ;
asyncFunctionPointer( oFCKXml ) ;
}
}

View File

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

View File

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

View File

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

View File

@@ -1,128 +1,128 @@
<%
' FCKeditor - The text editor for Internet - http://www.fckeditor.net
' Copyright (C) 2003-2008 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 ==
'
' Configuration file for the File Manager Connector for ASP.
%>
<%
' SECURITY: You must explicitly enable this "connector" (set it to "True").
' 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.
Dim ConfigIsEnabled
ConfigIsEnabled = False
' Path to user files relative to the document root.
' This setting is preserved only for backward compatibility.
' You should look at the settings for each resource type to get the full potential
Dim ConfigUserFilesPath
ConfigUserFilesPath = "/userfiles/"
' Due to security issues with Apache modules, it is recommended to leave the
' following setting enabled.
Dim ConfigForceSingleExtension
ConfigForceSingleExtension = true
' What the user can do with this connector
Dim ConfigAllowedCommands
ConfigAllowedCommands = "QuickUpload|FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder"
' Allowed Resource Types
Dim ConfigAllowedTypes
ConfigAllowedTypes = "File|Image|Flash|Media"
' For security, HTML is allowed in the first Kb of data for files having the
' following extensions only.
Dim ConfigHtmlExtensions
ConfigHtmlExtensions = "html|htm|xml|xsd|txt|js"
'
' Configuration settings for each Resource Type
'
' - AllowedExtensions: the possible extensions that can be allowed.
' If it is empty then any file type can be uploaded.
'
' - DeniedExtensions: The extensions that won't be allowed.
' If it is empty then no restrictions are done here.
'
' For a file to be uploaded it has to fulfill both the AllowedExtensions
' and DeniedExtensions (that's it: not being denied) conditions.
'
' - FileTypesPath: the virtual folder relative to the document root where
' these resources will be located.
' Attention: It must start and end with a slash: '/'
'
' - FileTypesAbsolutePath: the physical path to the above folder. It must be
' an absolute path.
' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'FileTypesPath' must point to the same directory.
' Attention: It must end with a slash: '/'
'
' - QuickUploadPath: the virtual folder relative to the document root where
' these resources will be uploaded using the Upload tab in the resources
' dialogs.
' Attention: It must start and end with a slash: '/'
'
' - QuickUploadAbsolutePath: the physical path to the above folder. It must be
' an absolute path.
' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'QuickUploadPath' must point to the same directory.
' Attention: It must end with a slash: '/'
'
Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath
Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" )
Set ConfigQuickUploadPath = 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"
ConfigDeniedExtensions.Add "File", ""
ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/"
ConfigFileTypesAbsolutePath.Add "File", ""
ConfigQuickUploadPath.Add "File", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "File", ""
ConfigAllowedExtensions.Add "Image", "bmp|gif|jpeg|jpg|png"
ConfigDeniedExtensions.Add "Image", ""
ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/"
ConfigFileTypesAbsolutePath.Add "Image", ""
ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Image", ""
ConfigAllowedExtensions.Add "Flash", "swf|flv"
ConfigDeniedExtensions.Add "Flash", ""
ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/"
ConfigFileTypesAbsolutePath.Add "Flash", ""
ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath
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"
ConfigDeniedExtensions.Add "Media", ""
ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/"
ConfigFileTypesAbsolutePath.Add "Media", ""
ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Media", ""
%>
<%
' 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 ==
'
' Configuration file for the File Manager Connector for ASP.
%>
<%
' SECURITY: You must explicitly enable this "connector" (set it to "True").
' 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.
Dim ConfigIsEnabled
ConfigIsEnabled = False
' Path to user files relative to the document root.
' This setting is preserved only for backward compatibility.
' You should look at the settings for each resource type to get the full potential
Dim ConfigUserFilesPath
ConfigUserFilesPath = "/userfiles/"
' Due to security issues with Apache modules, it is recommended to leave the
' following setting enabled.
Dim ConfigForceSingleExtension
ConfigForceSingleExtension = true
' What the user can do with this connector
Dim ConfigAllowedCommands
ConfigAllowedCommands = "QuickUpload|FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder"
' Allowed Resource Types
Dim ConfigAllowedTypes
ConfigAllowedTypes = "File|Image|Flash|Media"
' For security, HTML is allowed in the first Kb of data for files having the
' following extensions only.
Dim ConfigHtmlExtensions
ConfigHtmlExtensions = "html|htm|xml|xsd|txt|js"
'
' Configuration settings for each Resource Type
'
' - AllowedExtensions: the possible extensions that can be allowed.
' If it is empty then any file type can be uploaded.
'
' - DeniedExtensions: The extensions that won't be allowed.
' If it is empty then no restrictions are done here.
'
' For a file to be uploaded it has to fulfill both the AllowedExtensions
' and DeniedExtensions (that's it: not being denied) conditions.
'
' - FileTypesPath: the virtual folder relative to the document root where
' these resources will be located.
' Attention: It must start and end with a slash: '/'
'
' - FileTypesAbsolutePath: the physical path to the above folder. It must be
' an absolute path.
' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'FileTypesPath' must point to the same directory.
' Attention: It must end with a slash: '/'
'
' - QuickUploadPath: the virtual folder relative to the document root where
' these resources will be uploaded using the Upload tab in the resources
' dialogs.
' Attention: It must start and end with a slash: '/'
'
' - QuickUploadAbsolutePath: the physical path to the above folder. It must be
' an absolute path.
' If it's an empty string then it will be autocalculated.
' Useful if you are using a virtual directory, symbolic link or alias.
' Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
' Attention: The above 'QuickUploadPath' must point to the same directory.
' Attention: It must end with a slash: '/'
'
Dim ConfigAllowedExtensions, ConfigDeniedExtensions, ConfigFileTypesPath, ConfigFileTypesAbsolutePath, ConfigQuickUploadPath, ConfigQuickUploadAbsolutePath
Set ConfigAllowedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigDeniedExtensions = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesPath = CreateObject( "Scripting.Dictionary" )
Set ConfigFileTypesAbsolutePath = CreateObject( "Scripting.Dictionary" )
Set ConfigQuickUploadPath = 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"
ConfigDeniedExtensions.Add "File", ""
ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/"
ConfigFileTypesAbsolutePath.Add "File", ""
ConfigQuickUploadPath.Add "File", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "File", ""
ConfigAllowedExtensions.Add "Image", "bmp|gif|jpeg|jpg|png"
ConfigDeniedExtensions.Add "Image", ""
ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/"
ConfigFileTypesAbsolutePath.Add "Image", ""
ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Image", ""
ConfigAllowedExtensions.Add "Flash", "swf|flv"
ConfigDeniedExtensions.Add "Flash", ""
ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/"
ConfigFileTypesAbsolutePath.Add "Flash", ""
ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath
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"
ConfigDeniedExtensions.Add "Media", ""
ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/"
ConfigFileTypesAbsolutePath.Add "Media", ""
ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath
ConfigQuickUploadAbsolutePath.Add "Media", ""
%>

View File

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

View File

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

View File

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

View File

@@ -1,98 +1,98 @@
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %>
<%--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* Configuration file for the File Browser Connector for ASP.NET.
--%>
<script runat="server">
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*/
private bool CheckAuthentication()
{
// 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
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return false;
}
public override void SetConfig()
{
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
Enabled = CheckAuthentication();
// URL path to user files.
UserFilesPath = "/userfiles/";
// The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = "";
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
ForceSingleExtension = true;
// Allowed Resource Types
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
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" ].DeniedExtensions = new string[] { };
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
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" ].DeniedExtensions = new string[] { };
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
}
</script>
<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Config" %>
<%--
* 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 ==
*
* Configuration file for the File Browser Connector for ASP.NET.
--%>
<script runat="server">
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*/
private bool CheckAuthentication()
{
// 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
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return false;
}
public override void SetConfig()
{
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
Enabled = CheckAuthentication();
// URL path to user files.
UserFilesPath = "/userfiles/";
// The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = "";
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
ForceSingleExtension = true;
// Allowed Resource Types
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };
// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
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" ].DeniedExtensions = new string[] { };
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
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" ].DeniedExtensions = new string[] { };
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
}
</script>

View File

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

View File

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

View File

@@ -1,315 +1,315 @@
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* File Browser connector for ColdFusion 5.
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
*
* Note:
* FCKeditor requires that the connector responds with UTF-8 encoded XML.
* 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
* 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.
* 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
* connector already did this with file names and nobody seemed to mind,
* so fingers-crossed nobody will mind their folder names being munged too.
*
--->
<cfparam name="url.command">
<cfparam name="url.type">
<cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm">
<cfscript>
userFilesPath = config.userFilesPath;
if ( userFilesPath eq "" )
{
userFilesPath = "/userfiles/";
}
// make sure the user files path is correctly formatted
userFilesPath = replace(userFilesPath, "\", "/", "ALL");
userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
if ( right(userFilesPath,1) NEQ "/" )
{
userFilesPath = userFilesPath & "/";
}
if ( left(userFilesPath,1) NEQ "/" )
{
userFilesPath = "/" & userFilesPath;
}
// make sure the current folder is correctly formatted
url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
if ( right(url.currentFolder,1) neq "/" )
{
url.currentFolder = url.currentFolder & "/";
}
if ( left(url.currentFolder,1) neq "/" )
{
url.currentFolder = "/" & url.currentFolder;
}
if ( find("/",getBaseTemplatePath()) neq 0 )
{
fs = "/";
}
else
{
fs = "\";
}
// Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
// the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
// virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
if ( len(config.serverPath) )
{
serverPath = config.serverPath;
if ( right(serverPath,1) neq fs )
{
serverPath = serverPath & fs;
}
}
else
{
serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
}
rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ;
xmlContent = ""; // append to this string to build content
</cfscript>
<cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
<cfif isDefined( "Config.FileTypesAbsolutePath" )
and structkeyexists( Config.FileTypesAbsolutePath, url.type )
and Len( Config.FileTypesAbsolutePath[url.type] )>
<cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder>
<cfelse>
<cftry>
<cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder>
<!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
<cfcatch type="any">
<cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder>
</cfcatch>
</cftry>
</cfif>
<cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) >
<!--- get rid of double directory separators --->
<cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
<cfif not config.enabled>
<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)>
<cfset xmlContent = "<Error number=""102"" />">
<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" />'>
<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" />'>
</cfif>
<cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )>
<cfif not len(xmlContent) and not directoryexists(resourceTypeDirectory)>
<!--- create directories in physical path if they don't already exist --->
<cfset currentPath = "">
<cftry>
<cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#">
<cfif currentPath eq "" and fs eq "\">
<!--- Without checking this, we would have in Windows \C:\ --->
<cfif not directoryExists(name)>
<cfdirectory action="create" directory="#name#" mode="755">
</cfif>
<cfelse>
<cfif not directoryExists(currentPath & fs & name)>
<cfdirectory action="create" directory="#currentPath##fs##name#" mode="755">
</cfif>
</cfif>
<cfif fs eq "\" and currentPath eq "">
<cfset currentPath = name>
<cfelse>
<cfset currentPath = currentPath & fs & name>
</cfif>
</cfloop>
<cfcatch type="any">
<!--- this should only occur as a result of a permissions problem --->
<cfset xmlContent = "<Error number=""103"" />">
</cfcatch>
</cftry>
</cfif>
<cfif not len(xmlContent)>
<!--- no errors thus far - run command --->
<!--- we need to know the physical path to the current folder for all commands --->
<cfset currentFolderPath = userFilesServerPath>
<cfswitch expression="#url.command#">
<cfcase value="FileUpload">
<cfset config_included = true >
<cfinclude template="cf5_upload.cfm">
<cfabort>
</cfcase>
<cfcase value="GetFolders">
<!--- Sort directories first, name ascending --->
<cfdirectory
action="list"
directory="#currentFolderPath#"
name="qDir"
sort="type,name">
<cfscript>
i=1;
folders = "";
while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "FILE" ))
break;
if( not listFind(".,..", qDir.name[i]) )
folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />';
i=i+1;
}
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
</cfscript>
</cfcase>
<cfcase value="GetFoldersAndFiles">
<!--- Sort directories first, name ascending --->
<cfdirectory
action="list"
directory="#currentFolderPath#"
name="qDir"
sort="type,name">
<cfscript>
i=1;
folders = "";
files = "";
while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />';
} else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
fileSizeKB = round(qDir.size[i] / 1024);
files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />';
}
i=i+1;
}
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
xmlContent = xmlContent & '<Files>' & files & '</Files>';
</cfscript>
</cfcase>
<cfcase value="CreateFolder">
<cfparam name="url.newFolderName" default="">
<cfscript>
newFolderName = url.newFolderName;
if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
// Munge folder name same way as we do the filename
// This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
}
</cfscript>
<cfif not len(newFolderName) or len(newFolderName) gt 255>
<cfset errorNumber = 102>
<cfelseif directoryExists(currentFolderPath & newFolderName)>
<cfset errorNumber = 101>
<cfelseif reFind("^\.\.",newFolderName)>
<cfset errorNumber = 103>
<cfelse>
<cfset errorNumber = 0>
<cftry>
<cfdirectory
action="create"
directory="#currentFolderPath##newFolderName#"
mode="755">
<cfcatch>
<!---
un-resolvable error numbers in ColdFusion:
* 102 : Invalid folder name.
* 103 : You have no permissions to create the folder.
--->
<cfset errorNumber = 110>
</cfcatch>
</cftry>
</cfif>
<cfset xmlContent = xmlContent & '<Error number="#errorNumber#" />'>
</cfcase>
<cfdefaultcase>
<cfthrow type="fckeditor.connector" message="Illegal command: #url.command#">
</cfdefaultcase>
</cfswitch>
</cfif>
<cfscript>
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#" />';
xmlFooter = '</Connector>';
</cfscript>
<cfheader name="Expires" value="#GetHttpTimeString(Now())#">
<cfheader name="Pragma" value="no-cache">
<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
<cfcontent reset="true" type="text/xml; charset=UTF-8">
<cfoutput>#xmlHeader##xmlContent##xmlFooter#</cfoutput>
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!---
* 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 ==
*
* File Browser connector for ColdFusion 5.
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
*
* Note:
* FCKeditor requires that the connector responds with UTF-8 encoded XML.
* 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
* 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.
* 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
* connector already did this with file names and nobody seemed to mind,
* so fingers-crossed nobody will mind their folder names being munged too.
*
--->
<cfparam name="url.command">
<cfparam name="url.type">
<cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm">
<cfscript>
userFilesPath = config.userFilesPath;
if ( userFilesPath eq "" )
{
userFilesPath = "/userfiles/";
}
// make sure the user files path is correctly formatted
userFilesPath = replace(userFilesPath, "\", "/", "ALL");
userFilesPath = replace(userFilesPath, '//', '/', 'ALL');
if ( right(userFilesPath,1) NEQ "/" )
{
userFilesPath = userFilesPath & "/";
}
if ( left(userFilesPath,1) NEQ "/" )
{
userFilesPath = "/" & userFilesPath;
}
// make sure the current folder is correctly formatted
url.currentFolder = replace(url.currentFolder, "\", "/", "ALL");
url.currentFolder = replace(url.currentFolder, '//', '/', 'ALL');
if ( right(url.currentFolder,1) neq "/" )
{
url.currentFolder = url.currentFolder & "/";
}
if ( left(url.currentFolder,1) neq "/" )
{
url.currentFolder = "/" & url.currentFolder;
}
if ( find("/",getBaseTemplatePath()) neq 0 )
{
fs = "/";
}
else
{
fs = "\";
}
// Get the base physical path to the web root for this application. The code to determine the path automatically assumes that
// the "FCKeditor" directory in the http request path is directly off the web root for the application and that it's not a
// virtual directory or a symbolic link / junction. Use the serverPath config setting to force a physical path if necessary.
if ( len(config.serverPath) )
{
serverPath = config.serverPath;
if ( right(serverPath,1) neq fs )
{
serverPath = serverPath & fs;
}
}
else
{
serverPath = replaceNoCase(getBaseTemplatePath(),replace(cgi.script_name,"/",fs,"all"),"") & replace(userFilesPath,"/",fs,"all");
}
rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ;
xmlContent = ""; // append to this string to build content
</cfscript>
<cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
<cfif isDefined( "Config.FileTypesAbsolutePath" )
and structkeyexists( Config.FileTypesAbsolutePath, url.type )
and Len( Config.FileTypesAbsolutePath[url.type] )>
<cfset userFilesServerPath = Config.FileTypesAbsolutePath[url.type] & url.currentFolder>
<cfelse>
<cftry>
<cfset userFilesServerPath = expandpath( resourceTypeUrl ) & url.currentFolder>
<!--- Catch: Parameter 1 of function ExpandPath must be a relative path --->
<cfcatch type="any">
<cfset userFilesServerPath = rootPath & Config.FileTypesPath[url.type] & url.currentFolder>
</cfcatch>
</cftry>
</cfif>
<cfset userFilesServerPath = replace( userFilesServerPath, "/", fs, "all" ) >
<!--- get rid of double directory separators --->
<cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
<cfif not config.enabled>
<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)>
<cfset xmlContent = "<Error number=""102"" />">
<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" />'>
<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" />'>
</cfif>
<cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )>
<cfif not len(xmlContent) and not directoryexists(resourceTypeDirectory)>
<!--- create directories in physical path if they don't already exist --->
<cfset currentPath = "">
<cftry>
<cfloop list="#resourceTypeDirectory#" index="name" delimiters="#fs#">
<cfif currentPath eq "" and fs eq "\">
<!--- Without checking this, we would have in Windows \C:\ --->
<cfif not directoryExists(name)>
<cfdirectory action="create" directory="#name#" mode="755">
</cfif>
<cfelse>
<cfif not directoryExists(currentPath & fs & name)>
<cfdirectory action="create" directory="#currentPath##fs##name#" mode="755">
</cfif>
</cfif>
<cfif fs eq "\" and currentPath eq "">
<cfset currentPath = name>
<cfelse>
<cfset currentPath = currentPath & fs & name>
</cfif>
</cfloop>
<cfcatch type="any">
<!--- this should only occur as a result of a permissions problem --->
<cfset xmlContent = "<Error number=""103"" />">
</cfcatch>
</cftry>
</cfif>
<cfif not len(xmlContent)>
<!--- no errors thus far - run command --->
<!--- we need to know the physical path to the current folder for all commands --->
<cfset currentFolderPath = userFilesServerPath>
<cfswitch expression="#url.command#">
<cfcase value="FileUpload">
<cfset config_included = true >
<cfinclude template="cf5_upload.cfm">
<cfabort>
</cfcase>
<cfcase value="GetFolders">
<!--- Sort directories first, name ascending --->
<cfdirectory
action="list"
directory="#currentFolderPath#"
name="qDir"
sort="type,name">
<cfscript>
i=1;
folders = "";
while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "FILE" ))
break;
if( not listFind(".,..", qDir.name[i]) )
folders = folders & '<Folder name="#HTMLEditFormat( qDir.name[i] )#" />';
i=i+1;
}
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
</cfscript>
</cfcase>
<cfcase value="GetFoldersAndFiles">
<!--- Sort directories first, name ascending --->
<cfdirectory
action="list"
directory="#currentFolderPath#"
name="qDir"
sort="type,name">
<cfscript>
i=1;
folders = "";
files = "";
while( i lte qDir.recordCount ) {
if( not compareNoCase( qDir.type[i], "DIR" ) and not listFind(".,..", qDir.name[i]) ) {
folders = folders & '<Folder name="#HTMLEditFormat(qDir.name[i])#" />';
} else if( not compareNoCase( qDir.type[i], "FILE" ) ) {
fileSizeKB = round(qDir.size[i] / 1024);
files = files & '<File name="#HTMLEditFormat(qDir.name[i])#" size="#IIf( fileSizeKB GT 0, DE( fileSizeKB ), 1)#" />';
}
i=i+1;
}
xmlContent = xmlContent & '<Folders>' & folders & '</Folders>';
xmlContent = xmlContent & '<Files>' & files & '</Files>';
</cfscript>
</cfcase>
<cfcase value="CreateFolder">
<cfparam name="url.newFolderName" default="">
<cfscript>
newFolderName = url.newFolderName;
if( reFind("[^A-Za-z0-9_\-\.]", newFolderName) ) {
// Munge folder name same way as we do the filename
// This means folder names are always US-ASCII so we don't have to worry about CF5 and UTF-8
newFolderName = reReplace(newFolderName, "[^A-Za-z0-9\-\.]", "_", "all");
newFolderName = reReplace(newFolderName, "_{2,}", "_", "all");
newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
}
</cfscript>
<cfif not len(newFolderName) or len(newFolderName) gt 255>
<cfset errorNumber = 102>
<cfelseif directoryExists(currentFolderPath & newFolderName)>
<cfset errorNumber = 101>
<cfelseif reFind("^\.\.",newFolderName)>
<cfset errorNumber = 103>
<cfelse>
<cfset errorNumber = 0>
<cftry>
<cfdirectory
action="create"
directory="#currentFolderPath##newFolderName#"
mode="755">
<cfcatch>
<!---
un-resolvable error numbers in ColdFusion:
* 102 : Invalid folder name.
* 103 : You have no permissions to create the folder.
--->
<cfset errorNumber = 110>
</cfcatch>
</cftry>
</cfif>
<cfset xmlContent = xmlContent & '<Error number="#errorNumber#" />'>
</cfcase>
<cfdefaultcase>
<cfthrow type="fckeditor.connector" message="Illegal command: #url.command#">
</cfdefaultcase>
</cfswitch>
</cfif>
<cfscript>
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#" />';
xmlFooter = '</Connector>';
</cfscript>
<cfheader name="Expires" value="#GetHttpTimeString(Now())#">
<cfheader name="Pragma" value="no-cache">
<cfheader name="Cache-Control" value="no-cache, no-store, must-revalidate">
<cfcontent reset="true" type="text/xml; charset=UTF-8">
<cfoutput>#xmlHeader##xmlContent##xmlFooter#</cfoutput>

View File

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

View File

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

View File

@@ -1,89 +1,89 @@
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* File Browser connector for ColdFusion (MX 6.0 and above).
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
*
--->
<cfparam name="url.command">
<cfparam name="url.type">
<cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm">
<cfinclude template="cf_util.cfm">
<cfinclude template="cf_io.cfm">
<cfinclude template="cf_basexml.cfm">
<cfinclude template="cf_commands.cfm">
<cfif not Config.Enabled>
<cfset SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
</cfif>
<cfset REQUEST.Config = Config>
<cfif find( "/", getBaseTemplatePath() ) >
<cfset REQUEST.Fs = "/">
<cfelse>
<cfset REQUEST.Fs = "\">
</cfif>
<cfset DoResponse() >
<cffunction name="DoResponse" output="true" returntype="void">
<!--- Get the main request informaiton. --->
<cfset var sCommand = "#URL.Command#" >
<cfset var sResourceType = URL.Type >
<cfset var sCurrentFolder = GetCurrentFolder() >
<!--- Check if it is an allowed command --->
<cfif not IsAllowedCommand( sCommand ) >
<cfset SendError( 1, "The """ & sCommand & """ command isn't allowed" ) >
</cfif>
<!--- Check if it is an allowed type. --->
<cfif not IsAllowedType( sResourceType ) >
<cfset SendError( 1, 'Invalid type specified' ) >
</cfif>
<!--- File Upload doesn't have to Return XML, so it must be intercepted before anything. --->
<cfif sCommand eq "FileUpload">
<cfset FileUpload( sResourceType, sCurrentFolder, sCommand )>
<cfabort>
</cfif>
<cfset CreateXmlHeader( sCommand, sResourceType, sCurrentFolder )>
<!--- Execute the required command. --->
<cfif sCommand eq "GetFolders">
<cfset GetFolders( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "GetFoldersAndFiles">
<cfset GetFoldersAndFiles( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "CreateFolder">
<cfset CreateFolder( sResourceType, sCurrentFolder ) >
</cfif>
<cfset CreateXmlFooter()>
<cfexit>
</cffunction>
<cfsetting enablecfoutputonly="yes" showdebugoutput="no">
<!---
* 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 ==
*
* File Browser connector for ColdFusion (MX 6.0 and above).
* (based on the original CF connector by Hendrik Kramer - hk@lwd.de)
*
--->
<cfparam name="url.command">
<cfparam name="url.type">
<cfparam name="url.currentFolder">
<!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
<cfinclude template="config.cfm">
<cfinclude template="cf_util.cfm">
<cfinclude template="cf_io.cfm">
<cfinclude template="cf_basexml.cfm">
<cfinclude template="cf_commands.cfm">
<cfif not Config.Enabled>
<cfset SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/cfm/config.cfm" file' )>
</cfif>
<cfset REQUEST.Config = Config>
<cfif find( "/", getBaseTemplatePath() ) >
<cfset REQUEST.Fs = "/">
<cfelse>
<cfset REQUEST.Fs = "\">
</cfif>
<cfset DoResponse() >
<cffunction name="DoResponse" output="true" returntype="void">
<!--- Get the main request informaiton. --->
<cfset var sCommand = "#URL.Command#" >
<cfset var sResourceType = URL.Type >
<cfset var sCurrentFolder = GetCurrentFolder() >
<!--- Check if it is an allowed command --->
<cfif not IsAllowedCommand( sCommand ) >
<cfset SendError( 1, "The """ & sCommand & """ command isn't allowed" ) >
</cfif>
<!--- Check if it is an allowed type. --->
<cfif not IsAllowedType( sResourceType ) >
<cfset SendError( 1, 'Invalid type specified' ) >
</cfif>
<!--- File Upload doesn't have to Return XML, so it must be intercepted before anything. --->
<cfif sCommand eq "FileUpload">
<cfset FileUpload( sResourceType, sCurrentFolder, sCommand )>
<cfabort>
</cfif>
<cfset CreateXmlHeader( sCommand, sResourceType, sCurrentFolder )>
<!--- Execute the required command. --->
<cfif sCommand eq "GetFolders">
<cfset GetFolders( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "GetFoldersAndFiles">
<cfset GetFoldersAndFiles( sResourceType, sCurrentFolder ) >
<cfelseif sCommand eq "CreateFolder">
<cfset CreateFolder( sResourceType, sCurrentFolder ) >
</cfif>
<cfset CreateXmlFooter()>
<cfexit>
</cffunction>

View File

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

View File

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

View File

@@ -1,189 +1,189 @@
<cfsetting enablecfoutputonly="Yes">
<!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* Configuration file for the ColdFusion Connector (all versions).
--->
<cfscript>
Config = StructNew() ;
// SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
Config.Enabled = false ;
// Path to uploaded files relative to the document root.
Config.UserFilesPath = "/userfiles/" ;
// Use this to force the server path if FCKeditor is not running directly off
// the root of the application or the FCKeditor directory in the URL is a virtual directory
// or a symbolic link / junction
// Example: C:\inetpub\wwwroot\myDocs\
Config.ServerPath = "" ;
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
Config.ForceSingleExtension = true ;
// Perform additional checks for image files - if set to true, validate image size
// (This feature works in MX 6.0 and above)
Config.SecureImageUploads = true;
// What the user can do with this connector
Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ;
//Allowed Resource Types
Config.ConfigAllowedTypes = "File,Image,Flash,Media" ;
// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
// (This feature works in MX 6.0 and above))
Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ;
//Due to known issues with GetTempDirectory function, it is
//recommended to set this vairiable to a valid directory
//instead of using the GetTempDirectory function
//(used by MX 6.0 and above)
Config.TempDirectory = GetTempDirectory();
// Configuration settings for each Resource Type
//
// - AllowedExtensions: the possible extensions that can be allowed.
// If it is empty then any file type can be uploaded.
// - DeniedExtensions: The extensions that won't be allowed.
// If it is empty then no restrictions are done here.
//
// For a file to be uploaded it has to fulfill both the AllowedExtensions
// and DeniedExtensions (that's it: not being denied) conditions.
//
// - FileTypesPath: the virtual folder relative to the document root where
// these resources will be located.
// Attention: It must start and end with a slash: '/'
//
// - FileTypesAbsolutePath: the physical path to the above folder. It must be
// an absolute path.
// If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'FileTypesPath' must point to the same directory.
// Attention: It must end with a slash: '/'
//
//
// - QuickUploadPath: the virtual folder relative to the document root where
// these resources will be uploaded using the Upload tab in the resources
// dialogs.
// Attention: It must start and end with a slash: '/'
//
// - QuickUploadAbsolutePath: the physical path to the above folder. It must be
// an absolute path.
// If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'QuickUploadPath' must point to the same directory.
// Attention: It must end with a slash: '/'
Config.AllowedExtensions = StructNew() ;
Config.DeniedExtensions = StructNew() ;
Config.FileTypesPath = StructNew() ;
Config.FileTypesAbsolutePath = StructNew() ;
Config.QuickUploadPath = 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.DeniedExtensions["File"] = "" ;
Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ;
Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ;
Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ;
Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ;
Config.AllowedExtensions["Image"] = "bmp,gif,jpeg,jpg,png" ;
Config.DeniedExtensions["Image"] = "" ;
Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ;
Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ;
Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ;
Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ;
Config.AllowedExtensions["Flash"] = "swf,flv" ;
Config.DeniedExtensions["Flash"] = "" ;
Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ;
Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ;
Config.QuickUploadPath["Flash"] = Config.FileTypesPath["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.DeniedExtensions["Media"] = "" ;
Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ;
Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ;
Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ;
Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ;
</cfscript>
<cftry>
<!--- code to maintain backwards compatibility with previous version of cfm connector --->
<cfif isDefined("application.userFilesPath")>
<cflock scope="application" type="readonly" timeout="5">
<cfset config.userFilesPath = application.userFilesPath>
</cflock>
<cfelseif isDefined("server.userFilesPath")>
<cflock scope="server" type="readonly" timeout="5">
<cfset config.userFilesPath = server.userFilesPath>
</cflock>
</cfif>
<!--- look for config struct in application and server scopes --->
<cfif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
<cflock scope="application" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(application.FCKeditor)>
</cflock>
<cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
<cflock scope="server" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(server.FCKeditor)>
</cflock>
</cfif>
<!--- catch potential "The requested scope application has not been enabled" exception --->
<cfcatch type="any">
</cfcatch>
</cftry>
<cfif isDefined("FCKeditor")>
<!--- copy key values from external to local config (i.e. override default config as required) --->
<cfscript>
function structCopyKeys(stFrom, stTo) {
for ( key in stFrom ) {
if ( isStruct(stFrom[key]) ) {
structCopyKeys(stFrom[key],stTo[key]);
} else {
stTo[key] = stFrom[key];
}
}
}
structCopyKeys(FCKeditor, config);
</cfscript>
</cfif>
<cfsetting enablecfoutputonly="Yes">
<!---
* 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 ==
*
* Configuration file for the ColdFusion Connector (all versions).
--->
<cfscript>
Config = StructNew() ;
// SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
Config.Enabled = false ;
// Path to uploaded files relative to the document root.
Config.UserFilesPath = "/userfiles/" ;
// Use this to force the server path if FCKeditor is not running directly off
// the root of the application or the FCKeditor directory in the URL is a virtual directory
// or a symbolic link / junction
// Example: C:\inetpub\wwwroot\myDocs\
Config.ServerPath = "" ;
// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
Config.ForceSingleExtension = true ;
// Perform additional checks for image files - if set to true, validate image size
// (This feature works in MX 6.0 and above)
Config.SecureImageUploads = true;
// What the user can do with this connector
Config.ConfigAllowedCommands = "QuickUpload,FileUpload,GetFolders,GetFoldersAndFiles,CreateFolder" ;
//Allowed Resource Types
Config.ConfigAllowedTypes = "File,Image,Flash,Media" ;
// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
// (This feature works in MX 6.0 and above))
Config.HtmlExtensions = "html,htm,xml,xsd,txt,js" ;
//Due to known issues with GetTempDirectory function, it is
//recommended to set this vairiable to a valid directory
//instead of using the GetTempDirectory function
//(used by MX 6.0 and above)
Config.TempDirectory = GetTempDirectory();
// Configuration settings for each Resource Type
//
// - AllowedExtensions: the possible extensions that can be allowed.
// If it is empty then any file type can be uploaded.
// - DeniedExtensions: The extensions that won't be allowed.
// If it is empty then no restrictions are done here.
//
// For a file to be uploaded it has to fulfill both the AllowedExtensions
// and DeniedExtensions (that's it: not being denied) conditions.
//
// - FileTypesPath: the virtual folder relative to the document root where
// these resources will be located.
// Attention: It must start and end with a slash: '/'
//
// - FileTypesAbsolutePath: the physical path to the above folder. It must be
// an absolute path.
// If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'FileTypesPath' must point to the same directory.
// Attention: It must end with a slash: '/'
//
//
// - QuickUploadPath: the virtual folder relative to the document root where
// these resources will be uploaded using the Upload tab in the resources
// dialogs.
// Attention: It must start and end with a slash: '/'
//
// - QuickUploadAbsolutePath: the physical path to the above folder. It must be
// an absolute path.
// If it's an empty string then it will be autocalculated.
// Usefull if you are using a virtual directory, symbolic link or alias.
// Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'QuickUploadPath' must point to the same directory.
// Attention: It must end with a slash: '/'
Config.AllowedExtensions = StructNew() ;
Config.DeniedExtensions = StructNew() ;
Config.FileTypesPath = StructNew() ;
Config.FileTypesAbsolutePath = StructNew() ;
Config.QuickUploadPath = 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.DeniedExtensions["File"] = "" ;
Config.FileTypesPath["File"] = Config.UserFilesPath & 'file/' ;
Config.FileTypesAbsolutePath["File"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'file/') ) ;
Config.QuickUploadPath["File"] = Config.FileTypesPath["File"] ;
Config.QuickUploadAbsolutePath["File"] = Config.FileTypesAbsolutePath["File"] ;
Config.AllowedExtensions["Image"] = "bmp,gif,jpeg,jpg,png" ;
Config.DeniedExtensions["Image"] = "" ;
Config.FileTypesPath["Image"] = Config.UserFilesPath & 'image/' ;
Config.FileTypesAbsolutePath["Image"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'image/') ) ;
Config.QuickUploadPath["Image"] = Config.FileTypesPath["Image"] ;
Config.QuickUploadAbsolutePath["Image"] = Config.FileTypesAbsolutePath["Image"] ;
Config.AllowedExtensions["Flash"] = "swf,flv" ;
Config.DeniedExtensions["Flash"] = "" ;
Config.FileTypesPath["Flash"] = Config.UserFilesPath & 'flash/' ;
Config.FileTypesAbsolutePath["Flash"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'flash/') ) ;
Config.QuickUploadPath["Flash"] = Config.FileTypesPath["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.DeniedExtensions["Media"] = "" ;
Config.FileTypesPath["Media"] = Config.UserFilesPath & 'media/' ;
Config.FileTypesAbsolutePath["Media"] = iif( Config.ServerPath eq "", de(""), de(Config.ServerPath & 'media/') ) ;
Config.QuickUploadPath["Media"] = Config.FileTypesPath["Media"] ;
Config.QuickUploadAbsolutePath["Media"] = Config.FileTypesAbsolutePath["Media"] ;
</cfscript>
<cftry>
<!--- code to maintain backwards compatibility with previous version of cfm connector --->
<cfif isDefined("application.userFilesPath")>
<cflock scope="application" type="readonly" timeout="5">
<cfset config.userFilesPath = application.userFilesPath>
</cflock>
<cfelseif isDefined("server.userFilesPath")>
<cflock scope="server" type="readonly" timeout="5">
<cfset config.userFilesPath = server.userFilesPath>
</cflock>
</cfif>
<!--- look for config struct in application and server scopes --->
<cfif isDefined("application.FCKeditor") and isStruct(application.FCKeditor)>
<cflock scope="application" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(application.FCKeditor)>
</cflock>
<cfelseif isDefined("server.FCKeditor") and isStruct(server.FCKeditor)>
<cflock scope="server" type="readonly" timeout="5">
<cfset variables.FCKeditor = duplicate(server.FCKeditor)>
</cflock>
</cfif>
<!--- catch potential "The requested scope application has not been enabled" exception --->
<cfcatch type="any">
</cfcatch>
</cftry>
<cfif isDefined("FCKeditor")>
<!--- copy key values from external to local config (i.e. override default config as required) --->
<cfscript>
function structCopyKeys(stFrom, stTo) {
for ( key in stFrom ) {
if ( isStruct(stFrom[key]) ) {
structCopyKeys(stFrom[key],stTo[key]);
} else {
stTo[key] = stFrom[key];
}
}
}
structCopyKeys(FCKeditor, config);
</cfscript>
</cfif>

View File

@@ -1,32 +1,32 @@
<cfsetting enablecfoutputonly="Yes">
<!---
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* File Browser connector for ColdFusion (all versions).
*
--->
<cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )>
<cfif REQUEST.CFVersion lte 5>
<cfinclude template="cf5_connector.cfm">
<cfelse>
<cfinclude template="cf_connector.cfm">
</cfif>
<cfabort>
<cfsetting enablecfoutputonly="Yes">
<!---
* 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 ==
*
* File Browser connector for ColdFusion (all versions).
*
--->
<cfset REQUEST.CFVersion = Left( SERVER.COLDFUSION.PRODUCTVERSION, Find( ",", SERVER.COLDFUSION.PRODUCTVERSION ) - 1 )>
<cfif REQUEST.CFVersion lte 5>
<cfinclude template="cf5_connector.cfm">
<cfelse>
<cfinclude template="cf_connector.cfm">
</cfif>
<cfabort>

View File

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

View File

@@ -1,65 +1,65 @@
[//lasso
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 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 ==
*
* Configuration file for the File Manager Connector for Lasso.
*/
/*.....................................................................
The connector uses the file tags, which require authentication. Enter a
valid username and password from Lasso admin for a group with file tags
permissions for uploads and the path you define in UserFilesPath below.
*/
var('connection') = array(
-username='xxxxxxxx',
-password='xxxxxxxx'
);
/*.....................................................................
Set the base path for files that users can upload and browse (relative
to server root).
Set which file extensions are allowed and/or denied for each file type.
*/
var('config') = map(
'Enabled' = false,
'UserFilesPath' = '/userfiles/',
'Subdirectories' = map(
'File' = 'File/',
'Image' = 'Image/',
'Flash' = 'Flash/',
'Media' = 'Media/'
),
'AllowedExtensions' = map(
'File' = array('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'),
'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')
),
'DeniedExtensions' = map(
'File' = array(),
'Image' = array(),
'Flash' = array(),
'Media' = array()
)
);
]
[//lasso
/*
* 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 ==
*
* Configuration file for the File Manager Connector for Lasso.
*/
/*.....................................................................
The connector uses the file tags, which require authentication. Enter a
valid username and password from Lasso admin for a group with file tags
permissions for uploads and the path you define in UserFilesPath below.
*/
var('connection') = array(
-username='xxxxxxxx',
-password='xxxxxxxx'
);
/*.....................................................................
Set the base path for files that users can upload and browse (relative
to server root).
Set which file extensions are allowed and/or denied for each file type.
*/
var('config') = map(
'Enabled' = false,
'UserFilesPath' = '/userfiles/',
'Subdirectories' = map(
'File' = 'File/',
'Image' = 'Image/',
'Flash' = 'Flash/',
'Media' = 'Media/'
),
'AllowedExtensions' = map(
'File' = array('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'),
'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')
),
'DeniedExtensions' = map(
'File' = array(),
'Image' = array(),
'Flash' = array(),
'Media' = array()
)
);
]

View File

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

View File

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

View File

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

View File

@@ -1,214 +1,187 @@
#####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben
#
# == BEGIN LICENSE ==
#
# Licensed under the terms of any of the following licenses at your
# choice:
#
# - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html
#
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html
#
# - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html
#
# == END LICENSE ==
#
# This is the File Manager Connector for Perl.
#####
sub GetFolders
{
local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder);
print "<Folders>"; # Open the "Folders" node.
opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR);
foreach $sFile (@files) {
if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) {
$cnv_filename = &ConvertToXmlAttribute($sFile);
print '<Folder name="' . $cnv_filename . '" />';
}
}
print "</Folders>"; # Close the "Folders" node.
}
sub GetFoldersAndFiles
{
local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Initialize the output buffers for "Folders" and "Files".
$sFolders = '<Folders>';
$sFiles = '<Files>';
opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR);
foreach $sFile (@files) {
if($sFile ne '.' && $sFile ne '..') {
if(-d "$sServerDir$sFile") {
$cnv_filename = &ConvertToXmlAttribute($sFile);
$sFolders .= '<Folder name="' . $cnv_filename . '" />' ;
} else {
($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2];
if($iFileSize > 0) {
$iFileSize = int($iFileSize / 1024);
if($iFileSize < 1) {
$iFileSize = 1;
}
}
$cnv_filename = &ConvertToXmlAttribute($sFile);
$sFiles .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ;
}
}
}
print $sFolders ;
print '</Folders>'; # Close the "Folders" node.
print $sFiles ;
print '</Files>'; # Close the "Files" node.
}
sub CreateFolder
{
local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ;
$sErrorMsg = '' ;
if($FORM{'NewFolderName'} ne "") {
$sNewFolderName = $FORM{'NewFolderName'};
$sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
# Map the virtual path to the local server path of the current folder.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder);
if(-w $sServerDir) {
$sServerDir .= $sNewFolderName;
$sErrorMsg = &CreateServerFolder($sServerDir);
if($sErrorMsg == 0) {
$sErrorNumber = '0';
} elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') {
$sErrorNumber = '102'; #// Path too long.
} else {
$sErrorNumber = '110';
}
} else {
$sErrorNumber = '103';
}
} else {
$sErrorNumber = '102' ;
}
# Create the "Error" node.
$cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg);
print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
}
sub FileUpload
{
eval("use File::Copy;");
local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ;
$sFileName = '' ;
if($new_fname) {
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Get the uploaded file name.
$sFileName = $new_fname;
$sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
$sOriginalFileName = $sFileName;
$iCounter = 0;
while(1) {
$sFilePath = $sServerDir . $sFileName;
if(-e $sFilePath) {
$iCounter++ ;
($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName);
$sFileName = $BaseName . '(' . $iCounter . ').' . $ext;
$sErrorNumber = '201';
} else {
copy("$img_dir/$new_fname","$sFilePath");
if (defined $CHMOD_ON_UPLOAD) {
if ($CHMOD_ON_UPLOAD) {
umask(000);
chmod($CHMOD_ON_UPLOAD,$sFilePath);
}
}
else {
umask(000);
chmod(0777,$sFilePath);
}
unlink("$img_dir/$new_fname");
last;
}
}
} else {
$sErrorNumber = '202' ;
}
$sFileName =~ s/"/\\"/g;
SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, '');
}
sub SendUploadResults
{
local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_;
print <<EOF;
Content-type: text/html
<script type="text/javascript">
// Automatically detect the correct document.domain (#1919).
(function()
{
var d = document.domain ;
while ( true )
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\\.|\$)/, '' ) ;
if ( d.length == 0 )
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
EOF
print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;';
print '</script>';
exit ;
}
1;
#####
# 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 ==
#
# This is the File Manager Connector for Perl.
#####
sub GetFolders
{
local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder);
print "<Folders>"; # Open the "Folders" node.
opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR);
foreach $sFile (@files) {
if($sFile != '.' && $sFile != '..' && (-d "$sServerDir$sFile")) {
$cnv_filename = &ConvertToXmlAttribute($sFile);
print '<Folder name="' . $cnv_filename . '" />';
}
}
print "</Folders>"; # Close the "Folders" node.
}
sub GetFoldersAndFiles
{
local($resourceType, $currentFolder) = @_;
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Initialize the output buffers for "Folders" and "Files".
$sFolders = '<Folders>';
$sFiles = '<Files>';
opendir(DIR,"$sServerDir");
@files = grep(!/^\.\.?$/,readdir(DIR));
closedir(DIR);
foreach $sFile (@files) {
if($sFile ne '.' && $sFile ne '..') {
if(-d "$sServerDir$sFile") {
$cnv_filename = &ConvertToXmlAttribute($sFile);
$sFolders .= '<Folder name="' . $cnv_filename . '" />' ;
} else {
($iFileSize,$refdate,$filedate,$fileperm) = (stat("$sServerDir$sFile"))[7,8,9,2];
if($iFileSize > 0) {
$iFileSize = int($iFileSize / 1024);
if($iFileSize < 1) {
$iFileSize = 1;
}
}
$cnv_filename = &ConvertToXmlAttribute($sFile);
$sFiles .= '<File name="' . $cnv_filename . '" size="' . $iFileSize . '" />' ;
}
}
}
print $sFolders ;
print '</Folders>'; # Close the "Folders" node.
print $sFiles ;
print '</Files>'; # Close the "Files" node.
}
sub CreateFolder
{
local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ;
$sErrorMsg = '' ;
if($FORM{'NewFolderName'} ne "") {
$sNewFolderName = $FORM{'NewFolderName'};
$sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
# Map the virtual path to the local server path of the current folder.
$sServerDir = &ServerMapFolder($resourceType, $currentFolder);
if(-w $sServerDir) {
$sServerDir .= $sNewFolderName;
$sErrorMsg = &CreateServerFolder($sServerDir);
if($sErrorMsg == 0) {
$sErrorNumber = '0';
} elsif($sErrorMsg eq 'Invalid argument' || $sErrorMsg eq 'No such file or directory') {
$sErrorNumber = '102'; #// Path too long.
} else {
$sErrorNumber = '110';
}
} else {
$sErrorNumber = '103';
}
} else {
$sErrorNumber = '102' ;
}
# Create the "Error" node.
$cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg);
print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
}
sub FileUpload
{
eval("use File::Copy;");
local($resourceType, $currentFolder) = @_;
$sErrorNumber = '0' ;
$sFileName = '' ;
if($new_fname) {
# Map the virtual path to the local server path.
$sServerDir = &ServerMapFolder($resourceType,$currentFolder);
# Get the uploaded file name.
$sFileName = $new_fname;
$sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
$sOriginalFileName = $sFileName;
$iCounter = 0;
while(1) {
$sFilePath = $sServerDir . $sFileName;
if(-e $sFilePath) {
$iCounter++ ;
($path,$BaseName,$ext) = &RemoveExtension($sOriginalFileName);
$sFileName = $BaseName . '(' . $iCounter . ').' . $ext;
$sErrorNumber = '201';
} else {
copy("$img_dir/$new_fname","$sFilePath");
if (defined $CHMOD_ON_UPLOAD) {
if ($CHMOD_ON_UPLOAD) {
umask(000);
chmod($CHMOD_ON_UPLOAD,$sFilePath);
}
}
else {
umask(000);
chmod(0777,$sFilePath);
}
unlink("$img_dir/$new_fname");
last;
}
}
} else {
$sErrorNumber = '202' ;
}
$sFileName =~ s/"/\\"/g;
SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, '');
}
sub SendUploadResults
{
local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_;
# Minified version of the document.domain automatic fix script (#1919).
# The original script can be found at _dev/domain_fix_template.js
# Note: in Perl replace \ with \\ and $ with \$
print <<EOF;
Content-type: text/html
<script type="text/javascript">
(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;}}})();
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
#####
# FCKeditor - The text editor for Internet - http://www.fckeditor.net
# Copyright (C) 2003-2008 Frederico Caldeira Knabben
#
# == BEGIN LICENSE ==
#
# Licensed under the terms of any of the following licenses at your
# choice:
#
# - GNU General Public License Version 2 or later (the "GPL")
# http://www.gnu.org/licenses/gpl.html
#
# - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
# http://www.gnu.org/licenses/lgpl.html
#
# - Mozilla Public License Version 1.1 or later (the "MPL")
# http://www.mozilla.org/MPL/MPL-1.1.html
#
# == END LICENSE ==
#
# This is the File Manager Connector for Perl.
#####
##
# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file.
##
## START: Hack for Windows (Not important to understand the editor code... Perl specific).
if(Windows_check()) {
chdir(GetScriptPath($0));
}
sub Windows_check
{
# IIS,PWS(NT/95)
$www_server_os = $^O;
# Win98 & NT(SP4)
if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
# AnHTTPd/Omni/IIS
if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
# Win Apache
if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
if($www_server_os=~ /win/i) { return(1); }
return(0);
}
sub GetScriptPath {
local($path) = @_;
if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
$path;
}
## END: Hack for IIS
require 'util.pl';
require 'io.pl';
require 'basexml.pl';
require 'commands.pl';
require 'upload_fck.pl';
##
# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
##
&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ;
&read_input();
if($FORM{'ServerPath'} ne "") {
$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
$GLOBALS{'UserFilesPath'} .= '/' ;
}
} else {
$GLOBALS{'UserFilesPath'} = '/userfiles/';
}
# Map the "UserFiles" path to a local directory.
$rootpath = &GetRootPath();
$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
&DoResponse();
sub DoResponse
{
if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") {
return ;
}
# Get the main request informaiton.
$sCommand = $FORM{'Command'};
$sResourceType = $FORM{'Type'};
$sCurrentFolder = $FORM{'CurrentFolder'};
# Check the current folder syntax (must begin and start with a slash).
if(!($sCurrentFolder =~ /\/$/)) {
$sCurrentFolder .= '/';
}
if(!($sCurrentFolder =~ /^\//)) {
$sCurrentFolder = '/' . $sCurrentFolder;
}
# Check for invalid folder paths (..)
if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
SendError( 102, "" ) ;
}
# File Upload doesn't have to Return XML, so it must be intercepted before anything.
if($sCommand eq 'FileUpload') {
FileUpload($sResourceType,$sCurrentFolder);
return ;
}
print << "_HTML_HEAD_";
Content-Type:text/xml; charset=utf-8
Pragma: no-cache
Cache-Control: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT
_HTML_HEAD_
&CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder);
# Execute the required command.
if($sCommand eq 'GetFolders') {
&GetFolders($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'GetFoldersAndFiles') {
&GetFoldersAndFiles($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'CreateFolder') {
&CreateFolder($sResourceType,$sCurrentFolder);
}
&CreateXmlFooter();
exit ;
}
#!/usr/bin/env perl
#####
# FCKeditor - The text editor for Internet - 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 ==
#
# This is the File Manager Connector for Perl.
#####
##
# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file.
##
## START: Hack for Windows (Not important to understand the editor code... Perl specific).
if(Windows_check()) {
chdir(GetScriptPath($0));
}
sub Windows_check
{
# IIS,PWS(NT/95)
$www_server_os = $^O;
# Win98 & NT(SP4)
if($www_server_os eq "") { $www_server_os= $ENV{'OS'}; }
# AnHTTPd/Omni/IIS
if($ENV{'SERVER_SOFTWARE'} =~ /AnWeb|Omni|IIS\//i) { $www_server_os= 'win'; }
# Win Apache
if($ENV{'WINDIR'} ne "") { $www_server_os= 'win'; }
if($www_server_os=~ /win/i) { return(1); }
return(0);
}
sub GetScriptPath {
local($path) = @_;
if($path =~ /[\:\/\\]/) { $path =~ s/(.*?)[\/\\][^\/\\]+$/$1/; } else { $path = '.'; }
$path;
}
## END: Hack for IIS
require 'util.pl';
require 'io.pl';
require 'basexml.pl';
require 'commands.pl';
require 'upload_fck.pl';
##
# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
##
&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ;
&read_input();
if($FORM{'ServerPath'} ne "") {
$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
$GLOBALS{'UserFilesPath'} .= '/' ;
}
} else {
$GLOBALS{'UserFilesPath'} = '/userfiles/';
}
# Map the "UserFiles" path to a local directory.
$rootpath = &GetRootPath();
$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
&DoResponse();
sub DoResponse
{
if($FORM{'Command'} eq "" || $FORM{'Type'} eq "" || $FORM{'CurrentFolder'} eq "") {
return ;
}
# Get the main request informaiton.
$sCommand = $FORM{'Command'};
$sResourceType = $FORM{'Type'};
$sCurrentFolder = $FORM{'CurrentFolder'};
# Check the current folder syntax (must begin and start with a slash).
if(!($sCurrentFolder =~ /\/$/)) {
$sCurrentFolder .= '/';
}
if(!($sCurrentFolder =~ /^\//)) {
$sCurrentFolder = '/' . $sCurrentFolder;
}
# Check for invalid folder paths (..)
if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
SendError( 102, "" ) ;
}
# File Upload doesn't have to Return XML, so it must be intercepted before anything.
if($sCommand eq 'FileUpload') {
FileUpload($sResourceType,$sCurrentFolder);
return ;
}
print << "_HTML_HEAD_";
Content-Type:text/xml; charset=utf-8
Pragma: no-cache
Cache-Control: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT
_HTML_HEAD_
&CreateXmlHeader($sCommand,$sResourceType,$sCurrentFolder);
# Execute the required command.
if($sCommand eq 'GetFolders') {
&GetFolders($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'GetFoldersAndFiles') {
&GetFoldersAndFiles($sResourceType,$sCurrentFolder);
} elsif($sCommand eq 'CreateFolder') {
&CreateFolder($sResourceType,$sCurrentFolder);
}
&CreateXmlFooter();
exit ;
}

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*
@@ -154,6 +154,8 @@ function GetRootPath()
global $_SERVER;
}
$sRealPath = realpath( './' ) ;
// #2124 ensure that no slash is at the end
$sRealPath = rtrim($sRealPath,"\\/");
$sSelfPath = $_SERVER['PHP_SELF'] ;
$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.
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
<script type="text/javascript">
(function()
{
var d = document.domain ;
while ( true )
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ;
if ( d.length == 0 )
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
(function(){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;}}})();
EOF;
$rpl = array( '\\' => '\\\\', '"' => '\\"' ) ;
echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ;
echo '</script>' ;

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

View File

@@ -1,7 +1,7 @@
<?php
/*
* 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 ==
*

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