3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
14
* File Name: sample02.php
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
21
include("../../fckeditor.php") ;
23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
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">
32
function FCKeditor_OnComplete( editorInstance )
34
var oCombo = document.getElementById( 'cmbLanguages' ) ;
35
for ( code in editorInstance.Language.AvailableLanguages )
37
AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
39
oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
42
function AddComboOption(combo, optionText, optionValue)
44
var oOption = document.createElement("OPTION") ;
46
combo.options.add(oOption) ;
48
oOption.innerHTML = optionText ;
49
oOption.value = optionValue ;
54
function ChangeLanguage( languageCode )
56
window.location.href = window.location.pathname + "?Lang=" + languageCode ;
61
<h1>FCKeditor - PHP - Sample 2</h1>
62
This sample shows the editor in all its available languages.
64
<table cellpadding="0" cellspacing="0" border="0">
67
Select a language:
70
<select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
76
<form action="sampleposteddata.php" method="post" target="_blank">
78
// Automatically calculates the editor base path based on the _samples directory.
79
// This is usefull only for these samples. A real application should use something like this:
80
// $oFCKeditor->BasePath = '/FCKeditor/' ; // '/FCKeditor/' is the default value.
81
$sBasePath = $_SERVER['PHP_SELF'] ;
82
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
84
$oFCKeditor = new FCKeditor('FCKeditor1') ;
85
$oFCKeditor->BasePath = $sBasePath ;
87
if ( isset($_GET['Lang']) )
89
$oFCKeditor->Config['AutoDetectLanguage'] = false ;
90
$oFCKeditor->Config['DefaultLanguage'] = $_GET['Lang'] ;
94
$oFCKeditor->Config['AutoDetectLanguage'] = true ;
95
$oFCKeditor->Config['DefaultLanguage'] = 'en' ;
98
$oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
99
$oFCKeditor->Create() ;
101
<input type="submit" value="Submit">
b'\\ No newline at end of file'