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