TinyMCE Advanced - Version 3.3.9.1

Version Description

Added advanced options: stop removing iframes, stop removing HTML 5.0 elements, moved the support for custom editor styles to editor-style.css in the current theme.

Attention: if you have a customized tadv-mce.css file and your theme doesn't have editor-style.css, please download tadv-mce.css, rename it to editor-style.css and upload it to your current theme directory. Alternatively you can add there the editor-style.css from the Twenty Ten theme. If your theme has editor-style.css you can add any custom styles there.

Download this release

Release Info

Developer azaozz
Plugin Icon 128x128 TinyMCE Advanced
Version 3.3.9.1
Comparing to
See all releases

Code changes from version 3.3.9 to 3.3.9.1

Files changed (5) hide show
  1. css/tadv-mce.css +0 -3
  2. readme.txt +13 -14
  3. tadv_admin.php +77 -59
  4. tadv_defaults.php +2 -0
  5. tinymce-advanced.php +31 -21
css/tadv-mce.css DELETED
@@ -1,3 +0,0 @@
1
- /* Add css class names below and they will show in all "Style" drop-downs */
2
- .shutter {}
3
- .shutterset {}
 
 
 
readme.txt CHANGED
@@ -1,15 +1,17 @@
1
  === TinyMCE Advanced ===
2
- Contributors: Andrew Ozz
3
  Donate link:
4
- Tags: wysiwyg, formatting, tinymce, write, edit, post
5
  Requires at least: 3.1
6
  Tested up to: 3.1
7
- Stable tag: 3.3.9
8
 
9
  Enables the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
11
  == Description ==
12
 
 
 
13
  This plugin adds 17 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advanced HR, Advanced Image, Advanced Link, Advanced List, Context Menu, Emotions (Smilies), Date and Time, IESpell, Layer, Embed Media, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
14
 
15
  **Language Support:** The plugin interface in only in English, but the TinyMCE plugins include several translations: German, French, Italian, Spanish, Portuguese, Russian, Chinese and Japanese. More translations are available at the [TinyMCE web site](http://tinymce.moxiecode.com/download_i18n.php).
@@ -27,22 +29,22 @@ This plugin adds 17 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advance
27
 
28
  == Installation ==
29
 
 
 
30
  1. Download.
31
  2. Unzip.
32
- 3. Upload to the plugins directory (wp-content/plugins).
33
  4. Activate the plugin.
34
  5. Set your preferences at "Settings - TinyMCE Advanced".
35
  6. Clear your browser cache.
36
 
37
 
38
- = Upgrading from TinyMCE Advanced 2.x =
39
-
40
- 1. Deactivate the previous version.
41
- 2. Delete the "tinymce-advanced" folder from the WordPress plugins directory.
42
- 3. Follow the above steps to install the new version.
43
 
 
 
44
 
45
- == Changelog ==
46
 
47
  = 3.3.9 =
48
  Compatibility with WordPress 3.1 and TinyMCE 3.3.9, improved P and BR tags option.
@@ -79,10 +81,7 @@ Includes an admin page for arranging the TinyMCE toolbar buttons, easy installat
79
 
80
  = No styles are imported in the Styles drop-down menu. =
81
 
82
- These styles (just the classes) are imported from your current theme style.css file. However some themes use @import to load the actual css file(s). Tiny does not follow these links. To make the classes appear, add their names to tadv-mce.css file located in "tinymce-advanced/css". You do not need to copy the whole classes if you do not want them to appear in the editor, just add the names, like that:
83
-
84
- .my-class{}
85
- .my-other-class{}
86
 
87
  = I have just installed this plugin, but it does not do anything. =
88
 
1
  === TinyMCE Advanced ===
2
+ Contributors: azaozz
3
  Donate link:
4
+ Tags: wysiwyg, formatting, tinymce, write, editor
5
  Requires at least: 3.1
6
  Tested up to: 3.1
7
+ Stable tag: 3.3.9.1
8
 
9
  Enables the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
11
  == Description ==
12
 
13
+ Attention: if you are using customized tadv-mce.css and are updating to version 3.3.9.1 or newer, see the release notes.
14
+
15
  This plugin adds 17 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advanced HR, Advanced Image, Advanced Link, Advanced List, Context Menu, Emotions (Smilies), Date and Time, IESpell, Layer, Embed Media, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
16
 
17
  **Language Support:** The plugin interface in only in English, but the TinyMCE plugins include several translations: German, French, Italian, Spanish, Portuguese, Russian, Chinese and Japanese. More translations are available at the [TinyMCE web site](http://tinymce.moxiecode.com/download_i18n.php).
29
 
30
  == Installation ==
31
 
32
+ = Manual installation (FTP) =
33
+
34
  1. Download.
35
  2. Unzip.
36
+ 3. Upload to the plugins directory.
37
  4. Activate the plugin.
38
  5. Set your preferences at "Settings - TinyMCE Advanced".
39
  6. Clear your browser cache.
40
 
41
 
42
+ == Changelog ==
 
 
 
 
43
 
44
+ = 3.3.9.1 =
45
+ Added advanced options: stop removing iframes, stop removing HTML 5.0 elements, moved the support for custom editor styles to editor-style.css in the current theme.
46
 
47
+ Attention: if you have a customized tadv-mce.css file and your theme doesn't have editor-style.css, please download tadv-mce.css, rename it to editor-style.css and upload it to your current theme directory. Alternatively you can add there the editor-style.css from the Twenty Ten theme. If your theme has editor-style.css you can add any custom styles there.
48
 
49
  = 3.3.9 =
50
  Compatibility with WordPress 3.1 and TinyMCE 3.3.9, improved P and BR tags option.
81
 
82
  = No styles are imported in the Styles drop-down menu. =
83
 
84
+ These styles (just the classes) are imported from your current theme editor-style.css file. However some themes do not have this functionality. For these themes TinyMCE Advanced will let you add a customized editor-style.css and import it into the editor.
 
 
 
85
 
86
  = I have just installed this plugin, but it does not do anything. =
87
 
tadv_admin.php CHANGED
@@ -22,7 +22,7 @@ if ( isset( $_POST['tadv_uninstall'] ) ) {
22
  return;
23
  }
24
 
25
- if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '3.0', '<') ) { // if less than ... ?>
26
  <div class="error" style="margin-top:30px;">
27
  <p><?php _e('This plugin requires WordPress version 3.1 or newer. Please upgrade your WordPress installation or download an', 'tadv'); ?> <a href="http://wordpress.org/extend/plugins/tinymce-advanced/download/"><?php _e('older version of the plugin.', 'tadv'); ?></a></p>
28
  </div>
@@ -30,13 +30,11 @@ if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'],
30
  return;
31
  }
32
 
33
- $update_tadv_options = false;
34
  $imgpath = TADV_URL . 'images/';
35
-
36
  $tadv_toolbars = get_option('tadv_toolbars');
37
- if ( ! is_array($tadv_toolbars) ) {
 
38
  @include_once( TADV_PATH . 'tadv_defaults.php');
39
- $tadv_options = array( 'advlink1' => 0, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'no_autop' => 0 );
40
  } else {
41
  $tadv_options = get_option('tadv_options');
42
  $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
@@ -59,21 +57,25 @@ if ( isset( $_POST['tadv-save'] ) ) {
59
  $tadv_toolbars['toolbar_3'] = (array) $tb3['pre'];
60
  $tadv_toolbars['toolbar_4'] = (array) $tb4['pre'];
61
 
62
- update_option( 'tadv_toolbars', $tadv_toolbars );
63
-
64
  $tadv_options['advlink1'] = $_POST['advlink1'] ? 1 : 0;
65
  $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
66
  $tadv_options['advlist'] = $_POST['advlist'] ? 1 : 0;
67
  $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
68
- $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
 
 
 
 
69
  $tadv_options['no_autop'] = $_POST['no_autop'] ? 1 : 0;
70
- $update_tadv_options = true;
 
 
71
  }
72
 
73
  $hidden_row = 0;
74
  $i = 0;
75
  foreach ( $tadv_toolbars as $toolbar ) {
76
- $l = false;
77
  $i++;
78
 
79
  if ( empty($toolbar) ) {
@@ -82,11 +84,24 @@ foreach ( $tadv_toolbars as $toolbar ) {
82
  }
83
 
84
  foreach( $toolbar as $k => $v ) {
85
- if ( strpos($v, 'separator') !== false ) $toolbar[$k] = 'separator';
86
- if ( 'layer' == $v ) $l = $k;
87
- if ( empty($v) ) unset($toolbar[$k]);
 
 
 
 
 
 
 
 
88
  }
89
- if ( $l ) array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
 
 
 
 
 
90
 
91
  $btns["toolbar_$i"] = $toolbar;
92
  }
@@ -100,33 +115,35 @@ if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolb
100
  } else {
101
  $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
102
  }
103
- if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
104
- if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
105
- if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
106
-
107
- if ( in_array('nonbreaking', $allbtns) ) $plugins[] = 'nonbreaking';
108
- if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
109
- if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
110
- if ( in_array('insertdate', $allbtns) ||
111
- in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
112
-
113
- if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
114
- if ( in_array('print', $allbtns) ) $plugins[] = 'print';
115
- if ( in_array('iespell', $allbtns) ) $plugins[] = 'iespell';
116
- if ( in_array('search', $allbtns) ||
117
- in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
118
-
119
- if ( in_array('cite', $allbtns) ||
120
- in_array('ins', $allbtns) ||
121
- in_array('del', $allbtns) ||
122
- in_array('abbr', $allbtns) ||
123
- in_array('acronym', $allbtns) ||
124
- in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
125
-
126
- if ( $tadv_options['advlink1'] == '1' ) $plugins[] = 'advlink';
127
- if ( $tadv_options['advlist'] == '1' ) $plugins[] = 'advlist';
128
- if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
129
- if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
 
 
130
 
131
  $buttons = array( 'Hide next row' => 'wp_adv', 'Quote' => 'blockquote', 'Bold' => 'bold', 'Italic' => 'italic', 'Strikethrough' => 'strikethrough', 'Underline' => 'underline', 'Bullet List' => 'bullist', 'Numbered List' => 'numlist', 'Outdent' => 'outdent', 'Indent' => 'indent', 'Allign Left' => 'justifyleft', 'Center' => 'justifycenter', 'Alligh Right' => 'justifyright', 'Justify' => 'justifyfull', 'Cut' => 'cut', 'Copy' => 'copy', 'Paste' => 'paste', 'Link' => 'link', 'Remove Link' => 'unlink', 'Insert Image' => 'image', 'More Tag' => 'wp_more', 'Split Page' => 'wp_page', 'Search' => 'search', 'Replace' => 'replace', '<!--fontselect-->' => 'fontselect', '<!--fontsizeselect-->' => 'fontsizeselect', 'Help' => 'wp_help', 'Full Screen' => 'fullscreen', '<!--styleselect-->' => 'styleselect', '<!--formatselect-->' => 'formatselect', 'Text Color' => 'forecolor', 'Back Color' => 'backcolor', 'Paste as Text' => 'pastetext', 'Paste from Word' => 'pasteword', 'Remove Format' => 'removeformat', 'Clean Code' => 'cleanup', 'Check Spelling' => 'spellchecker', 'Character Map' => 'charmap', 'Print' => 'print', 'Undo' => 'undo', 'Redo' => 'redo', 'Table' => 'tablecontrols', 'Citation' => 'cite', 'Inserted Text' => 'ins', 'Deleted Text' => 'del', 'Abbreviation' => 'abbr', 'Acronym' => 'acronym', 'XHTML Attribs' => 'attribs', 'Layer' => 'layer', 'Advanced HR' => 'advhr', 'View HTML' => 'code', 'Hidden Chars' => 'visualchars', 'NB Space' => 'nonbreaking', 'Sub' => 'sub', 'Sup' => 'sup', 'Visual Aids' => 'visualaid', 'Insert Date' => 'insertdate', 'Insert Time' => 'inserttime', 'Anchor' => 'anchor', 'Style' => 'styleprops', 'Smilies' => 'emotions', 'Insert Movie' => 'media', 'IE Spell' => 'iespell' );
132
 
@@ -139,17 +156,17 @@ $tadv_allbtns = array_values($buttons);
139
  $tadv_allbtns[] = 'separator';
140
  $tadv_allbtns[] = '|';
141
 
142
- if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
143
- if ( get_option('tadv_btns1') != $toolbar_1 ) update_option( 'tadv_btns1', $toolbar_1 );
144
- if ( get_option('tadv_btns2') != $toolbar_2 ) update_option( 'tadv_btns2', $toolbar_2 );
145
- if ( get_option('tadv_btns3') != $toolbar_3 ) update_option( 'tadv_btns3', $toolbar_3 );
146
- if ( get_option('tadv_btns4') != $toolbar_4 ) update_option( 'tadv_btns4', $toolbar_4 );
147
- if ( get_option('tadv_allbtns') != $tadv_allbtns ) update_option( 'tadv_allbtns', $tadv_allbtns );
148
-
149
  for ( $i = 1; $i < 21; $i++ )
150
  $buttons["s$i"] = "separator$i";
151
 
152
- if ( isset($_POST['tadv-save']) ) { ?>
 
 
 
 
 
 
 
153
  <div class="updated" id="message"><p><?php _e('Options saved', 'tadv'); ?></p></div>
154
  <?php } ?>
155
 
@@ -313,16 +330,21 @@ if ( is_array($buttons) ) {
313
  </td></tr>
314
 
315
  <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
316
- <p style="font-weight:bold;color:#CD0000;"><?php _e('Advanced Options', 'tadv'); ?></p><?php
317
-
318
- if ( function_exists('mceopt_admin') )
319
- echo '<p><a href="' . admin_url('options-general.php?page=tinymce-options/tinymce-options.php') . '">' . __('Manage TinyMCE Options', 'tadv') . '</a></p>'; ?>
320
 
321
  <p><input type="checkbox" class="tadv-chk" name="advlink1" id="advlink1" <?php if ( $tadv_options['advlink1'] == '1' ) echo ' checked="checked"'; ?> /> <label for="advlink1" class="tadv-box"><?php _e('Advanced Link', 'tadv'); ?></label> <?php _e('Enabling this TinyMCE plugin will overwrite the new internal links feature in WordPress 3.1. Cuttently there is no way to enable both of them at the same time.', 'tadv'); ?></p>
322
 
323
- <p><?php _e('Custom CSS styles can be added in', 'tadv'); ?> <a href="plugin-editor.php?file=tinymce-advanced/css/tadv-mce.css&amp;plugin=tinymce-advanced/tinymce-advanced.php"> <?php _e('/wp-content/plugins/tinymce-advanced/css/tadv-mce.css.', 'tadv'); ?></a> <?php _e('They will be imported and used in TinyMCE. Only CSS classes will be used, also <strong>div.my-class</strong> would not work, but <strong>.my-class</strong> will.', 'tadv'); ?></p>
 
324
 
325
- <p><input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /> <label for="importcss" class="tadv-box"><?php _e('Import the current theme CSS classes.', 'tadv'); ?></label> <?php _e('You can try to import the styles from your theme\'s stylesheet. This can improve the look of the visual editor and make it more like your theme. However this is not necessary for many new and updated themes (like Twenty Ten) as they style the visual editor automatically.', 'tadv'); ?></p>
 
 
 
 
 
 
 
326
 
327
  <p><input type="checkbox" class="tadv-chk" name="no_autop" id="no_autop" <?php if ( $tadv_options['no_autop'] == '1' ) echo ' checked="checked"'; ?> /> <label for="no_autop" class="tadv-box"><?php _e('Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor', 'tadv'); ?></label> <?php _e('This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently. Also line breaks in the HTML editor would still affect the output, in particular do not use empty lines, line breaks inside HTML tags or multiple &lt;br /&gt; tags.', 'tadv'); ?></p>
328
  </td></tr>
@@ -359,7 +381,3 @@ if ( is_array($buttons) ) {
359
  </form>
360
  </div>
361
  </div>
362
-
363
- <?php
364
- if ( $update_tadv_options )
365
- update_option( 'tadv_options', $tadv_options );
22
  return;
23
  }
24
 
25
+ if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '3.1', '<') ) { // if less than ... ?>
26
  <div class="error" style="margin-top:30px;">
27
  <p><?php _e('This plugin requires WordPress version 3.1 or newer. Please upgrade your WordPress installation or download an', 'tadv'); ?> <a href="http://wordpress.org/extend/plugins/tinymce-advanced/download/"><?php _e('older version of the plugin.', 'tadv'); ?></a></p>
28
  </div>
30
  return;
31
  }
32
 
 
33
  $imgpath = TADV_URL . 'images/';
 
34
  $tadv_toolbars = get_option('tadv_toolbars');
35
+
36
+ if ( empty($tadv_toolbars) || ! is_array($tadv_toolbars) ) {
37
  @include_once( TADV_PATH . 'tadv_defaults.php');
 
38
  } else {
39
  $tadv_options = get_option('tadv_options');
40
  $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
57
  $tadv_toolbars['toolbar_3'] = (array) $tb3['pre'];
58
  $tadv_toolbars['toolbar_4'] = (array) $tb4['pre'];
59
 
 
 
60
  $tadv_options['advlink1'] = $_POST['advlink1'] ? 1 : 0;
61
  $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
62
  $tadv_options['advlist'] = $_POST['advlist'] ? 1 : 0;
63
  $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
64
+
65
+ $tadv_options['iframe'] = $_POST['iframe'] ? 1 : 0;
66
+ $tadv_options['html5'] = $_POST['html5'] ? 1 : 0;
67
+ $tadv_options['editorstyle'] = $_POST['editorstyle'] ? 1 : 0;
68
+ $tadv_options['hideclasses'] = $_POST['hideclasses'] ? 1 : 0;
69
  $tadv_options['no_autop'] = $_POST['no_autop'] ? 1 : 0;
70
+
71
+ update_option( 'tadv_toolbars', $tadv_toolbars );
72
+ update_option( 'tadv_options', $tadv_options );
73
  }
74
 
75
  $hidden_row = 0;
76
  $i = 0;
77
  foreach ( $tadv_toolbars as $toolbar ) {
78
+ $l = $t = false;
79
  $i++;
80
 
81
  if ( empty($toolbar) ) {
84
  }
85
 
86
  foreach( $toolbar as $k => $v ) {
87
+ if ( strpos($v, 'separator') !== false )
88
+ $toolbar[$k] = 'separator';
89
+
90
+ if ( 'layer' == $v )
91
+ $l = $k;
92
+
93
+ if ( 'tablecontrols' == $v )
94
+ $t = $k;
95
+
96
+ if ( empty($v) )
97
+ unset($toolbar[$k]);
98
  }
99
+
100
+ if ( $l !== false )
101
+ array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
102
+
103
+ if ( $t !== false )
104
+ array_splice( $toolbar, $t + 1, 0, 'delete_table,' );
105
 
106
  $btns["toolbar_$i"] = $toolbar;
107
  }
115
  } else {
116
  $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
117
  }
118
+
119
+ if ( in_array('media', $allbtns) ) $plugins[] = 'media';
120
+ if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
121
+ if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
122
+ if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
123
+
124
+ if ( in_array('nonbreaking', $allbtns) ) $plugins[] = 'nonbreaking';
125
+ if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
126
+ if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
127
+ if ( in_array('insertdate', $allbtns) ||
128
+ in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
129
+
130
+ if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
131
+ if ( in_array('print', $allbtns) ) $plugins[] = 'print';
132
+ if ( in_array('iespell', $allbtns) ) $plugins[] = 'iespell';
133
+ if ( in_array('search', $allbtns) ||
134
+ in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
135
+
136
+ if ( in_array('cite', $allbtns) ||
137
+ in_array('ins', $allbtns) ||
138
+ in_array('del', $allbtns) ||
139
+ in_array('abbr', $allbtns) ||
140
+ in_array('acronym', $allbtns) ||
141
+ in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
142
+
143
+ if ( $tadv_options['advlink1'] == '1' ) $plugins[] = 'advlink';
144
+ if ( $tadv_options['advlist'] == '1' ) $plugins[] = 'advlist';
145
+ if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
146
+ if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
147
 
148
  $buttons = array( 'Hide next row' => 'wp_adv', 'Quote' => 'blockquote', 'Bold' => 'bold', 'Italic' => 'italic', 'Strikethrough' => 'strikethrough', 'Underline' => 'underline', 'Bullet List' => 'bullist', 'Numbered List' => 'numlist', 'Outdent' => 'outdent', 'Indent' => 'indent', 'Allign Left' => 'justifyleft', 'Center' => 'justifycenter', 'Alligh Right' => 'justifyright', 'Justify' => 'justifyfull', 'Cut' => 'cut', 'Copy' => 'copy', 'Paste' => 'paste', 'Link' => 'link', 'Remove Link' => 'unlink', 'Insert Image' => 'image', 'More Tag' => 'wp_more', 'Split Page' => 'wp_page', 'Search' => 'search', 'Replace' => 'replace', '<!--fontselect-->' => 'fontselect', '<!--fontsizeselect-->' => 'fontsizeselect', 'Help' => 'wp_help', 'Full Screen' => 'fullscreen', '<!--styleselect-->' => 'styleselect', '<!--formatselect-->' => 'formatselect', 'Text Color' => 'forecolor', 'Back Color' => 'backcolor', 'Paste as Text' => 'pastetext', 'Paste from Word' => 'pasteword', 'Remove Format' => 'removeformat', 'Clean Code' => 'cleanup', 'Check Spelling' => 'spellchecker', 'Character Map' => 'charmap', 'Print' => 'print', 'Undo' => 'undo', 'Redo' => 'redo', 'Table' => 'tablecontrols', 'Citation' => 'cite', 'Inserted Text' => 'ins', 'Deleted Text' => 'del', 'Abbreviation' => 'abbr', 'Acronym' => 'acronym', 'XHTML Attribs' => 'attribs', 'Layer' => 'layer', 'Advanced HR' => 'advhr', 'View HTML' => 'code', 'Hidden Chars' => 'visualchars', 'NB Space' => 'nonbreaking', 'Sub' => 'sub', 'Sup' => 'sup', 'Visual Aids' => 'visualaid', 'Insert Date' => 'insertdate', 'Insert Time' => 'inserttime', 'Anchor' => 'anchor', 'Style' => 'styleprops', 'Smilies' => 'emotions', 'Insert Movie' => 'media', 'IE Spell' => 'iespell' );
149
 
156
  $tadv_allbtns[] = 'separator';
157
  $tadv_allbtns[] = '|';
158
 
 
 
 
 
 
 
 
159
  for ( $i = 1; $i < 21; $i++ )
160
  $buttons["s$i"] = "separator$i";
161
 
162
+ if ( isset($_POST['tadv-save']) ) {
163
+ update_option( 'tadv_plugins', $plugins );
164
+ update_option( 'tadv_btns1', $toolbar_1 );
165
+ update_option( 'tadv_btns2', $toolbar_2 );
166
+ update_option( 'tadv_btns3', $toolbar_3 );
167
+ update_option( 'tadv_btns4', $toolbar_4 );
168
+ update_option( 'tadv_allbtns', $tadv_allbtns );
169
+ ?>
170
  <div class="updated" id="message"><p><?php _e('Options saved', 'tadv'); ?></p></div>
171
  <?php } ?>
172
 
330
  </td></tr>
331
 
332
  <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
333
+ <p style="font-weight:bold;color:#CD0000;"><?php _e('Advanced Options', 'tadv'); ?></p>
 
 
 
334
 
335
  <p><input type="checkbox" class="tadv-chk" name="advlink1" id="advlink1" <?php if ( $tadv_options['advlink1'] == '1' ) echo ' checked="checked"'; ?> /> <label for="advlink1" class="tadv-box"><?php _e('Advanced Link', 'tadv'); ?></label> <?php _e('Enabling this TinyMCE plugin will overwrite the new internal links feature in WordPress 3.1. Cuttently there is no way to enable both of them at the same time.', 'tadv'); ?></p>
336
 
337
+ <?php if ( ! current_theme_supports( 'editor-style' ) ) { ?>
338
+ <p><?php _e('It seems your theme (still) doesn\'t support customised styles for the editor. If you would like to use that, you can create a file named <i>editor-style.css</i> and add it to your theme\'s directory. You can use the editor-style.css from the Twenty Ten theme as a template.', 'tadv'); ?></p>
339
 
340
+ <p><input type="checkbox" class="tadv-chk" name="editorstyle" id="editorstyle" <?php if ( $tadv_options['editorstyle'] == '1' ) echo ' checked="checked"'; ?> /> <label for="editorstyle" class="tadv-box"><?php _e('Import editor-style.css.', 'tadv'); ?></label> <?php _e('This is only needed if you created that file. Themes that style the editor will import the stylesheet automatically.', 'tadv'); ?></p>
341
+ <?php } ?>
342
+
343
+ <p><input type="checkbox" class="tadv-chk" name="iframe" id="iframe" <?php if ( $tadv_options['iframe'] == '1' ) echo ' checked="checked"'; ?> /> <label for="iframe" class="tadv-box"><?php _e('Do not remove IFRAME tags.', 'tadv'); ?></label> <?php _e('This will allow you to paste the new style video embed code from Vimeo and YouTube. Note that this may be a security concern if pasting arbitrary HTML.', 'tadv'); ?></p>
344
+
345
+ <p><input type="checkbox" class="tadv-chk" name="html5" id="html5" <?php if ( $tadv_options['html5'] == '1' ) echo ' checked="checked"'; ?> /> <label for="html5" class="tadv-box"><?php _e('Do not remove HTML 5.0 tags.', 'tadv'); ?></label> <?php _e('This will stop the visual editor from removing HTML 5.0 tags when serializing the code. However only some browsers support some of these tags so the editor may behave unexpectedly depending on your browser and its version.', 'tadv'); ?></p>
346
+
347
+ <p><input type="checkbox" class="tadv-chk" name="hideclasses" id="hideclasses" <?php if ( $tadv_options['hideclasses'] == '1' ) echo ' checked="checked"'; ?> /> <label for="hideclasses" class="tadv-box"><?php _e('Hide all CSS classes in the editor menus.', 'tadv'); ?></label> <?php _e('Note that selecting this will also disable the Styles drop-down menu.', 'tadv'); ?></p>
348
 
349
  <p><input type="checkbox" class="tadv-chk" name="no_autop" id="no_autop" <?php if ( $tadv_options['no_autop'] == '1' ) echo ' checked="checked"'; ?> /> <label for="no_autop" class="tadv-box"><?php _e('Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor', 'tadv'); ?></label> <?php _e('This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently. Also line breaks in the HTML editor would still affect the output, in particular do not use empty lines, line breaks inside HTML tags or multiple &lt;br /&gt; tags.', 'tadv'); ?></p>
350
  </td></tr>
381
  </form>
382
  </div>
383
  </div>
 
 
 
 
tadv_defaults.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advimage' );
4
 
5
  $tadv_toolbars = array(
1
  <?php
2
 
3
+ $tadv_options = array( 'advlink1' => 0, 'advimage' => 1, 'editorstyle' => 0, 'hideclasses' => 0, 'contextmenu' => 0, 'no_autop' => 0 );
4
+
5
  $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advimage' );
6
 
7
  $tadv_toolbars = array(
tinymce-advanced.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE, the visual editor in WordPress.
6
- Version: 3.3.9
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
@@ -43,15 +43,17 @@ if ( ! function_exists('tadv_add_scripts') ) {
43
  } // end tadv_add_scripts
44
 
45
 
46
- if ( ! function_exists('tadv_activate') ) {
47
- function tadv_activate() {
 
 
 
48
 
49
  @include_once('tadv_defaults.php');
50
- $tadv_options = array( 'advlink1' => 0, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'no_autop' => 0 );
51
 
52
  if ( isset($tadv_toolbars) ) {
 
53
  add_option( 'tadv_toolbars', $tadv_toolbars, '', 'no' );
54
- add_option( 'tadv_options', $tadv_options, '', 'no' );
55
  add_option( 'tadv_plugins', $tadv_plugins, '', 'no' );
56
  add_option( 'tadv_btns1', $tadv_btns1, '', 'no' );
57
  add_option( 'tadv_btns2', $tadv_btns2, '', 'no' );
@@ -60,24 +62,9 @@ if ( ! function_exists('tadv_activate') ) {
60
  add_option( 'tadv_allbtns', $tadv_allbtns, '', 'no' );
61
  }
62
  }
63
- add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
64
  }
65
 
66
-
67
- if ( ! function_exists('tdav_css') ) {
68
- function tdav_css($wp) {
69
- $tadv_options = get_option('tadv_options', array());
70
-
71
- if ( $tadv_options['importcss'] == '1' )
72
- $wp .= ',' . get_bloginfo('stylesheet_url');
73
-
74
- $wp .= ',' . TADV_URL . 'css/tadv-mce.css';
75
- return trim($wp, ' ,');
76
- }
77
- add_filter( 'mce_css', 'tdav_css' );
78
- }
79
-
80
-
81
  if ( ! function_exists('tdav_get_file') ) {
82
  function tdav_get_file($path) {
83
 
@@ -112,6 +99,7 @@ if ( ! function_exists('tadv_mce_btns') ) {
112
  global $tadv_allbtns, $tadv_hidden_row;
113
  $tadv_btns1 = (array) get_option('tadv_btns1', array());
114
  $tadv_allbtns = (array) get_option('tadv_allbtns', array());
 
115
 
116
  if ( in_array( 'wp_adv', $tadv_btns1 ) )
117
  $tadv_hidden_row = 2;
@@ -120,6 +108,10 @@ if ( ! function_exists('tadv_mce_btns') ) {
120
  $orig = array_diff( $orig, $tadv_allbtns );
121
  $tadv_btns1 = array_merge( $tadv_btns1, $orig );
122
  }
 
 
 
 
123
  return $tadv_btns1;
124
  }
125
  add_filter( 'mce_buttons', 'tadv_mce_btns', 999 );
@@ -181,6 +173,7 @@ if ( ! function_exists('tadv_mce_options') ) {
181
  function tadv_mce_options($init) {
182
  global $tadv_hidden_row;
183
  $tadv_options = get_option('tadv_options', array());
 
184
 
185
  if ( $tadv_hidden_row > 0 )
186
  $init['wordpress_adv_toolbar'] = 'toolbar' . $tadv_hidden_row;
@@ -190,6 +183,23 @@ if ( ! function_exists('tadv_mce_options') ) {
190
  if ( isset($tadv_options['no_autop']) && $tadv_options['no_autop'] == 1 )
191
  $init['apply_source_formatting'] = true;
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  return $init;
194
  }
195
  add_filter( 'tiny_mce_before_init', 'tadv_mce_options' );
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE, the visual editor in WordPress.
6
+ Version: 3.3.9.1-beta2
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
43
  } // end tadv_add_scripts
44
 
45
 
46
+ if ( ! function_exists('tadv_load_defaults') ) {
47
+ function tadv_load_defaults() {
48
+ $tadv_options = get_option('tadv_options');
49
+ if ( ! empty($tadv_options) )
50
+ return;
51
 
52
  @include_once('tadv_defaults.php');
 
53
 
54
  if ( isset($tadv_toolbars) ) {
55
+ add_option( 'tadv_options', $tadv_options );
56
  add_option( 'tadv_toolbars', $tadv_toolbars, '', 'no' );
 
57
  add_option( 'tadv_plugins', $tadv_plugins, '', 'no' );
58
  add_option( 'tadv_btns1', $tadv_btns1, '', 'no' );
59
  add_option( 'tadv_btns2', $tadv_btns2, '', 'no' );
62
  add_option( 'tadv_allbtns', $tadv_allbtns, '', 'no' );
63
  }
64
  }
65
+ add_action( 'admin_init', 'tadv_load_defaults' );
66
  }
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  if ( ! function_exists('tdav_get_file') ) {
69
  function tdav_get_file($path) {
70
 
99
  global $tadv_allbtns, $tadv_hidden_row;
100
  $tadv_btns1 = (array) get_option('tadv_btns1', array());
101
  $tadv_allbtns = (array) get_option('tadv_allbtns', array());
102
+ $tadv_options = get_option('tadv_options', array());
103
 
104
  if ( in_array( 'wp_adv', $tadv_btns1 ) )
105
  $tadv_hidden_row = 2;
108
  $orig = array_diff( $orig, $tadv_allbtns );
109
  $tadv_btns1 = array_merge( $tadv_btns1, $orig );
110
  }
111
+
112
+ if ( $tadv_options['editorstyle'] == '1' )
113
+ add_editor_style(); // import user created editor-style.css
114
+
115
  return $tadv_btns1;
116
  }
117
  add_filter( 'mce_buttons', 'tadv_mce_btns', 999 );
173
  function tadv_mce_options($init) {
174
  global $tadv_hidden_row;
175
  $tadv_options = get_option('tadv_options', array());
176
+ $ext_elements = '';
177
 
178
  if ( $tadv_hidden_row > 0 )
179
  $init['wordpress_adv_toolbar'] = 'toolbar' . $tadv_hidden_row;
183
  if ( isset($tadv_options['no_autop']) && $tadv_options['no_autop'] == 1 )
184
  $init['apply_source_formatting'] = true;
185
 
186
+ if ( isset($tadv_options['hideclasses']) && $tadv_options['hideclasses'] == 1 )
187
+ $init['class_filter'] = '[function(){return false;}]';
188
+
189
+ if ( isset($tadv_options['iframe']) && $tadv_options['iframe'] == 1 )
190
+ $ext_elements = ',iframe[*]';
191
+
192
+ if ( isset($tadv_options['html5']) && $tadv_options['html5'] == 1 )
193
+ $ext_elements .= ',article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr';
194
+
195
+ if ( !empty($ext_elements) ) {
196
+
197
+ if ( !empty($init['extended_valid_elements']) )
198
+ $init['extended_valid_elements'] .= $ext_elements;
199
+ else
200
+ $init['extended_valid_elements'] = trim($ext_elements, ',');
201
+ }
202
+
203
  return $init;
204
  }
205
  add_filter( 'tiny_mce_before_init', 'tadv_mce_options' );