Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
392 jpm 1
<?php 
/*
2
 * FCKeditor - The text editor for internet
3
 * Copyright (C) 2003-2005 Frederico Caldeira Knabben
4
 *
5
 * Licensed under the terms of the GNU Lesser General Public License:
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
7
 *
8
 * For further information visit:
9
 * 		http://www.fckeditor.net/
10
 *
11
 * File Name: fckeditor.php
12
 * 	This is the integration file for PHP.
13
 *
14
 * 	It defines the FCKeditor class that can be used to create editor
15
 * 	instances in PHP pages on server side.
16
 *
17
 * File Authors:
18
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
19
 */
20
21
 
22
{
23
	var $InstanceName ;
24
	var $BasePath ;
25
	var $Width ;
26
	var $Height ;
27
	var $ToolbarSet ;
28
	var $Value ;
29
	var $Config ;
30
31
 
32
	{
33
		$this->InstanceName	= $instanceName ;
34
		$this->BasePath		= '/FCKeditor/' ;
35
		$this->Width		= '100%' ;
36
		$this->Height		= '200' ;
37
		$this->ToolbarSet	= 'Default' ;
38
		$this->Value		= '' ;
39
40
 
41
	}
42
43
 
44
	{
45
		echo $this->CreateHtml() ;
46
	}
47
48
 
49
	{
50
		$HtmlValue = htmlspecialchars( $this->Value ) ;
51
52
 
53
54
 
55
		{
56
			$Link = "{$this->BasePath}editor/fckeditor.html?InstanceName={$this->InstanceName}" ;
57
58
 
59
				$Link .= "&amp;Toolbar={$this->ToolbarSet}" ;
60
61
 
62
			$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" />" ;
63
64
 
65
			$Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" />" ;
66
67
 
68
			$Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"no\" scrolling=\"no\"></iframe>" ;
69
		}
70
		else
71
		{
72
			if ( strpos( $this->Width, '%' ) === false )
73
				$WidthCSS = $this->Width . 'px' ;
74
			else
75
				$WidthCSS = $this->Width ;
76
77
 
78
				$HeightCSS = $this->Height . 'px' ;
79
			else
80
				$HeightCSS = $this->Height ;
81
82
 
83
		}
84
85
 
86
87
 
88
	}
89
90
 
91
	{
92
		global $HTTP_USER_AGENT ;
93
94
 
95
			$sAgent = $HTTP_USER_AGENT ;
96
		else
97
			$sAgent = $_SERVER['HTTP_USER_AGENT'] ;
98
99
 
100
		{
101
			$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
102
			return ($iVersion >= 5.5) ;
103
		}
104
		else if ( strpos($sAgent, 'Gecko/') !== false )
105
		{
106
			$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
107
			return ($iVersion >= 20030210) ;
108
		}
109
		else
110
			return false ;
111
	}
112
113
 
114
	{
115
		$sParams = '' ;
116
		$bFirst = true ;
117
118
 
119
		{
120
			if ( $bFirst == false )
121
				$sParams .= '&amp;' ;
122
			else
123
				$bFirst = false ;
124
125
 
126
				$sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
127
			else if ( $sValue === false )
128
				$sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
129
			else
130
				$sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
131
		}
132
133
 
134
	}
135
136
 
137
	{
138
		$chars = array(
139
			'&' => '%26',
140
			'=' => '%3D',
141
			'"' => '%22' ) ;
142
143
 
144
	}
145
}
146
147