PluginProbe
Wp-Insert / 1.2
Wp-Insert v1.2
trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.3.0 1.3.1 1.3.3 1.4 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 2.0 All 63 releases
wp-insert / fckeditor / _samples / php / sample02.php

sample02.php in Wp-Insert 1.2, at fckeditor/_samples/php/sample02.php

217 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4
5 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
6
7 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
8
9 *
10
11 * == BEGIN LICENSE ==
12
13 *
14
15 * Licensed under the terms of any of the following licenses at your
16
17 * choice:
18
19 *
20
21 * - GNU General Public License Version 2 or later (the "GPL")
22
23 * http://www.gnu.org/licenses/gpl.html
24
25 *
26
27 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
28
29 * http://www.gnu.org/licenses/lgpl.html
30
31 *
32
33 * - Mozilla Public License Version 1.1 or later (the "MPL")
34
35 * http://www.mozilla.org/MPL/MPL-1.1.html
36
37 *
38
39 * == END LICENSE ==
40
41 *
42
43 * Sample page.
44
45 */
46
47
48
49 include("../../fckeditor.php") ;
50
51 ?>
52
53 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
54
55 <html>
56
57 <head>
58
59 <title>FCKeditor - Sample</title>
60
61 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
62
63 <meta name="robots" content="noindex, nofollow">
64
65 <link href="../sample.css" rel="stylesheet" type="text/css" />
66
67 <script type="text/javascript">
68
69
70
71 function FCKeditor_OnComplete( editorInstance )
72
73 {
74
75 var oCombo = document.getElementById( 'cmbLanguages' ) ;
76
77 for ( code in editorInstance.Language.AvailableLanguages )
78
79 {
80
81 AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
82
83 }
84
85 oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
86
87 }
88
89
90
91 function AddComboOption(combo, optionText, optionValue)
92
93 {
94
95 var oOption = document.createElement("OPTION") ;
96
97
98
99 combo.options.add(oOption) ;
100
101
102
103 oOption.innerHTML = optionText ;
104
105 oOption.value = optionValue ;
106
107
108
109 return oOption ;
110
111 }
112
113
114
115 function ChangeLanguage( languageCode )
116
117 {
118
119 window.location.href = window.location.pathname + "?Lang=" + languageCode ;
120
121 }
122
123 </script>
124
125 </head>
126
127 <body>
128
129 <h1>FCKeditor - PHP - Sample 2</h1>
130
131 This sample shows the editor in all its available languages.
132
133 <hr>
134
135 <table cellpadding="0" cellspacing="0" border="0">
136
137 <tr>
138
139 <td>
140
141 Select a language:&nbsp;
142
143 </td>
144
145 <td>
146
147 <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
148
149 </select>
150
151 </td>
152
153 </tr>
154
155 </table>
156
157 <br>
158
159 <form action="sampleposteddata.php" method="post" target="_blank">
160
161 <?php
162
163 // Automatically calculates the editor base path based on the _samples directory.
164
165 // This is usefull only for these samples. A real application should use something like this:
166
167 // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
168
169 $sBasePath = $_SERVER['PHP_SELF'] ;
170
171 $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
172
173
174
175 $oFCKeditor = new FCKeditor('FCKeditor1') ;
176
177 $oFCKeditor->BasePath = $sBasePath ;
178
179
180
181 if ( isset($_GET['Lang']) )
182
183 {
184
185 $oFCKeditor->Config['AutoDetectLanguage'] = false ;
186
187 $oFCKeditor->Config['DefaultLanguage'] = $_GET['Lang'] ;
188
189 }
190
191 else
192
193 {
194
195 $oFCKeditor->Config['AutoDetectLanguage'] = true ;
196
197 $oFCKeditor->Config['DefaultLanguage'] = 'en' ;
198
199 }
200
201
202
203 $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
204
205 $oFCKeditor->Create() ;
206
207 ?> <br>
208
209 <input type="submit" value="Submit">
210
211 </form>
212
213 </body>
214
215 </html>
216
217