[763] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * FCKeditor - The text editor for internet |
---|
| 4 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben |
---|
| 5 | * |
---|
| 6 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
| 7 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
| 8 | * |
---|
| 9 | * For further information visit: |
---|
| 10 | * http://www.fckeditor.net/ |
---|
| 11 | * |
---|
| 12 | * "Support Open Source software. What about a donation today?" |
---|
| 13 | * |
---|
| 14 | * File Name: sample03.php |
---|
| 15 | * Sample page. |
---|
| 16 | * |
---|
| 17 | * File Authors: |
---|
| 18 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | include("../../fckeditor.php") ; |
---|
| 22 | ?> |
---|
| 23 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
| 24 | <html> |
---|
| 25 | <head> |
---|
| 26 | <title>FCKeditor - Sample</title> |
---|
| 27 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
---|
| 28 | <meta name="robots" content="noindex, nofollow"> |
---|
| 29 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
---|
| 30 | <script type="text/javascript"> |
---|
| 31 | |
---|
| 32 | function FCKeditor_OnComplete( editorInstance ) |
---|
| 33 | { |
---|
| 34 | var oCombo = document.getElementById( 'cmbToolbars' ) ; |
---|
| 35 | oCombo.value = editorInstance.ToolbarSet.Name ; |
---|
| 36 | oCombo.style.visibility = '' ; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | function ChangeToolbar( toolbarName ) |
---|
| 40 | { |
---|
| 41 | window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | </script> |
---|
| 45 | </head> |
---|
| 46 | <body> |
---|
| 47 | <h1>FCKeditor - PHP - Sample 3</h1> |
---|
| 48 | This sample shows how to change the editor toolbar. |
---|
| 49 | <hr> |
---|
| 50 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
| 51 | <tr> |
---|
| 52 | <td> |
---|
| 53 | Select the toolbar to load: |
---|
| 54 | </td> |
---|
| 55 | <td> |
---|
| 56 | <select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden"> |
---|
| 57 | <option value="Default" selected>Default</option> |
---|
| 58 | <option value="Basic">Basic</option> |
---|
| 59 | </select> |
---|
| 60 | </td> |
---|
| 61 | </tr> |
---|
| 62 | </table> |
---|
| 63 | <br> |
---|
| 64 | <form action="sampleposteddata.php" method="post" target="_blank"> |
---|
| 65 | <?php |
---|
| 66 | // Automatically calculates the editor base path based on the _samples directory. |
---|
| 67 | // This is usefull only for these samples. A real application should use something like this: |
---|
| 68 | // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. |
---|
| 69 | $sBasePath = $_SERVER['PHP_SELF'] ; |
---|
| 70 | $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ; |
---|
| 71 | |
---|
| 72 | $oFCKeditor = new FCKeditor('FCKeditor1') ; |
---|
| 73 | $oFCKeditor->BasePath = $sBasePath ; |
---|
| 74 | |
---|
| 75 | if ( isset($_GET['Toolbar']) ) |
---|
| 76 | $oFCKeditor->ToolbarSet = htmlspecialchars($_GET['Toolbar']); |
---|
| 77 | |
---|
| 78 | $oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ; |
---|
| 79 | $oFCKeditor->Create() ; |
---|
| 80 | ?> |
---|
| 81 | <br> |
---|
| 82 | <input type="submit" value="Submit"> |
---|
| 83 | </form> |
---|
| 84 | </body> |
---|
| 85 | </html> |
---|