Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 10:04 PM

in-portal

Index: trunk/admin/editor/cmseditor/fckeditor.js
===================================================================
--- trunk/admin/editor/cmseditor/fckeditor.js (revision 1973)
+++ trunk/admin/editor/cmseditor/fckeditor.js (revision 1974)
@@ -1,171 +1,173 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fckeditor.js
* This is the integration file for JavaScript.
*
* It defines the FCKeditor class that can be used to create editor
* instances in a HTML page in the client side. For server side
* operations, use the specific integration system.
*
* Version: 2.0 RC3
* Modified: 2005-02-27 19:04:39
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// FCKeditor Class
var FCKeditor = function( instanceName, width, height, toolbarSet, value )
{
// Properties
this.InstanceName = instanceName ;
this.Width = width || '100%' ;
this.Height = height || '200' ;
this.ToolbarSet = toolbarSet || 'Default' ;
this.Value = value || '' ;
this.BasePath = '/fckeditor/' ;
this.CheckBrowser = true ;
this.DisplayErrors = true ;
//this.ProjectDir = '';
this.Config = new Object() ;
// Events
this.OnError = null ; // function( source, errorNumber, errorDescription )
}
FCKeditor.prototype.Create = function()
{
// Check for errors
if ( !this.InstanceName || this.InstanceName.length == 0 )
{
this._ThrowError( 701, 'You must specify a instance name.' ) ;
return ;
}
document.write( '<div>' ) ;
if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
{
document.write( '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '">' ) ;
document.write( this._GetConfigHtml() ) ;
document.write( this._GetIFrameHtml() ) ;
}
else
{
var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ;
var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
document.write('<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="WIDTH: ' + sWidth + '; HEIGHT: ' + sHeight + '" wrap="virtual">' + this._HTMLEncode( this.Value ) + '<\/textarea>') ;
}
document.write( '</div>' ) ;
}
FCKeditor.prototype.ReplaceTextarea = function()
{
if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
{
var oTextarea = document.getElementById( this.InstanceName ) ;
if ( !oTextarea )
oTextarea = document.getElementsByName( this.InstanceName )[0] ;
if ( !oTextarea || oTextarea.tagName != 'TEXTAREA' )
{
alert( 'Error: The TEXTAREA id "' + this.InstanceName + '" was not found' ) ;
return ;
}
oTextarea.style.display = 'none' ;
this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
this.oTextarea = oTextarea;
}
}
FCKeditor.prototype._InsertHtmlBefore = function( html, element )
{
if ( element.insertAdjacentHTML ) // IE
element.insertAdjacentHTML( 'beforeBegin', html ) ;
else // Gecko
{
var oRange = document.createRange() ;
oRange.setStartBefore( element ) ;
var oFragment = oRange.createContextualFragment( html );
element.parentNode.insertBefore( oFragment, element ) ;
}
}
FCKeditor.prototype._GetConfigHtml = function()
{
var sConfig = '' ;
for ( var o in this.Config )
{
if ( sConfig.length > 0 ) sConfig += '&' ;
sConfig += escape(o) + '=' + escape( this.Config[o] ) ;
}
return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '">' ;
}
FCKeditor.prototype._GetIFrameHtml = function()
{
var sLink = this.BasePath + 'editor/fckeditor.html?InstanceName=' + this.InstanceName ;
if (this.ToolbarSet) sLink += '&Toolbar=' + this.ToolbarSet ;
return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="no" scrolling="no"></iframe>' ;
}
FCKeditor.prototype._IsCompatibleBrowser = function()
{
var sAgent = navigator.userAgent.toLowerCase() ;
// Internet Explorer
if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
{
var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
return ( sBrowserVersion >= 5.5 ) ;
}
// Gecko
else if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 )
return true ;
else
return false ;
}
FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
{
this.ErrorNumber = errorNumber ;
this.ErrorDescription = errorDescription ;
if ( this.DisplayErrors )
{
document.write( '<div style="COLOR: #ff0000">' ) ;
document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
document.write( '</div>' ) ;
}
if ( typeof( this.OnError ) == 'function' )
this.OnError( this, errorNumber, errorDescription ) ;
}
FCKeditor.prototype._HTMLEncode = function( text )
{
if ( typeof( text ) != "string" )
text = text.toString() ;
- text = text.replace(/&/g, "&amp;") ;
+ //text = text.replace(/&/g, "&amp;") ;
text = text.replace(/"/g, "&quot;") ;
text = text.replace(/</g, "&lt;") ;
text = text.replace(/>/g, "&gt;") ;
text = text.replace(/'/g, "&#39;") ;
+ //text = text.replace( /&amp;lt;/g, "&lt;" ) ;
+ //text = text.replace( /&amp;qt;/g, "&qt;" ) ;
return text ;
}
\ No newline at end of file
Property changes on: trunk/admin/editor/cmseditor/fckeditor.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/_source/internals/fcktools.js
===================================================================
--- trunk/admin/editor/cmseditor/editor/_source/internals/fcktools.js (revision 1973)
+++ trunk/admin/editor/cmseditor/editor/_source/internals/fcktools.js (revision 1974)
@@ -1,208 +1,210 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fcktools.js
* Utility functions.
*
* Version: 2.0 RC3
* Modified: 2005-02-19 15:27:16
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKTools = new Object() ;
//**
// FCKTools.GetLinkedFieldValue: Gets the value of the hidden INPUT element
// that is associated to the editor. This element has its ID set to the
// editor's instance name so the user reffers to the instance name when getting
// the posted data.
FCKTools.GetLinkedFieldValue = function()
{
return FCK.LinkedField.value ;
}
//**
// FCKTools.SetLinkedFieldValue: Sets the value of the hidden INPUT element
// that is associated to the editor. This element has its ID set to the
// editor's instance name so the user reffers to the instance name when getting
// the posted data.
FCKTools.SetLinkedFieldValue = function( value )
{
if ( FCKConfig.FormatOutput )
FCK.LinkedField.value = FCKCodeFormatter.Format( value ) ;
else
FCK.LinkedField.value = value ;
}
//**
// FCKTools.AttachToLinkedFieldFormSubmit: attaches a function call to the
// submit event of the linked field form. This function us generally used to
// update the linked field value before submitting the form.
FCKTools.AttachToLinkedFieldFormSubmit = function( functionPointer )
{
// Gets the linked field form
var oForm = FCK.LinkedField.form ;
// Return now if no form is available
if (!oForm) return ;
// Attaches the functionPointer call to the onsubmit event
if ( FCKBrowserInfo.IsIE )
oForm.attachEvent( "onsubmit", functionPointer ) ;
else
oForm.addEventListener( 'submit', functionPointer, true ) ;
//**
// Attaches the functionPointer call to the submit method
// This is done because IE doesn't fire onsubmit when the submit method is called
// BEGIN --
// Creates a Array in the form object that will hold all Attached function call
// (in the case there are more than one editor in the same page)
if (! oForm.updateFCKEditor) oForm.updateFCKEditor = new Array() ;
// Adds the function pointer to the array of functions to call when "submit" is called
oForm.updateFCKEditor[oForm.updateFCKEditor.length] = functionPointer ;
// Switches the original submit method with a new one that first call all functions
// on the above array and the call the original submit
// IE sees it oForm.submit function as an 'object'.
if (! oForm.originalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) )
{
// Creates a copy of the original submit
oForm.originalSubmit = oForm.submit ;
// Creates our replacement for the submit
oForm.submit = function()
{
if (this.updateFCKEditor)
{
// Calls all functions in the functions array
for (var i = 0 ; i < this.updateFCKEditor.length ; i++)
this.updateFCKEditor[i]() ;
}
// Calls the original "submit"
this.originalSubmit() ;
}
}
// END --
}
//**
// FCKTools.AddSelectOption: Adds a option to a SELECT element.
FCKTools.AddSelectOption = function( targetDocument, selectElement, optionText, optionValue )
{
var oOption = targetDocument.createElement("OPTION") ;
oOption.text = optionText ;
oOption.value = optionValue ;
selectElement.options.add(oOption) ;
return oOption ;
}
FCKTools.RemoveAllSelectOptions = function( selectElement )
{
for ( var i = selectElement.options.length - 1 ; i >= 0 ; i-- )
{
selectElement.options.remove(i) ;
}
}
FCKTools.SelectNoCase = function( selectElement, value, defaultValue )
{
var sNoCaseValue = value.toString().toLowerCase() ;
for ( var i = 0 ; i < selectElement.options.length ; i++ )
{
if ( sNoCaseValue == selectElement.options[i].value.toLowerCase() )
{
selectElement.selectedIndex = i ;
return ;
}
}
if ( defaultValue != null ) FCKTools.SelectNoCase( selectElement, defaultValue ) ;
}
FCKTools.HTMLEncode = function( text )
{
- text = text.replace( /&/g, "&amp;" ) ;
+ //text = text.replace( /&/g, "&amp;" ) ;
text = text.replace( /"/g, "&quot;" ) ;
text = text.replace( /</g, "&lt;" ) ;
text = text.replace( />/g, "&gt;" ) ;
text = text.replace( /'/g, "&#39;" ) ;
+ //text = text.replace( /&amp;lt;/g, "&lt;" ) ;
+ //text = text.replace( /&amp;qt;/g, "&qt;" ) ;
return text ;
}
//**
// FCKTools.GetResultingArray: Gets a array from a string (where the elements
// are separated by a character), a fuction (that returns a array) or a array.
FCKTools.GetResultingArray = function( arraySource, separator )
{
switch ( typeof( arraySource ) )
{
case "string" :
return arraySource.split( separator ) ;
case "function" :
return separator() ;
default :
if ( isArray( arraySource ) ) return arraySource ;
else return new Array() ;
}
}
FCKTools.GetElementPosition = function( el )
{
// Initializes the Coordinates object that will be returned by the function.
var c = { X:0, Y:0 } ;
// Loop throw the offset chain.
while ( el )
{
c.X += el.offsetLeft ;
c.Y += el.offsetTop ;
el = el.offsetParent ;
}
// Return the Coordinates object
return c ;
}
FCKTools.GetElementAscensor = function( element, ascensorTagName )
{
var e = element.parentNode ;
while ( e )
{
if ( e.nodeName == ascensorTagName )
return e ;
e = e.parentNode ;
}
}
FCKTools.Pause = function( miliseconds )
{
var oStart = new Date() ;
while (true)
{
var oNow = new Date() ;
if ( miliseconds < oNow - oStart )
return ;
}
}
Property changes on: trunk/admin/editor/cmseditor/editor/_source/internals/fcktools.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_link.html
===================================================================
--- trunk/admin/editor/cmseditor/editor/dialog/fck_link.html (revision 1973)
+++ trunk/admin/editor/cmseditor/editor/dialog/fck_link.html (revision 1974)
@@ -1,189 +1,189 @@
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_link.html
* Link dialog window.
*
* Version: 2.0 RC3
* Modified: 2005-02-18 23:55:22
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Link Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_link/fck_link.js" type="text/javascript"></script>
<script src="../filemanager/browser/default/js/fckxml.js" type="text/javascript"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<div id="divInfo">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><span fckLang="DlgLnkTo">Link To</span><br /></td>
<td>&nbsp;</td>
<td><div id="divNoMail1"><span fckLang="DlgLnkViewIn">View In</span><br /></div></td>
</tr>
<tr>
<td>
<select id="cmbLinkType" onchange="SetLinkType(this.value);">
<option value="external" fckLang="DlgLnkEnternal">External Web Page</option>
<option value="internal" fckLang="DlgLnkInternal">Internal Web Page</option>
<option value="email" fckLang="DlgLnkTypeEMail">E-mail</option>
<option value="Doc" fckLang="DlgLnkTypeFile">File</option>
</select>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td><div id="divNoMail2">
<select id="cmbTarget" onchange="SetTarget(this.value);">
<option value="" fckLang="DlgLnkTargetSelf">Same Window</option>
<option value="_blank" fckLang="DlgLnkTargetBlank">New Window</option>
<option value="popup" fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
</select>
</div>
</td>
</tr>
</table>
<div id="divNoMail3">
<table cellspacing="0" cellpadding="0" border="0" style="WIDTH: 100%">
<tr>
<td><span fckLang="DlgLnkAltTxt">Alternative Text</span><br /></td>
</tr>
<tr>
<td><input id="txtAlt" style="WIDTH: 100%" type="text" /></td>
</tr>
</table>
</div>
</div>
<hr>
<div id="divLinkTypeExternal" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkProto">Type:</span><br />
<select id="cmbLinkProtocol">
<option value="http://" selected="selected">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
<option value="news://">news://</option>
<option value="" fckLang="DlgLnkProtoOther">&lt;other&gt;</option>
</select>
</td>
</tr>
<tr>
<td nowrap="nowrap" width="100%">
<span fckLang="DlgLnkURL">Address:</span><br />
<input id="txtUrl" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />
</td>
</tr>
</table>
</div>
<div id="divLinkTypeInternal" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<span fckLang="DlgLnkInternalName">Internal Page Name:</span><br />
- <select id="cmbImternalPagName" onchange="ChangeInternalUrl(this.value);">
+ <select id="cmbImternalPagName" onchange="ChangeInternalUrl(this.value,this);">
</select><br />
</td>
</tr>
</table>
</div>
<div id="divLinkTypeFile" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<!--
<tr>
<td nowrap="nowrap">
<span fckLang="DlgLnkProto">Type:</span><br />
<select id="cmbLinkProtocol">
<option value="http://" selected="selected">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
</select>
</td>
</tr>
-->
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan='3'><span fckLang="DlgFileURL">File URL:</span></td>
</tr>
<tr>
<td><input id="fileUrl" style="WIDTH: 260px" type="text"></td>
<td>&nbsp;&nbsp;</td>
<td id="tdBrowse" nowrap>
<input id="btnBrowse2" onclick="BrowseServer('fileUrl'); " type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" NAME="btnBrowse">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="divSelAnchor" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fckLang="DlgLnkAnchorSel">Select an Anchor:</span><br>
<select id="cmbAnchorName" style="WIDTH: 100%">
<option value="" selected="selected"></option>
</select>
</td>
</tr>
</table>
</div>
<div id="divNoAnchor" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<span fckLang="DlgLnkNoAnchors">&lt;No anchors available in the document&gt;</span>
</td>
</tr>
</table>
</div>
<div id="divPopupSize" style="DISPLAY: none">
<table cellspacing="0" cellpadding="0" border="0">
<tr><td colspan='7'><img src='images/s.gif' width='1' height='5'></td></tr>
<tr>
<td><span fckLang="DlgLnkPopupWidth">PopUp Width:</span></td>
<td>&nbsp;&nbsp;</td>
<td><input id="txtPopupWidth" style="WIDTH: 30" type="text" /></td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td><span fckLang="DlgLnkPopupHeight">PopUp Height:</span></td>
<td>&nbsp;&nbsp;</td>
<td><input id="txtPopupHeight" style="WIDTH: 30" type="text" /></td>
</tr>
</table>
</div>
<div id="divLinkTypeEMail" style="DISPLAY: none">
<span fckLang="DlgLnkEMail">E-Mail Address</span><br />
<input id="txtEMailAddress" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailSubject">Message Subject</span><br />
<input id="txtEMailSubject" style="WIDTH: 100%" type="text" /><br />
<span fckLang="DlgLnkEMailBody">Message Body</span><br />
<textarea id="txtEMailBody" style="WIDTH: 100%" rows="3" cols="20"></textarea>
</div>
<iframe id="frmInternal" name="frmInternal" frameborder="0" scrolling="no" width='0' height='0' OnLoad="LoadAnchorNamesAndIds();" style="DISPLAY: none">
</iframe>
</body>
</html>
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_link.html
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js
===================================================================
--- trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (revision 1973)
+++ trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (revision 1974)
@@ -1,617 +1,673 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: fck_link.js
* Scripts related to the Link dialog window (see fck_link.html).
*
* Version: 2.0 RC3
* Modified: 2005-02-09 13:53:13
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var oEditor = window.parent.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var ServerPath = '';
var from = '';
var anchor_ = '';
+var links_path = new Array()
+
//#### Dialog Tabs
// Set the dialog tabs.
//window.parent.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
//window.parent.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
// TODO : Enable File Upload (1/3).
//window.parent.AddTab( 'Upload', 'Upload', true ) ;
//window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
// ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
// ShowE('divTarget' , ( tabCode == 'Target' ) ) ;
// TODO : Enable File Upload (2/3).
// ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
// ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ;
}
//#### Regular Expressions library.
var oRegex = new Object() ;
oRegex.UriProtocol = new RegExp('') ;
oRegex.UriProtocol.compile( '^(((http|https|ftp|news):\/\/)|mailto:)', 'gi' ) ;
oRegex.UrlOnChangeProtocol = new RegExp('') ;
oRegex.UrlOnChangeProtocol.compile( '^(http|https|ftp|news)://(?=.)', 'gi' ) ;
oRegex.UrlOnChangeTestOther = new RegExp('') ;
oRegex.UrlOnChangeTestOther.compile( '^(javascript:|#|/)', 'gi' ) ;
oRegex.ReserveTarget = new RegExp('') ;
oRegex.ReserveTarget.compile( '^_(blank|self|top|parent)$', 'i' ) ;
oRegex.PopupUri = new RegExp('') ;
//oRegex.PopupUri.compile( "^javascript:void\\(\\s*window.open\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*'([^']*)'\\s*\\)\\s*\\)\\s*$" ) ;
oRegex.PopupUri.compile( "^javascript:openwincms\\(\\s*'([^']+)'\\s*,\\s*(?:'([^']*)'|null)\\s*,\\s*([^']*)\\s*,\\s*([^']*)\\s*\\)$" ) ;
oRegex.PopupFeatures = new RegExp('') ;
oRegex.PopupFeatures.compile( '(?:^|,)([^=]+)=(\\d+|yes|no)', 'gi' ) ;
//#### Parser Functions
var oParser = new Object() ;
oParser.ParseEMailUrl = function( emailUrl )
{
// Initializes the EMailInfo object.
var oEMailInfo = new Object() ;
oEMailInfo.Address = '' ;
oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ;
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ;
if ( oParts )
{
// Set the e-mail address.
oEMailInfo.Address = oParts[1] ;
// Look for the optional e-mail parameters.
if ( oParts[2] )
{
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Subject = unescape( oMatch[2] ) ;
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ;
if ( oMatch ) oEMailInfo.Body = unescape( oMatch[2] ) ;
}
}
return oEMailInfo ;
}
oParser.CreateEMailUri = function( address, subject, body )
{
var sBaseUri = 'mailto:' + address ;
var sParams = '' ;
if ( subject.length > 0 )
sParams = '?subject=' + escape( subject ) ;
if ( body.length > 0 )
{
sParams += ( sParams.length == 0 ? '?' : '&' ) ;
sParams += 'body=' + escape( body ) ;
}
return sBaseUri + sParams ;
}
//#### Initialization Code
// oLink: The actual selected link in the editor.
var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
if ( oLink ) {
FCK.Selection.MoveToNode( oLink ) ;
//show_props(oLink.attributes, 'LINK: ')
}
function OnDialogTabChange( tabCode )
{
if (tabCode == 'Info') {
updateDataArray();
}
}
function updateDataArray()
{
window.parent.parentData['linkTxtUrl'] = BuildUrlByType();
if (window.parent.parentData['linkTxtUrl'].length > 2) {
if (GetE('txtAlt')) {
window.parent.parentData['linkTxtAlt'] = GetE('txtAlt').value;
window.parent.parentData['linkTxtTitle'] = GetE('txtAlt').value;
}
window.parent.parentData['linkCmbTarget'] = GetE('cmbTarget').value;
window.parent.parentData['linkType'] = GetE('cmbLinkType').value;
window.location.href='dialog/fck_image.html?from';
}
}
window.onload = function()
{
// Translate the dialog box texts.
oEditor.FCKLanguageManager.TranslatePage(document) ;
// Fill the Anchor Names and Ids combos.
//LoadAnchorNamesAndIds();
//alert(window.location.search.substr(1));
// Load the selected link information (if any).
LoadSelection() ;
// Show the initial dialog content.
GetE('divInfo').style.display = '' ;
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
// if (window.location.search.substr(1) == 'create'){
// alert('OK');
// window.parent.Ok();
// }
}
var bHasAnchors ;
function LoadAnchorNamesAndIds()
{
//alert('LoadAnchorNamesAndIds');
if (GetE('cmbLinkType').value != 'internal') {
ShowE( 'divNoAnchor' , 0 ) ;
return;
}
var aAnchors = window.frames["frmInternal"].document.anchors ;
//var aAnchors = oEditor.FCK.EditorDocument.anchors ;
//var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
if (aAnchors) {
bHasAnchors = ( aAnchors.length > 0) ;
if (GetE('cmbAnchorName').options.length > 0) {
GetE('cmbAnchorName').options.length = 0;
}
oEditor.FCKTools.AddSelectOption( document, GetE('cmbAnchorName'), '', '' ) ;
for ( var i = 0 ; i < aAnchors.length ; i++ )
{
var sName = aAnchors[i].name ;
if ( sName && sName.length > 0 ) {
oEditor.FCKTools.AddSelectOption( document, GetE('cmbAnchorName'), sName, sName ) ;
}
}
ShowE( 'divSelAnchor' , bHasAnchors ) ;
ShowE( 'divNoAnchor' , !bHasAnchors ) ;
for ( var i = 0 ; i < GetE('cmbAnchorName').length ; i++ )
{
if (anchor_ == GetE('cmbAnchorName').options[i].value)
GetE('cmbAnchorName').options[i].selected=1;
}
}
}
function LoadSelection()
{
var sHRef = '';
var sType = '';
if (window.parent.parentData['linkTxtUrl'])
{
sHRef = window.parent.parentData['linkTxtUrl'];
if (window.parent.parentData['linkTxtAlt'])
GetE('txtAlt').value = window.parent.parentData['linkTxtAlt'];
sType = GetE('cmbLinkType').value = window.parent.parentData['linkType'];
var sTarget = window.parent.parentData['linkCmbTarget'];
//alert('href: ' + sHRef + '\n'+'txtAlt: '+ GetE('txtAlt').value+'\n'+'sType: ' + sType+'\n'+'sTarget: ' + sTarget);
} else if ( !oLink ) {
SetLinkType('external');
return ;
}
if (sHRef.length == 0)
{
// Get the actual Link href.
var sHRef = oLink.getAttribute('href',2) + '' ;
if (oLink.getAttribute('alt',2)) {
if(oLink.getAttribute('alt',2).length > 0)
GetE('txtAlt').value = oLink.getAttribute('alt',2) + '' ;
else
GetE('txtAlt').value = '';
}
// Look for a popup javascript link.
}
var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
if( oPopupMatch )
{
GetE('cmbTarget').value = 'popup' ;
sHRef = oPopupMatch[1] ;
GetE('txtPopupWidth').value = oPopupMatch[3];
GetE('txtPopupHeight').value = oPopupMatch[4];
SetTarget('popup');
}
// Search for the protocol.
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
if ( sProtocol )
{
sProtocol = sProtocol[0].toLowerCase() ;
GetE('cmbLinkProtocol').value = sProtocol ;
// Remove the protocol and get the remainig URL.
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
if ( sProtocol == 'mailto:' ) // It is an e-mail link.
{
sType = 'email' ;
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else // It is a normal link.
GetE('txtUrl').value = sUrl ;
}
else // It is another type of link.
{
GetE('cmbLinkProtocol').value = '' ;
GetE('txtUrl').value = sHRef ;
}
if (oLink) {
//if (!window.location.search)
if (sType.length == 0)
sType = GetAttribute( oLink, 'label', '' );
if (sType.length == 0)
sType = 'external';
}
if (sType == 'Doc' && sHRef.length > 2) {
GetE('fileUrl').value = sHRef ;
}
if (sType == 'internal' && sHRef.length > 2 && sHRef.indexOf('#') > 0) {
anchor_ = sHRef.slice(sHRef.lastIndexOf('#')+1);
sHRef = sHRef.slice(0,sHRef.lastIndexOf('#'));
GetE('txtUrl').value = sHRef ;
}
-
if ( !oPopupMatch )
{
// Get the target.
if (oLink)
var sTarget = oLink.target;
else if (window.parent.parentData['linkCmbTarget'])
var sTarget = window.parent.parentData['linkCmbTarget'];
if ( sTarget && sTarget.length > 0 )
{
if ( oRegex.ReserveTarget.test( sTarget ) )
{
sTarget = sTarget.toLowerCase() ;
GetE('cmbTarget').value = sTarget ;
}
else
GetE('cmbTarget').value = '' ;
}
}
GetE('cmbLinkType').value = sType ;
SetLinkType( sType );
}
//#### Link type selection.
function SetLinkType( linkType )
{
if (linkType == 'email') {
ShowE('divNoMail1',0);
ShowE('divNoMail2',0);
ShowE('divNoMail3',0);
} else {
ShowE('divNoMail1',1);
ShowE('divNoMail2',1);
ShowE('divNoMail3',1);
}
if (linkType != 'internal')
ShowE( 'divNoAnchor' , 0 ) ;
ShowE('divLinkTypeInternal' , (linkType == 'internal') ) ;
ShowE('divLinkTypeExternal' , (linkType == 'external') ) ;
ShowE('divLinkTypeEMail' , (linkType == 'email') ) ;
ShowE('divLinkTypeFile' , (linkType == 'Doc') ) ;
if(GetE('cmbTarget')) {
if (GetE('cmbTarget').value == 'popup' ) {
ShowE('divPopupSize',1);
} else
ShowE('divPopupSize',0);
} else
ShowE('divPopupSize',0);
if ( linkType == 'internal' ) {
LoadResources();
//LoadAnchorNamesAndIds();
}
if ( linkType == 'email')
window.parent.SetAutoSize( true ) ;
}
function LoadResources()
{
var oXML = new FCKXml() ;
var sConnUrl = 'filemanager/browser/default/connectors/php/connector.php?Command=GetCmsTree';
sConnUrl = window.location.href.replace( /dialog.*$/, '' ) + sConnUrl ;
oXML.LoadUrl(sConnUrl, GetCmsTreeCallBack ) ; // Asynchronous load.
}
function GetCmsTreeCallBack( fckXml )
{
//alert(show_props(fckXml, 'oNodes'));
var oNodes = fckXml.SelectNodes( 'Connector/CmsPages/CmsPage' ) ;
for ( var i = 0 ; i < oNodes.length ; i++ )
{
var sCmsPage = oNodes[i].attributes.getNamedItem('path').value ;
+ var sCmsId = oNodes[i].attributes.getNamedItem('st_id').value ;
var sTitle = oNodes[i].attributes.getNamedItem('title').value ;
ServerPath = oNodes[i].attributes.getNamedItem('serverpath').value;
- GetE('cmbImternalPagName').options[i] = new Option(sTitle, sCmsPage);
+ if (LinkTypeID()) {
+ links_path[i] = sCmsPage;
+ GetE('cmbImternalPagName').options[i] = new Option(sTitle, SetIDtag(sCmsId));
+ }
+ else
+ GetE('cmbImternalPagName').options[i] = new Option(sTitle, sCmsPage);
+
if (GetE('txtUrl')) {
tmpUrl = GetE('txtUrl').value;
if (tmpUrl.length == 0 && i == 0) {
window.frames["frmInternal"].document.location.href = ServerPath + sCmsPage+GetAdmin();
}
//alert(tmpUrl+' === '+sCmsPage);
- if (tmpUrl.match(sCmsPage+'$')) {
- GetE('cmbImternalPagName').options[i].selected=1;
- window.frames["frmInternal"].document.location.href = tmpUrl+GetAdmin();
+ if (LinkTypeID())
+ {
+ if (tmpUrl == SetIDtag(sCmsId) || tmpUrl == SetIDtagAMP(sCmsId) || tmpUrl == SetIDtagNoLtQt(sCmsId)) {
+ GetE('cmbImternalPagName').options[i].selected=1;
+ //alert(ServerPath+sCmsPage+GetAdmin());
+ window.frames["frmInternal"].document.location.href = ServerPath+sCmsPage+GetAdmin();
+ }
+ } else {
+ if (tmpUrl.match(sCmsPage+'$')) {
+ GetE('cmbImternalPagName').options[i].selected=1;
+ //alert(tmpUrl+GetAdmin());
+ window.frames["frmInternal"].document.location.href = tmpUrl+GetAdmin();
+ }
}
}
}
}
-function ChangeInternalUrl(url)
+function LinkTypeID()
+{
+ if (typeof(oEditor.FCKConfig.LocalLinkType) != 'undefined')
+ {
+ if (oEditor.FCKConfig.LocalLinkType == 'ID')
+ return true;
+ }
+ return false;
+}
+
+function SetIDtagNoLtQt(id)
+{
+ return "<%cms:GetBlockData id='"+id+"' field='href'%>";
+}
+
+function SetIDtag(id)
+{
+ return "&lt;%cms:GetBlockData id='"+id+"' field='href'%&gt;";
+}
+function SetIDtagAMP(id)
+{
+ return "&amp;lt;%cms:GetBlockData id='"+id+"' field='href'%&amp;gt;";
+
+}
+
+function ChangeInternalUrl(url,obj)
{
- window.frames["frmInternal"].document.location.href = ServerPath + url+GetAdmin();
- //window.frames["frmInternal"].document.location.onload = LoadAnchorNamesAndIds();
+ if(LinkTypeID()) {
+ for (var i=0; i < obj.options.length; i++) {
+ if (obj.options[i].value == url) {
+ url=links_path[i];
+ window.frames["frmInternal"].document.location.href = ServerPath + url + GetAdmin();
+ return;
+ }
+ }
+ } else
+ window.frames["frmInternal"].document.location.href = ServerPath + url+GetAdmin();
+ //window.frames["frmInternal"].document.location.onload = LoadAnchorNamesAndIds();
//LoadAnchorNamesAndIds();
}
function GetAdmin()
{
if (oEditor.FCKConfig.Admin == 1)
return "&admin=1";
}
function show_props(obj, objName) {
var result = "";
for (var i in obj) {
alert( objName + "." + i + " = " + obj[i] + " \n" );
}
}
//#### Target type selection.
function SetTarget( targetType )
{
switch ( targetType )
{
case "_blank" :
case "_self" :
case "_parent" :
case "_top" :
GetE('cmbTarget').value = targetType ;
break ;
case "" :
GetE('cmbTarget').value = '' ;
break ;
}
if ( targetType == 'popup' )
{
ShowE('divPopupSize',1);
window.parent.SetAutoSize( true ) ;
if (!GetE('txtPopupWidth').value)
GetE('txtPopupWidth').value = 800;
if (!GetE('txtPopupHeight').value)
GetE('txtPopupHeight').value = 600;
} else
ShowE('divPopupSize',0);
}
//#### Called while the user types the URL.
function OnUrlChange()
{
//alert("OnUrlChange "+ sUrl);
var sUrl = GetE('txtUrl').value ;
var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
if ( sProtocol )
{
sUrl = sUrl.substr( sProtocol[0].length ) ;
GetE('txtUrl').value = sUrl ;
GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ;
}
else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) )
{
GetE('cmbLinkProtocol').value = '' ;
}
}
//#### Called while the user types the target name.
function OnTargetNameChange()
{
}
//#### Builds the javascript URI to open a popup to the specified URI.
function BuildPopupUri( uri )
{
var ret = "javascript:openwincms('"+uri+"','popup',"+GetE('txtPopupWidth').value+","+GetE('txtPopupHeight').value+")";
return ret; //void(window.open('" + uri + "'," + sWindowName + ",'" + sFeatures + "'))" ) ;
}
//#### The OK button was hit.
function BuildUrlByType()
{
switch ( GetE('cmbLinkType').value )
{
case 'internal' :
- sUri = ServerPath+GetE('cmbImternalPagName').value;
+ if (LinkTypeID())
+ sUri = GetE('cmbImternalPagName').value
+ else
+ sUri = ServerPath+GetE('cmbImternalPagName').value;
//sUri = GetE('cmbLinkProtocol').value + sUri ;
+ //alert(sUri);
var cmbAnchorName = GetE('cmbAnchorName').value
if (cmbAnchorName.length > 0)
sUri = sUri+'#'+cmbAnchorName
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'Doc' :
sUri = GetE('fileUrl').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoUrl ) ;
return false ;
}
//sUri = sUri ;
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'external' :
sUri = GetE('txtUrl').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoUrl ) ;
return false ;
}
sUri = GetE('cmbLinkProtocol').value + sUri ;
if( GetE('cmbTarget').value == 'popup' )
sUri = BuildPopupUri( sUri ) ;
break ;
case 'email' :
sUri = GetE('txtEMailAddress').value ;
if ( sUri.length == 0 )
{
alert( FCKLang.DlnLnkMsgNoEMail ) ;
return false ;
}
sUri = oParser.CreateEMailUri(
sUri,
GetE('txtEMailSubject').value,
GetE('txtEMailBody').value ) ;
break ;
}
return sUri;
}
function Ok()
{
var sUri = BuildUrlByType();
if (sUri == false)
return false;
if (window.location.search.substr(1) == 'from') {
updateDataArray();
window.location.href='dialog/fck_image.html?create';
return ;
}
-
+
if ( oLink )
oLink.href = sUri ;
else
{
oLink = oEditor.FCK.CreateLink( sUri ) ;
if ( ! oLink )
return true ;
}
if( GetE('cmbTarget').value != 'popup' )
SetAttribute( oLink, 'target', GetE('cmbTarget').value ) ;
else
SetAttribute( oLink, 'target', null ) ;
if (GetE('txtAlt')) {
SetAttribute( oLink, 'alt', GetE('txtAlt').value) ;
SetAttribute( oLink, 'title', GetE('txtAlt').value) ;
}
SetAttribute( oLink, 'label', GetE('cmbLinkType').value)
/*
if ( oEditor.FCKBrowserInfo.IsIE )
oLink.style.cssText = GetE('txtAttStyle').value ;
else
SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
*/
return true ;
}
function show_props(obj, objName) {
var result = "";
for (var i in obj) {
result = objName + "." + i + " = " + obj[i] + " \n";
alert(result);
}
//return result;
}
function BrowseServer(field)
{
// Set the browser window feature
urlField = field;
var iWidth = oEditor.FCKConfig.ImageBrowserWindowWidth ;
var iHeight = oEditor.FCKConfig.ImageBrowserWindowHeight ;
var iLeft = (screen.width - iWidth) / 2 ;
var iTop = (screen.height - iHeight) / 2 ;
var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
sOptions += ",width=" + iWidth ;
sOptions += ",height=" + iHeight ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
// Open the browser window.
var oWindow = window.open( oEditor.FCKConfig.FilesBrowserURL, "FCKBrowseWindow", sOptions ) ;
}
function SetUrl( url, width, height, alt, fsize )
{
GetE(urlField).value = url ;
if ( alt )
GetE('txtAlt').value = alt;
}
\ No newline at end of file
Property changes on: trunk/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php
===================================================================
--- trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (revision 1973)
+++ trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (revision 1974)
@@ -1 +1 @@
-<?php /* * FCKeditor - The text editor for internet * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * File Name: commands.php * This is the File Manager Connector for ASP. * * Version: 2.0 RC3 * Modified: 2005-02-19 16:02:38 * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ function GetFolders( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; // Open the "Folders" node. echo "<Folders>" ; $oCurrentFolder = opendir( $sServerDir ) ; while ( $sFile = readdir( $oCurrentFolder ) ) { if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS' && is_dir( $sServerDir . $sFile ) ) echo '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ; } closedir( $oCurrentFolder ) ; // Close the "Folders" node. echo "</Folders>" ; } /* function GetCmsTree() { $conn = GetADODbConnection(); $query="SELECT st.* , wb.eng_content AS page_title FROM structure_templates st LEFT JOIN working_blocks AS wb ON (st.st_id = wb.template_id) AND (wb.block_type = 3) WHERE st_id != '5' AND st_path != '/cms' GROUP BY st_id ORDER BY st_lastupdate desc"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $ret = "<CmsPages>"; while($rs && !$rs->EOF) { $ret.= '<CmsPage path="'.BASE_PATH.'/index.php?t='.$rs->fields['st_path'].'" title="'.$rs->fields['page_title'].'" />'; //echo $rs->fields['page_title']."<br>"; $rs->MoveNext(); } $ret.= '</CmsPages>'; echo $ret; } } */ function GetCmsTree() { global $Config; $ret = "<CmsPages>"; if (isset($Config['K4Mode'])) { $ret.= K4ReadCmsTree(0); } else { $ret.= ReadCmsTree(0); } $ret.= "</CmsPages>"; echo $ret; } function K4ReadCmsTree($cat_id, $level = 0) { $application =& kApplication::Instance(); $application->Init(); $query = 'SELECT Path, Title FROM '.TABLE_PREFIX.'Pages'; $pages = $application->DB->Query($query); $res = ''; foreach ($pages as $page) { $page_path = $page['Path'].'.html'; $title = $page['Title'].' ('.$page_path.')'; $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($title,ENT_QUOTES).'" serverpath="'.BASE_PATH.'/" />'; } return $res; } function ReadCmsTree($st_id, $level = 0) { $conn = GetADODbConnection(); $query = "SELECT value FROM config WHERE name = 'cms_direct_mode'"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $cms_mode = $rs->fields['value']; } $query = "SELECT value FROM config WHERE name = 'email_templates_folder_id'"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $email_templates_folder_id = $rs->fields['value']; } if ( $email_templates_folder_id == "" ) $email_templates_folder_id = 0; if ( $cms_mode == 1 ) { $query = " SELECT st.*, IF(lb.eng_content='' OR lb.eng_content IS NULL, st.st_path, lb.eng_content ) AS page_title FROM structure_templates AS st LEFT JOIN live_blocks AS lb ON (st.st_id = lb.template_id) AND (lb.block_type = 3) WHERE st.st_parent_id = ".$st_id." AND st_id != ".$email_templates_folder_id." AND st_path != '/cms' ORDER BY st.st_order"; } else { $query = " SELECT st.*, IF(wb.eng_content='' OR wb.eng_content IS NULL, st.st_path, wb.eng_content ) AS page_title FROM structure_templates AS st LEFT JOIN working_blocks AS wb ON (st.st_id = wb.template_id) AND (wb.block_type = 3) WHERE st.st_parent_id = ".$st_id." AND st_id != ".$email_templates_folder_id." AND st_path != '/cms%' ORDER BY st.st_order"; } //echo $query." <br>"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { while ($rs && !$rs->EOF) { $page_path = ltrim($rs->fields['st_path'], '/'); //$page_path = SERVER_NAME.BASE_PATH.'/index.php?t='.$page_path; //$page_path = $page_path; $prefix=''; for ($i = 0; $i < $level; $i++) $prefix .= '--'; if ($level > 0) $prefix=$prefix.'- '; $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($rs->fields['page_title'],ENT_QUOTES).'" serverpath="'.BASE_PATH.'/index.php?t=" />'; $res .= ReadCmsTree($rs->fields['st_id'], $level+1); $rs->MoveNext(); } return $res; } } function GetFoldersAndFiles( $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>' ; $oCurrentFolder = opendir( $sServerDir ) ; while ( $sFile = readdir( $oCurrentFolder ) ) { if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS') { if ( is_dir( $sServerDir . $sFile ) ) $sFolders .= '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ; else { $iFileSize = filesize( $sServerDir . $sFile ) ; if ( $iFileSize > 0 ) { $iFileSize = round( $iFileSize / 1024 ) ; if ( $iFileSize < 1 ) $iFileSize = 1 ; } $sFiles .= '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ; } } } echo $sFolders ; // Close the "Folders" node. echo '</Folders>' ; echo $sFiles ; // Close the "Files" node. echo '</Files>' ; } function CreateFolder( $resourceType, $currentFolder ) { $sErrorNumber = '0' ; $sErrorMsg = '' ; if ( isset( $_GET['NewFolderName'] ) ) { $sNewFolderName = $_GET['NewFolderName'] ; // Map the virtual path to the local server path of the current folder. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; if ( is_writable( $sServerDir ) ) { $sServerDir .= $sNewFolderName ; $sErrorMsg = CreateServerFolder( $sServerDir ) ; switch ( $sErrorMsg ) { case '' : $sErrorNumber = '0' ; break ; case 'Invalid argument' : case 'No such file or directory' : $sErrorNumber = '102' ; // Path too long. break ; default : $sErrorNumber = '110' ; break ; } } else $sErrorNumber = '103' ; } else $sErrorNumber = '102' ; // Create the "Error" node. echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ; } function FileUpload( $resourceType, $currentFolder ) { $sErrorNumber = '0' ; $sFileName = '' ; if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) ) { $oFile = $_FILES['NewFile'] ; // Map the virtual path to the local server path. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; // Get the uploaded file name. $sFileName = $oFile['name'] ; $sOriginalFileName = $sFileName ; $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; global $Config ; $arAllowed = $Config['AllowedExtensions'][$resourceType] ; $arDenied = $Config['DeniedExtensions'][$resourceType] ; if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) { $iCounter = 0 ; while ( true ) { $sFilePath = $sServerDir . $sFileName ; if ( is_file( $sFilePath ) ) { $iCounter++ ; $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; $sErrorNumber = '201' ; } else { move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; if ( is_file( $sFilePath ) ) { $oldumask = umask(0) ; chmod( $sFilePath, 0777 ) ; umask( $oldumask ) ; } break ; } } } else $sErrorNumber = '202' ; } else $sErrorNumber = '202' ; echo '<script type="text/javascript">' ; echo 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . str_replace( '"', '\\"', $sFileName ) . '") ;' ; echo '</script>' ; exit ; } ?>
\ No newline at end of file
+<?php /* * FCKeditor - The text editor for internet * Copyright (C) 2003-2004 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * File Name: commands.php * This is the File Manager Connector for ASP. * * Version: 2.0 RC3 * Modified: 2005-02-19 16:02:38 * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ function GetFolders( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; // Open the "Folders" node. echo "<Folders>" ; $oCurrentFolder = opendir( $sServerDir ) ; while ( $sFile = readdir( $oCurrentFolder ) ) { if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS' && is_dir( $sServerDir . $sFile ) ) echo '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ; } closedir( $oCurrentFolder ) ; // Close the "Folders" node. echo "</Folders>" ; } /* function GetCmsTree() { $conn = GetADODbConnection(); $query="SELECT st.* , wb.eng_content AS page_title FROM structure_templates st LEFT JOIN working_blocks AS wb ON (st.st_id = wb.template_id) AND (wb.block_type = 3) WHERE st_id != '5' AND st_path != '/cms' GROUP BY st_id ORDER BY st_lastupdate desc"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $ret = "<CmsPages>"; while($rs && !$rs->EOF) { $ret.= '<CmsPage path="'.BASE_PATH.'/index.php?t='.$rs->fields['st_path'].'" title="'.$rs->fields['page_title'].'" />'; //echo $rs->fields['page_title']."<br>"; $rs->MoveNext(); } $ret.= '</CmsPages>'; echo $ret; } } */ function GetCmsTree() { global $Config; $ret = "<CmsPages>"; if (isset($Config['K4Mode'])) { $ret.= K4ReadCmsTree(0); } else { $ret.= ReadCmsTree(0); } $ret.= "</CmsPages>"; echo $ret; } function K4ReadCmsTree($cat_id, $level = 0) { $application =& kApplication::Instance(); $application->Init(); $query = 'SELECT Path, Title FROM '.TABLE_PREFIX.'Pages'; $pages = $application->DB->Query($query); $res = ''; foreach ($pages as $page) { $page_path = $page['Path'].'.html'; $title = $page['Title'].' ('.$page_path.')'; $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($title,ENT_QUOTES).'" serverpath="'.BASE_PATH.'/" />'; } return $res; } function ReadCmsTree($st_id, $level = 0) { $conn = GetADODbConnection(); $query = "SELECT value FROM config WHERE name = 'cms_direct_mode'"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $cms_mode = $rs->fields['value']; } $query = "SELECT value FROM config WHERE name = 'email_templates_folder_id'"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { $email_templates_folder_id = $rs->fields['value']; } if ( $email_templates_folder_id == "" ) $email_templates_folder_id = 0; if ( $cms_mode == 1 ) { $query = " SELECT st.*, IF(lb.eng_content='' OR lb.eng_content IS NULL, st.st_path, lb.eng_content ) AS page_title FROM structure_templates AS st LEFT JOIN live_blocks AS lb ON (st.st_id = lb.template_id) AND (lb.block_type = 3) WHERE st.st_parent_id = ".$st_id." AND st_id != ".$email_templates_folder_id." AND st_path != '/cms' ORDER BY st.st_order"; } else { $query = " SELECT st.*, IF(wb.eng_content='' OR wb.eng_content IS NULL, st.st_path, wb.eng_content ) AS page_title FROM structure_templates AS st LEFT JOIN working_blocks AS wb ON (st.st_id = wb.template_id) AND (wb.block_type = 3) WHERE st.st_parent_id = ".$st_id." AND st_id != ".$email_templates_folder_id." AND st_path != '/cms%' ORDER BY st.st_order"; } //echo $query." <br>"; $rs = $conn->Execute($query); if ($rs && !$rs->EOF) { while ($rs && !$rs->EOF) { $page_path = ltrim($rs->fields['st_path'], '/'); //$page_path = SERVER_NAME.BASE_PATH.'/index.php?t='.$page_path; //$page_path = $page_path; $prefix=''; for ($i = 0; $i < $level; $i++) $prefix .= '--'; if ($level > 0) $prefix=$prefix.'- '; $res .= '<CmsPage path="'.$page_path.'" title="'.$prefix.htmlspecialchars($rs->fields['page_title'],ENT_QUOTES).'" st_id="'.$rs->fields['st_id'].'" serverpath="'.BASE_PATH.'/index.php?t=" />'; $res .= ReadCmsTree($rs->fields['st_id'], $level+1); $rs->MoveNext(); } return $res; } } function GetFoldersAndFiles( $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>' ; $oCurrentFolder = opendir( $sServerDir ) ; while ( $sFile = readdir( $oCurrentFolder ) ) { if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS') { if ( is_dir( $sServerDir . $sFile ) ) $sFolders .= '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ; else { $iFileSize = filesize( $sServerDir . $sFile ) ; if ( $iFileSize > 0 ) { $iFileSize = round( $iFileSize / 1024 ) ; if ( $iFileSize < 1 ) $iFileSize = 1 ; } $sFiles .= '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ; } } } echo $sFolders ; // Close the "Folders" node. echo '</Folders>' ; echo $sFiles ; // Close the "Files" node. echo '</Files>' ; } function CreateFolder( $resourceType, $currentFolder ) { $sErrorNumber = '0' ; $sErrorMsg = '' ; if ( isset( $_GET['NewFolderName'] ) ) { $sNewFolderName = $_GET['NewFolderName'] ; // Map the virtual path to the local server path of the current folder. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; if ( is_writable( $sServerDir ) ) { $sServerDir .= $sNewFolderName ; $sErrorMsg = CreateServerFolder( $sServerDir ) ; switch ( $sErrorMsg ) { case '' : $sErrorNumber = '0' ; break ; case 'Invalid argument' : case 'No such file or directory' : $sErrorNumber = '102' ; // Path too long. break ; default : $sErrorNumber = '110' ; break ; } } else $sErrorNumber = '103' ; } else $sErrorNumber = '102' ; // Create the "Error" node. echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ; } function FileUpload( $resourceType, $currentFolder ) { $sErrorNumber = '0' ; $sFileName = '' ; if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) ) { $oFile = $_FILES['NewFile'] ; // Map the virtual path to the local server path. $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; // Get the uploaded file name. $sFileName = $oFile['name'] ; $sOriginalFileName = $sFileName ; $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; global $Config ; $arAllowed = $Config['AllowedExtensions'][$resourceType] ; $arDenied = $Config['DeniedExtensions'][$resourceType] ; if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) { $iCounter = 0 ; while ( true ) { $sFilePath = $sServerDir . $sFileName ; if ( is_file( $sFilePath ) ) { $iCounter++ ; $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; $sErrorNumber = '201' ; } else { move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; if ( is_file( $sFilePath ) ) { $oldumask = umask(0) ; chmod( $sFilePath, 0777 ) ; umask( $oldumask ) ; } break ; } } } else $sErrorNumber = '202' ; } else $sErrorNumber = '202' ; echo '<script type="text/javascript">' ; echo 'window.parent.frames["frmUpload"].OnUploadCompleted(' . $sErrorNumber . ',"' . str_replace( '"', '\\"', $sFileName ) . '") ;' ; echo '</script>' ; exit ; } ?>
\ No newline at end of file
Property changes on: trunk/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/admin/editor/cmseditor/editor/fckeditor.html
===================================================================
--- trunk/admin/editor/cmseditor/editor/fckeditor.html (revision 1973)
+++ trunk/admin/editor/cmseditor/editor/fckeditor.html (revision 1974)
@@ -1,61 +1,75 @@
-<!--
+<!--
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
- * File Name: fckeditor.html
+ * File Name: fckeditor.original.html
* Main page that holds the editor.
*
+ * Version: 2.0 RC3
+ * Modified: 2005-03-02 10:54:21
+ *
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FCKeditor</title>
+ <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <!-- @Packager.RemoveLine -->
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="lang/fcklanguagemanager.js"></script>
+ <!-- @Packager.RemoveLine
<meta http-equiv="Cache-Control" content="public">
+ @Packager.RemoveLine -->
+ <!-- @Packager.Remove.Start -->
+ <script type="text/javascript" src="_source/internals/fckcoreextensions.js"></script>
+ <script type="text/javascript" src="_source/globals/fck_constants.js"></script>
+ <script type="text/javascript" src="_source/internals/fckbrowserinfo.js"></script>
+ <script type="text/javascript" src="_source/internals/fckscriptloader.js"></script>
+ <script type="text/javascript" src="_source/internals/fckurlparams.js"></script>
+ <script type="text/javascript" src="_source/internals/fck.js"></script>
+ <script type="text/javascript" src="_source/internals/fckconfig.js"></script>
+ <script type="text/javascript" src="_source/globals/fckeditorapi.js"></script>
+ <script type="text/javascript" src="_source/internals/fck_onload.js"></script>
+ <!-- @Packager.Remove.End -->
+ <!-- @Packager.RemoveLine
<script type="text/javascript" src="js/fck_startup.js"></script>
+ @Packager.RemoveLine -->
</head>
<body>
<table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" style="TABLE-LAYOUT: fixed">
<tr>
<td unselectable="on" style="OVERFLOW: hidden">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr id="Collapsed" style="DISPLAY: none">
<td id="ExpandHandle" class="TB_Expand" unselectable="on" colspan="3" onclick="FCKToolbarSet.Expand();return false;"><img class="TB_ExpandImg" src="images/spacer.gif" width="8" height="4" unselectable="on"></td>
</tr>
<tr id="Expanded" style="DISPLAY: none">
<td id="CollapseHandle" style="DISPLAY: none" class="TB_Collapse"
unselectable="on" valign="bottom" onclick="FCKToolbarSet.Collapse();return false;"><img class="TB_CollapseImg" src="images/spacer.gif" width="8" height="4" unselectable="on"></td>
<td id="eToolbar" class="TB_ToolbarSet" unselectable="on"></td>
<td width="1" style="BACKGROUND-COLOR: #696969"></td>
</tr>
</table>
</td>
</tr>
<tr id="eWysiwyg">
<td id="eWysiwygCell" height="100%" valign="top">
- <iframe id="eEditorArea" class='defaulttext' name="eEditorArea" height="100%" width="100%" frameborder="no" src="fckblank.html"></iframe>
+ <iframe id="eEditorArea" name="eEditorArea" height="100%" width="100%" frameborder="no" src="fckeditorarea.html"></iframe>
</td>
</tr>
<tr id="eSource" style="DISPLAY: none">
<td class="Source" height="100%" valign="top">
- <span style="font-size: 8pt; font-family: arial,verdana,sans-serif; color: #AA0000;">
- <span style="color: #FF0000;">You are in HTML mode. Use the [Source] button to switch back to WYSIWYG mode.</span><br>
- Please note that incorrect or invalid HTML may break the web site's layout or produce undesirable results.
- This mode should be utilized only by expert users. Intechnic Corporation assumes no responsibility for problems caused by incorrect modifications of the HTML code.
- </span><hr>
- <textarea id="eSourceField" dir="ltr" style="WIDTH: 100%; HEIGHT: 82%"></textarea>
+ <textarea id="eSourceField" dir="ltr" style="WIDTH: 100%; HEIGHT: 100%"></textarea>
</td>
</tr>
</table>
</body>
</html>
Property changes on: trunk/admin/editor/cmseditor/editor/fckeditor.html
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property

Event Timeline