Location: PHPKode > projects > Openology PHP Application Integration > openology/backend/edit/_samples/php/sample03.php
<?php 
header('content-type:text/html;charset=UTF-8');
//require(dirname(__FILE__)."/config.php");
session_start();
  if(!isset($_SESSION['valid_user']))
  {
   header ("Location:../../../login.php");
  }
include("../../fckeditor.php") ;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>FCKeditor - Sample</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="robots" content="noindex, nofollow">
		<link href="../sample.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">

function FCKeditor_OnComplete( editorInstance )
{
	var oCombo = document.getElementById( 'cmbLanguages' ) ;
	for ( code in editorInstance.Language.AvailableLanguages )
	{
		AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
	}
	oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
}	

function AddComboOption(combo, optionText, optionValue)
{
	var oOption = document.createElement("OPTION") ;

	combo.options.add(oOption) ;

	oOption.innerHTML = optionText ;
	oOption.value     = optionValue ;
	
	return oOption ;
}

function ChangeLanguage( languageCode )
{
	window.location.href = window.location.pathname + "?Lang=" + languageCode ;
}
		</script>
	</head>
	<body>
		<h1>Editor</h1>
		<hr>
		<form action="../../../create_en.php" method="post" target="_blank">
		<table cellpadding="0" cellspacing="0" border="0">
		<tr> 
            <td height="95" valign="top"> <table width="99%" border="0" align="right" cellpadding="0" cellspacing="0">
			    <tr>
				  <td width="12%" height="22" nowrap>生成网页的名称:</td>
				  <td width="38%"><input name="filename" type="text" id="filename" size="20"></td>
			    </tr>  
                <tr> 
				  <td width="12%" height="22" nowrap>文章标题:</td>
                  <td width="38%"><input name="title" type="text" id="title" size="30"></td>
				</tr>  
				<tr> 
                  <td height="100%">文章简述:</td>
                  <td colspan="3"><textarea name="description" cols="60" rows="3" id="description"></textarea></td>
                </tr>
				<tr>
				  <td width="12%" height="22" nowrap>文章关键词:</td>
				  <td width="38%"><input name="keyword" type="text" id="keyword" maxlength="200" size="60"></td>
				</tr>  
				<tr>
				<td>选择语言:&nbsp;</td>
				<td><select id="cmbLanguages" onChange="ChangeLanguage(this.value);"></select></td>
				
			    </tr>
			  </table></td></tr>
		</table>
		<br>
		<?php
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/FCKeditor/' ;	// '/FCKeditor/' is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;

$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = $sBasePath ;

if ( isset($_GET['Lang']) )
{
	$oFCKeditor->Config['AutoDetectLanguage']	= false ;
	$oFCKeditor->Config['DefaultLanguage']		= $_GET['Lang'] ;
}
else
{
	$oFCKeditor->Config['AutoDetectLanguage']	= true ;
	$oFCKeditor->Config['DefaultLanguage']		= 'en' ;
}

$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?>			<br>
            <input type="submit" value="生成网页">
		</form>
	</body>
</html>
Return current item: Openology PHP Application Integration