| [ 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: sample03.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( 'cmbToolbars' ) ; 43 oCombo.value = editorInstance.ToolbarSet.Name ; 44 oCombo.style.visibility = '' ; 45 } 46 47 function ChangeToolbar( toolbarName ) 48 { 49 window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ; 50 } 51 52 </script> 53 </head> 54 <body> 55 <h1>FCKeditor - PHP - Sample 3</h1> 56 This sample shows how to change the editor toolbar. 57 <hr> 58 <table cellpadding="0" cellspacing="0" border="0"> 59 <tr> 60 <td> 61 Select the toolbar to load: 62 </td> 63 <td> 64 <select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden"> 65 <option value="Default" selected>Default</option> 66 <option value="Basic">Basic</option> 67 </select> 68 </td> 69 </tr> 70 </table> 71 <br> 72 <form action="sampleposteddata.php" method="post" target="_blank"> 73 <?php 74 // Automatically calculates the editor base path based on the _samples directory. 75 // This is usefull only for these samples. A real application should use something like this: 76 // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. 77 $sBasePath = $_SERVER['PHP_SELF'] ; 78 $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ; 79 80 $oFCKeditor = new FCKeditor('FCKeditor1') ; 81 $oFCKeditor->BasePath = $sBasePath ; 82 83 if ( isset($_GET['Toolbar']) ) 84 $oFCKeditor->ToolbarSet = htmlspecialchars($_GET['Toolbar']); 85 86 $oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ; 87 $oFCKeditor->Create() ; 88 ?> 89 <br> 90 <input type="submit" value="Submit"> 91 </form> 92 </body> 93 </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 |