<?php
/*
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * Sample page.
 */
//require_once('../common/configs/config.inc.php');
setcookie("template", $CFG['html']['template']['default'], time()+3600, "/");
function fckEditor($field_name='', $value='', $useHtmlSpChars = true)
	{
		global $CFG;
		include("fckeditor.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, "members" )?strpos( $sBasePath, "members" ):strpos( $sBasePath, "admin" ))) ;
*/
		$oFCKeditor = new FCKeditor('FCKeditor1');
		$oFCKeditor->InstanceName	= $field_name;

		$oFCKeditor->BasePath = $CFG['site']['project_path_relative'];
		//$oFCKeditor->BasePath = $CFG['site']['url'];

		/*if ($CFG['html']['current_script_name'] == 'mailCompose' && $CFG['feature']['rewrite_mode'] == 'normal')
			$oFCKeditor->BasePath	=  $sBasePath;
		else
			$oFCKeditor->BasePath	=  '../'.$sBasePath;

		if ($CFG['feature']['rewrite_mode'] == 'htaccess' && ($CFG['html']['current_script_name'] == 'forumsResponseCreate'))
			$oFCKeditor->BasePath	= '../../../../';
		if ($CFG['feature']['rewrite_mode'] == 'htaccess' && ($CFG['html']['current_script_name'] == 'forumsTopicCreate'))
			$oFCKeditor->BasePath	= '../../';*/

		$oFCKeditor->Value		= html_entity_decode($value);
		$oFCKeditor->Width		= '100%';
		$oFCKeditor->Height		= '300';
		$oFCKeditor->ToolbarSet	= 'Anova';
		$oFCKeditor->Create() ;
	}
?>
