Works on ckeditor integration

This commit is contained in:
Regis Houssin 2011-01-31 21:51:10 +00:00
parent e6ddc8bd71
commit 4c36a9be36
6 changed files with 346 additions and 11 deletions

View File

@ -40,6 +40,7 @@ class DolEditor
// If not using fckeditor
var $content;
var $htmlname;
var $toolbarname;
var $rows;
var $cols;
var $height;
@ -110,12 +111,13 @@ class DolEditor
if (in_array($this->tool,array('textarea','ckeditor')))
{
$this->content = $content;
$this->htmlname = $htmlname;
$this->rows = max(ROWS_3,$rows);
$this->cols = max(40,$cols);
$this->height = $height;
$this->width = 600;
$this->content = $content;
$this->htmlname = $htmlname;
$this->toolbarname = $toolbarname;
$this->rows = max(ROWS_3,$rows);
$this->cols = max(40,$cols);
$this->height = $height;
$this->width = 600;
}
}
@ -145,11 +147,19 @@ class DolEditor
{
if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1');
print '<script type="text/javascript">';
print 'jQuery(document).ready(function () {';
print 'CKEDITOR.replace(\''.$this->htmlname.'\', { toolbar: \'Basic\', width: '.$this->width.', height: '.$this->height.', toolbarStartupExpanded: false });';
print '});';
print '</script>';
print '<script type="text/javascript">
jQuery(document).ready(function () {
CKEDITOR.replace(\''.$this->htmlname.'\',
{
customConfig : \''.DOL_URL_ROOT.'/theme/'.$conf->theme.'/ckeditor/config.js\',
toolbar: \''.$this->toolbarname.'\',
//width: '.$this->width.',
height: '.$this->height.',
toolbarStartupExpanded: false
});
});
</script>';
}
}

View File

@ -0,0 +1,65 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here.
// http://docs.cksource.com/CKEditor_3.x/Developers_Guide
config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
config.toolbar_dolibarr_mailings =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_notes =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_details =
[
['FitWindow','Source'],
['Cut','Copy','Paste','-','Preview'],
['Undo','Redo'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['SpecialChar'],
['FontName','FontSize']
];
};

View File

@ -0,0 +1,65 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here.
// http://docs.cksource.com/CKEditor_3.x/Developers_Guide
config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
config.toolbar_dolibarr_mailings =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_notes =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_details =
[
['FitWindow','Source'],
['Cut','Copy','Paste','-','Preview'],
['Undo','Redo'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['SpecialChar'],
['FontName','FontSize']
];
};

View File

@ -0,0 +1,65 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here.
// http://docs.cksource.com/CKEditor_3.x/Developers_Guide
config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
config.toolbar_dolibarr_mailings =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_notes =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_details =
[
['FitWindow','Source'],
['Cut','Copy','Paste','-','Preview'],
['Undo','Redo'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['SpecialChar'],
['FontName','FontSize']
];
};

View File

@ -0,0 +1,65 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here.
// http://docs.cksource.com/CKEditor_3.x/Developers_Guide
config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
config.toolbar_dolibarr_mailings =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_notes =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_details =
[
['FitWindow','Source'],
['Cut','Copy','Paste','-','Preview'],
['Undo','Redo'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['SpecialChar'],
['FontName','FontSize']
];
};

View File

@ -0,0 +1,65 @@
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here.
// http://docs.cksource.com/CKEditor_3.x/Developers_Guide
config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];
config.toolbar_dolibarr_mailings =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_notes =
[
['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar'],
['FontName','FontSize']
];
config.toolbar_dolibarr_details =
[
['FitWindow','Source'],
['Cut','Copy','Paste','-','Preview'],
['Undo','Redo'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['SpecialChar'],
['FontName','FontSize']
];
};