Ticket #173: sample10.php

File sample10.php, 2.6 KB (added by Frederico Caldeira Knabben, 17 years ago)

Test Case

Line 
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 * Sample page.
23 */
24
25include("../../fckeditor.php") ;
26?>
27<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28<html xmlns="http://www.w3.org/1999/xhtml">
29<head>
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</head>
35<body>
36        <h1>
37                FCKeditor - PHP - Sample 10</h1>
38        <div>
39                This sample shows a form with two FCKeditor instance. Both instances share the same
40                toolbar, available in the top.
41        </div>
42        <hr />
43        <div id="xToolbar"></div>
44        <hr />
45        <form action="sampleposteddata.php" method="post" target="_blank">
46                Normal text field:<br />
47                <input name="NormaText" value="Plain Text" />
48                <br />
49                <br />
50                FCKeditor 1:
51<?php
52// Automatically calculates the editor base path based on the _samples directory.
53// This is usefull only for these samples. A real application should use something like this:
54// $oFCKeditor->BasePath = '/fckeditor/' ;      // '/fckeditor/' is the default value.
55$sBasePath = $_SERVER['PHP_SELF'] ;
56$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
57
58$oFCKeditor = new FCKeditor('FCKeditor1') ;
59$oFCKeditor->BasePath = $sBasePath ;
60$oFCKeditor->Height = 100 ;
61$oFCKeditor->Config[ 'ToolbarLocation' ] = 'Out:xToolbar' ;
62$oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
63$oFCKeditor->Create() ;
64?>
65                <br />
66                FCKeditor 2:
67<?php
68$oFCKeditor = new FCKeditor('FCKeditor2') ;
69$oFCKeditor->BasePath = $sBasePath ;
70$oFCKeditor->Height = 100 ;
71$oFCKeditor->Config[ 'ToolbarLocation' ] = 'Out:xToolbar' ;
72$oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
73$oFCKeditor->Create() ;
74?>
75                <br />
76                <input type="submit" value="Submit" />
77        </form>
78</body>
79</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy