Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 2032)
+++ branches/2.8.x/CHANGELOG	(revision 2033)
@@ -11,6 +11,9 @@
 ! = Update/Change
 ===============================================================================
 
+16 Dec-2013 Build 2033 Dietmar Woellbrink (Luisehahne)
+! /include/editarea/wb_wrapper_edit_area.php:: add init parameters as Array
+! /modules/droplets/modify_droplet.php call edit_area with Array
 16 Dec-2013 Build 2032 Dietmar Woellbrink (Luisehahne)
 ! /modules/droplets/example/ update some droplets and remove the old ones
 15 Dec-2013 Build 2031 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/include/editarea/wb_wrapper_edit_area.php
===================================================================
--- branches/2.8.x/wb/include/editarea/wb_wrapper_edit_area.php	(revision 2032)
+++ branches/2.8.x/wb/include/editarea/wb_wrapper_edit_area.php	(revision 2033)
@@ -37,60 +37,131 @@
 /*]]>*/
 </script>
 
-<?php
+<?php }
 
+if (!function_exists('getEditareaDefaultSettings')) {
+    function getEditareaDefaultSettings() {
+        
+    /**
+     * toolbar: define the toolbar that will be displayed, each element being separated by a ",".
+     * Type: String (combinaison of: "|", "*", "search", "go_to_line", "undo", "redo", "change_smooth_selection", "reset_highlight", "highlight", "word_wrap", "help", "save", "load", "new_document", "syntax_selection")
+     * "|" or "separator" make appears a separator in the toolbar.
+     * "*" or "return" make appears a line-break in the toolbar
+     * Default: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
+     */
+    
+    return array (
+    		'id' => "src"	// should contain the id of the textarea that should be converted into an editor
+    		,'language' => "en"
+    		,'syntax' => ""
+    		,'start_highlight' => false	// if start with highlight
+    		,'is_multi_files' => false		// enable the multi file mode (the textarea content is ignored)
+    		,'min_width' => 400
+    		,'min_height' => 125
+    		,'allow_resize' => "y"	// possible values: "no", "both", "x", "y"
+    		,'allow_toggle' => true		// true or false
+    		,'plugins' => "" // comma separated plugin list
+    		,'browsers' => "all"	// all or known
+    		,'display' => "onload" 		// onload or later
+    		,'toolbar' => "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
+    		,'begin_toolbar' => ""		//  "new_document, save, load, |"
+    		,'end_toolbar' => ""		// or end_toolbar
+    		,'font_size' => "10"		// not for IE
+    		,'font_family' => "monospace, verdana"	// can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... 
+    		,'cursor_position' => "begin"
+    		,'gecko_spellcheck' => false	// enable/disable by default the gecko_spellcheck
+    		,'max_undo' => 30
+    		,'fullscreen' => false
+    		,'is_editable' => true
+    		,'word_wrap' => false		// define if the text is wrapped of not in the textarea
+    		,'replace_tab_by_spaces' => false
+    		,'debug' => false		// used to display some debug information into a newly created textarea. Can be usefull to display trace info in it if you want to modify the code
+    		,'show_line_colors' => false	// if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
+    		,'syntax_selection_allow' => "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
+    		,'smooth_selection' => true
+    		,'autocompletion' => false	// NOT IMPLEMENTED			
+    		,'load_callback' => ""		// click on load button (function name)
+    		,'save_callback' => ""		// click on save button (function name)
+    		,'change_callback' => ""	// textarea onchange trigger (function name)
+    		,'submit_callback' => ""	// form submited (function name)
+    		,'EA_init_callback' => ""	// EditArea initiliazed (function name)
+    		,'EA_delete_callback' => ""	// EditArea deleted (function name)
+    		,'EA_load_callback' => ""	// EditArea fully loaded and displayed (function name)
+    		,'EA_unload_callback' => ""	// EditArea delete while being displayed (function name)
+    		,'EA_toggle_on_callback' => ""	         // EditArea toggled on (function name)
+    		,'EA_toggle_off_callback' => ""	        // EditArea toggled off (function name)
+    		,'EA_file_switch_on_callback' => ""	    // a new tab is selected (called for the newly selected file)
+    		,'EA_file_switch_off_callback' => ""	// a new tab is selected (called for the previously selected file)
+    		,'EA_file_close_callback' => ""		    // close a tab
+    	);
+    }
 }
 if (!function_exists('registerEditArea')) {
-	function registerEditArea(
-                $id = 'code_area',
-                $syntax = 'php',
-                $syntax_selection = true,
-                $allow_resize = 'both',
-                $allow_toggle = true,
-                $start_highlight = true,
-                $min_width = 600,
-                $min_height = 450,
-                $toolbar = 'default'  )
-	{
+    
+function registerEditArea( $initId = null 
+            ,$syntax = "php"
+            ,$syntax_selection = true
+            ,$allow_resize = "both"
+            ,$allow_toggle = true
+            ,$start_highlight = true
+            ,$min_width = 600
+            ,$min_height = 450
+            ,$toolbar = "default" 
+            ) 
+{                
 
+$isArray = true;
+if( is_array($initId) ){
+//    $json = json_encode($sInitId, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG);
+    $aInitEditArea = getEditareaDefaultSettings();
+    $aInitEditArea = array_merge($aInitEditArea,$initId);      
+} else {
+    $id = $initId;
+    $aInitEditArea = getEditareaDefaultSettings();    
+    $aInitEditArea['id'] = $initId;
+    $aInitEditArea['syntax'] = $syntax;
+    $aInitEditArea['syntax_selection_allow'] = $syntax_selection;
+    $aInitEditArea['allow_resize'] = $allow_resize;
+    $aInitEditArea['allow_toggle'] = $allow_toggle;
+    $aInitEditArea['start_highlight'] = $start_highlight;
+    $aInitEditArea['min_width'] = $min_width;
+    $aInitEditArea['min_height'] = $min_height;
+    $aInitEditArea['toolbar'] = $toolbar;
+}
 		// set default toolbar if no user defined was specified
-		if ($toolbar == 'default') {
-			$toolbar = 'search, fullscreen, |, undo, redo, |, select_font, syntax_selection, |, highlight, reset_highlight, |, help';
-			$toolbar = (!$syntax_selection) ? str_replace('syntax_selection,', '', $toolbar) : $toolbar;
+		if ($aInitEditArea['toolbar'] == 'default') {
+			$aInitEditArea['toolbar'] = 'search, fullscreen, |, undo, redo, |, select_font, |, change_smooth_selection, highlight, reset_highlight, |, help';
+//			$aInitEditArea['toolbar'] = (!$aInitEditArea['syntax_selection_allow']) ? str_replace('syntax_selection,', '', $aInitEditArea['toolbar']) : $aInitEditArea['toolbar'];
 		}
 
 		// check if used Website Baker backend language is supported by EditArea
 		$language = 'en';
-		if (defined('LANGUAGE') && file_exists(dirname(__FILE__) . '/langs/' . strtolower(LANGUAGE) . '.js'))
+
+		if (defined('LANGUAGE') && is_readable(dirname(__FILE__).'/langs/'.strtolower(LANGUAGE).'.js'))
         {
-			$language = strtolower(LANGUAGE);
+			$aInitEditArea['language'] = strtolower(LANGUAGE);
 		}
 
 		// check if highlight syntax is supported by edit_area
-		$syntax = in_array($syntax, array('css', 'html', 'js', 'php', 'xml')) ? $syntax : 'php';
+		$aInitEditArea['syntax'] = in_array($aInitEditArea['syntax'], array('css', 'html', 'js', 'php', 'xml')) ? $aInitEditArea['syntax'] : 'basic';
 
 		// check if resize option is supported by edit_area
-		$allow_resize = in_array($allow_resize, array('no', 'both', 'x', 'y')) ? $allow_resize : 'no';
+		$aInitEditArea['allow_resize'] = in_array($aInitEditArea['allow_resize'], array('no', 'both', 'x', 'y')) ? $aInitEditArea['allow_resize'] : 'no';
 
 		if(!defined('LOADER_HELP')) {
 			loader_help();
 	        define('LOADER_HELP', true);
 		}
-
+        if(version_compare(PHP_VERSION, '5.3', '<'))
+        {
+            $json = json_encode($aInitEditArea);
+        } else {
+            $json = json_encode($aInitEditArea, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG);
+        }
 		// return the Javascript code
 		$result = <<< EOT
 		<script type="text/javascript">
-			editAreaLoader.init({
-				id: 				'$id',
-				start_highlight:	$start_highlight,
-				syntax:			    '$syntax',
-				min_width:			$min_width,
-				min_height:		    $min_height,
-				allow_resize: 		'$allow_resize',
-				allow_toggle: 		'$allow_toggle',
-				toolbar: 			'$toolbar',
-				language:			'$language'
-			});
+			editAreaLoader.init( $json );
 		</script>
 EOT;
 		return $result;
@@ -135,5 +206,3 @@
 		return $syntax ;
 	}
 }
-
-?>
\ No newline at end of file
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 2032)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 2033)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '2032');
+if(!defined('REVISION')) define('REVISION', '2033');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/droplets/modify_droplet.php
===================================================================
--- branches/2.8.x/wb/modules/droplets/modify_droplet.php	(revision 2032)
+++ branches/2.8.x/wb/modules/droplets/modify_droplet.php	(revision 2033)
@@ -46,8 +46,90 @@
 	}
 }
 require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
-echo registerEditArea ('contentedit','php',true,'both',true,true,600,450,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, help');
 
+/**
+ * toolbar: define the toolbar that will be displayed, each element being separated by a ",".
+ * Type: String (combinaison of: "|", "*", "search", "go_to_line", "undo", "redo", "change_smooth_selection", "reset_highlight", "highlight", "word_wrap", "help", "save", "load", "new_document", "syntax_selection")
+ * "|" or "separator" make appears a separator in the toolbar.
+ * "*" or "return" make appears a line-break in the toolbar
+ * Default: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
+
+$aDefaultSettings = array (
+		'id' => "src"	// should contain the id of the textarea that should be converted into an editor
+		,'language' => "en"
+		,'syntax' => ""
+		,'start_highlight' => false	// if start with highlight
+		,'is_multi_files' => false		// enable the multi file mode (the textarea content is ignored)
+		,'min_width' => 400
+		,'min_height' => 125
+		,'allow_resize' => "y"	// possible values: "no", "both", "x", "y"
+		,'allow_toggle' => true		// true or false
+		,'plugins' => "" // comma separated plugin list
+		,'browsers' => "all"	// all or known
+		,'display' => "onload" 		// onload or later
+		,'toolbar' => "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
+		,'begin_toolbar' => ""		//  "new_document, save, load, |"
+		,'end_toolbar' => ""		// or end_toolbar
+		,'font_size' => "10"		// not for IE
+		,'font_family' => "monospace"	// can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... 
+		,'cursor_position' => "begin"
+		,'gecko_spellcheck' => false	// enable/disable by default the gecko_spellcheck
+		,'max_undo' => 30
+		,'fullscreen' => false
+		,'is_editable' => true
+		,'word_wrap' => false		// define if the text is wrapped of not in the textarea
+		,'replace_tab_by_spaces' => false
+		,'debug' => false		// used to display some debug information into a newly created textarea. Can be usefull to display trace info in it if you want to modify the code
+		,'show_line_colors' => false	// if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
+		,'syntax_selection_allow' => "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
+		,'smooth_selection' => true
+		,'autocompletion' => false	// NOT IMPLEMENTED			
+		,'load_callback' => ""		// click on load button (function name)
+		,'save_callback' => ""		// click on save button (function name)
+		,'change_callback' => ""	// textarea onchange trigger (function name)
+		,'submit_callback' => ""	// form submited (function name)
+		,'EA_init_callback' => ""	// EditArea initiliazed (function name)
+		,'EA_delete_callback' => ""	// EditArea deleted (function name)
+		,'EA_load_callback' => ""	// EditArea fully loaded and displayed (function name)
+		,'EA_unload_callback' => ""	// EditArea delete while being displayed (function name)
+		,'EA_toggle_on_callback' => ""	         // EditArea toggled on (function name)
+		,'EA_toggle_off_callback' => ""	        // EditArea toggled off (function name)
+		,'EA_file_switch_on_callback' => ""	    // a new tab is selected (called for the newly selected file)
+		,'EA_file_switch_off_callback' => ""	// a new tab is selected (called for the previously selected file)
+		,'EA_file_close_callback' => ""		    // close a tab
+	);
+ */
+
+/**
+ * 
+ */
+$aInitEditArea = getEditareaDefaultSettings();
+$aInitEditArea['id'] = 'contentedit';
+$aInitEditArea['syntax'] = 'php';
+$aInitEditArea['allow_resize'] = 'y';
+$aInitEditArea['allow_toggle'] = true;
+$aInitEditArea['start_highlight'] = true;
+$aInitEditArea['min_width'] = 200;
+$aInitEditArea['min_height'] = 250;
+$aInitEditArea['toolbar'] = 'default';
+$aInitEditArea['syntax_selection_allow'] = 'basic,php,css,html';
+echo registerEditArea($aInitEditArea);
+
+/**
+ * 
+echo registerEditArea ('contentedit'
+                      ,'php'
+                      ,'basic,php,css,html'
+                      ,'y'
+                      ,true
+                      ,true
+                      ,200
+                      ,250
+                      ,'default'
+//                      ,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, word_wrap, |, help'
+);
+ */
+
 $modified_when = time();
 $modified_by = ($admin->ami_group_member('1') ? 1 : $admin->get_user_id());
 $sOverviewDroplets = $TEXT['LIST_OPTIONS'].' '.$DR_TEXT['DROPLETS'];
@@ -75,7 +157,7 @@
 <input type="hidden" name="show_wysiwyg" value="<?php echo $fetch_content['show_wysiwyg']; ?>" />
 <?php echo $admin->getFTAN(); ?>
 
-<table class="row_a" cellpadding="4" cellspacing="0" border="0" width="100%">
+<table class="row_a">
 		<tr>
 		<td width="10%" class="setting_name">
 			<?php echo $TEXT['NAME']; ?>:
@@ -140,7 +222,7 @@
 ?>
 	<tr>
 		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['CODE']; ?>:</td>
-		<td ><textarea name="savecontent" id ="contentedit" style="width: 98%; height: 450px;" rows="50" cols="120"><?php echo $content; ?></textarea>&nbsp;
+		<td ><textarea name="savecontent" id ="contentedit" style="width: 98%; height: 450px;" rows="10" cols="12"><?php echo $content; ?></textarea>&nbsp;
 		</td>
 	</tr>
 	<tr>
