diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index fff1e53623c..2473039a81f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2007 Regis Houssin +/* Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,8 +26,6 @@ * \version $Revision$ */ -if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1'); - require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); diff --git a/htdocs/lib/doleditor.class.php b/htdocs/lib/doleditor.class.php index 52aa96d5782..91516e4b095 100644 --- a/htdocs/lib/doleditor.class.php +++ b/htdocs/lib/doleditor.class.php @@ -43,6 +43,7 @@ class DolEditor var $rows; var $cols; var $height; + var $width; /** @@ -60,17 +61,17 @@ class DolEditor * @param rows Size of rows for textarea tool * @param cols Size of cols for textarea tool */ - function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextandededitor=true,$rows=0,$cols=0) + function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0) { global $conf,$langs; dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." tool=".$tool); // Name of extended editor to use - $this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?'fckeditor':$conf->global->FCKEDITOR_EDITORNAME; + $this->tool=empty($conf->global->MAIN_EXTENDED_EDITOR_NAME)?'fckeditor':$conf->global->MAIN_EXTENDED_EDITOR_NAME; // Check if extended editor is ok. If not we force textarea - if (empty($conf->fckeditor->enabled) || ! $okforextandededitor) + if (empty($conf->fckeditor->enabled) || ! $okforextendededitor) { $this->tool = 'textarea'; } @@ -119,7 +120,6 @@ class DolEditor } - /** * Output edit area inside the HTML stream */ @@ -137,15 +137,18 @@ class DolEditor if (in_array($this->tool,array('textarea','ckeditor'))) { $found=1; - $cssclass='flat'; - print ''; if ($this->tool == 'ckeditor') { + if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1'); + print ''; } } @@ -158,5 +161,4 @@ class DolEditor } - ?> diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 47c927a5ec4..d3e3cc51b5f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -886,12 +886,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print ''."\n"; } - - // CKEditor - if ($conf->global->MAIN_USE_CKEDITOR && defined('REQUIRE_CKEDITOR')) - { - print ''."\n"; - } } // Output module javascript @@ -1572,6 +1566,12 @@ if (! function_exists("llxFooter")) print "\n"; if ($foot) print ''."\n"; + + // CKEditor + if (defined('REQUIRE_CKEDITOR')) + { + print ''."\n"; + } if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";