![]() |
Xataface CKeditor Module 0.3
CKeditor Widget for Xataface
|
00001 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 00002 <!-- 00003 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 00004 For licensing, see LICENSE.html or http://ckeditor.com/license 00005 --> 00006 <html xmlns="http://www.w3.org/1999/xhtml"> 00007 <head> 00008 <title>Sample - CKEditor</title> 00009 <meta content="text/html; charset=utf-8" http-equiv="content-type"/> 00010 <link href="../sample.css" rel="stylesheet" type="text/css"/> 00011 </head> 00012 <body> 00013 <h1> 00014 CKEditor Sample 00015 </h1> 00016 <!-- This <div> holds alert messages to be display in the sample page. --> 00017 <div id="alerts"> 00018 <noscript> 00019 <p> 00020 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript 00021 support, like yours, you should still see the contents (HTML data) and you should 00022 be able to edit it normally, without a rich editor interface. 00023 </p> 00024 </noscript> 00025 </div> 00026 <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> 00027 <fieldset title="Output"> 00028 <legend>Output</legend> 00029 <form action="../sample_posteddata.php" method="post"> 00030 <p> 00031 <label>Editor 1:</label><br/> 00032 </p> 00033 <?php 00034 // Include CKEditor class. 00035 include("../../ckeditor.php"); 00036 00037 // Create class instance. 00038 $CKEditor = new CKEditor(); 00039 00040 // Do not print the code directly to the browser, return it instead 00041 $CKEditor->returnOutput = true; 00042 00043 // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: 00044 // $CKEditor->basePath = '/ckeditor/' 00045 // If not set, CKEditor will try to detect the correct path. 00046 $CKEditor->basePath = '../../'; 00047 00048 // Set global configuration (will be used by all instances of CKEditor). 00049 $CKEditor->config['width'] = 600; 00050 00051 // Change default textarea attributes 00052 $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10); 00053 00054 // The initial value to be displayed in the editor. 00055 $initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'; 00056 00057 // Create first instance. 00058 $code = $CKEditor->editor("editor1", $initialValue); 00059 00060 echo $code; 00061 ?> 00062 <p> 00063 <label>Editor 2:</label><br/> 00064 </p> 00065 <?php 00066 // Configuration that will be used only by the second editor. 00067 $config['toolbar'] = array( 00068 array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), 00069 array( 'Image', 'Link', 'Unlink', 'Anchor' ) 00070 ); 00071 00072 $config['skin'] = 'v2'; 00073 00074 // Create second instance. 00075 echo $CKEditor->editor("editor2", $initialValue, $config); 00076 ?> 00077 <p> 00078 <input type="submit" value="Submit"/> 00079 </p> 00080 </form> 00081 </fieldset> 00082 <div id="footer"> 00083 <hr /> 00084 <p> 00085 CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> 00086 </p> 00087 <p id="copy"> 00088 Copyright © 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico 00089 Knabben. All rights reserved. 00090 </p> 00091 </div> 00092 </body> 00093 </html>