1 | <?php
|
---|
2 | /*
|
---|
3 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
---|
4 | * Copyright (C) 2003-2009 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 | * Sample page.
|
---|
23 | */
|
---|
24 |
|
---|
25 | include("../../fckeditor.php") ;
|
---|
26 | ?>
|
---|
27 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
28 | <html>
|
---|
29 | <head>
|
---|
30 | <title>FCKeditor - Sample</title>
|
---|
31 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
---|
32 | <meta name="robots" content="noindex, nofollow">
|
---|
33 | <link href="../sample.css" rel="stylesheet" type="text/css" />
|
---|
34 | <script type="text/javascript">
|
---|
35 |
|
---|
36 | function FCKeditor_OnComplete( editorInstance )
|
---|
37 | {
|
---|
38 | var oCombo = document.getElementById( 'cmbSkins' ) ;
|
---|
39 |
|
---|
40 | // Get the active skin.
|
---|
41 | var sSkin = editorInstance.Config['SkinPath'] ;
|
---|
42 | sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
|
---|
43 |
|
---|
44 | oCombo.value = sSkin ;
|
---|
45 | oCombo.style.visibility = '' ;
|
---|
46 | }
|
---|
47 |
|
---|
48 | function ChangeSkin( skinName )
|
---|
49 | {
|
---|
50 | window.location.href = window.location.pathname + "?Skin=" + skinName ;
|
---|
51 | }
|
---|
52 |
|
---|
53 | </script>
|
---|
54 | </head>
|
---|
55 | <body>
|
---|
56 | <h1>FCKeditor - PHP - Sample 4</h1>
|
---|
57 | This sample shows how to change the editor skin.
|
---|
58 | <hr>
|
---|
59 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
60 | <tr>
|
---|
61 | <td>
|
---|
62 | Select the skin to load:
|
---|
63 | </td>
|
---|
64 | <td>
|
---|
65 | <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
|
---|
66 | <option value="default" selected>Default</option>
|
---|
67 | <option value="office2003">Office 2003</option>
|
---|
68 | <option value="silver">Silver</option>
|
---|
69 | </select>
|
---|
70 | </td>
|
---|
71 | </tr>
|
---|
72 | </table>
|
---|
73 | <br>
|
---|
74 | <form action="sampleposteddata.php" method="post" target="_blank">
|
---|
75 | <?php
|
---|
76 | // Automatically calculates the editor base path based on the _samples directory.
|
---|
77 | // This is usefull only for these samples. A real application should use something like this:
|
---|
78 | // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
|
---|
79 | $sBasePath = $_SERVER['PHP_SELF'] ;
|
---|
80 | $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
|
---|
81 |
|
---|
82 | $oFCKeditor = new FCKeditor('FCKeditor1') ;
|
---|
83 | $oFCKeditor->BasePath = $sBasePath ;
|
---|
84 |
|
---|
85 | if ( isset($_GET['Skin']) )
|
---|
86 | $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . preg_replace("/[^a-z0-9]/i", "", $_GET['Skin']) . '/' ;
|
---|
87 |
|
---|
88 | $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
|
---|
89 | $oFCKeditor->Create() ;
|
---|
90 | ?>
|
---|
91 | <br>
|
---|
92 | <input type="submit" value="Submit">
|
---|
93 | </form>
|
---|
94 | </body>
|
---|
95 | </html>
|
---|