<?php
class fck
{
	static function loadFCK ($name,$value,$toolbar="Default",$height="300px",$width="100%") {

	//global $config;
	$path = "";

	$oFCKeditor = new FCKeditor($name) ;
	$oFCKeditor->BasePath = $path.'/core/FCKeditor/';
	$oFCKeditor->Value = fck::addAbsolutePaths($value);
	$oFCKeditor->ToolbarSet = $toolbar;
	$oFCKeditor->Height = $height;
	$oFCKeditor->Width = $width;
	$oFCKeditor->Create();

	}

	static function removeAbsolutePaths($content){

	//global $config;
	//$notNeeded=$config->siteURL;
	$notNeeded="http://www.lighting-by-gabrielli.co.uk/";

	$notNeeded=$config->siteURL;
	$changed=str_replace("$notNeeded",'',$content);
	return $changed;
	}

	static function addAbsolutePaths($content){
		
		//global $config;

		//$toAdd=$config->siteURL;
		$toAdd="http://www.lighting-by-gabrielli.co.uk/";
		$changed=str_replace('"/UserFiles/','"'.$toAdd.'/UserFiles/',$content);
		$changed=str_replace("'/UserFiles/","'".$toAdd."/UserFiles/",$changed);
		return $changed;
	}

}
?>