From 4c36a9be36039e7caf20ab4d26139948b93e658f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 31 Jan 2011 21:51:10 +0000 Subject: [PATCH] Works on ckeditor integration --- htdocs/lib/doleditor.class.php | 32 ++++++---- htdocs/theme/auguria/ckeditor/config.js | 65 +++++++++++++++++++++ htdocs/theme/bureau2crea/ckeditor/config.js | 65 +++++++++++++++++++++ htdocs/theme/eldy/ckeditor/config.js | 65 +++++++++++++++++++++ htdocs/theme/freelug/ckeditor/config.js | 65 +++++++++++++++++++++ htdocs/theme/yellow/ckeditor/config.js | 65 +++++++++++++++++++++ 6 files changed, 346 insertions(+), 11 deletions(-) create mode 100644 htdocs/theme/auguria/ckeditor/config.js create mode 100644 htdocs/theme/bureau2crea/ckeditor/config.js create mode 100644 htdocs/theme/eldy/ckeditor/config.js create mode 100644 htdocs/theme/freelug/ckeditor/config.js create mode 100644 htdocs/theme/yellow/ckeditor/config.js diff --git a/htdocs/lib/doleditor.class.php b/htdocs/lib/doleditor.class.php index 91516e4b095..d6af10f71b7 100644 --- a/htdocs/lib/doleditor.class.php +++ b/htdocs/lib/doleditor.class.php @@ -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 ''; + print ''; } } diff --git a/htdocs/theme/auguria/ckeditor/config.js b/htdocs/theme/auguria/ckeditor/config.js new file mode 100644 index 00000000000..634ef24dddb --- /dev/null +++ b/htdocs/theme/auguria/ckeditor/config.js @@ -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'] + ]; +}; diff --git a/htdocs/theme/bureau2crea/ckeditor/config.js b/htdocs/theme/bureau2crea/ckeditor/config.js new file mode 100644 index 00000000000..634ef24dddb --- /dev/null +++ b/htdocs/theme/bureau2crea/ckeditor/config.js @@ -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'] + ]; +}; diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js new file mode 100644 index 00000000000..634ef24dddb --- /dev/null +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -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'] + ]; +}; diff --git a/htdocs/theme/freelug/ckeditor/config.js b/htdocs/theme/freelug/ckeditor/config.js new file mode 100644 index 00000000000..634ef24dddb --- /dev/null +++ b/htdocs/theme/freelug/ckeditor/config.js @@ -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'] + ]; +}; diff --git a/htdocs/theme/yellow/ckeditor/config.js b/htdocs/theme/yellow/ckeditor/config.js new file mode 100644 index 00000000000..634ef24dddb --- /dev/null +++ b/htdocs/theme/yellow/ckeditor/config.js @@ -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'] + ]; +};