#352703 by sun: Fixed wrong default configuration options for TinyMCE 3.2.1+.
authorsun
Wed, 31 Dec 2008 15:01:05 +0000 (15:01 +0000)
committersun
Wed, 31 Dec 2008 15:01:05 +0000 (15:01 +0000)
CHANGELOG.txt
editors/tinymce.inc

index cf18ce0..8d979a9 100644 (file)
@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
 
 Wysiwyg 5.x-x.x, xxxx-xx-xx
 ---------------------------
+#352703 by sun: Fixed wrong default configuration options for TinyMCE 3.2.1+.
 #348317 by sun: Fixed TinyMCE's extended_valid_elements for advlink/advimage
   plugin.
 #348986 by sun: Added CSS class for toggle link container.
index 7321404..4db8d8e 100644 (file)
@@ -222,31 +222,23 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
       $init += array(
         'theme_advanced_resize_horizontal' => FALSE,
         'theme_advanced_resizing_use_cookie' => FALSE,
+        'theme_advanced_path_location' => isset($config['path_loc']) ? $config['path_loc'] : 'bottom',
+        'theme_advanced_resizing' => isset($config['resizing']) ? $config['resizing'] : 1,
+        'theme_advanced_toolbar_location' => isset($config['toolbar_loc']) ? $config['toolbar_loc'] : 'top',
+        'theme_advanced_toolbar_align' => isset($config['toolbar_align']) ? $config['toolbar_align'] : 'left',
       );
       if (isset($config['block_formats'])) {
         $init['theme_advanced_blockformats'] = $config['block_formats'];
       }
-      if (isset($config['path_loc'])) {
-        $init['theme_advanced_path_location'] = $config['path_loc'];
-      }
-      if (isset($config['resizing'])) {
-        $init['theme_advanced_resizing'] = $config['resizing'];
-      }
-      if (isset($config['toolbar_loc'])) {
-        $init['theme_advanced_toolbar_location'] = $config['toolbar_loc'];
-      }
-      if (isset($config['toolbar_align'])) {
-        $init['theme_advanced_toolbar_align'] = $config['toolbar_align'];
-      }
-
       if (isset($init['buttons'])) {
-        // Note: These rows need to be set to NULL otherwise TinyMCE loads its
-        // own buttons as defined in advanced theme.
+        // These rows explicitly need to be set to be empty, otherwise TinyMCE
+        // loads its default buttons of the advanced theme for each row.
         $init += array(
           'theme_advanced_buttons1' => array(),
           'theme_advanced_buttons2' => array(),
           'theme_advanced_buttons3' => array(),
         );
+        // @todo Allow to sort/arrange editor buttons.
         for ($i = 0; $i < count($init['buttons']); $i++) {
           $init['theme_advanced_buttons1'][] = $init['buttons'][$i];
         }