Project

General

Profile

« Previous | Next » 

Revision 816

Added by doc about 16 years ago

Added the latest FCKEditor v2.60

View differences:

trunk/CHANGELOG
14 14
07-Apr-2008 Matthias Gallas
15 15
#	fixed error in german laguage file
16 16
07-Apr-2008 Christian Sommer
17
+	added the latest FCKEditor v2.60
17 18
-	removed the outdated FCKEditor v2.51
18 19
!	set version from 2.7 (RC3) to 2.7 (RC3a)
19 20
07-Apr-2008 Thomas Hornik
trunk/wb/modules/fckeditor/class.cssparser.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
/*
27
 * Class to parse css information.
28
 *
29
 * See the readme file : http://www.phpclasses.org/browse/file/4685.html
30
 *
31
 * $Id: class.cssparser.php 559 2008-01-18 19:12:51Z Ruebenwurzel $
32
 *
33
 * @author http://www.phpclasses.org/browse/package/1289.html
34
 * @package PhpGedView
35
 * @subpackage Charts
36
 *
37
 * added function GetXML to the cssparser class (Christian Sommer, 2007)
38
 *
39
 */
40

  
41
class cssparser {
42
	var $css;
43
	var $html;
44
  
45
	function cssparser($html = true) {
46
		// Register "destructor"
47
		register_shutdown_function(array(&$this, "finalize"));
48
		$this->html = ($html != false);
49
		$this->Clear();
50
	}
51
  
52
	function finalize() {
53
		unset($this->css);
54
	}
55
  
56
	function Clear() {
57
		unset($this->css);
58
		$this->css = array();
59
		if($this->html) {
60
			$this->Add("ADDRESS", "");
61
			$this->Add("APPLET", "");
62
			$this->Add("AREA", "");
63
			$this->Add("A", "");
64
			$this->Add("A:visited", "");
65
			$this->Add("BASE", "");
66
			$this->Add("BASEFONT", "");
67
			$this->Add("BIG", "");
68
			$this->Add("BLOCKQUOTE", "");
69
			$this->Add("BODY", "");
70
			$this->Add("BR", "");
71
			$this->Add("B", "");
72
			$this->Add("CAPTION", "");
73
			$this->Add("CENTER", "");
74
			$this->Add("CITE", "");
75
			$this->Add("CODE", "");
76
			$this->Add("DD", "");
77
			$this->Add("DFN", "");
78
			$this->Add("DIR", "");
79
			$this->Add("DIV", "");
80
			$this->Add("DL", "");
81
			$this->Add("DT", "");
82
			$this->Add("EM", "");
83
			$this->Add("FONT", "");
84
			$this->Add("FORM", "");
85
			$this->Add("H1", "");
86
			$this->Add("H2", "");
87
			$this->Add("H3", "");
88
			$this->Add("H4", "");
89
			$this->Add("H5", "");
90
			$this->Add("H6", "");
91
			$this->Add("HEAD", "");
92
			$this->Add("HR", "");
93
			$this->Add("HTML", "");
94
			$this->Add("IMG", "");
95
			$this->Add("INPUT", "");
96
			$this->Add("ISINDEX", "");
97
			$this->Add("I", "");
98
			$this->Add("KBD", "");
99
			$this->Add("LINK", "");
100
			$this->Add("LI", "");
101
			$this->Add("MAP", "");
102
			$this->Add("MENU", "");
103
			$this->Add("META", "");
104
			$this->Add("OL", "");
105
			$this->Add("OPTION", "");
106
			$this->Add("PARAM", "");
107
			$this->Add("PRE", "");
108
			$this->Add("P", "");
109
			$this->Add("SAMP", "");
110
			$this->Add("SCRIPT", "");
111
			$this->Add("SELECT", "");
112
			$this->Add("SMALL", "");
113
			$this->Add("STRIKE", "");
114
			$this->Add("STRONG", "");
115
			$this->Add("STYLE", "");
116
			$this->Add("SUB", "");
117
			$this->Add("SUP", "");
118
			$this->Add("TABLE", "");
119
			$this->Add("TD", "");
120
			$this->Add("TEXTAREA", "");
121
			$this->Add("TH", "");
122
			$this->Add("TITLE", "");
123
			$this->Add("TR", "");
124
			$this->Add("TT", "");
125
			$this->Add("UL", "");
126
			$this->Add("U", "");
127
			$this->Add("VAR", "");
128
		}
129
	}
130
  
131
	function SetHTML($html) {
132
		$this->html = ($html != false);
133
	}
134
  
135
	function Add($key, $codestr) {
136
		$key = strtolower($key);
137
		//    $codestr = strtolower($codestr);
138
		if(!isset($this->css[$key])) {
139
			$this->css[$key] = array();
140
		}
141
		$codes = explode(";",$codestr);
142
		if(count($codes) > 0) {
143
			foreach($codes as $code) {
144
				$code = trim($code);
145
				@list($codekey, $codevalue) = explode(":",$code);
146
				if(strlen($codekey) > 0) {
147
					$this->css[$key][trim($codekey)] = trim($codevalue);
148
				}
149
			}
150
		}
151
	}
152
  
153
	function Get($key, $property) {
154
		$key = strtolower($key);
155
		//    $property = strtolower($property);
156
		@list($tag, $subtag) = explode(":",$key);
157
		@list($tag, $class) = explode(".",$tag);
158
		@list($tag, $id) = explode("#",$tag);
159
		$result = "";
160
		foreach($this->css as $_tag => $value) {
161
			@list($_tag, $_subtag) = explode(":",$_tag);
162
			@list($_tag, $_class) = explode(".",$_tag);
163
			@list($_tag, $_id) = explode("#",$_tag);
164
            $tagmatch = (strcmp($tag, $_tag) == 0) | (strlen($_tag) == 0);
165
			$subtagmatch = (strcmp($subtag, $_subtag) == 0) | (strlen($_subtag) == 0);
166
			$classmatch = (strcmp($class, $_class) == 0) | (strlen($_class) == 0);
167
			$idmatch = (strcmp($id, $_id) == 0);
168
            if($tagmatch & $subtagmatch & $classmatch & $idmatch) {
169
				$temp = $_tag;
170
				if((strlen($temp) > 0) & (strlen($_class) > 0)) {
171
					$temp .= ".".$_class;
172
				}
173
				elseif(strlen($temp) == 0) {
174
					$temp = ".".$_class;
175
				}
176
				if((strlen($temp) > 0) & (strlen($_subtag) > 0)) {
177
					$temp .= ":".$_subtag;
178
				}
179
				elseif(strlen($temp) == 0) {
180
					$temp = ":".$_subtag;
181
				}
182
				if(isset($this->css[$temp][$property])) {
183
					$result = $this->css[$temp][$property];
184
				}
185
			}
186
		}
187
		return $result;
188
	}
189
  
190
	function GetSection($key) {
191
		$key = strtolower($key);
192
        @list($tag, $subtag) = explode(":",$key);
193
		@list($tag, $class) = explode(".",$tag);
194
		@list($tag, $id) = explode("#",$tag);
195
		$result = array();
196
		foreach($this->css as $_tag => $value) {
197
			@list($_tag, $_subtag) = explode(":",$_tag);
198
			@list($_tag, $_class) = explode(".",$_tag);
199
			@list($_tag, $_id) = explode("#",$_tag);
200
			$tagmatch = (strcmp($tag, $_tag) == 0) | (strlen($_tag) == 0);
201
			$subtagmatch = (strcmp($subtag, $_subtag) == 0) | (strlen($_subtag) == 0);
202
			$classmatch = (strcmp($class, $_class) == 0) | (strlen($_class) == 0);
203
			$idmatch = (strcmp($id, $_id) == 0);
204
			if($tagmatch & $subtagmatch & $classmatch & $idmatch) {
205
				$temp = $_tag;
206
				if((strlen($temp) > 0) & (strlen($_class) > 0)) {
207
					$temp .= ".".$_class;
208
				}
209
				elseif(strlen($temp) == 0) {
210
					$temp = ".".$_class;
211
				}
212
				if((strlen($temp) > 0) & (strlen($_subtag) > 0)) {
213
					$temp .= ":".$_subtag;
214
				}
215
				elseif(strlen($temp) == 0) {
216
					$temp = ":".$_subtag;
217
				}	
218
				foreach($this->css[$temp] as $property => $value) {
219
					$result[$property] = $value;
220
				}
221
			}
222
		}
223
		return $result;
224
	}
225
  
226
	function ParseStr($str) {
227
		$this->Clear();
228
		// Remove comments
229
		$str = preg_replace("/\/\*(.*)?\*\//Usi", "", $str);
230
		// Parse this damn csscode
231
		$parts = explode("}",$str);
232
		if(count($parts) > 0) {
233
			foreach($parts as $part) {
234
				@list($keystr,$codestr) = explode("{",$part);
235
				$keys = explode(",",trim($keystr));
236
				if(count($keys) > 0) {
237
					foreach($keys as $key) {
238
						if(strlen($key) > 0) {
239
							$key = str_replace("\n", "", $key);
240
							$key = str_replace("\\", "", $key);
241
							$this->Add($key, trim($codestr));
242
						}
243
					}
244
				}
245
			}
246
		}
247
		//
248
		return (count($this->css) > 0);
249
	}
250
  
251
	function Parse($filename) {
252
		$this->Clear();
253
		if(file_exists($filename)) {
254
			return $this->ParseStr(file_get_contents($filename));
255
		}
256
		else {
257
			return false;
258
		}
259
	}
260
	
261
	function GetCSS() {
262
		$result = "";
263
		foreach($this->css as $key => $values) {
264
			$result .= $key." {\n";
265
			foreach($values as $key => $value) {
266
				$result .= "  $key: $value;\n";
267
			}
268
			$result .= "}\n\n";
269
		}
270
		return $result;
271
	}
272

  
273
	function GetXML() {
274
		// Construction of "fckstyles.xml" for FCKeditor
275
		$styles = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"."\n";
276
		$styles .= '<Styles>'."\n";
277
		foreach ($this->css as $key => $value) {
278
			// skip all CSS that are a combination of CSS
279
			// skip CSS that are binded on an EVENT
280
			if (strpos($key, " ") === false && strpos($key, ":") === false) {
281
				$pieces = explode(".", $key, 2);
282
				if (strcmp($pieces[0], "") != 0) {
283
					continue;
284
				} else {
285
					$style_elem = "span";
286
				}
287
				if (strcmp($pieces[1], "") != 0) {
288
					$style_class_name = $pieces[1];
289
				} else {
290
					$style_class_name = $pieces[0];
291
				}
292
				$styles .= '<Style name="'.$style_class_name.'" element="'.$style_elem.'"';
293
				if (strcmp($style_class_name, $style_elem) != 0) {
294
					$styles .= '>'."\n".'<Attribute name="class" value="'.$style_class_name.'" />'."\n".'</Style>'."\n";
295
				} else {
296
					$styles .= '/>'."\n";
297
				}
298
			}
299
		}
300
		$styles .= '</Styles>'."\n";
301
		return trim($styles);
302
	}
303
}
304
?>
trunk/wb/modules/fckeditor/uninstall.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// Must include code to stop this file being access directly
27
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
28

  
29
// Delete the editor directory
30
rm_full_dir(WB_PATH.'/modules/fckeditor/fckeditor');
31

  
32
?>
trunk/wb/modules/fckeditor/css_to_xml.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
require_once('../../config.php');
27

  
28
if(isset($_GET['template_name'])) {
29
	$temp_name = $_GET['template_name'];
30
	// check if specified template exists
31
	if(file_exists(WB_PATH .'/templates/' .$temp_name)) {
32
		// parse the editor.css and write XML output
33
		require_once(WB_PATH .'/modules/fckeditor/class.cssparser.php');
34
		$cssparser = new cssparser();
35
		$cssparser->Parse(WB_PATH .'/templates/' .$temp_name .'/editor.css');
36
		header('Content-type: text/xml'); 
37
		echo $cssparser->GetXML();
38
	}
39
}
40
?>
trunk/wb/modules/fckeditor/info.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
 -----------------------------------------------------------------------------------------------------------
25
  FCKEditor module for Website Baker v2.6.x
26
  Authors: P. Widlund, S. Braunewell, M. Gallas (ruebenwurzel), Wouldlouper, C. Sommer (doc)
27
	Started to track applied changes in info.php from 27.03.2007 onwards (cs)
28
 -----------------------------------------------------------------------------------------------------------
29
	
30
	v2.84 (doc.. Christian Sommer; Apr 7, 2008)
31
		+ update to FCKEditor release v2.6
32
	
33
	v2.83 (doc.. Christian Sommer; Mar 12, 2008)
34
		+ added the WB home folder fix found by the forum member spawnferkel
35
			(see forum thread: http://forum.websitebaker2.org/index.php/topic,8978.msg53107.html#msg53107)
36
		+ defined <strong> and <em> instead of <b> and <i> per default
37
	
38
	v2.82 (doc.. Christian Sommer; Feb 20, 2008)
39
		+ added the connector fix found by the forum member Luisehahne
40
		(see forum thread: http://forum.websitebaker2.org/index.php/topic,8240.msg51675.html#msg51675)
41

  
42
	v2.81 (ruebenwurzel.. Matthias Gallas; Dez 24, 2007)
43
		+ update to FCKEditor release v2.51
44
	
45
	v2.80 (doc.. Christian Sommer; Dec 05, 2007)
46
		+ update to FCKEditor release v2.50 (according to the developers, the most important release since v2.0)
47
		+ entire PHP connector stuff rewritten from scratch
48
		+ permissions to view media, upload files and to create folders are now controlled by WB group access rights 
49
		+ included WBLinkPlugin fix from melisa (http://forum.websitebaker.org/index.php/topic,1670.msg45948.html#msg45948)
50
		  (Note: removed text field to specify the link title; function creates errors in IE and seems not to work in FF either)
51
		+ added text file "CHANGELOG" which contains all changes since Mar 27, 2007
52

  
53
	v2.77 (doc.. Christian Sommer; Oct 30, 2007)
54
		+ re-introduced fix from v2.74a to solve issues with wb_fcktemplates.xml
55
		
56
	v2.76 (doc.. Christian Sommer; Oct 29, 2007)
57
		+ v2.75 was released as hotfix to prevent major damage to WB hosted sites using FCKEditor
58
		  (users loged in the WB backend can upload files and create folders regardless of their WB permissions)
59
		+ the following additional security measures were applied with the v2.76 release:
60
			o possibility to upload files / create folders via FCKEditor disabled by default
61
			o PHP connector only active for users authentificated via WB backend and permissions to view the MEDIA folder
62
			o buttons to search the server (e.g. image/flash/link browser) only enabled if user has permission to view MEDIA folder
63
			o buttons to upload files from FCKEditor always disabled (users settings will be overwritten)
64
		+ it is no longer possible to upload files or to create folder by the FCKEditor dialogues
65
		+ file uploads and creation of folders needs to be done via the WB MEDIA center
66

  
67
	v2.75 (doc.. Christian Sommer; Oct 20, 2007) HOTFIX TO PREVENT THE WORST CASE SCENARIOUS
68
		+ implemented the slightly modified security patch provided by the forum member sogua (thanks man)
69
			Note: all older versions of the FCKEditor module allow file uploads and creation of folders from any
70
			browser, no matter if you have access to the Website Baker backend or not!!!
71
			Upload of PHP files is and was not possible with earlier version. However, images, textfiles, movies...
72
			could be uploaded and overwritten within the WB /MEDIA folder.
73

  
74
   v2.7.4a (ruebenwurzel; 05.07.2007)
75
		+ fixed issue in include.php with wb_fcktemplates.xml
76
   
77
   v2.7.4 (ruebenwurzel; 14.06.2007)
78
		+ update to FCKEditor release v2.4.3
79
   
80
   v2.7.3 (ruebenwurzel; 10.04.2007)
81
		+ update to FCKEditor release v2.4.2
82
   
83
   v2.7.2 (ruebenwurzel, doc; 29.03.2007)
84
		+ update to FCKEditor release v2.4.1 (added UTF8-BOM fix from http://dev.fckeditor.net/ticket/279)
85
		+ removed two test.html files from fckeditor/editor/filemanager/browser and .../upload which could be used
86
		  to upload any files from outside to the WB media directory if the exact URL is known (thanks to Funky_MF)
87
		+ changed the following default settings in the wb_fckconfig.js files:
88
			FCKConfig.EnterMode 		= 'p';
89
   		FCKConfig.ShiftEnterMode 	= 'br';
90
   		FCKConfig.FlashBrowser = true;
91

  
92
   v2.7.1 (doc; 06.02.2007)
93
		+ fixed issues with CSS and XML handling
94
		+ moved FCK Javascript settings to external file: /wb_config/wb_fckconfig.js
95

  
96
   v2.7.0 (ruebenwurzel; 05.02.2007)
97
		+ update to FCKEditor release v2.4.0
98

  
99
	 CREDITS: 
100
	  o Thanks to tallyce for the php-connector patch which enables file upload to WB media folder
101
	  o all other members who contributed to the FCKEditor module and are not mentioned here
102
 -----------------------------------------------------------------------------------------------------------
103

  
104
*/
105

  
106
$module_directory		= 'fckeditor';
107
$module_name				= 'FCKeditor';
108
$module_function		= 'WYSIWYG';
109
$module_version			= '2.84';
110
$module_platform		= '2.6.x';
111
$module_author 			= 'Christian Sommer, P. Widlund, S. Braunewell, M. Gallas, Wouldlouper';
112
$module_license 		= 'GNU General Public License';
113
$module_description 	= 'This module allows you to edit the contents of a page using <a href="http://www.fckeditor.net/" target="_blank">FCKeditor v2.6</a>.';
114

  
115
?>
trunk/wb/modules/fckeditor/languages/index.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
header("Location: ../../../index.php");
27

  
28
?>
trunk/wb/modules/fckeditor/languages/DE.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
 -----------------------------------------------------------------------------------------
25
  DEUTSCHE SPRACHDATEI FUER DAS MODUL: FCKEDITOR
26
 -----------------------------------------------------------------------------------------
27
*/
28

  
29
// Deutsche Modulbeschreibung
30
$module_description 	= 'Dieses Modul erlaubt das bearbeiten von Seiteninhalten mit dem <a href="http://www.fckeditor.net/" target="_blank">FCKeditor v2.6</a>.';
31

  
32
?>
trunk/wb/modules/fckeditor/include.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2008, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
function reverse_htmlentities($mixed) {
27
	$mixed = str_replace(array('&gt;','&lt;','&quot;','&amp;'), array('>','<','"','&'), $mixed);
28
	return $mixed;
29
}
30

  
31
function get_template_name() {
32
	// returns the template name of the current displayed page
33
	require_once('../../config.php');
34
	require_once(WB_PATH. '/framework/class.database.php');
35

  
36
	// work out default editor.css file for FCKEditor
37
	if(file_exists(WB_PATH .'/templates/' .DEFAULT_TEMPLATE .'/editor.css')) {
38
		$fck_template_dir = DEFAULT_TEMPLATE;
39
	} else {
40
		$fck_template_dir = "none";
41
	}
42

  
43
	// check if a editor.css file exists in the specified template directory of current page
44
	if (isset($_GET["page_id"]) && (int) $_GET["page_id"] > 0) {
45
		$pageid = (int) $_GET["page_id"];
46

  
47
		// obtain template folder of current page from the database
48
		if(!isset($admin)) { 
49
			$database = new database(); 
50
		}
51
		$query_page = "SELECT template FROM " .TABLE_PREFIX ."pages WHERE page_id =$pageid"; 
52
		$pagetpl = $database->get_one($query_page);   // if empty, default template is used
53

  
54
		// check if a specific template is defined for current page
55
		if(isset($pagetpl) && $pagetpl != '') {
56
			// check if a specify editor.css file is contained in that folder
57
			if(file_exists(WB_PATH.'/templates/'.$pagetpl.'/editor.css')) {
58
				$fck_template_dir = $pagetpl;
59
			}
60
		}
61
	}
62
	return $fck_template_dir;
63
}
64

  
65
function show_wysiwyg_editor($name, $id, $content, $width, $height) {
66
	// create new FCKEditor instance
67
	require_once(WB_PATH.'/modules/fckeditor/fckeditor/fckeditor.php');
68
	$oFCKeditor = new FCKeditor($name);
69

  
70
	// set defaults (Note: custom settings defined in: "/my_config/my_fckconfig.js" instead of "/editor/fckconfig.js")
71
	$oFCKeditor->BasePath = WB_URL.'/modules/fckeditor/fckeditor/';
72
	$oFCKeditor->Config['CustomConfigurationsPath'] = WB_URL .'/modules/fckeditor/wb_config/wb_fckconfig.js';
73
	$oFCKeditor->ToolbarSet = 'WBToolbar';        // toolbar defined in my_fckconfig.js
74

  
75
	// obtain template name of current page (if empty, no editor.css files exists)
76
	$template_name = get_template_name();
77

  
78
	// work out default CSS file to be used for FCK textarea
79
	if($template_name == "none") {
80
		// no editor.css file exists in default template folder, or template folder of current page
81
		$css_file = WB_URL .'/modules/fckeditor/wb_config/wb_fckeditorarea.css';
82
	} else {
83
		// editor.css file exists in default template folder or template folder of current page
84
		$css_file = WB_URL .'/templates/' .$template_name .'/editor.css';
85
	}
86
	// set CSS file depending on $css_file
87
	$oFCKeditor->Config['EditorAreaCSS'] = $css_file;
88

  
89
	// work out settings for the FCK "Style" toolbar
90
	if ($template_name == "none") {
91
		// no custom editor.css exists, use default XML definitions
92
		$oFCKeditor->Config['StylesXmlPath'] = WB_URL.'/modules/fckeditor/wb_config/wb_fckstyles.xml';
93
	} else {
94
		// file editor.css exists in template folder, parse it and create XML definitions
95
		$oFCKeditor->Config['StylesXmlPath'] = WB_URL.'/modules/fckeditor/css_to_xml.php?template_name=' .$template_name;
96
	}
97

  
98
	// custom templates can be defined via /wb_config/wb_fcktemplates.xml
99
	if(file_exists(WB_PATH .'/modules/fckeditor/wb_config/wb_fcktemplates.xml')) {
100
		$oFCKeditor->Config['TemplatesXmlPath'] = WB_URL.'/modules/fckeditor/wb_config/wb_fcktemplates.xml';
101
	}
102

  
103
  // set required file connectors (overwrite settings which may be made in fckconfig.js or my_fckconfig.js)
104
	$connectorPath = $oFCKeditor->BasePath.'editor/filemanager/connectors/php/connector.php';
105
  $oFCKeditor->Config['LinkBrowserURL'] = $oFCKeditor->BasePath.'editor/filemanager/browser/default/browser.html?Connector='
106
		.$connectorPath;
107
  $oFCKeditor->Config['ImageBrowserURL'] = $oFCKeditor->BasePath.'editor/filemanager/browser/default/browser.html?Connector='
108
		.$connectorPath;
109
  $oFCKeditor->Config['FlashBrowserURL'] = $oFCKeditor->BasePath.'editor/filemanager/browser/default/browser.html?Connector='
110
		.$connectorPath;
111

  
112
	$oFCKeditor->Value = reverse_htmlentities($content);
113
	$oFCKeditor->Height = $height;
114
	$oFCKeditor->Create();
115
}
116

  
117
?>
trunk/wb/modules/fckeditor/fckeditor/fckeditor.php
1
<?php
2
/*
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
5
 *
6
 * == BEGIN LICENSE ==
7
 *
8
 * Licensed under the terms of any of the following licenses at your
9
 * choice:
10
 *
11
 *  - GNU General Public License Version 2 or later (the "GPL")
12
 *    http://www.gnu.org/licenses/gpl.html
13
 *
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
 *    http://www.gnu.org/licenses/lgpl.html
16
 *
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
19
 *
20
 * == END LICENSE ==
21
 *
22
 * This is the integration file for PHP (All versions).
23
 *
24
 * It loads the correct integration file based on the PHP version (avoiding
25
 * strict error messages with PHP 5).
26
 */
27

  
28
/**
29
 * Check if browser is compatible with FCKeditor.
30
 * Return true if is compatible.
31
 *
32
 * @return boolean
33
 */
34
function FCKeditor_IsCompatibleBrowser()
35
{
36
	if ( isset( $_SERVER ) ) {
37
		$sAgent = $_SERVER['HTTP_USER_AGENT'] ;
38
	}
39
	else {
40
		global $HTTP_SERVER_VARS ;
41
		if ( isset( $HTTP_SERVER_VARS ) ) {
42
			$sAgent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ;
43
		}
44
		else {
45
			global $HTTP_USER_AGENT ;
46
			$sAgent = $HTTP_USER_AGENT ;
47
		}
48
	}
49

  
50
	if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
51
	{
52
		$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
53
		return ($iVersion >= 5.5) ;
54
	}
55
	else if ( strpos($sAgent, 'Gecko/') !== false )
56
	{
57
		$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
58
		return ($iVersion >= 20030210) ;
59
	}
60
	else if ( strpos($sAgent, 'Opera/') !== false )
61
	{
62
		$fVersion = (float)substr($sAgent, strpos($sAgent, 'Opera/') + 6, 4) ;
63
		return ($fVersion >= 9.5) ;
64
	}
65
	else if ( preg_match( "|AppleWebKit/(\d+)|i", $sAgent, $matches ) )
66
	{
67
		$iVersion = $matches[1] ;
68
		return ( $matches[1] >= 522 ) ;
69
	}
70
	else
71
		return false ;
72
}
73

  
74
if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
75
	include_once( 'fckeditor_php4.php' ) ;
76
else
77
	include_once( 'fckeditor_php5.php' ) ;
trunk/wb/modules/fckeditor/fckeditor/fckpackager.xml
1
<?xml version="1.0" encoding="utf-8" ?>
2
<!--
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
5
 *
6
 * == BEGIN LICENSE ==
7
 *
8
 * Licensed under the terms of any of the following licenses at your
9
 * choice:
10
 *
11
 *  - GNU General Public License Version 2 or later (the "GPL")
12
 *    http://www.gnu.org/licenses/gpl.html
13
 *
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
 *    http://www.gnu.org/licenses/lgpl.html
16
 *
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
19
 *
20
 * == END LICENSE ==
21
 *
22
 * This is the configuration file to be used with FCKpackager to generate the
23
 * compressed code files in the "js" folder.
24
 *
25
 * Please check http://www.fckeditor.net for more info.
26
-->
27
<Package>
28
	<Header><![CDATA[/*
29
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
30
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
31
 *
32
 * == BEGIN LICENSE ==
33
 *
34
 * Licensed under the terms of any of the following licenses at your
35
 * choice:
36
 *
37
 *  - GNU General Public License Version 2 or later (the "GPL")
38
 *    http://www.gnu.org/licenses/gpl.html
39
 *
40
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
41
 *    http://www.gnu.org/licenses/lgpl.html
42
 *
43
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
44
 *    http://www.mozilla.org/MPL/MPL-1.1.html
45
 *
46
 * == END LICENSE ==
47
 *
48
 * This file has been compressed for better performance. The original source
49
 * can be found at "editor/_source".
50
 */
51
]]></Header>
52
	<Constants removeDeclaration="false">
53
		<Constant name="FCK_STATUS_NOTLOADED" value="0" />
54
		<Constant name="FCK_STATUS_ACTIVE" value="1" />
55
		<Constant name="FCK_STATUS_COMPLETE" value="2" />
56
		<Constant name="FCK_TRISTATE_OFF" value="0" />
57
		<Constant name="FCK_TRISTATE_ON" value="1" />
58
		<Constant name="FCK_TRISTATE_DISABLED" value="-1" />
59
		<Constant name="FCK_UNKNOWN" value="-9" />
60
		<Constant name="FCK_TOOLBARITEM_ONLYICON" value="0" />
61
		<Constant name="FCK_TOOLBARITEM_ONLYTEXT" value="1" />
62
		<Constant name="FCK_TOOLBARITEM_ICONTEXT" value="2" />
63
		<Constant name="FCK_EDITMODE_WYSIWYG" value="0" />
64
		<Constant name="FCK_EDITMODE_SOURCE" value="1" />
65
		<Constant name="FCK_STYLE_BLOCK" value="0" />
66
		<Constant name="FCK_STYLE_INLINE" value="1" />
67
		<Constant name="FCK_STYLE_OBJECT" value="2" />
68
	</Constants>
69
	<PackageFile path="editor/js/fckeditorcode_ie.js">
70
		<File path="editor/_source/fckconstants.js" />
71
		<File path="editor/_source/fckjscoreextensions.js" />
72
		<File path="editor/_source/classes/fckiecleanup.js" />
73
		<File path="editor/_source/internals/fckbrowserinfo.js" />
74
		<File path="editor/_source/internals/fckurlparams.js" />
75
		<File path="editor/_source/classes/fckevents.js" />
76
		<File path="editor/_source/classes/fckdataprocessor.js" />
77
		<File path="editor/_source/internals/fck.js" />
78
		<File path="editor/_source/internals/fck_ie.js" />
79
		<File path="editor/_source/internals/fckconfig.js" />
80
		<File path="editor/_source/internals/fckdebug.js" />
81
		<File path="editor/_source/internals/fckdomtools.js" />
82
		<File path="editor/_source/internals/fcktools.js" />
83
		<File path="editor/_source/internals/fcktools_ie.js" />
84
		<File path="editor/_source/fckeditorapi.js" />
85
		<File path="editor/_source/classes/fckimagepreloader.js" />
86

  
87
		<File path="editor/_source/internals/fckregexlib.js" />
88
		<File path="editor/_source/internals/fcklistslib.js" />
89
		<File path="editor/_source/internals/fcklanguagemanager.js" />
90
		<File path="editor/_source/internals/fckxhtmlentities.js" />
91
		<File path="editor/_source/internals/fckxhtml.js" />
92
		<File path="editor/_source/internals/fckxhtml_ie.js" />
93
		<File path="editor/_source/internals/fckcodeformatter.js" />
94
		<File path="editor/_source/internals/fckundo.js" />
95
		<File path="editor/_source/classes/fckeditingarea.js" />
96
		<File path="editor/_source/classes/fckkeystrokehandler.js" />
97

  
98
		<File path="editor/dtd/fck_xhtml10transitional.js" />
99
		<File path="editor/_source/classes/fckstyle.js" />
100
		<File path="editor/_source/internals/fckstyles.js" />
101

  
102
		<File path="editor/_source/internals/fcklisthandler.js" />
103
		<File path="editor/_source/classes/fckelementpath.js" />
104
		<File path="editor/_source/classes/fckdomrange.js" />
105
		<File path="editor/_source/classes/fckdomrange_ie.js" />
106
		<File path="editor/_source/classes/fckdomrangeiterator.js" />
107
		<File path="editor/_source/classes/fckdocumentfragment_ie.js" />
108
		<File path="editor/_source/classes/fckw3crange.js" />
109
		<File path="editor/_source/classes/fckenterkey.js" />
110

  
111
		<File path="editor/_source/internals/fckdocumentprocessor.js" />
112
		<File path="editor/_source/internals/fckselection.js" />
113
		<File path="editor/_source/internals/fckselection_ie.js" />
114

  
115
		<File path="editor/_source/internals/fcktablehandler.js" />
116
		<File path="editor/_source/internals/fcktablehandler_ie.js" />
117
		<File path="editor/_source/classes/fckxml.js" />
118
		<File path="editor/_source/classes/fckxml_ie.js" />
119

  
120
		<File path="editor/_source/commandclasses/fcknamedcommand.js" />
121
		<File path="editor/_source/commandclasses/fckstylecommand.js" />
122
		<File path="editor/_source/commandclasses/fck_othercommands.js" />
123
		<File path="editor/_source/commandclasses/fckshowblocks.js" />
124
		<File path="editor/_source/commandclasses/fckspellcheckcommand_ie.js" />
125
		<File path="editor/_source/commandclasses/fcktextcolorcommand.js" />
126
		<File path="editor/_source/commandclasses/fckpasteplaintextcommand.js" />
127
		<File path="editor/_source/commandclasses/fckpastewordcommand.js" />
128
		<File path="editor/_source/commandclasses/fcktablecommand.js" />
129
		<File path="editor/_source/commandclasses/fckfitwindow.js" />
130
		<File path="editor/_source/commandclasses/fcklistcommands.js" />
131
		<File path="editor/_source/commandclasses/fckjustifycommands.js" />
132
		<File path="editor/_source/commandclasses/fckindentcommands.js" />
133
		<File path="editor/_source/commandclasses/fckblockquotecommand.js" />
134
		<File path="editor/_source/commandclasses/fckcorestylecommand.js" />
135
		<File path="editor/_source/commandclasses/fckremoveformatcommand.js" />
136
		<File path="editor/_source/internals/fckcommands.js" />
137

  
138
		<File path="editor/_source/classes/fckpanel.js" />
139
		<File path="editor/_source/classes/fckicon.js" />
140
		<File path="editor/_source/classes/fcktoolbarbuttonui.js" />
141
		<File path="editor/_source/classes/fcktoolbarbutton.js" />
142
		<File path="editor/_source/classes/fckspecialcombo.js" />
143
		<File path="editor/_source/classes/fcktoolbarspecialcombo.js" />
144
		<File path="editor/_source/classes/fcktoolbarstylecombo.js" />
145
		<File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />
146
		<File path="editor/_source/classes/fcktoolbarfontscombo.js" />
147
		<File path="editor/_source/classes/fcktoolbarfontsizecombo.js" />
148
		<File path="editor/_source/classes/fcktoolbarpanelbutton.js" />
149
		<File path="editor/_source/internals/fcktoolbaritems.js" />
150
		<File path="editor/_source/classes/fcktoolbar.js" />
151
		<File path="editor/_source/classes/fcktoolbarbreak_ie.js" />
152
		<File path="editor/_source/internals/fcktoolbarset.js" />
153
		<File path="editor/_source/internals/fckdialog.js" />
154

  
155
		<File path="editor/_source/classes/fckmenuitem.js" />
156
		<File path="editor/_source/classes/fckmenublock.js" />
157
		<File path="editor/_source/classes/fckmenublockpanel.js" />
158
		<File path="editor/_source/classes/fckcontextmenu.js" />
159
		<File path="editor/_source/internals/fck_contextmenu.js" />
160
		<File path="editor/_source/classes/fckhtmliterator.js" />
161

  
162
		<File path="editor/_source/classes/fckplugin.js" />
163
		<File path="editor/_source/internals/fckplugins.js" />
164
	</PackageFile>
165

  
166
	<PackageFile path="editor/js/fckeditorcode_gecko.js">
167
		<File path="editor/_source/fckconstants.js" />
168
		<File path="editor/_source/fckjscoreextensions.js" />
169
		<File path="editor/_source/internals/fckbrowserinfo.js" />
170
		<File path="editor/_source/internals/fckurlparams.js" />
171
		<File path="editor/_source/classes/fckevents.js" />
172
		<File path="editor/_source/classes/fckdataprocessor.js" />
173
		<File path="editor/_source/internals/fck.js" />
174
		<File path="editor/_source/internals/fck_gecko.js" />
175
		<File path="editor/_source/internals/fckconfig.js" />
176
		<File path="editor/_source/internals/fckdebug.js" />
177
		<File path="editor/_source/internals/fckdomtools.js" />
178
		<File path="editor/_source/internals/fcktools.js" />
179
		<File path="editor/_source/internals/fcktools_gecko.js" />
180
		<File path="editor/_source/fckeditorapi.js" />
181
		<File path="editor/_source/classes/fckimagepreloader.js" />
182

  
183
		<File path="editor/_source/internals/fckregexlib.js" />
184
		<File path="editor/_source/internals/fcklistslib.js" />
185
		<File path="editor/_source/internals/fcklanguagemanager.js" />
186
		<File path="editor/_source/internals/fckxhtmlentities.js" />
187
		<File path="editor/_source/internals/fckxhtml.js" />
188
		<File path="editor/_source/internals/fckxhtml_gecko.js" />
189
		<File path="editor/_source/internals/fckcodeformatter.js" />
190
		<File path="editor/_source/internals/fckundo.js" />
191
		<File path="editor/_source/classes/fckeditingarea.js" />
192
		<File path="editor/_source/classes/fckkeystrokehandler.js" />
193

  
194
		<File path="editor/dtd/fck_xhtml10transitional.js" />
195
		<File path="editor/_source/classes/fckstyle.js" />
196
		<File path="editor/_source/internals/fckstyles.js" />
197

  
198
		<File path="editor/_source/internals/fcklisthandler.js" />
199
		<File path="editor/_source/classes/fckelementpath.js" />
200
		<File path="editor/_source/classes/fckdomrange.js" />
201
		<File path="editor/_source/classes/fckdomrange_gecko.js" />
202
		<File path="editor/_source/classes/fckdomrangeiterator.js" />
203
		<File path="editor/_source/classes/fckdocumentfragment_gecko.js" />
204
		<File path="editor/_source/classes/fckw3crange.js" />
205
		<File path="editor/_source/classes/fckenterkey.js" />
206

  
207
		<File path="editor/_source/internals/fckdocumentprocessor.js" />
208
		<File path="editor/_source/internals/fckselection.js" />
209
		<File path="editor/_source/internals/fckselection_gecko.js" />
210

  
211
		<File path="editor/_source/internals/fcktablehandler.js" />
212
		<File path="editor/_source/internals/fcktablehandler_gecko.js" />
213
		<File path="editor/_source/classes/fckxml.js" />
214
		<File path="editor/_source/classes/fckxml_gecko.js" />
215

  
216
		<File path="editor/_source/commandclasses/fcknamedcommand.js" />
217
		<File path="editor/_source/commandclasses/fckstylecommand.js" />
218
		<File path="editor/_source/commandclasses/fck_othercommands.js" />
219
		<File path="editor/_source/commandclasses/fckshowblocks.js" />
220
		<File path="editor/_source/commandclasses/fckspellcheckcommand_gecko.js" />
221
		<File path="editor/_source/commandclasses/fcktextcolorcommand.js" />
222
		<File path="editor/_source/commandclasses/fckpasteplaintextcommand.js" />
223
		<File path="editor/_source/commandclasses/fckpastewordcommand.js" />
224
		<File path="editor/_source/commandclasses/fcktablecommand.js" />
225
		<File path="editor/_source/commandclasses/fckfitwindow.js" />
226
		<File path="editor/_source/commandclasses/fcklistcommands.js" />
227
		<File path="editor/_source/commandclasses/fckjustifycommands.js" />
228
		<File path="editor/_source/commandclasses/fckindentcommands.js" />
229
		<File path="editor/_source/commandclasses/fckblockquotecommand.js" />
230
		<File path="editor/_source/commandclasses/fckcorestylecommand.js" />
231
		<File path="editor/_source/commandclasses/fckremoveformatcommand.js" />
232
		<File path="editor/_source/internals/fckcommands.js" />
233

  
234
		<File path="editor/_source/classes/fckpanel.js" />
235
		<File path="editor/_source/classes/fckicon.js" />
236
		<File path="editor/_source/classes/fcktoolbarbuttonui.js" />
237
		<File path="editor/_source/classes/fcktoolbarbutton.js" />
238
		<File path="editor/_source/classes/fckspecialcombo.js" />
239
		<File path="editor/_source/classes/fcktoolbarspecialcombo.js" />
240
		<File path="editor/_source/classes/fcktoolbarstylecombo.js" />
241
		<File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />
242
		<File path="editor/_source/classes/fcktoolbarfontscombo.js" />
243
		<File path="editor/_source/classes/fcktoolbarfontsizecombo.js" />
244
		<File path="editor/_source/classes/fcktoolbarpanelbutton.js" />
245
		<File path="editor/_source/internals/fcktoolbaritems.js" />
246
		<File path="editor/_source/classes/fcktoolbar.js" />
247
		<File path="editor/_source/classes/fcktoolbarbreak_gecko.js" />
248
		<File path="editor/_source/internals/fcktoolbarset.js" />
249
		<File path="editor/_source/internals/fckdialog.js" />
250

  
251
		<File path="editor/_source/classes/fckmenuitem.js" />
252
		<File path="editor/_source/classes/fckmenublock.js" />
253
		<File path="editor/_source/classes/fckmenublockpanel.js" />
254
		<File path="editor/_source/classes/fckcontextmenu.js" />
255
		<File path="editor/_source/internals/fck_contextmenu.js" />
256
		<File path="editor/_source/classes/fckhtmliterator.js" />
257

  
258
		<File path="editor/_source/classes/fckplugin.js" />
259
		<File path="editor/_source/internals/fckplugins.js" />
260
	</PackageFile>
261

  
262
</Package>
trunk/wb/modules/fckeditor/fckeditor/license.txt
1
FCKeditor - The text editor for Internet - http://www.fckeditor.net
2
Copyright (C) 2003-2008 Frederico Caldeira Knabben
3

  
4
Licensed under the terms of any of the following licenses at your
5
choice:
6

  
7
 - GNU General Public License Version 2 or later (the "GPL")
8
   http://www.gnu.org/licenses/gpl.html
9
   (See Appendix A)
10

  
11
 - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
12
   http://www.gnu.org/licenses/lgpl.html
13
   (See Appendix B)
14

  
15
 - Mozilla Public License Version 1.1 or later (the "MPL")
16
   http://www.mozilla.org/MPL/MPL-1.1.html
17
   (See Appendix C)
18

  
19
You are not required to, but if you want to explicitly declare the
20
license you have chosen to be bound to when using, reproducing,
21
modifying and distributing this software, just include a text file
22
titled "legal.txt" in your version of this software, indicating your
23
license choice. In any case, your choice will not restrict any
24
recipient of your version of this software to use, reproduce, modify
25
and distribute this software under any of the above licenses.
26

  
27
Appendix A: The GPL License
28
===========================
29

  
30
		    GNU GENERAL PUBLIC LICENSE
31
		       Version 2, June 1991
32

  
33
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
34
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35
 Everyone is permitted to copy and distribute verbatim copies
36
 of this license document, but changing it is not allowed.
37

  
38
			    Preamble
39

  
40
  The licenses for most software are designed to take away your
41
freedom to share and change it.  By contrast, the GNU General Public
42
License is intended to guarantee your freedom to share and change free
43
software--to make sure the software is free for all its users.  This
44
General Public License applies to most of the Free Software
45
Foundation's software and to any other program whose authors commit to
46
using it.  (Some other Free Software Foundation software is covered by
47
the GNU Lesser General Public License instead.)  You can apply it to
48
your programs, too.
49

  
50
  When we speak of free software, we are referring to freedom, not
51
price.  Our General Public Licenses are designed to make sure that you
52
have the freedom to distribute copies of free software (and charge for
53
this service if you wish), that you receive source code or can get it
54
if you want it, that you can change the software or use pieces of it
55
in new free programs; and that you know you can do these things.
56

  
57
  To protect your rights, we need to make restrictions that forbid
58
anyone to deny you these rights or to ask you to surrender the rights.
59
These restrictions translate to certain responsibilities for you if you
60
distribute copies of the software, or if you modify it.
61

  
62
  For example, if you distribute copies of such a program, whether
63
gratis or for a fee, you must give the recipients all the rights that
64
you have.  You must make sure that they, too, receive or can get the
65
source code.  And you must show them these terms so they know their
66
rights.
67

  
68
  We protect your rights with two steps: (1) copyright the software, and
69
(2) offer you this license which gives you legal permission to copy,
70
distribute and/or modify the software.
71

  
72
  Also, for each author's protection and ours, we want to make certain
73
that everyone understands that there is no warranty for this free
74
software.  If the software is modified by someone else and passed on, we
75
want its recipients to know that what they have is not the original, so
76
that any problems introduced by others will not reflect on the original
77
authors' reputations.
78

  
79
  Finally, any free program is threatened constantly by software
80
patents.  We wish to avoid the danger that redistributors of a free
81
program will individually obtain patent licenses, in effect making the
82
program proprietary.  To prevent this, we have made it clear that any
83
patent must be licensed for everyone's free use or not licensed at all.
84

  
85
  The precise terms and conditions for copying, distribution and
86
modification follow.
87

  
88
		    GNU GENERAL PUBLIC LICENSE
89
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
90

  
91
  0. This License applies to any program or other work which contains
92
a notice placed by the copyright holder saying it may be distributed
93
under the terms of this General Public License.  The "Program", below,
94
refers to any such program or work, and a "work based on the Program"
95
means either the Program or any derivative work under copyright law:
96
that is to say, a work containing the Program or a portion of it,
97
either verbatim or with modifications and/or translated into another
98
language.  (Hereinafter, translation is included without limitation in
99
the term "modification".)  Each licensee is addressed as "you".
100

  
101
Activities other than copying, distribution and modification are not
102
covered by this License; they are outside its scope.  The act of
103
running the Program is not restricted, and the output from the Program
104
is covered only if its contents constitute a work based on the
105
Program (independent of having been made by running the Program).
106
Whether that is true depends on what the Program does.
107

  
108
  1. You may copy and distribute verbatim copies of the Program's
109
source code as you receive it, in any medium, provided that you
110
conspicuously and appropriately publish on each copy an appropriate
111
copyright notice and disclaimer of warranty; keep intact all the
112
notices that refer to this License and to the absence of any warranty;
113
and give any other recipients of the Program a copy of this License
114
along with the Program.
115

  
116
You may charge a fee for the physical act of transferring a copy, and
117
you may at your option offer warranty protection in exchange for a fee.
118

  
119
  2. You may modify your copy or copies of the Program or any portion
120
of it, thus forming a work based on the Program, and copy and
121
distribute such modifications or work under the terms of Section 1
122
above, provided that you also meet all of these conditions:
123

  
124
    a) You must cause the modified files to carry prominent notices
125
    stating that you changed the files and the date of any change.
126

  
127
    b) You must cause any work that you distribute or publish, that in
128
    whole or in part contains or is derived from the Program or any
129
    part thereof, to be licensed as a whole at no charge to all third
130
    parties under the terms of this License.
131

  
132
    c) If the modified program normally reads commands interactively
133
    when run, you must cause it, when started running for such
134
    interactive use in the most ordinary way, to print or display an
135
    announcement including an appropriate copyright notice and a
136
    notice that there is no warranty (or else, saying that you provide
137
    a warranty) and that users may redistribute the program under
138
    these conditions, and telling the user how to view a copy of this
139
    License.  (Exception: if the Program itself is interactive but
140
    does not normally print such an announcement, your work based on
141
    the Program is not required to print an announcement.)
142

  
143
These requirements apply to the modified work as a whole.  If
144
identifiable sections of that work are not derived from the Program,
145
and can be reasonably considered independent and separate works in
146
themselves, then this License, and its terms, do not apply to those
147
sections when you distribute them as separate works.  But when you
148
distribute the same sections as part of a whole which is a work based
149
on the Program, the distribution of the whole must be on the terms of
150
this License, whose permissions for other licensees extend to the
151
entire whole, and thus to each and every part regardless of who wrote it.
152

  
153
Thus, it is not the intent of this section to claim rights or contest
154
your rights to work written entirely by you; rather, the intent is to
155
exercise the right to control the distribution of derivative or
156
collective works based on the Program.
157

  
158
In addition, mere aggregation of another work not based on the Program
159
with the Program (or with a work based on the Program) on a volume of
160
a storage or distribution medium does not bring the other work under
161
the scope of this License.
162

  
163
  3. You may copy and distribute the Program (or a work based on it,
164
under Section 2) in object code or executable form under the terms of
165
Sections 1 and 2 above provided that you also do one of the following:
166

  
167
    a) Accompany it with the complete corresponding machine-readable
168
    source code, which must be distributed under the terms of Sections
169
    1 and 2 above on a medium customarily used for software interchange; or,
170

  
171
    b) Accompany it with a written offer, valid for at least three
172
    years, to give any third party, for a charge no more than your
173
    cost of physically performing source distribution, a complete
174
    machine-readable copy of the corresponding source code, to be
175
    distributed under the terms of Sections 1 and 2 above on a medium
176
    customarily used for software interchange; or,
177

  
178
    c) Accompany it with the information you received as to the offer
179
    to distribute corresponding source code.  (This alternative is
180
    allowed only for noncommercial distribution and only if you
181
    received the program in object code or executable form with such
182
    an offer, in accord with Subsection b above.)
183

  
184
The source code for a work means the preferred form of the work for
185
making modifications to it.  For an executable work, complete source
186
code means all the source code for all modules it contains, plus any
187
associated interface definition files, plus the scripts used to
188
control compilation and installation of the executable.  However, as a
189
special exception, the source code distributed need not include
190
anything that is normally distributed (in either source or binary
191
form) with the major components (compiler, kernel, and so on) of the
192
operating system on which the executable runs, unless that component
193
itself accompanies the executable.
194

  
195
If distribution of executable or object code is made by offering
196
access to copy from a designated place, then offering equivalent
197
access to copy the source code from the same place counts as
198
distribution of the source code, even though third parties are not
199
compelled to copy the source along with the object code.
200

  
201
  4. You may not copy, modify, sublicense, or distribute the Program
202
except as expressly provided under this License.  Any attempt
203
otherwise to copy, modify, sublicense or distribute the Program is
204
void, and will automatically terminate your rights under this License.
205
However, parties who have received copies, or rights, from you under
206
this License will not have their licenses terminated so long as such
207
parties remain in full compliance.
208

  
209
  5. You are not required to accept this License, since you have not
210
signed it.  However, nothing else grants you permission to modify or
211
distribute the Program or its derivative works.  These actions are
212
prohibited by law if you do not accept this License.  Therefore, by
213
modifying or distributing the Program (or any work based on the
214
Program), you indicate your acceptance of this License to do so, and
215
all its terms and conditions for copying, distributing or modifying
216
the Program or works based on it.
217

  
218
  6. Each time you redistribute the Program (or any work based on the
219
Program), the recipient automatically receives a license from the
220
original licensor to copy, distribute or modify the Program subject to
221
these terms and conditions.  You may not impose any further
222
restrictions on the recipients' exercise of the rights granted herein.
223
You are not responsible for enforcing compliance by third parties to
224
this License.
225

  
226
  7. If, as a consequence of a court judgment or allegation of patent
227
infringement or for any other reason (not limited to patent issues),
228
conditions are imposed on you (whether by court order, agreement or
229
otherwise) that contradict the conditions of this License, they do not
230
excuse you from the conditions of this License.  If you cannot
231
distribute so as to satisfy simultaneously your obligations under this
232
License and any other pertinent obligations, then as a consequence you
233
may not distribute the Program at all.  For example, if a patent
234
license would not permit royalty-free redistribution of the Program by
235
all those who receive copies directly or indirectly through you, then
236
the only way you could satisfy both it and this License would be to
237
refrain entirely from distribution of the Program.
238

  
239
If any portion of this section is held invalid or unenforceable under
240
any particular circumstance, the balance of the section is intended to
241
apply and the section as a whole is intended to apply in other
242
circumstances.
243

  
244
It is not the purpose of this section to induce you to infringe any
245
patents or other property right claims or to contest validity of any
246
such claims; this section has the sole purpose of protecting the
247
integrity of the free software distribution system, which is
248
implemented by public license practices.  Many people have made
249
generous contributions to the wide range of software distributed
250
through that system in reliance on consistent application of that
251
system; it is up to the author/donor to decide if he or she is willing
252
to distribute software through any other system and a licensee cannot
253
impose that choice.
254

  
255
This section is intended to make thoroughly clear what is believed to
256
be a consequence of the rest of this License.
257

  
258
  8. If the distribution and/or use of the Program is restricted in
259
certain countries either by patents or by copyrighted interfaces, the
260
original copyright holder who places the Program under this License
261
may add an explicit geographical distribution limitation excluding
262
those countries, so that distribution is permitted only in or among
263
countries not thus excluded.  In such case, this License incorporates
264
the limitation as if written in the body of this License.
265

  
266
  9. The Free Software Foundation may publish revised and/or new versions
267
of the General Public License from time to time.  Such new versions will
268
be similar in spirit to the present version, but may differ in detail to
269
address new problems or concerns.
270

  
271
Each version is given a distinguishing version number.  If the Program
272
specifies a version number of this License which applies to it and "any
273
later version", you have the option of following the terms and conditions
274
either of that version or of any later version published by the Free
275
Software Foundation.  If the Program does not specify a version number of
276
this License, you may choose any version ever published by the Free Software
277
Foundation.
278

  
279
  10. If you wish to incorporate parts of the Program into other free
280
programs whose distribution conditions are different, write to the author
281
to ask for permission.  For software which is copyrighted by the Free
282
Software Foundation, write to the Free Software Foundation; we sometimes
283
make exceptions for this.  Our decision will be guided by the two goals
284
of preserving the free status of all derivatives of our free software and
285
of promoting the sharing and reuse of software generally.
286

  
287
			    NO WARRANTY
288

  
289
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
290
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
291
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
292
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
293
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
294
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
295
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
296
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
297
REPAIR OR CORRECTION.
298

  
299
  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
300
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
301
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
302
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
303
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
304
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
305
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
306
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
307
POSSIBILITY OF SUCH DAMAGES.
308

  
309
		     END OF TERMS AND CONDITIONS
310

  
311

  
312
Appendix B: The LGPL License
313
============================
314

  
315
		  GNU LESSER GENERAL PUBLIC LICENSE
316
		       Version 2.1, February 1999
317

  
318
 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
319
     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
320
 Everyone is permitted to copy and distribute verbatim copies
321
 of this license document, but changing it is not allowed.
322

  
323
[This is the first released version of the Lesser GPL.  It also counts
324
 as the successor of the GNU Library Public License, version 2, hence
325
 the version number 2.1.]
326

  
327
			    Preamble
328

  
329
  The licenses for most software are designed to take away your
330
freedom to share and change it.  By contrast, the GNU General Public
331
Licenses are intended to guarantee your freedom to share and change
332
free software--to make sure the software is free for all its users.
333

  
334
  This license, the Lesser General Public License, applies to some
335
specially designated software packages--typically libraries--of the
336
Free Software Foundation and other authors who decide to use it.  You
337
can use it too, but we suggest you first think carefully about whether
338
this license or the ordinary General Public License is the better
339
strategy to use in any particular case, based on the explanations below.
340

  
341
  When we speak of free software, we are referring to freedom of use,
342
not price.  Our General Public Licenses are designed to make sure that
343
you have the freedom to distribute copies of free software (and charge
344
for this service if you wish); that you receive source code or can get
345
it if you want it; that you can change the software and use pieces of
346
it in new free programs; and that you are informed that you can do
347
these things.
348

  
349
  To protect your rights, we need to make restrictions that forbid
350
distributors to deny you these rights or to ask you to surrender these
351
rights.  These restrictions translate to certain responsibilities for
352
you if you distribute copies of the library or if you modify it.
353

  
354
  For example, if you distribute copies of the library, whether gratis
355
or for a fee, you must give the recipients all the rights that we gave
356
you.  You must make sure that they, too, receive or can get the source
357
code.  If you link other code with the library, you must provide
358
complete object files to the recipients, so that they can relink them
359
with the library after making changes to the library and recompiling
360
it.  And you must show them these terms so they know their rights.
361

  
362
  We protect your rights with a two-step method: (1) we copyright the
363
library, and (2) we offer you this license, which gives you legal
364
permission to copy, distribute and/or modify the library.
365

  
366
  To protect each distributor, we want to make it very clear that
367
there is no warranty for the free library.  Also, if the library is
368
modified by someone else and passed on, the recipients should know
369
that what they have is not the original version, so that the original
370
author's reputation will not be affected by problems that might be
371
introduced by others.
372

  
373
  Finally, software patents pose a constant threat to the existence of
374
any free program.  We wish to make sure that a company cannot
375
effectively restrict the users of a free program by obtaining a
376
restrictive license from a patent holder.  Therefore, we insist that
377
any patent license obtained for a version of the library must be
378
consistent with the full freedom of use specified in this license.
379

  
380
  Most GNU software, including some libraries, is covered by the
381
ordinary GNU General Public License.  This license, the GNU Lesser
382
General Public License, applies to certain designated libraries, and
383
is quite different from the ordinary General Public License.  We use
384
this license for certain libraries in order to permit linking those
385
libraries into non-free programs.
386

  
387
  When a program is linked with a library, whether statically or using
388
a shared library, the combination of the two is legally speaking a
389
combined work, a derivative of the original library.  The ordinary
390
General Public License therefore permits such linking only if the
391
entire combination fits its criteria of freedom.  The Lesser General
392
Public License permits more lax criteria for linking other code with
393
the library.
394

  
395
  We call this license the "Lesser" General Public License because it
396
does Less to protect the user's freedom than the ordinary General
397
Public License.  It also provides other free software developers Less
398
of an advantage over competing non-free programs.  These disadvantages
399
are the reason we use the ordinary General Public License for many
400
libraries.  However, the Lesser license provides advantages in certain
401
special circumstances.
402

  
403
  For example, on rare occasions, there may be a special need to
404
encourage the widest possible use of a certain library, so that it becomes
405
a de-facto standard.  To achieve this, non-free programs must be
406
allowed to use the library.  A more frequent case is that a free
407
library does the same job as widely used non-free libraries.  In this
408
case, there is little to gain by limiting the free library to free
409
software only, so we use the Lesser General Public License.
410

  
411
  In other cases, permission to use a particular library in non-free
412
programs enables a greater number of people to use a large body of
413
free software.  For example, permission to use the GNU C Library in
414
non-free programs enables many more people to use the whole GNU
415
operating system, as well as its variant, the GNU/Linux operating
416
system.
417

  
418
  Although the Lesser General Public License is Less protective of the
419
users' freedom, it does ensure that the user of a program that is
420
linked with the Library has the freedom and the wherewithal to run
421
that program using a modified version of the Library.
422

  
423
  The precise terms and conditions for copying, distribution and
424
modification follow.  Pay close attention to the difference between a
425
"work based on the library" and a "work that uses the library".  The
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff