public function setFCKHTML($fckname, $value = null)
{
$path1 = substr(dirname($_SERVER['SCRIPT_NAME']), 1);
$path2 = str_replace('\\', '/', dirname(APP_DIR));
$pieces = explode('/', $path1);
$ar = array();
foreach ($pieces as $val)
{
if (preg_match("/\/$val/is", $path2))
{
$ar[] = $val;
}
}
$path = join('/', $ar);
if (!empty($path))
{
$path = '/' . $path;
}
$oFCKeditor = new FCKeditor($fckname);
$base_path = $path . '/frame/fckeditor/';
$oFCKeditor->BasePath = $base_path;
$oFCKeditor->Height = '360';
$oFCKeditor->Width = '98%';
$oFCKeditor->ToolbarSet = 'Terse';
$oFCKeditor->Value = $value;
return $oFCKeditor->CreateHTML();
}
public function addEditAction()
{
.......
require(dirname(APP_DIR) . "/frame/fckeditor/FCKeditor.php");
$this->view->contentIframe = $this->setFCKHTML("news[content]", $this->news->content);
}