3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
8 * Licensed under the terms of any of the following licenses at your
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
25 include '../../fckeditor.php';
27 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
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 <script type="text/javascript">
36 function FCKeditor_OnComplete( editorInstance )
38 var oCombo = document.getElementById( 'cmbLanguages' ) ;
39 for ( code in editorInstance.Language.AvailableLanguages )
41 AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
43 oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
46 function AddComboOption(combo, optionText, optionValue)
48 var oOption = document.createElement("OPTION") ;
50 combo.options.add(oOption) ;
52 oOption.innerHTML = optionText ;
53 oOption.value = optionValue ;
58 function ChangeLanguage( languageCode )
60 window.location.href = window.location.pathname + "?Lang=" + languageCode ;
65 <h1>FCKeditor - PHP - Sample 2</h1>
66 This sample shows the editor in all its available languages.
68 <table cellpadding="0" cellspacing="0" border="0">
71 Select a language:
74 <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
80 <form action="sampleposteddata.php" method="post" target="_blank">
82 // Automatically calculates the editor base path based on the _samples directory.
83 // This is usefull only for these samples. A real application should use something like this:
84 // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
85 $sBasePath = $_SERVER['PHP_SELF'] ;
86 $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
88 $oFCKeditor = new FCKeditor('FCKeditor1') ;
89 $oFCKeditor->BasePath = $sBasePath ;
91 if ( isset($_GET['Lang']) )
93 $oFCKeditor->Config['AutoDetectLanguage'] = false ;
94 $oFCKeditor->Config['DefaultLanguage'] = $_GET['Lang'] ;
98 $oFCKeditor->Config['AutoDetectLanguage'] = true ;
99 $oFCKeditor->Config['DefaultLanguage'] = 'en' ;
102 $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
103 $oFCKeditor->Create() ;
105 <input type="submit" value="Submit">