Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1949778
fckeditor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Oct 29, 7:34 AM
Size
2 KB
Mime Type
text/x-php
Expires
Sat, Oct 31, 7:34 AM (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
963546
Attached To
rINP In-Portal
fckeditor.php
View Options
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003 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 go to http://www.fredck.com/FCKeditor/
* or contact fckeditor@fredck.com.
*
* fckeditor.php: PHP pages integration.
*
* Authors:
* Frederico Caldeira Knabben (fckeditor@fredck.com)
*/
// The editor base path
// You have to update it with you web site configuration
// new startup: begin
define
(
'REL_PATH'
,
'admin/editor/FCKEditor'
);
$relation_level
=
count
(
explode
(
'/'
,
REL_PATH
)
);
define
(
'FULL_PATH'
,
realpath
(
dirname
(
__FILE__
)
.
str_repeat
(
'/..'
,
$relation_level
)
)
);
require_once
FULL_PATH
.
'/kernel/startup.php'
;
// new startup: end
//echo $pathtoroot;
$FCKeditorBasePath
=
$rootURL
.
$admin
.
"/editor/FCKeditor/"
;
class
FCKeditor
{
var
$ToolbarSet
;
var
$Value
;
var
$CanUpload
;
var
$CanBrowse
;
function
FCKeditor
()
{
$this
->
ToolbarSet
=
''
;
$this
->
Value
=
''
;
$this
->
CanUpload
=
'none'
;
$this
->
CanBrowse
=
'none'
;
}
function
CreateFCKeditor
(
$instanceName
,
$width
,
$height
)
{
echo
$this
->
ReturnFCKeditor
(
$instanceName
,
$width
,
$height
)
;
}
function
ReturnFCKeditor
(
$instanceName
,
$width
,
$height
)
{
// $grstr = htmlentities( $this->Value ) ;
$grstr
=
htmlspecialchars
(
$this
->
Value
)
;
$strEditor
=
""
;
if
(
$this
->
IsCompatible
()
)
{
global
$FCKeditorBasePath
;
$sLink
=
$FCKeditorBasePath
.
"fckeditor.html?FieldName=$instanceName"
;
if
(
$this
->
ToolbarSet
!=
''
)
$sLink
=
$sLink
.
"&Toolbar=$this->ToolbarSet"
;
if
(
$this
->
CanUpload
!=
'none'
)
{
if
(
$this
->
CanUpload
==
true
)
$sLink
=
$sLink
.
"&Upload=true"
;
else
$sLink
=
$sLink
.
"&Upload=false"
;
}
if
(
$this
->
CanBrowse
!=
'none'
)
{
if
(
$this
->
CanBrowse
==
true
)
$sLink
=
$sLink
.
"&Browse=true"
;
else
$sLink
=
$sLink
.
"&Browse=false"
;
}
$strEditor
.=
"<IFRAME src=
\"
$sLink
\"
width=
\"
$width
\"
height=
\"
$height
\"
frameborder=
\"
no
\"
scrolling=
\"
no
\"
></IFRAME>"
;
$strEditor
.=
"<INPUT type=
\"
hidden
\"
id=
\"
$instanceName
\"
name=
\"
$instanceName
\"
value=
\"
$grstr
\"
>"
;
}
else
{
$strEditor
.=
"<TEXTAREA id=
\"
$instanceName
\"
name=
\"
$instanceName
\"
rows=
\"
4
\"
cols=
\"
40
\"
style=
\"
WIDTH: $width; HEIGHT: $height
\"
wrap=
\"
virtual
\"
>$grstr</TEXTAREA>"
;
}
return
$strEditor
;
}
function
IsCompatible
()
{
$sAgent
=
$_SERVER
[
'HTTP_USER_AGENT'
]
;
if
(
is_integer
(
strpos
(
$sAgent
,
'MSIE'
)
)
&&
is_integer
(
strpos
(
$sAgent
,
'Windows'
)
)
&&
!
is_integer
(
strpos
(
$sAgent
,
'Opera'
)
)
)
{
$iVersion
=
(
int
)
substr
(
$sAgent
,
strpos
(
$sAgent
,
'MSIE'
)
+
5
,
1
)
;
return
(
$iVersion
>=
5
)
;
}
else
{
return
FALSE
;
}
}
}
?>
Event Timeline
Log In to Comment