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 / sample04.php

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

191 lines 3.0 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( 'cmbSkins' ) ;
76
77
78
79 // Get the active skin.
80
81 var sSkin = editorInstance.Config['SkinPath'] ;
82
83 sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
84
85
86
87 oCombo.value = sSkin ;
88
89 oCombo.style.visibility = '' ;
90
91 }
92
93
94
95 function ChangeSkin( skinName )
96
97 {
98
99 window.location.href = window.location.pathname + "?Skin=" + skinName ;
100
101 }
102
103
104
105 </script>
106
107 </head>
108
109 <body>
110
111 <h1>FCKeditor - PHP - Sample 4</h1>
112
113 This sample shows how to change the editor skin.
114
115 <hr>
116
117 <table cellpadding="0" cellspacing="0" border="0">
118
119 <tr>
120
121 <td>
122
123 Select the skin to load:&nbsp;
124
125 </td>
126
127 <td>
128
129 <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
130
131 <option value="default" selected>Default</option>
132
133 <option value="office2003">Office 2003</option>
134
135 <option value="silver">Silver</option>
136
137 </select>
138
139 </td>
140
141 </tr>
142
143 </table>
144
145 <br>
146
147 <form action="sampleposteddata.php" method="post" target="_blank">
148
149 <?php
150
151 // Automatically calculates the editor base path based on the _samples directory.
152
153 // This is usefull only for these samples. A real application should use something like this:
154
155 // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
156
157 $sBasePath = $_SERVER['PHP_SELF'] ;
158
159 $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
160
161
162
163 $oFCKeditor = new FCKeditor('FCKeditor1') ;
164
165 $oFCKeditor->BasePath = $sBasePath ;
166
167
168
169 if ( isset($_GET['Skin']) )
170
171 $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . htmlspecialchars($_GET['Skin']) . '/' ;
172
173
174
175 $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
176
177 $oFCKeditor->Create() ;
178
179 ?>
180
181 <br>
182
183 <input type="submit" value="Submit">
184
185 </form>
186
187 </body>
188
189 </html>
190
191