source: companies/celepar/news_admin/templates/celepar/fckeditor/to_delete/_samples/php/sample04.php @ 763

Revision 763, 2.6 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
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: sample04.php
15 *      Sample page.
16 *
17 * File Authors:
18 *              Frederico Caldeira Knabben (fredck@fckeditor.net)
19 */
20
21include("../../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
32function FCKeditor_OnComplete( editorInstance )
33{
34        var oCombo = document.getElementById( 'cmbSkins' ) ;
35       
36        // Get the active skin.
37        var sSkin = editorInstance.Config['SkinPath'] ;
38        sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
39       
40        oCombo.value = sSkin ;
41        oCombo.style.visibility = '' ;
42}
43
44function ChangeSkin( skinName )
45{
46        window.location.href = window.location.pathname + "?Skin=" + skinName ;
47}
48
49                </script>
50        </head>
51        <body>
52                <h1>FCKeditor - PHP - Sample 4</h1>
53                This sample shows how to change the editor skin.
54                <hr>
55                <table cellpadding="0" cellspacing="0" border="0">
56                        <tr>
57                                <td>
58                                        Select the skin to load:&nbsp;
59                                </td>
60                                <td>
61                                        <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
62                                                <option value="default" selected>Default</option>
63                                                <option value="office2003">Office 2003</option>
64                                                <option value="silver">Silver</option>
65                                        </select>
66                                </td>
67                        </tr>
68                </table>
69                <br>
70                <form action="sampleposteddata.php" method="post" target="_blank">
71<?php
72// Automatically calculates the editor base path based on the _samples directory.
73// This is usefull only for these samples. A real application should use something like this:
74// $oFCKeditor->BasePath = '/fckeditor/' ;      // '/fckeditor/' is the default value.
75$sBasePath = $_SERVER['PHP_SELF'] ;
76$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
77
78$oFCKeditor = new FCKeditor('FCKeditor1') ;
79$oFCKeditor->BasePath = $sBasePath ;
80
81if ( isset($_GET['Skin']) )
82        $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . htmlspecialchars($_GET['Skin']) . '/' ;
83
84$oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
85$oFCKeditor->Create() ;
86?>
87                        <br>
88                        <input type="submit" value="Submit">
89                </form>
90        </body>
91</html>
Note: See TracBrowser for help on using the repository browser.