3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
8 * Licensed under the terms of any of the following licenses at your
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
25 include '../../fckeditor.php';
27 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
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">
36 function FCKeditor_OnComplete( editorInstance )
38 var oCombo = document.getElementById( 'cmbSkins' ) ;
40 // Get the active skin.
41 var sSkin = editorInstance.Config['SkinPath'] ;
42 sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
44 oCombo.value = sSkin ;
45 oCombo.style.visibility = '' ;
48 function ChangeSkin( skinName )
50 window.location.href = window.location.pathname + "?Skin=" + skinName ;
56 <h1>FCKeditor - PHP - Sample 4</h1>
57 This sample shows how to change the editor skin.
59 <table cellpadding="0" cellspacing="0" border="0">
62 Select the skin to load:
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>
74 <form action="sampleposteddata.php" method="post" target="_blank">
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" ) ) ;
82 $oFCKeditor = new FCKeditor('FCKeditor1') ;
83 $oFCKeditor->BasePath = $sBasePath ;
85 if ( isset($_GET['Skin']) )
86 $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . htmlspecialchars($_GET['Skin']) . '/' ;
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() ;
92 <input type="submit" value="Submit">