1<%
2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
4 *
5 * == BEGIN LICENSE ==
6 *
7 * Licensed under the terms of any of the following licenses at your
8 * choice:
9 *
10 *  - GNU General Public License Version 2 or later (the "GPL")
11 *    http://www.gnu.org/licenses/gpl.html
12 *
13 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14 *    http://www.gnu.org/licenses/lgpl.html
15 *
16 *  - Mozilla Public License Version 1.1 or later (the "MPL")
17 *    http://www.mozilla.org/MPL/MPL-1.1.html
18 *
19 * == END LICENSE ==
20 *
21 * This page is a basic Sample for FCKeditor integration in the AFP script language (www.afpages.de)
22 *
23%>
24
25<html>
26	<head>
27		<title>FCKeditor - AFP Sample 3</title>
28		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
29		<meta name="robots" content="noindex, nofollow">
30		<link href="../sample.css" rel="stylesheet" type="text/css" />
31
32		<script type="text/javascript">
33			function FCKeditor_OnComplete( editorInstance )
34			{
35				var oCombo = document.getElementById( 'cmbToolbars' ) ;
36				oCombo.value = editorInstance.ToolbarSet.Name ;
37				oCombo.style.visibility = '' ;
38			}
39
40			function ChangeToolbar( toolbarName )
41			{
42				window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ;
43			}
44		</script>
45		</head>
46	<body>
47		<h1>FCKeditor - AFP - Sample 3</h1>
48		This sample shows how to change the editor toolbar.
49		<hr>
50		<table cellpadding="0" cellspacing="0" border="0">
51			<tr>
52				<td>
53					Select the toolbar to load:&nbsp;
54				</td>
55				<td>
56					<select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden">
57						<option value="Default" selected>Default</option>
58						<option value="Basic">Basic</option>
59					</select>
60				</td>
61			</tr>
62		</table>
63		<br>
64		<form action="sampleposteddata.afp" method="post" target="_blank">
65<%
66
67			sBasePath="../../../fckeditor/"						&& Change this to your local path
68
69			oFCKeditor = CREATEOBJECT("FCKeditor")
70			oFCKeditor.fckeditor("FCKeditor1")
71
72			lcToolbar=request.querystring("Toolbar")			&& Request Parameter
73			lcToolbar=oFCKeditor.StripAttacks(lcToolbar)		&& Remove special escape characters
74			IF !EMPTY(lcToolbar)
75				oFCKeditor.ToolbarSet=lcToolbar
76			ENDIF
77
78			lcText=[<p>This is some <strong>sample text</strong>. You are using ]
79			lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
80
81			oFCKeditor.BasePath	= sBasePath
82			oFCKeditor.cValue	= lcText
83
84			? oFCKeditor.Create()
85
86%>
87			<br>
88			<input type="submit" value="Submit">
89		</form>
90	</body>
91</html>
92