AddQuicktag - Version 2.3.0-RC1

Version Description

(05/22/2014) = * Use on default all post types with active UI, incl. Custom and Defaul Post types * New settings UI to easier add quicktags to each post type * Add Widget area, now it is possible to use Quicktags on widgets with WP editor * Add brazilian translation * Add turkish translation * Add possibility to remove default quicktags * Changes on settings style, check in MP6 design, WP 3.8 * Add ukranian translation * Add solution to remove core quicktag, Beta Status * Fix TinyMCE Select Box in WordPress 3.9*

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin AddQuicktag
Version 2.3.0-RC1
Comparing to
See all releases

Code changes from version 2.2.2 to 2.3.0-RC1

addquicktag.php CHANGED
@@ -1,110 +1,198 @@
1
  <?php
 
2
  /**
3
  * Plugin Name: AddQuicktag
4
  * Plugin URI: http://bueltge.de/wp-addquicktags-de-plugin/120/
5
  * Text Domain: addquicktag
6
  * Domain Path: /languages
7
  * Description: Allows you to easily add custom Quicktags to the html- and visual-editor.
8
- * Version: 2.2.2
9
  * Author: Frank Bültge
10
  * Author URI: http://bueltge.de
11
- * License: GPLv3
12
- *
13
- *
14
- *
15
- License:
16
- ==============================================================================
17
- Copyright 2011 - 2013 Frank Bültge (email : frank@bueltge.de)
18
-
19
- This program is free software; you can redistribute it and/or modify
20
- it under the terms of the GNU General Public License as published by
21
- the Free Software Foundation; either version 2 of the License, or
22
- (at your option) any later version.
23
-
24
- This program is distributed in the hope that it will be useful,
25
- but WITHOUT ANY WARRANTY; without even the implied warranty of
26
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
- GNU General Public License for more details.
28
-
29
- You should have received a copy of the GNU General Public License
30
- along with this program; if not, write to the Free Software
31
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
-
33
- Requirements:
34
- ==============================================================================
35
- This plugin requires WordPress >= 3.3 and tested with PHP Interpreter >= 5.3
36
- *
37
- *
38
  *
39
  * Add Quicktag Plugin class
40
- *
41
  * @since 2.0.0
42
  */
43
  class Add_Quicktag {
44
-
45
- protected static $classobj;
46
-
47
- static private $option_string = 'rmnlQuicktagSettings';
48
- // use filter 'addquicktag_pages' for add custom pages
 
 
 
 
 
 
 
 
49
  static private $admin_pages_for_js = array(
50
- 'post.php', 'post-new.php', 'comment.php', 'edit-comments.php'
 
 
 
 
51
  );
52
- // use filter 'addquicktag_post_types' for add custom post_types
53
- static private $post_types_for_js = array(
54
- 'post', 'page', 'comment', 'edit-comments'
55
- );
56
-
 
 
 
 
 
 
57
  static private $plugin;
58
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Constructor, init the functions inside WP
61
  *
62
  * @since 2.0.0
63
- * @return void
64
  */
65
- function __construct() {
66
-
67
- if ( ! is_admin() )
68
  return;
69
-
 
70
  // get string of plugin
71
- self :: $plugin = plugin_basename( __FILE__ );
72
-
73
  // on uninstall remove capability from roles
74
- register_uninstall_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
75
  // on deactivate delete all settings in database
76
  // register_deactivation_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
77
-
78
  // load translation files
79
  add_action( 'admin_init', array( $this, 'localize_plugin' ) );
80
  // on init register post type for addquicktag and print js
81
  add_action( 'init', array( $this, 'on_admin_init' ) );
82
-
 
83
  }
84
-
85
-
86
  /**
87
  * Include other files and print JS
88
- *
89
  * @since 07/16/2012
90
  * @return void
91
  */
92
  public function on_admin_init() {
93
-
94
- if ( ! is_admin() )
95
  return NULL;
96
-
 
97
  // Include settings
98
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-settings.php';
99
  // Include solution for TinyMCE
100
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-tinymce.php';
101
-
102
  foreach ( $this->get_admin_pages_for_js() as $page ) {
103
  add_action( 'admin_print_scripts-' . $page, array( $this, 'get_json' ) );
104
- add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_enqueue_scripts') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
 
 
 
 
 
 
106
  }
107
-
108
  /**
109
  * Uninstall data in options table, if the plugin was uninstall via backend
110
  *
@@ -112,11 +200,10 @@ class Add_Quicktag {
112
  * @return void
113
  */
114
  public function uninstall() {
115
-
116
- delete_option( self :: $option_string );
117
- delete_site_option( self :: $option_string );
118
  }
119
-
120
  /**
121
  * Print json data in head
122
  *
@@ -124,83 +211,96 @@ class Add_Quicktag {
124
  * @return void
125
  */
126
  public function get_json() {
 
127
  global $current_screen;
128
-
129
- if ( isset( $current_screen->id ) &&
130
- ! in_array(
131
- $current_screen->id,
132
- $this->get_post_types_for_js()
133
- )
134
- )
135
  return NULL;
136
-
137
- if ( is_multisite() && is_plugin_active_for_network( $this -> get_plugin_string() ) )
138
- $options = get_site_option( self :: $option_string );
139
- else
140
- $options = get_option( self :: $option_string );
141
-
 
 
 
 
 
 
142
  // allow change or enhance buttons array
143
- $options['buttons'] = apply_filters( 'addquicktag_buttons', $options['buttons'] );
144
  // hook for filter options
145
  $options = apply_filters( 'addquicktag_options', $options );
146
-
147
- if ( ! $options )
148
  return NULL;
149
-
150
- if ( 1 < count($options['buttons']) ) {
 
151
  // sort array by order value
152
  $tmp = array();
153
- foreach( $options['buttons'] as $order ) {
154
- if ( isset( $order['order'] ) )
155
- $tmp[] = $order['order'];
156
- else
157
- $tmp[] = 0;
 
158
  }
159
- array_multisort( $tmp, SORT_ASC, $options['buttons'] );
160
  }
161
-
162
  ?>
163
  <script type="text/javascript">
164
  var addquicktag_tags = <?php echo json_encode( $options ); ?>,
165
  addquicktag_post_type = <?php echo json_encode( $current_screen->id ); ?>,
166
  addquicktag_pt_for_js = <?php echo json_encode( $this->get_post_types_for_js() ); ?>;
167
  </script>
168
- <?php
169
  }
170
-
171
  /**
172
  * Enqueue Scripts for plugin
173
- *
174
  * @param $where string
 
175
  * @since 2.0.0
176
  * @access public
177
  * @return void
178
  */
179
  public function admin_enqueue_scripts( $where ) {
 
180
  global $current_screen;
181
-
182
- if ( isset( $current_screen->id ) &&
183
- ! in_array(
184
- $current_screen->id,
185
- $this->get_post_types_for_js()
186
- )
187
- )
188
  return NULL;
189
-
190
- $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
191
-
192
- if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) ) {
 
193
  wp_enqueue_script(
194
- self :: get_textdomain() . '_script',
195
- plugins_url( '/js/add-quicktags' . $suffix. '.js', __FILE__ ),
196
  array( 'jquery', 'quicktags' ),
197
  '',
198
  TRUE
199
  );
 
200
  } else {
201
  wp_enqueue_script(
202
- self :: get_textdomain() . '_script',
203
- plugins_url( '/js/add-quicktags_32' . $suffix. '.js', __FILE__ ),
204
  array( 'jquery', 'quicktags' ),
205
  '',
206
  TRUE
@@ -209,121 +309,127 @@ class Add_Quicktag {
209
  // Alternative to JSON function
210
  // wp_localize_script( self :: get_textdomain() . '_script', 'addquicktag_tags', get_option( self :: $option_string ) );
211
  }
212
-
213
- /**
214
- * Handler for the action 'init'. Instantiates this class.
215
- *
216
- * @since 2.0.0
217
- * @access public
218
- * @return $classobj
219
- */
220
- public static function get_object() {
221
-
222
- if ( NULL === self :: $classobj ) {
223
- self :: $classobj = new self;
224
- }
225
-
226
- return self :: $classobj;
227
- }
228
-
229
  /**
230
  * Localize_plugin function.
231
  *
232
- * @uses load_plugin_textdomain, plugin_basename
233
  * @access public
234
  * @since 2.0.0
235
  * @return void
236
  */
237
  public function localize_plugin() {
238
-
239
- load_plugin_textdomain( $this -> get_textdomain(), FALSE, dirname( plugin_basename(__FILE__) ) . '/languages' );
240
  }
241
-
242
  /**
243
  * return plugin comment data
244
- *
245
  * @since 2.0.0
246
  * @access public
 
247
  * @param $value string, default = 'TextDomain'
248
- * Name, PluginURI, Version, Description, Author, AuthorURI, TextDomain, DomainPath, Network, Title
 
249
  * @return string
250
  */
251
  public function get_plugin_data( $value = 'TextDomain' ) {
252
-
253
- static $plugin_data = array ();
254
-
255
  // fetch the data just once.
256
- if ( isset( $plugin_data[ $value ] ) )
257
  return $plugin_data[ $value ];
258
-
259
- if ( ! function_exists( 'get_plugin_data' ) )
 
260
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
261
-
262
- $plugin_data = get_plugin_data( __FILE__ );
263
- $plugin_value = $plugin_data[$value];
264
-
265
- return empty ( $plugin_data[ $value ] ) ? '' : $plugin_data[ $value ];
266
  }
267
-
268
  /**
269
  * Return string of plugin
270
- *
271
  * @since 2.0.0
272
  * @return string
273
  */
274
  public function get_plugin_string() {
275
-
276
  return self::$plugin;
277
  }
278
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  /**
280
- * Retrun allowed post types for include scripts
281
- *
282
  * @since 2.1.1
283
  * @access public
284
  * @return Array
285
  */
286
  public function get_post_types_for_js() {
287
-
288
- return apply_filters( 'addquicktag_post_types', self::$post_types_for_js );
289
  }
290
-
291
  /**
292
- * Retrun allowed post types for include scripts
293
- *
294
  * @since 2.1.1
295
  * @access public
296
  * @return Array
297
  */
298
  public function get_admin_pages_for_js() {
299
-
300
  return apply_filters( 'addquicktag_pages', self::$admin_pages_for_js );
301
  }
302
-
303
  /**
304
- * Retrun textdomain string
305
- *
306
  * @since 2.0.0
307
  * @access public
308
  * @return string
309
  */
310
  public function get_textdomain() {
311
-
312
  return self::get_plugin_data( 'TextDomain' );
313
  }
314
-
315
  /**
316
  * Return string for options
317
  *
318
  * @since 2.0.0
319
- * @retrun string
320
  */
321
  public function get_option_string() {
322
-
323
- return self :: $option_string;
324
  }
325
-
326
-
327
  } // end class
328
 
329
  if ( function_exists( 'add_action' ) && class_exists( 'Add_Quicktag' ) ) {
1
  <?php
2
+
3
  /**
4
  * Plugin Name: AddQuicktag
5
  * Plugin URI: http://bueltge.de/wp-addquicktags-de-plugin/120/
6
  * Text Domain: addquicktag
7
  * Domain Path: /languages
8
  * Description: Allows you to easily add custom Quicktags to the html- and visual-editor.
9
+ * Version: 2.3.0-RC1
10
  * Author: Frank Bültge
11
  * Author URI: http://bueltge.de
12
+ * License: GPLv2+
13
+ *
14
+ *
15
+ *
16
+ * License:
17
+ * ==============================================================================
18
+ * Copyright 2011 - 2014 Frank Bültge (email : frank@bueltge.de)
19
+ *
20
+ * This program is free software; you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation; either version 2 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program; if not, write to the Free Software
32
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
+ *
34
+ * Requirements:
35
+ * ==============================================================================
36
+ * This plugin requires WordPress >= 3.9 and tested with PHP Interpreter >= 5.3
37
+ *
38
+ *
39
  *
40
  * Add Quicktag Plugin class
41
+ *
42
  * @since 2.0.0
43
  */
44
  class Add_Quicktag {
45
+
46
+ /**
47
+ * Option key - String
48
+ *
49
+ * @var string
50
+ */
51
+ static private $option_string = 'rmnlQuicktagSettings';
52
+
53
+ /**
54
+ * Use filter 'addquicktag_pages' for add custom pages
55
+ *
56
+ * @var array
57
+ */
58
  static private $admin_pages_for_js = array(
59
+ 'post.php',
60
+ 'post-new.php',
61
+ 'comment.php',
62
+ 'edit-comments.php',
63
+ 'widgets.php'
64
  );
65
+
66
+ /**
67
+ * Use filter 'addquicktag_post_types' for add custom post_types
68
+ *
69
+ * @var array
70
+ */
71
+ static private $post_types_for_js = array( 'widgets' );
72
+
73
+ /**
74
+ * @var string
75
+ */
76
  static private $plugin;
77
+
78
+ /**
79
+ * Handler for the action 'init'. Instantiates this class.
80
+ *
81
+ * @since 2.0.0
82
+ * @access public
83
+ * @return \Add_Quicktag $instance
84
+ */
85
+ public static function get_object() {
86
+
87
+ static $instance;
88
+
89
+ if ( NULL === $instance ) {
90
+ $instance = new self();
91
+ }
92
+
93
+ return $instance;
94
+ }
95
+
96
  /**
97
  * Constructor, init the functions inside WP
98
  *
99
  * @since 2.0.0
100
+ * @return \Add_Quicktag
101
  */
102
+ private function __construct() {
103
+
104
+ if ( ! is_admin() ) {
105
  return;
106
+ }
107
+
108
  // get string of plugin
109
+ self::$plugin = plugin_basename( __FILE__ );
110
+
111
  // on uninstall remove capability from roles
112
+ register_uninstall_hook( __FILE__, array( 'Add_Quicktag', 'uninstall' ) );
113
  // on deactivate delete all settings in database
114
  // register_deactivation_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
115
+
116
  // load translation files
117
  add_action( 'admin_init', array( $this, 'localize_plugin' ) );
118
  // on init register post type for addquicktag and print js
119
  add_action( 'init', array( $this, 'on_admin_init' ) );
120
+
121
+ add_filter( 'quicktags_settings', array( $this, 'remove_quicktags' ), 10, 1 );
122
  }
123
+
124
+
125
  /**
126
  * Include other files and print JS
127
+ *
128
  * @since 07/16/2012
129
  * @return void
130
  */
131
  public function on_admin_init() {
132
+
133
+ if ( ! is_admin() ) {
134
  return NULL;
135
+ }
136
+
137
  // Include settings
138
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-settings.php';
139
  // Include solution for TinyMCE
140
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-tinymce.php';
141
+
142
  foreach ( $this->get_admin_pages_for_js() as $page ) {
143
  add_action( 'admin_print_scripts-' . $page, array( $this, 'get_json' ) );
144
+ add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_enqueue_scripts' ) );
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Remove quicktags
150
+ *
151
+ * @since 08/15/2013
152
+ *
153
+ * @param array $qtInit the Buttons
154
+ *
155
+ * @type string id
156
+ * @type array buttons, default: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen'
157
+ * @return array $qtInit the Buttons
158
+ */
159
+ public function remove_quicktags( $qtInit ) {
160
+
161
+ // No core buttons, not necessary to filter
162
+ if ( empty( $qtInit[ 'buttons' ] ) ) {
163
+ return $qtInit;
164
+ }
165
+
166
+ if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
167
+ $options = get_site_option( self::$option_string );
168
+ } else {
169
+ $options = get_option( self::$option_string );
170
+ }
171
+
172
+ // No settings, not necessary to filter
173
+ if ( empty( $options[ 'core_buttons' ] ) ) {
174
+ return $qtInit;
175
+ }
176
+
177
+ // get only the keys
178
+ $remove_these = array_keys( $options[ 'core_buttons' ] );
179
+
180
+ // Convert string to array
181
+ $buttons = explode( ',', $qtInit[ 'buttons' ] );
182
+ // Loop over items to remove and unset them from the buttons
183
+ for ( $i = 0; $i < count( $remove_these ); $i ++ ) {
184
+ if ( FALSE !== ( $key = array_search( $remove_these[ $i ], $buttons ) ) ) {
185
+ unset( $buttons[ $key ] );
186
+ }
187
  }
188
+
189
+ // Convert new buttons array back into a comma-separated string
190
+ $qtInit[ 'buttons' ] = implode( ',', $buttons );
191
+ $qtInit[ 'buttons' ] = apply_filters( 'addquicktag_remove_buttons', $qtInit[ 'buttons' ] );
192
+
193
+ return $qtInit;
194
  }
195
+
196
  /**
197
  * Uninstall data in options table, if the plugin was uninstall via backend
198
  *
200
  * @return void
201
  */
202
  public function uninstall() {
203
+
204
+ delete_site_option( self::$option_string );
 
205
  }
206
+
207
  /**
208
  * Print json data in head
209
  *
211
  * @return void
212
  */
213
  public function get_json() {
214
+
215
  global $current_screen;
216
+
217
+ if ( isset( $current_screen->id ) &&
218
+ ! in_array(
219
+ $current_screen->id,
220
+ $this->get_post_types_for_js()
221
+ )
222
+ ) {
223
  return NULL;
224
+ }
225
+
226
+ if ( is_multisite() && is_plugin_active_for_network( $this ->get_plugin_string() ) ) {
227
+ $options = get_site_option( self::$option_string );
228
+ } else {
229
+ $options = get_option( self::$option_string );
230
+ }
231
+
232
+ if ( empty( $options[ 'buttons' ] ) ) {
233
+ $options[ 'buttons' ] = '';
234
+ }
235
+
236
  // allow change or enhance buttons array
237
+ $options[ 'buttons' ] = apply_filters( 'addquicktag_buttons', $options[ 'buttons' ] );
238
  // hook for filter options
239
  $options = apply_filters( 'addquicktag_options', $options );
240
+
241
+ if ( ! $options ) {
242
  return NULL;
243
+ }
244
+
245
+ if ( 1 < count( $options[ 'buttons' ] ) ) {
246
  // sort array by order value
247
  $tmp = array();
248
+ foreach ( $options[ 'buttons' ] as $order ) {
249
+ if ( isset( $order[ 'order' ] ) ) {
250
+ $tmp[ ] = $order[ 'order' ];
251
+ } else {
252
+ $tmp[ ] = 0;
253
+ }
254
  }
255
+ array_multisort( $tmp, SORT_ASC, $options[ 'buttons' ] );
256
  }
257
+
258
  ?>
259
  <script type="text/javascript">
260
  var addquicktag_tags = <?php echo json_encode( $options ); ?>,
261
  addquicktag_post_type = <?php echo json_encode( $current_screen->id ); ?>,
262
  addquicktag_pt_for_js = <?php echo json_encode( $this->get_post_types_for_js() ); ?>;
263
  </script>
264
+ <?php
265
  }
266
+
267
  /**
268
  * Enqueue Scripts for plugin
269
+ *
270
  * @param $where string
271
+ *
272
  * @since 2.0.0
273
  * @access public
274
  * @return void
275
  */
276
  public function admin_enqueue_scripts( $where ) {
277
+
278
  global $current_screen;
279
+
280
+ if ( isset( $current_screen->id ) &&
281
+ ! in_array(
282
+ $current_screen->id,
283
+ $this->get_post_types_for_js()
284
+ )
285
+ ) {
286
  return NULL;
287
+ }
288
+
289
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
290
+
291
+ if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3alpha', '>=' ) ) {
292
  wp_enqueue_script(
293
+ self::get_textdomain() . '_script',
294
+ plugins_url( '/js/add-quicktags' . $suffix . '.js', __FILE__ ),
295
  array( 'jquery', 'quicktags' ),
296
  '',
297
  TRUE
298
  );
299
+ // Load only for WPs, there version is smaller then 3.2
300
  } else {
301
  wp_enqueue_script(
302
+ self::get_textdomain() . '_script',
303
+ plugins_url( '/js/add-quicktags_32' . $suffix . '.js', __FILE__ ),
304
  array( 'jquery', 'quicktags' ),
305
  '',
306
  TRUE
309
  // Alternative to JSON function
310
  // wp_localize_script( self :: get_textdomain() . '_script', 'addquicktag_tags', get_option( self :: $option_string ) );
311
  }
312
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  /**
314
  * Localize_plugin function.
315
  *
316
+ * @uses load_plugin_textdomain, plugin_basename
317
  * @access public
318
  * @since 2.0.0
319
  * @return void
320
  */
321
  public function localize_plugin() {
322
+
323
+ load_plugin_textdomain( $this->get_textdomain(), FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
324
  }
325
+
326
  /**
327
  * return plugin comment data
328
+ *
329
  * @since 2.0.0
330
  * @access public
331
+ *
332
  * @param $value string, default = 'TextDomain'
333
+ * Name, PluginURI, Version, Description, Author, AuthorURI, TextDomain, DomainPath, Network, Title
334
+ *
335
  * @return string
336
  */
337
  public function get_plugin_data( $value = 'TextDomain' ) {
338
+
339
+ static $plugin_data = array();
340
+
341
  // fetch the data just once.
342
+ if ( isset( $plugin_data[ $value ] ) ) {
343
  return $plugin_data[ $value ];
344
+ }
345
+
346
+ if ( ! function_exists( 'get_plugin_data' ) ) {
347
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
348
+ }
349
+
350
+ $plugin_data = get_plugin_data( __FILE__ );
351
+
352
+ return empty( $plugin_data[ $value ] ) ? '' : $plugin_data[ $value ];
353
  }
354
+
355
  /**
356
  * Return string of plugin
357
+ *
358
  * @since 2.0.0
359
  * @return string
360
  */
361
  public function get_plugin_string() {
362
+
363
  return self::$plugin;
364
  }
365
+
366
+ /**
367
+ * Get Post types with UI to use optional the quicktags
368
+ *
369
+ * @since 08/1/2013
370
+ * @return Array
371
+ */
372
+ private function get_post_types() {
373
+
374
+ // list only post types, there was used in UI
375
+ $args = array( 'show_ui' => TRUE );
376
+ $post_types = get_post_types( $args, 'names' );
377
+ // simplify the array
378
+ $post_types = array_values( $post_types );
379
+ // merge with strings from var
380
+ $post_types = array_merge( $post_types, self::$post_types_for_js );
381
+
382
+ return $post_types;
383
+ }
384
+
385
  /**
386
+ * Return allowed post types for include scripts
387
+ *
388
  * @since 2.1.1
389
  * @access public
390
  * @return Array
391
  */
392
  public function get_post_types_for_js() {
393
+
394
+ return apply_filters( 'addquicktag_post_types', $this->get_post_types() );
395
  }
396
+
397
  /**
398
+ * Return allowed post types for include scripts
399
+ *
400
  * @since 2.1.1
401
  * @access public
402
  * @return Array
403
  */
404
  public function get_admin_pages_for_js() {
405
+
406
  return apply_filters( 'addquicktag_pages', self::$admin_pages_for_js );
407
  }
408
+
409
  /**
410
+ * Return textdomain string
411
+ *
412
  * @since 2.0.0
413
  * @access public
414
  * @return string
415
  */
416
  public function get_textdomain() {
417
+
418
  return self::get_plugin_data( 'TextDomain' );
419
  }
420
+
421
  /**
422
  * Return string for options
423
  *
424
  * @since 2.0.0
425
+ * @return string
426
  */
427
  public function get_option_string() {
428
+
429
+ return self::$option_string;
430
  }
431
+
432
+
433
  } // end class
434
 
435
  if ( function_exists( 'add_action' ) && class_exists( 'Add_Quicktag' ) ) {
css/settings.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AddQuicktag settings style
3
+ *
4
+ * @package AddQuicktag Plugin
5
+ * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 03/27/2014
7
+ * @since 2.02.3
8
+ */
9
+
10
+ .rmnlQuicktagSettings .rmnlqsheader{height:10em;vertical-align:bottom}.hover,table tr:hover{background-color:#ccc}.rmnlQuicktagSettings th{vertical-align:bottom!important;text-align:center}.rmnlQuicktagSettings .rotate{padding:0!important;margin:0 auto;width:1.2em;vertical-align:bottom!important}.rmnlQuicktagSettings .rotate span{display:block;padding:0!important;margin:0 auto;width:1.2em;vertical-align:middle!important;white-space:nowrap;writing-mode:tb-rl;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"}.rmnlQuicktagSettings input[type=text]{height:3.5em;width:99%;margin:0 0 .5em}.rmnlQuicktagSettings textarea{height:3.5em;width:99%;margin:0 0 .2em}
css/settings.dev.css ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AddQuicktag settings style
3
+ *
4
+ * @package AddQuicktag Plugin
5
+ * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 03/27/2014
7
+ * @since 2.02.3
8
+ */
9
+
10
+ .rmnlQuicktagSettings .rmnlqsheader {
11
+ height: 10em;
12
+ vertical-align: bottom;
13
+ }
14
+
15
+ .hover, table tr:hover {
16
+ background-color: #ccc;
17
+ }
18
+
19
+ .rmnlQuicktagSettings th {
20
+ vertical-align: bottom !important;
21
+ text-align: center;
22
+ }
23
+
24
+ .rmnlQuicktagSettings .rotate {
25
+ padding: 0 !important;
26
+ margin: 0 auto;
27
+ width: 1.2em;
28
+ vertical-align: bottom !important;
29
+ }
30
+
31
+ .rmnlQuicktagSettings .rotate span {
32
+ display: block;
33
+ padding: 0 !important;
34
+ margin: 0 auto;
35
+ width: 1.2em;
36
+ vertical-align: middle !important;
37
+ white-space: nowrap;
38
+ filter: flipv fliph;
39
+ writing-mode: tb-rl;
40
+ -webkit-transform: rotate(-90deg);
41
+ -moz-transform: rotate(-90deg);
42
+ -ms-transform: rotate(-90deg);
43
+ -o-transform: rotate(-90deg);
44
+ transform: rotate(-90deg);
45
+
46
+ /* Should be unset in IE9+ I think. */
47
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* IE6,IE7 */
48
+ -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; /* IE8 */
49
+ }
50
+
51
+ .rmnlQuicktagSettings input[type='text'] {
52
+ height: 3.5em;
53
+ width: 99%;
54
+ margin: 0 0 .5em 0;
55
+ }
56
+
57
+ .rmnlQuicktagSettings textarea {
58
+ height: 3.5em;
59
+ width: 99%;
60
+ margin: 0 0 .2em 0;
61
+ }
inc/class-code-quicktags.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AddQuicktag - Settings for enhanced code buttons
4
+ *
5
+ * @license GPLv2
6
+ * @package AddQuicktag
7
+ * @subpackage AddQuicktag Settings
8
+ * @author Frank Bueltge <frank@bueltge.de>
9
+ * @since 01/26/2014
10
+ */
11
+
12
+ if ( ! function_exists( 'add_action' ) ) {
13
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Class Add_Quicktag_Code_Quicktags
19
+ */
20
+ class Add_Quicktag_Code_Quicktags extends Add_Quicktag_Settings {
21
+
22
+ /**
23
+ * Post types for the settings
24
+ *
25
+ * @var
26
+ */
27
+ private static $post_types_for_js;
28
+
29
+ /**
30
+ * Static var for textdomain
31
+ *
32
+ * @var string
33
+ */
34
+ public static $textdomain = '';
35
+
36
+ /**
37
+ * Handler for the action 'init'. Instantiates this class.
38
+ *
39
+ * @access public
40
+ * @since 2.0.0
41
+ * @return \Add_Quicktag|\Add_Quicktag_Code_Quicktags|\Add_Quicktag_Settings $instance
42
+ */
43
+ public static function get_object() {
44
+
45
+ static $instance;
46
+
47
+ if ( NULL === $instance ) {
48
+ $instance = new self();
49
+ }
50
+
51
+ return $instance;
52
+ }
53
+
54
+ /**
55
+ * Constructor, init on defined hooks of WP and include second class
56
+ *
57
+ * @access public
58
+ * @since 0.0.2
59
+ * @uses register_activation_hook, register_uninstall_hook, add_action
60
+ * @return \Add_Quicktag_Code_Quicktags
61
+ */
62
+ private function __construct() {
63
+
64
+ self::$textdomain = parent::get_textdomain();
65
+
66
+ add_action( 'addquicktag_settings_form_page', array( $this, 'get_code_quicktag_area' ) );
67
+ }
68
+
69
+ /**
70
+ * Add settings area
71
+ *
72
+ * @param $options
73
+ */
74
+ public function get_code_quicktag_area( $options ) {
75
+
76
+ if ( ! isset( $options['code_buttons'] ) ) {
77
+ $options['code_buttons'] = array();
78
+ }
79
+
80
+ $checked_enhanced_code = $checked_ende_coding = '';
81
+ if ( array_key_exists( 'enhanced_code', $options['code_buttons'] ) ) {
82
+ $checked_enhanced_code = ' checked="checked"';
83
+ }
84
+ if ( array_key_exists( 'ende_coding', $options['code_buttons'] ) ) {
85
+ $checked_ende_coding = ' checked="checked"';
86
+ }
87
+ ?>
88
+ <h3><?php _e( 'Enhanced Code Quicktag buttons', self::$textdomain ); ?></h3>
89
+ <p><?php _e( 'Select the checkbox below to add enhanced code buttons.', $this->get_textdomain() ); ?></p>
90
+
91
+ <table class="widefat">
92
+ <tr>
93
+ <th class="row-title num" style="width:3%;">&#x2714;</th>
94
+ <th class="row-title"><?php _e( 'Button', self::$textdomain ); ?></th>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="num">
99
+ <?php echo '<input type="checkbox" name="' . parent::get_option_string()
100
+ . '[code_buttons][enhanced_code]" value="1" '
101
+ . $checked_enhanced_code . ' />';
102
+ ?>
103
+ </td>
104
+ <td>
105
+ <?php _e( 'Enhanced Code buttons.<br />Add a pull down menu for different languages before the default code button and include this as class inside the code tag. Also add a pre button for preformatted text.', self::$textdomain ); ?>
106
+ </td>
107
+ <td>
108
+ <tr>
109
+ <td class="num">
110
+ <?php echo '<input type="checkbox" name="' . parent::get_option_string()
111
+ . '[code_buttons][ende_coding]" value="1" '
112
+ . $checked_ende_coding . ' />';
113
+ ?>
114
+ </td>
115
+ <td><?php _e( 'Add buttons to do the inconvient HTML encoding/decoding, like &lt; to &amp;lt; and back.', self::$textdomain ); ?></td>
116
+ </tr>
117
+ </table>
118
+ <?php
119
+ }
120
+
121
+ } // end class
122
+
123
+ $add_quicktag_code_quicktags = Add_Quicktag_Code_Quicktags::get_object();
inc/class-imexport.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * AddQuicktag - Settings
4
- *
5
  * @license GPLv3
6
  * @package AddQuicktag
7
  * @subpackage AddQuicktag Settings
@@ -13,67 +13,82 @@ if ( ! function_exists( 'add_action' ) ) {
13
  exit;
14
  }
15
 
 
 
 
16
  class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
17
-
18
- protected static $classobj = NULL;
19
- // post types for the settings
 
 
 
20
  private static $post_types_for_js;
21
-
22
  /**
23
  * Handler for the action 'init'. Instantiates this class.
24
- *
25
  * @access public
26
  * @since 2.0.0
27
- * @return $classobj
28
  */
29
  public static function get_object() {
30
-
31
- if ( NULL === self :: $classobj ) {
32
- self :: $classobj = new self;
 
 
33
  }
34
-
35
- return self :: $classobj;
36
  }
37
-
38
  /**
39
  * Constructor, init on defined hooks of WP and include second class
40
- *
41
  * @access public
42
  * @since 0.0.2
43
  * @uses register_activation_hook, register_uninstall_hook, add_action
44
- * @return void
45
  */
46
- public function __construct() {
47
-
48
  self::$post_types_for_js = parent::get_post_types_for_js();
49
-
50
- if ( isset( $_GET['addquicktag_download'] ) && check_admin_referer( parent :: $nonce_string ) )
51
  $this->get_export_file();
52
- //add_action( 'init', array( $this, 'get_export_file' ) );
53
-
54
- if ( isset( $_POST['addquicktag_import'] ) && check_admin_referer( parent :: $nonce_string ) )
 
55
  $this->import_file();
56
- //add_action( 'init', array( $this, 'import_file' ) );
57
-
 
58
  add_action( 'addquicktag_settings_page', array( $this, 'get_im_export_part' ) );
59
  }
60
-
61
  /**
62
  * get markup for ex- and import on settings page
63
- *
64
  * @access public
65
  * @since 2.0.0
66
  * @uses wp_nonce_field
67
  * @return string
68
  */
69
  public function get_im_export_part() {
 
70
  ?>
71
  <div class="postbox">
72
  <h3><span><?php _e( 'Export', parent :: get_textdomain() ); ?></span></h3>
 
73
  <div class="inside">
74
  <p><?php _e( 'When you click the button below the plugin will create an XML file for you to save to your computer.', parent :: get_textdomain() ); ?></p>
 
75
  <p><?php _e( 'This format, a custom XML, will contain your options from quicktags.', parent :: get_textdomain() ); ?></p>
 
76
  <p><?php _e( 'Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site.', parent :: get_textdomain() ); ?></p>
 
77
  <form method="get" action="">
78
  <?php wp_nonce_field( parent :: $nonce_string ); ?>
79
  <p class="submit">
@@ -83,11 +98,13 @@ class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
83
  </form>
84
  </div>
85
  </div>
86
-
87
  <div class="postbox">
88
  <h3><span><?php _e( 'Import', parent :: get_textdomain() ); ?></span></h3>
 
89
  <div class="inside">
90
  <p><?php _e( 'If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import.', parent :: get_textdomain() ); ?></p>
 
91
  <form method="post" action="" enctype="multipart/form-data">
92
  <?php wp_nonce_field( parent :: $nonce_string ); ?>
93
  <p class="submit">
@@ -98,9 +115,9 @@ class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
98
  </form>
99
  </div>
100
  </div>
101
- <?php
102
  }
103
-
104
  /*
105
  * Build export file, xml
106
  *
@@ -110,23 +127,20 @@ class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
110
  * @return string $xml
111
  */
112
  public function get_export_file() {
113
-
114
- if ( is_multisite() && is_plugin_active_for_network( parent :: get_plugin_string() ) )
115
- $options = get_site_option( parent :: get_option_string() );
116
- else
117
- $options = get_option( parent :: get_option_string() );
118
-
119
  if ( $options['buttons'] ) {
120
-
121
- $xml = '<?xml version="1.0" encoding="UTF-8"?>';
122
  $xml .= "\n" . '<buttons>' . "\n";
123
-
124
- for ( $i = 0; $i < count( $options['buttons'] ); $i++ ) {
125
  $xml .= "\t" . '<quicktag>' . "\n";
126
- foreach( $options['buttons'][$i] as $name => $value ) {
127
-
128
  $value = stripslashes( $value );
129
-
130
  if ( empty( $value ) ) {
131
  $xml .= "\t\t" . '<' . $name . '/>' . "\n";
132
  } elseif ( preg_match( '/^[0-9]*$/', $value ) ) {
@@ -138,80 +152,91 @@ class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
138
  $xml .= "\t" . '</quicktag>' . "\n";
139
  }
140
  $xml .= '</buttons>';
141
-
142
  } else {
143
  $xml = 'We dont find settings in database';
144
  }
145
-
146
- $filename = urlencode( 'addquicktag.' . date('Y-m-d') . '.xml' );
147
  $filesize = strlen( $xml );
148
-
149
- $this -> export_xml( $filename, $filesize, $filetype = 'text/xml' );
150
  echo $xml;
151
  exit;
152
  }
153
-
154
  /**
155
  * Create download file
156
- *
157
  * @access public
158
  * @since 2.0.0
 
159
  * @param string $filename
160
  * @param string $filesize
161
  * @param string $filetype
 
162
  * @uses get_option
163
  * @return void
164
  */
165
  public function export_xml( $filename, $filesize, $filetype ) {
166
-
167
  header( 'Content-Description: File Transfer' );
168
  header( 'Content-Disposition: attachment; filename=' . $filename );
169
  header( 'Content-Length: ' . $filesize );
170
- header( 'Content-type: ' . $filetype . '; charset=' . get_option('blog_charset'), TRUE );
171
  flush();
172
  }
173
-
174
  /**
175
  * Import XML and update settings
176
- *
177
  * @access public
178
  * @since 2.0.0
179
- * @param string $filename
 
 
180
  * @uses current_user_can, wp_die, is_plugin_active_for_network, update_site_option, update_option
181
  * @return void
182
  */
183
  public function import_file( $filename = FALSE ) {
184
-
185
- if ( ! current_user_can( 'manage_options' ) )
186
- wp_die( __('Options not update - you don&lsquo;t have the privilidges to do this!', parent :: get_textdomain() ) );
187
-
 
188
  // use tmp file
189
- if ( ! $filename )
190
  $filename = $_FILES['xml']['tmp_name'];
191
-
 
192
  $filename = preg_replace( "/\<\!\[CDATA\[(.*?)\]\]\>/ies", "'[CDATA]' . base64_encode('$1') . '[/CDATA]'", $filename );
193
  $filename = utf8_encode( $filename );
194
  $matches = simplexml_load_file( $filename );
195
-
 
196
  // create array from xml
197
  $button = array();
198
- foreach ( $matches -> quicktag as $key ) {
199
- foreach ($key as $value) {
200
- $buttons[$value -> getName()] = $value;
 
 
 
 
 
201
  }
 
202
  $button[] = $buttons;
203
  }
204
  $options['buttons'] = $button;
 
205
  // validate the values from xml
206
- $options = parent :: validate_settings($options);
207
-
208
  // update settings in database
209
- if ( is_multisite() && is_plugin_active_for_network( parent :: get_plugin_string() ) )
210
- update_site_option( parent :: get_option_string(), $options );
211
- else
212
- update_option( parent :: get_option_string(), $options );
213
  }
214
-
215
  } // end class
216
 
217
- $add_quicktag_im_export = Add_Quicktag_Im_Export :: get_object();
1
  <?php
2
  /**
3
  * AddQuicktag - Settings
4
+ *
5
  * @license GPLv3
6
  * @package AddQuicktag
7
  * @subpackage AddQuicktag Settings
13
  exit;
14
  }
15
 
16
+ /**
17
+ * Class Add_Quicktag_Im_Export
18
+ */
19
  class Add_Quicktag_Im_Export extends Add_Quicktag_Settings {
20
+
21
+ /**
22
+ * Post types for the settings
23
+ *
24
+ * @var Array
25
+ */
26
  private static $post_types_for_js;
27
+
28
  /**
29
  * Handler for the action 'init'. Instantiates this class.
30
+ *
31
  * @access public
32
  * @since 2.0.0
33
+ * @return \Add_Quicktag|\Add_Quicktag_Im_Export|\Add_Quicktag_Settings $instance
34
  */
35
  public static function get_object() {
36
+
37
+ static $instance;
38
+
39
+ if ( NULL === $instance ) {
40
+ $instance = new self();
41
  }
42
+
43
+ return $instance;
44
  }
45
+
46
  /**
47
  * Constructor, init on defined hooks of WP and include second class
48
+ *
49
  * @access public
50
  * @since 0.0.2
51
  * @uses register_activation_hook, register_uninstall_hook, add_action
52
+ * @return \Add_Quicktag_Im_Export
53
  */
54
+ private function __construct() {
55
+
56
  self::$post_types_for_js = parent::get_post_types_for_js();
57
+
58
+ if ( isset( $_GET['addquicktag_download'] ) && check_admin_referer( parent :: $nonce_string ) ) {
59
  $this->get_export_file();
60
+ }
61
+ //add_action( 'init', array( $this, 'get_export_file' ) );
62
+
63
+ if ( isset( $_POST['addquicktag_import'] ) && check_admin_referer( parent :: $nonce_string ) ) {
64
  $this->import_file();
65
+ }
66
+ //add_action( 'init', array( $this, 'import_file' ) );
67
+
68
  add_action( 'addquicktag_settings_page', array( $this, 'get_im_export_part' ) );
69
  }
70
+
71
  /**
72
  * get markup for ex- and import on settings page
73
+ *
74
  * @access public
75
  * @since 2.0.0
76
  * @uses wp_nonce_field
77
  * @return string
78
  */
79
  public function get_im_export_part() {
80
+
81
  ?>
82
  <div class="postbox">
83
  <h3><span><?php _e( 'Export', parent :: get_textdomain() ); ?></span></h3>
84
+
85
  <div class="inside">
86
  <p><?php _e( 'When you click the button below the plugin will create an XML file for you to save to your computer.', parent :: get_textdomain() ); ?></p>
87
+
88
  <p><?php _e( 'This format, a custom XML, will contain your options from quicktags.', parent :: get_textdomain() ); ?></p>
89
+
90
  <p><?php _e( 'Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site.', parent :: get_textdomain() ); ?></p>
91
+
92
  <form method="get" action="">
93
  <?php wp_nonce_field( parent :: $nonce_string ); ?>
94
  <p class="submit">
98
  </form>
99
  </div>
100
  </div>
101
+
102
  <div class="postbox">
103
  <h3><span><?php _e( 'Import', parent :: get_textdomain() ); ?></span></h3>
104
+
105
  <div class="inside">
106
  <p><?php _e( 'If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import.', parent :: get_textdomain() ); ?></p>
107
+
108
  <form method="post" action="" enctype="multipart/form-data">
109
  <?php wp_nonce_field( parent :: $nonce_string ); ?>
110
  <p class="submit">
115
  </form>
116
  </div>
117
  </div>
118
+ <?php
119
  }
120
+
121
  /*
122
  * Build export file, xml
123
  *
127
  * @return string $xml
128
  */
129
  public function get_export_file() {
130
+
131
+ $options = get_site_option( parent :: get_option_string() );
132
+
 
 
 
133
  if ( $options['buttons'] ) {
134
+
135
+ $xml = '<?xml version="1.0" encoding="UTF-8"?>';
136
  $xml .= "\n" . '<buttons>' . "\n";
137
+
138
+ for( $i = 0; $i < count( $options['buttons'] ); $i ++ ) {
139
  $xml .= "\t" . '<quicktag>' . "\n";
140
+ foreach( $options['buttons'][ $i ] as $name => $value ) {
141
+
142
  $value = stripslashes( $value );
143
+
144
  if ( empty( $value ) ) {
145
  $xml .= "\t\t" . '<' . $name . '/>' . "\n";
146
  } elseif ( preg_match( '/^[0-9]*$/', $value ) ) {
152
  $xml .= "\t" . '</quicktag>' . "\n";
153
  }
154
  $xml .= '</buttons>';
155
+
156
  } else {
157
  $xml = 'We dont find settings in database';
158
  }
159
+
160
+ $filename = urlencode( 'addquicktag.' . date( 'Y-m-d' ) . '.xml' );
161
  $filesize = strlen( $xml );
162
+
163
+ $this ->export_xml( $filename, $filesize, $filetype = 'text/xml' );
164
  echo $xml;
165
  exit;
166
  }
167
+
168
  /**
169
  * Create download file
170
+ *
171
  * @access public
172
  * @since 2.0.0
173
+ *
174
  * @param string $filename
175
  * @param string $filesize
176
  * @param string $filetype
177
+ *
178
  * @uses get_option
179
  * @return void
180
  */
181
  public function export_xml( $filename, $filesize, $filetype ) {
182
+
183
  header( 'Content-Description: File Transfer' );
184
  header( 'Content-Disposition: attachment; filename=' . $filename );
185
  header( 'Content-Length: ' . $filesize );
186
+ header( 'Content-type: ' . $filetype . '; charset=' . get_option( 'blog_charset' ), TRUE );
187
  flush();
188
  }
189
+
190
  /**
191
  * Import XML and update settings
192
+ *
193
  * @access public
194
  * @since 2.0.0
195
+ *
196
+ * @param bool|string $filename
197
+ *
198
  * @uses current_user_can, wp_die, is_plugin_active_for_network, update_site_option, update_option
199
  * @return void
200
  */
201
  public function import_file( $filename = FALSE ) {
202
+
203
+ if ( ! current_user_can( 'manage_options' ) ) {
204
+ wp_die( __( 'Options not update - you don&lsquo;t have the privilidges to do this!', parent::get_textdomain() ) );
205
+ }
206
+
207
  // use tmp file
208
+ if ( ! $filename ) {
209
  $filename = $_FILES['xml']['tmp_name'];
210
+ }
211
+
212
  $filename = preg_replace( "/\<\!\[CDATA\[(.*?)\]\]\>/ies", "'[CDATA]' . base64_encode('$1') . '[/CDATA]'", $filename );
213
  $filename = utf8_encode( $filename );
214
  $matches = simplexml_load_file( $filename );
215
+
216
+ $buttons = '';
217
  // create array from xml
218
  $button = array();
219
+ /**
220
+ * @var $matches stdClass
221
+ */
222
+ foreach( $matches->quicktag as $key ) {
223
+
224
+ foreach( $key as $value ) {
225
+ /* @var $value stdClass */
226
+ $buttons[ $value->getName() ] = $value;
227
  }
228
+
229
  $button[] = $buttons;
230
  }
231
  $options['buttons'] = $button;
232
+
233
  // validate the values from xml
234
+ $options = parent::validate_settings( $options );
235
+
236
  // update settings in database
237
+ update_site_option( parent::get_option_string(), $options );
 
 
 
238
  }
239
+
240
  } // end class
241
 
242
+ $add_quicktag_im_export = Add_Quicktag_Im_Export::get_object();
inc/class-remove-quicktags.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AddQuicktag - Settings to remove core quicktags
4
+ * @license GPLv2
5
+ * @package AddQuicktag
6
+ * @subpackage AddQuicktag Settings
7
+ * @author Frank Bueltge <frank@bueltge.de>
8
+ * @version 05/22/2014
9
+ */
10
+
11
+ if ( ! function_exists( 'add_action' ) ) {
12
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
13
+ exit;
14
+ }
15
+
16
+ class Add_Quicktag_Remove_Quicktags extends Add_Quicktag_Settings {
17
+
18
+ // post types for the settings
19
+ private static $post_types_for_js;
20
+
21
+ // default buttons from WP Core
22
+ private static $core_quicktags = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,fullscreen';
23
+
24
+ // Transient string
25
+ private static $addquicktag_core_quicktags = 'addquicktag_core_quicktags';
26
+
27
+ /**
28
+ * Handler for the action 'init'. Instantiates this class.
29
+ *
30
+ * @access public
31
+ * @since 2.0.0
32
+ * @return \Add_Quicktag|\Add_Quicktag_Remove_Quicktags|\Add_Quicktag_Settings $instance
33
+ */
34
+ public static function get_object() {
35
+
36
+ static $instance;
37
+
38
+ if ( NULL === $instance ) {
39
+ $instance = new self();
40
+ }
41
+
42
+ return $instance;
43
+ }
44
+
45
+ /**
46
+ * Constructor, init on defined hooks of WP and include second class
47
+ *
48
+ * @access public
49
+ * @since 0.0.2
50
+ * @uses register_activation_hook, register_uninstall_hook, add_action
51
+ * @return \Add_Quicktag_Remove_Quicktags
52
+ */
53
+ private function __construct() {
54
+
55
+ add_action( 'addquicktag_settings_form_page', array( $this, 'get_remove_quicktag_area' ) );
56
+ }
57
+
58
+ /**
59
+ * Add settings area
60
+ *
61
+ * @param $options
62
+ */
63
+ public function get_remove_quicktag_area( $options ) {
64
+
65
+ if ( ! isset( $options['core_buttons'] ) ) {
66
+ $options['core_buttons'] = array();
67
+ }
68
+ ?>
69
+ <h3><?php _e( 'Remove Core Quicktag buttons', parent::get_textdomain() ); ?></h3>
70
+ <p><?php _e( 'Select the checkbox below to remove a core quicktags in all editors.', $this->get_textdomain() ); ?></p>
71
+ <p><?php _e( '<strong>Currently a Beta option</strong>, to validate and only usable global on each post type. Please give me hints, feedback via the support possibilities, like <a href="https://github.com/bueltge/AddQuicktag/issues">Github Issues</a> or <a href="http://wordpress.org/support/plugin/addquicktag">WP Support Forum</a>.', $this->get_textdomain() ); ?></p>
72
+
73
+ <table class="widefat">
74
+ <tr>
75
+ <th class="row-title num" style="width:3%;">&#x2714;</th>
76
+ <th class="row-title"><?php _e( 'Button', parent::get_textdomain() ); ?></th>
77
+ </tr>
78
+
79
+ <?php
80
+ // Convert string to array
81
+ $core_buttons = explode( ',', self::$core_quicktags );
82
+ // Loop over items to remove and unset them from the buttons
83
+ foreach( $core_buttons as $key => $value ) {
84
+
85
+ if ( array_key_exists( $value, $options['core_buttons'] ) ) {
86
+ $checked = ' checked="checked"';
87
+ } else {
88
+ $checked = '';
89
+ }
90
+
91
+ // same style as in editor
92
+ if ( 'strong' === $value ) {
93
+ $text = 'b';
94
+ $style = ' style="font-weight: bold;"';
95
+ } else if ( 'em' === $value ) {
96
+ $text = 'i';
97
+ $style = ' style="font-style: italic;"';
98
+ } else if ( 'link' === $value ) {
99
+ $text = $value;
100
+ $style = ' style="text-decoration: underline;"';
101
+ } else if ( 'del' === $value ) {
102
+ $text = $value;
103
+ $style = ' style="text-decoration: line-through;"';
104
+ } else if ( 'block' === $value ) {
105
+ $text = 'b-quote';
106
+ $style = '';
107
+ } else {
108
+ $text = $value;
109
+ $style = '';
110
+ }
111
+
112
+ echo '<tr><td class="num"><input type="checkbox" name="' . parent :: get_option_string()
113
+ . '[core_buttons][' . $value . ']" value="1" '
114
+ . $checked . ' /></td><td>';
115
+ echo '<input type="button" class="ed_button" title="" value="' . $text . '"' . $style . '> <code>' . $value . '</code></td></tr>';
116
+ }
117
+
118
+ // Convert new buttons array back into a comma-separated string
119
+ $core_qt = implode( ',', $core_buttons );
120
+ ?>
121
+ </table>
122
+ <?php
123
+ }
124
+
125
+ } // end class
126
+
127
+ $add_quicktag_remove_quicktags = Add_Quicktag_Remove_Quicktags::get_object();
inc/class-settings.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
2
  /**
3
  * AddQuicktag - Settings
4
- *
5
- * @license GPLv3
6
  * @package AddQuicktag
7
  * @subpackage AddQuicktag Settings
8
  * @author Frank Bueltge <frank@bueltge.de>
9
- * @version 02/09/2013
10
  * @since 2.0.0
11
  */
12
 
@@ -16,162 +15,199 @@ if ( ! function_exists( 'add_action' ) ) {
16
  }
17
 
18
  class Add_Quicktag_Settings extends Add_Quicktag {
19
-
20
- protected static $classobj = NULL;
21
- // string for translation
22
- static public $textdomain;
23
- // string for options in table options
24
- static private $option_string;
25
- // string for plugin file
26
- static private $plugin;
27
- // post types for the settings
28
- static private $post_types_for_js;
29
- // string for nonce fields
30
- static public $nonce_string;
31
-
32
- protected $page_hook;
33
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Handler for the action 'init'. Instantiates this class.
36
- *
37
  * @access public
38
  * @since 2.0.0
39
- * @return $classobj
40
  */
41
  public static function get_object() {
42
-
43
- if ( NULL === self :: $classobj ) {
44
- self :: $classobj = new self;
 
 
45
  }
46
-
47
- return self :: $classobj;
48
  }
49
-
50
  /**
51
  * Constructor, init on defined hooks of WP and include second class
52
- *
53
  * @access public
54
  * @since 0.0.2
55
  * @uses register_activation_hook, register_uninstall_hook, add_action
56
- * @return void
57
  */
58
- public function __construct() {
59
-
60
- if ( ! is_admin() )
61
  return NULL;
62
-
 
63
  // textdomain from parent class
64
  self::$textdomain = parent::get_textdomain();
65
  self::$option_string = parent::get_option_string();
66
  self::$plugin = parent::get_plugin_string();
67
  self::$post_types_for_js = parent::get_post_types_for_js();
68
  self::$nonce_string = 'addquicktag_nonce';
69
-
70
- register_uninstall_hook( __FILE__, array( 'Add_Quicktag_Settings', 'unregister_settings' ) );
71
  // settings for an active multisite
72
  if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
73
- add_action( 'network_admin_menu', array( $this, 'add_settings_page' ) );
74
  // add settings link
75
- add_filter( 'network_admin_plugin_action_links', array( $this, 'network_admin_plugin_action_links' ), 10, 2 );
 
 
 
 
 
76
  // save settings on network
77
  add_action( 'network_admin_edit_' . self::$option_string, array( $this, 'save_network_settings_page' ) );
78
  // return message for update settings
79
  add_action( 'network_admin_notices', array( $this, 'get_network_admin_notices' ) );
80
  // add script on settings page
81
  } else {
82
- add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
83
  // add settings link
84
- add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
85
  // use settings API
86
- add_action( 'admin_init', array( $this, 'register_settings' ) );
87
  }
88
  // include js
89
- add_action( 'admin_print_scripts-settings_page_' . str_replace( '.php', '', plugin_basename( __FILE__ ) ),
 
90
  array( $this, 'print_scripts' )
91
  );
92
-
93
  // add meta boxes on settings pages
94
  add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_plugin_infos' ) );
95
  add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_about_plugin' ) );
 
 
 
 
 
 
96
  // include class for im/export
97
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-imexport.php';
98
  }
99
-
100
  /**
101
- * Retrun allowed post types for include scripts
102
- *
103
  * @since 2.1.1
104
  * @access public
105
  * @return Array
106
  */
107
  public function get_post_types_for_js() {
108
-
109
  return self::$post_types_for_js;
110
  }
111
-
112
  /**
113
  * Return Textdomain string
114
- *
115
  * @access public
116
  * @since 2.0.0
117
  * @return string
118
  */
119
  public function get_textdomain() {
120
-
121
- return self :: $textdomain;
122
  }
123
-
124
  /**
125
  * Add settings link on plugins.php in backend
126
- *
127
- * @uses
128
- * @access public
129
- * @param array $links, string $file
130
- * @since 2.0.0
131
- * @return string $links
 
 
132
  */
133
  public function plugin_action_links( $links, $file ) {
134
-
135
- if ( parent :: get_plugin_string() == $file )
136
- $links[] = '<a href="options-general.php?page=' . plugin_basename( __FILE__ ) . '">' . __('Settings') . '</a>';
137
-
 
138
  return $links;
139
  }
140
-
141
  /**
142
  * Add settings link on plugins.php on network admin in backend
143
- *
144
- * @uses
145
  * @access public
146
- * @param array $links, string $file
147
  * @since 2.0.0
 
 
 
 
148
  * @return string $links
149
  */
150
  public function network_admin_plugin_action_links( $links, $file ) {
151
-
152
- if ( parent :: get_plugin_string() == $file )
153
- $links[] = '<a href="settings.php?page=' . plugin_basename( __FILE__ ) . '">' . __('Settings') . '</a>';
154
-
 
155
  return $links;
156
  }
157
-
158
  /**
159
  * Add settings page in WP backend
160
- *
161
  * @uses add_options_page
162
  * @access public
163
  * @since 2.0.0
164
  * @return void
165
  */
166
- public function add_settings_page () {
167
-
168
  if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
169
  add_submenu_page(
170
  'settings.php',
171
  parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this->get_textdomain() ),
172
  parent :: get_plugin_data( 'Name' ),
173
  'manage_options',
174
- plugin_basename(__FILE__),
175
  array( $this, 'get_settings_page' )
176
  );
177
  } else {
@@ -179,208 +215,246 @@ class Add_Quicktag_Settings extends Add_Quicktag {
179
  parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this->get_textdomain() ),
180
  parent :: get_plugin_data( 'Name' ),
181
  'manage_options',
182
- plugin_basename(__FILE__),
183
  array( $this, 'get_settings_page' )
184
  );
185
  add_action( 'contextual_help', array( $this, 'contextual_help' ), 10, 3 );
186
  }
187
  }
188
-
189
  /**
190
  * Return form and markup on settings page
191
- *
192
- * @uses settings_fields, normalize_whitespace, is_plugin_active_for_network, get_site_option, get_option
193
- * @access public
194
- * @since 0.0.2
195
  * @return void
196
  */
197
  public function get_settings_page() {
198
-
199
  ?>
200
  <div class="wrap">
201
- <?php screen_icon('options-general'); ?>
202
- <h2><?php echo parent :: get_plugin_data( 'Name' ); ?></h2>
203
-
204
- <h3><?php _e('Add or delete Quicktag buttons', $this->get_textdomain() ); ?></h3>
 
 
 
 
 
 
 
 
 
 
205
  <?php
206
- if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) )
207
- $action = 'edit.php?action=' . self::$option_string;
208
- else
209
- $action = 'options.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  ?>
211
- <form method="post" action="<?php echo $action; ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  <?php
213
- if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
214
- wp_nonce_field( self::$nonce_string );
215
- $options = get_site_option( self::$option_string );
216
- } else {
217
- settings_fields( self::$option_string . '_group' );
218
- $options = get_option( self::$option_string );
219
  }
220
-
221
- if ( ! $options )
222
- $options['buttons'] = array();
223
-
224
- if ( 1 < count($options['buttons']) ) {
225
- // sort array by order value
226
- $tmp = array();
227
- foreach( $options['buttons'] as $order ) {
228
- if ( isset( $order['order'] ) )
229
- $tmp[] = $order['order'];
230
- else
231
- $tmp[] = 0;
232
  }
233
- array_multisort( $tmp, SORT_ASC, $options['buttons'] );
234
- }
235
-
236
- // loop about the post types, create html an values for title in table
237
- $pt_title = '';
238
- foreach ( $this->get_post_types_for_js() as $post_type ) {
239
-
240
- $pt_title .= '<th class="row-title" title="Post Type"><code>' . $post_type . '</code></th>' . "\n";
241
- }
242
- ?>
243
-
244
- <table class="widefat">
245
- <tr>
246
- <th class="row-title"><?php _e( 'Button Label*', $this->get_textdomain() ); ?></th>
247
- <th class="row-title"><?php _e( 'Title Attribute', $this->get_textdomain() ); ?></th>
248
- <th class="row-title"><?php _e( 'Start Tag(s)*', $this->get_textdomain() ); ?></th>
249
- <th class="row-title"><?php _e( 'End Tag(s)', $this->get_textdomain() ); ?></th>
250
- <th class="row-title"><?php _e( 'Access Key', $this->get_textdomain() ); ?></th>
251
- <th class="row-title"><?php _e( 'Order', $this->get_textdomain() ); ?></th>
252
- <th class="row-title"><?php _e( 'Visual', $this->get_textdomain() ); ?></th>
253
- <?php echo $pt_title ?>
254
- <th class="row-title">&#x2714;</th>
255
- </tr>
256
- <?php
257
- if ( empty($options['buttons']) )
258
- $options['buttons'] = array();
259
- $class = '';
260
- for ( $i = 0; $i < count( $options['buttons'] ); $i++ ) {
261
- $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
262
- $b = $options['buttons'][$i];
263
- $b['text'] = htmlentities( stripslashes($b['text']), ENT_COMPAT, get_option('blog_charset') );
264
- if ( isset( $b['title'] ) )
265
- $b['title'] = htmlentities( stripslashes($b['title']), ENT_COMPAT, get_option('blog_charset') );
266
- $b['start'] = htmlentities( $b['start'], ENT_COMPAT, get_option('blog_charset') );
267
- if ( isset( $b['end'] ) )
268
- $b['end'] = htmlentities( $b['end'], ENT_COMPAT, get_option('blog_charset') );
269
- if ( ! isset( $b['access'] ) )
270
- $b['access'] = '';
271
- $b['access'] = htmlentities( $b['access'], ENT_COMPAT, get_option('blog_charset') );
272
- if ( ! isset( $b['order'] ) )
273
- $b['order'] = 0;
274
- $b['order'] = intval( $b['order'] );
275
- if ( ! isset( $b['visual'] ) )
276
- $b['visual'] = 0;
277
- $b['visual'] = intval( $b['visual'] );
278
- if ( 1 == $b['visual'] )
279
- $checked = ' checked="checked"';
280
- else
281
- $checked = '';
282
- // loop about the post types, create html an values
283
- $pt_checkboxes = '';
284
- foreach ( $this->get_post_types_for_js() as $post_type ) {
285
-
286
- if ( ! isset( $b[$post_type] ) )
287
- $b[$post_type] = 0;
288
-
289
- $b[$post_type] = intval( $b[$post_type] );
290
-
291
- if ( 1 == $b[$post_type] )
292
- $pt_checked = ' checked="checked"';
293
- else
294
- $pt_checked = '';
295
-
296
- $pt_checkboxes .= '<td><input type="checkbox" name="' .
297
- self::$option_string . '[buttons][' .
298
- $i . '][' . $post_type . ']" value="1"' .
299
- $pt_checked . '/></td>' . "\n";
300
  }
301
-
302
- $nr = $i + 1;
303
-
 
 
 
 
 
 
 
 
 
 
 
 
304
  echo '
305
  <tr id="rmqtb' . $i . '">
306
- <td><input type="text" name="' . self::$option_string . '[buttons][' . $i
307
- . '][text]" value="' . $b['text'] . '" style="width: 95%;" /></td>
308
- <td><input type="text" name="' . self::$option_string . '[buttons][' . $i . '][title]" value="'
309
- . $b['title'] . '" style="width: 95%;" /></td>
310
- <td><textarea class="code" name="' . self::$option_string . '[buttons][' . $i
311
- . '][start]" rows="2" cols="25" style="width: 95%;">' . $b['start'] . '</textarea></td>
312
- <td><textarea class="code" name="' . self::$option_string . '[buttons][' . $i
313
- . '][end]" rows="2" cols="25" style="width: 95%;">' . $b['end'] . '</textarea></td>
314
- <td><input type="text" name="' . self::$option_string . '[buttons][' . $i
315
- . '][access]" value="' . $b['access'] . '" style="width: 95%;" /></td>
316
- <td><input type="text" name="' . self::$option_string . '[buttons][' . $i
317
- . '][order]" value="' . $b['order'] . '" style="width: 95%;" /></td>
318
- <td><input type="checkbox" name="' . self::$option_string . '[buttons][' . $i
319
- . '][visual]" value="1"' . $checked . '/></td>' .
320
- $pt_checkboxes . '
321
- <td><input type="checkbox" class="toggle" id="select_all_' . $i . '" value="'. $i . '" /></td>' . '
322
  </tr>
323
  ';
 
 
 
 
 
 
 
324
  }
325
-
326
- // loop about the post types, create html an values for empty new checkboxes
327
- $pt_new_boxes = '';
328
- foreach ( $this->get_post_types_for_js() as $post_type ) {
329
- if ( ! isset( $b[$post_type] ) )
330
- $b[$post_type] = 0;
331
-
332
- $b[$post_type] = intval( $b[$post_type] );
333
-
334
- if ( 1 == $b[$post_type] )
335
- $pt_checked = ' checked="checked"';
336
- else
337
- $pt_checked = '';
338
-
339
- $pt_new_boxes .= '<td><input type="checkbox" name="' .
340
- self::$option_string . '[buttons][' .
341
- $i . '][' . $post_type . ']" value="1" /></td>' . "\n";
342
  }
343
- ?>
344
- <tr id="rmqtb<?php echo $i ?>">
345
- <td><input type="text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][text]" value="" style="width: 95%;" /></td>
346
- <td><input type="text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][title]" value="" style="width: 95%;" /></td>
347
- <td><textarea class="code" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][start]" rows="2" cols="25" style="width: 95%;"></textarea></td>
348
- <td><textarea class="code" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][end]" rows="2" cols="25" style="width: 95%;"></textarea></td>
349
- <td><input type="text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][access]" value="" class="code" style="width: 95%;" /></td>
350
- <td><input type="text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][order]" value="" style="width: 95%;" /></td>
351
- <td><input type="checkbox" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][visual]" value="1" /></td>
352
- <?php echo $pt_new_boxes; ?>
353
- <td><input type="checkbox" class="toggle" id="select_all_<?php echo $i ?>" value="<?php echo $i ?>" /></td>
354
- </tr>
355
- </table>
356
-
357
- <p><?php _e( 'Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields.', $this->get_textdomain() ); ?></p>
358
- <p class="submit">
359
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
360
- </p>
361
-
362
- </form>
363
-
364
- <div class="metabox-holder has-right-sidebar">
365
-
366
- <div class="inner-sidebar">
367
- <?php do_action( 'addquicktag_settings_page_sidebar' ); ?>
368
- </div> <!-- .inner-sidebar -->
369
-
370
- <div id="post-body">
371
- <div id="post-body-content">
372
- <?php do_action( 'addquicktag_settings_page' ); ?>
373
- </div> <!-- #post-body-content -->
374
- </div> <!-- #post-body -->
375
-
376
- </div> <!-- .metabox-holder -->
377
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  </div>
379
- <?php
 
 
 
380
  }
381
-
382
  /*
383
- * Return informations to donate
384
  *
385
  * @uses _e,esc_attr_e
386
  * @access public
@@ -388,23 +462,36 @@ class Add_Quicktag_Settings extends Add_Quicktag {
388
  * @return void
389
  */
390
  public function get_plugin_infos() {
 
391
  ?>
392
  <div class="postbox">
393
-
394
  <h3><span><?php _e( 'Like this plugin?', $this->get_textdomain() ); ?></span></h3>
 
395
  <div class="inside">
396
  <p><?php _e( 'Here\'s how you can give back:', $this->get_textdomain() ); ?></p>
397
  <ul>
398
- <li><a href="http://wordpress.org/extend/plugins/addquicktag/" title="<?php esc_attr_e( 'The Plugin on the WordPress plugin repository', $this->get_textdomain() ); ?>"><?php _e( 'Give the plugin a good rating.', $this->get_textdomain() ); ?></a></li>
399
- <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=6069955" title="<?php esc_attr_e( 'Donate via PayPal', $this->get_textdomain() ); ?>"><?php _e( 'Donate a few euros.', $this->get_textdomain() ); ?></a></li>
400
- <li><a href="http://www.amazon.de/gp/registry/3NTOGEK181L23/ref=wl_s_3" title="<?php esc_attr_e( 'Frank Bültge\'s Amazon Wish List', $this->get_textdomain() ); ?>"><?php _e( 'Get me something from my wish list.', $this->get_textdomain() ); ?></a></li>
401
- <li><a href="https://github.com/bueltge/AddQuicktag" title="<?php _e( 'Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues.', $this->get_textdomain() ); ?>"><?php _e( 'Github Repo for Contribute, Issues & Bugs', $this->get_textdomain() ); ?></a></li>
 
 
 
 
 
 
 
 
 
 
 
402
  </ul>
403
  </div>
404
  </div>
405
- <?php
406
  }
407
-
408
  /*
409
  * Return informations about the plugin
410
  *
@@ -414,25 +501,28 @@ class Add_Quicktag_Settings extends Add_Quicktag {
414
  * @return void
415
  */
416
  public function get_about_plugin() {
 
417
  ?>
418
  <div class="postbox">
419
-
420
  <h3><span><?php _e( 'About this plugin', $this->get_textdomain() ); ?></span></h3>
 
421
  <div class="inside">
422
  <p>
423
  <strong><?php _e( 'Version:', $this->get_textdomain() ); ?></strong>
424
  <?php echo parent :: get_plugin_data( 'Version' ); ?>
425
  </p>
 
426
  <p>
427
  <strong><?php _e( 'Description:', $this->get_textdomain() ); ?></strong>
428
  <?php echo parent :: get_plugin_data( 'Description' ); ?>
429
  </p>
430
  </div>
431
-
432
  </div>
433
- <?php
434
  }
435
-
436
  /*
437
  * Save network settings
438
  *
@@ -442,13 +532,14 @@ class Add_Quicktag_Settings extends Add_Quicktag {
442
  * @return void
443
  */
444
  public function save_network_settings_page() {
445
-
446
- if ( ! wp_verify_nonce( $_REQUEST[ '_wpnonce' ], self::$nonce_string ) )
447
  wp_die( 'Sorry, you failed the nonce test.' );
448
-
 
449
  // validate options
450
- $value = $this->validate_settings( $_POST[self::$option_string] );
451
-
452
  // update options
453
  update_site_option( self::$option_string, $value );
454
  // redirect to settings page in network
@@ -460,7 +551,7 @@ class Add_Quicktag_Settings extends Add_Quicktag {
460
  );
461
  exit();
462
  }
463
-
464
  /*
465
  * Retrun string vor update message
466
  *
@@ -470,143 +561,215 @@ class Add_Quicktag_Settings extends Add_Quicktag {
470
  * @return string $notice
471
  */
472
  public function get_network_admin_notices() {
473
-
474
  // if updated and the right page
475
- if ( isset( $_GET['updated'] ) &&
476
- 'settings_page_addquicktag/inc/class-settings-network' === $GLOBALS['current_screen'] -> id
477
- ) {
478
  $message = __( 'Options saved.', $this->get_textdomain() );
479
- $notice = '<div id="message" class="updated"><p>' .$message . '</p></div>';
480
  echo $notice;
481
  }
482
  }
483
-
484
  /**
485
  * Validate settings for options
486
- *
487
  * @uses normalize_whitespace
488
  * @access public
 
489
  * @param array $value
 
490
  * @since 2.0.0
491
  * @return string $value
492
  */
493
  public function validate_settings( $value ) {
494
-
495
- // set allowd values for import, only the defaults of plugin and custom post types
 
 
 
 
 
 
 
 
 
 
496
  $allowed_settings = (array) array_merge(
497
  $this->get_post_types_for_js(),
498
  array( 'text', 'title', 'start', 'end', 'access', 'order', 'visual' )
499
  );
 
 
500
  // filter for allowed values
501
- foreach ( $value['buttons'] as $key => $button ) {
502
-
503
- foreach ($button as $key => $val) {
504
-
505
- if ( ! in_array( $key, $allowed_settings) )
506
- unset( $button[$key] );
 
507
  }
508
- $buttons[] = $button;
 
509
  }
 
510
  // return filtered array
511
- $filtered_values['buttons'] = $buttons;
512
- $value = $filtered_values;
513
-
514
  $buttons = array();
515
- for ( $i = 0; $i < count( $value['buttons']); $i++ ) {
516
-
517
- $b = $value['buttons'][$i];
518
- if ($b['text'] != '' && $b['start'] != '') {
519
- $b['text'] = esc_html( $b['text'] );
520
- $b['title'] = esc_html( $b['title'] );
521
- $b['start'] = stripslashes( $b['start'] );
522
- $b['end'] = stripslashes( $b['end'] );
523
- if ( isset( $b['access'] ) )
524
- $b['access'] = esc_html( $b['access'] );
525
- if ( isset( $b['order'] ) )
526
- $b['order'] = intval( $b['order'] );
527
- // visual settings
528
- if ( isset( $b['visual'] ) )
529
- $b['visual'] = intval( $b['visual'] );
530
- else
531
- $b['visual'] = 0;
532
- // post types
533
- foreach ( $this->get_post_types_for_js() as $post_type ) {
534
- if ( isset( $b[$post_type] ) )
535
- $b[$post_type] = intval( $b[$post_type] );
536
- else
537
- $b[$post_type] = 0;
 
 
 
 
 
 
 
 
 
538
  }
539
-
540
- $buttons[] = $b;
541
  }
542
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  }
544
- $value['buttons'] = $buttons;
545
-
546
  return $value;
547
  }
548
-
549
  /**
550
  * Register settings for options
551
- *
552
  * @uses register_setting
553
  * @access public
554
  * @since 2.0.0
555
  * @return void
556
  */
557
  public function register_settings() {
558
-
559
  register_setting( self::$option_string . '_group', self::$option_string, array( $this, 'validate_settings' ) );
560
  }
561
-
562
  /**
563
  * Unregister and delete settings; clean database
564
- *
565
  * @uses unregister_setting, delete_option
566
  * @access public
567
  * @since 0.0.2
568
  * @return void
569
  */
570
  public function unregister_settings() {
571
-
572
  unregister_setting( self::$option_string . '_group', self::$option_string );
573
  delete_option( self::$option_string );
574
  }
575
-
 
 
 
 
 
 
576
  public function print_scripts( $where ) {
577
-
578
- $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
579
-
580
  wp_register_script(
581
- self::$option_string . '_admin_script',
582
- plugins_url( '/js/settings' . $suffix. '.js', parent::get_plugin_string() ),
583
  array( 'jquery', 'quicktags' ),
584
  '',
585
  TRUE
586
  );
587
  wp_enqueue_script( self::$option_string . '_admin_script' );
 
 
 
 
 
 
 
 
 
588
  }
589
-
590
  /**
591
  * Add help text
592
- *
593
  * @uses normalize_whitespace
 
594
  * @param string $contextual_help
595
  * @param string $screen_id
596
  * @param string $screen
 
597
  * @since 2.0.0
598
  * @return string $contextual_help
599
  */
600
  public function contextual_help( $contextual_help, $screen_id, $screen ) {
601
-
602
- if ( 'settings_page_' . self::$option_string . '_group' !== $screen_id )
603
  return $contextual_help;
604
-
605
- $contextual_help =
 
606
  '<p>' . __( '' ) . '</p>';
607
-
608
  return normalize_whitespace( $contextual_help );
609
  }
610
-
611
  }
 
612
  $add_quicktag_settings = Add_Quicktag_Settings :: get_object();
1
  <?php
2
  /**
3
  * AddQuicktag - Settings
4
+ * @license GPLv2
 
5
  * @package AddQuicktag
6
  * @subpackage AddQuicktag Settings
7
  * @author Frank Bueltge <frank@bueltge.de>
8
+ * @version 05/22/2014
9
  * @since 2.0.0
10
  */
11
 
15
  }
16
 
17
  class Add_Quicktag_Settings extends Add_Quicktag {
18
+
19
+ /**
20
+ * string for translation
21
+ * @var string
22
+ */
23
+ static public $textdomain;
24
+
25
+ /**
26
+ * string for options in table options
27
+ * @var string
28
+ */
29
+ static private $option_string;
30
+
31
+ /**
32
+ * string for plugin file
33
+ * @var string
34
+ */
35
+ static private $plugin;
36
+
37
+ /**
38
+ * post types for the settings
39
+ * @var Array
40
+ */
41
+ static private $post_types_for_js;
42
+
43
+ /**
44
+ * string for nonce fields
45
+ * @var string
46
+ */
47
+ static public $nonce_string;
48
+
49
+ /**
50
+ * @var
51
+ */
52
+ protected $page_hook;
53
+
54
  /**
55
  * Handler for the action 'init'. Instantiates this class.
 
56
  * @access public
57
  * @since 2.0.0
58
+ * @return \Add_Quicktag|\Add_Quicktag_Settings $instance
59
  */
60
  public static function get_object() {
61
+
62
+ static $instance;
63
+
64
+ if ( NULL === $instance ) {
65
+ $instance = new self();
66
  }
67
+
68
+ return $instance;
69
  }
70
+
71
  /**
72
  * Constructor, init on defined hooks of WP and include second class
 
73
  * @access public
74
  * @since 0.0.2
75
  * @uses register_activation_hook, register_uninstall_hook, add_action
76
+ * @return \Add_Quicktag_Settings
77
  */
78
+ private function __construct() {
79
+
80
+ if ( ! is_admin() ) {
81
  return NULL;
82
+ }
83
+
84
  // textdomain from parent class
85
  self::$textdomain = parent::get_textdomain();
86
  self::$option_string = parent::get_option_string();
87
  self::$plugin = parent::get_plugin_string();
88
  self::$post_types_for_js = parent::get_post_types_for_js();
89
  self::$nonce_string = 'addquicktag_nonce';
90
+
91
+ register_uninstall_hook( __FILE__, array( 'Add_Quicktag_Settings', 'unregister_settings' ) );
92
  // settings for an active multisite
93
  if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
94
+ add_action( 'network_admin_menu', array( $this, 'add_settings_page' ) );
95
  // add settings link
96
+ add_filter(
97
+ 'network_admin_plugin_action_links', array(
98
+ $this,
99
+ 'network_admin_plugin_action_links'
100
+ ), 10, 2
101
+ );
102
  // save settings on network
103
  add_action( 'network_admin_edit_' . self::$option_string, array( $this, 'save_network_settings_page' ) );
104
  // return message for update settings
105
  add_action( 'network_admin_notices', array( $this, 'get_network_admin_notices' ) );
106
  // add script on settings page
107
  } else {
108
+ add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
109
  // add settings link
110
+ add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
111
  // use settings API
112
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
113
  }
114
  // include js
115
+ add_action(
116
+ 'admin_print_scripts-settings_page_' . str_replace( '.php', '', plugin_basename( __FILE__ ) ),
117
  array( $this, 'print_scripts' )
118
  );
119
+
120
  // add meta boxes on settings pages
121
  add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_plugin_infos' ) );
122
  add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_about_plugin' ) );
123
+
124
+ // include class for remove core quicktags
125
+ require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-remove-quicktags.php';
126
+ // include class for add enhanced code quicktags
127
+ // @TODO Solution for special code tags in quicktags
128
+ //require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-code-quicktags.php';
129
  // include class for im/export
130
  require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-imexport.php';
131
  }
132
+
133
  /**
134
+ * Return allowed post types for include scripts
 
135
  * @since 2.1.1
136
  * @access public
137
  * @return Array
138
  */
139
  public function get_post_types_for_js() {
140
+
141
  return self::$post_types_for_js;
142
  }
143
+
144
  /**
145
  * Return Textdomain string
 
146
  * @access public
147
  * @since 2.0.0
148
  * @return string
149
  */
150
  public function get_textdomain() {
151
+
152
+ return self::$textdomain;
153
  }
154
+
155
  /**
156
  * Add settings link on plugins.php in backend
157
+ * @uses
158
+ * @access public
159
+ *
160
+ * @param array $links , string $file
161
+ * @param string $file
162
+ *
163
+ * @since 2.0.0
164
+ * @return string $links
165
  */
166
  public function plugin_action_links( $links, $file ) {
167
+
168
+ if ( parent :: get_plugin_string() == $file ) {
169
+ $links[ ] = '<a href="options-general.php?page=' . plugin_basename( __FILE__ ) . '">' . __( 'Settings' ) . '</a>';
170
+ }
171
+
172
  return $links;
173
  }
174
+
175
  /**
176
  * Add settings link on plugins.php on network admin in backend
177
+ * @uses
 
178
  * @access public
 
179
  * @since 2.0.0
180
+ *
181
+ * @param array $links , string $file
182
+ * @param $file
183
+ *
184
  * @return string $links
185
  */
186
  public function network_admin_plugin_action_links( $links, $file ) {
187
+
188
+ if ( parent :: get_plugin_string() == $file ) {
189
+ $links[ ] = '<a href="settings.php?page=' . plugin_basename( __FILE__ ) . '">' . __( 'Settings' ) . '</a>';
190
+ }
191
+
192
  return $links;
193
  }
194
+
195
  /**
196
  * Add settings page in WP backend
 
197
  * @uses add_options_page
198
  * @access public
199
  * @since 2.0.0
200
  * @return void
201
  */
202
+ public function add_settings_page() {
203
+
204
  if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
205
  add_submenu_page(
206
  'settings.php',
207
  parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this->get_textdomain() ),
208
  parent :: get_plugin_data( 'Name' ),
209
  'manage_options',
210
+ plugin_basename( __FILE__ ),
211
  array( $this, 'get_settings_page' )
212
  );
213
  } else {
215
  parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this->get_textdomain() ),
216
  parent :: get_plugin_data( 'Name' ),
217
  'manage_options',
218
+ plugin_basename( __FILE__ ),
219
  array( $this, 'get_settings_page' )
220
  );
221
  add_action( 'contextual_help', array( $this, 'contextual_help' ), 10, 3 );
222
  }
223
  }
224
+
225
  /**
226
  * Return form and markup on settings page
227
+ * @uses settings_fields, normalize_whitespace, is_plugin_active_for_network, get_site_option, get_option
228
+ * @access public
229
+ * @since 0.0.2
 
230
  * @return void
231
  */
232
  public function get_settings_page() {
233
+
234
  ?>
235
  <div class="wrap">
236
+ <h2><?php echo parent :: get_plugin_data( 'Name' ); ?></h2>
237
+
238
+ <h3><?php _e( 'Add or delete Quicktag buttons', $this->get_textdomain() ); ?></h3>
239
+
240
+ <p><?php _e( 'Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields.', $this->get_textdomain() ); ?></p>
241
+
242
+ <?php
243
+ if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
244
+ $action = 'edit.php?action=' . self::$option_string;
245
+ } else {
246
+ $action = 'options.php';
247
+ }
248
+ ?>
249
+ <form method="post" action="<?php echo $action; ?>">
250
  <?php
251
+ if ( is_multisite() && is_plugin_active_for_network( self::$plugin ) ) {
252
+ wp_nonce_field( self::$nonce_string );
253
+ $options = get_site_option( self::$option_string );
254
+ } else {
255
+ settings_fields( self::$option_string . '_group' );
256
+ $options = get_option( self::$option_string );
257
+ }
258
+
259
+ if ( ! isset( $options[ 'buttons' ] ) ) {
260
+ $options[ 'buttons' ] = array();
261
+ }
262
+
263
+ if ( 1 < count( $options[ 'buttons' ] ) ) {
264
+ // sort array by order value
265
+ $tmp = array();
266
+ foreach ( $options[ 'buttons' ] as $order ) {
267
+ if ( isset( $order[ 'order' ] ) ) {
268
+ $tmp[ ] = $order[ 'order' ];
269
+ } else {
270
+ $tmp[ ] = 0;
271
+ }
272
+ }
273
+ array_multisort( $tmp, SORT_ASC, $options[ 'buttons' ] );
274
+ }
275
+
276
+ // loop about the post types, create html an values for title in table
277
+ $pt_title = '';
278
+ $pt_colgroup = '';
279
+ foreach ( $this->get_post_types_for_js() as $post_type ) {
280
+
281
+ $pt_title .= '<th class="row-title rotate" title="Post Type"><span><code>' . $post_type . '</code></span></th>' . "\n";
282
+ $pt_colgroup .= '<colgroup></colgroup>' . "\n";
283
+ }
284
  ?>
285
+
286
+ <table class="widefat form-table rmnlQuicktagSettings">
287
+ <colgroup></colgroup>
288
+ <colgroup></colgroup>
289
+ <colgroup></colgroup>
290
+ <colgroup></colgroup>
291
+ <colgroup></colgroup>
292
+ <?php echo $pt_colgroup; ?>
293
+ <colgroup></colgroup>
294
+
295
+ <tr class="rmnlqsheader">
296
+ <th class="row-title"><?php _e( 'Button Label* and', $this->get_textdomain() ); ?><br />
297
+ <?php _e( 'Title Attribute', $this->get_textdomain() ); ?></th>
298
+ <th class="row-title"><?php _e( 'Start Tag(s)* and', $this->get_textdomain() ); ?><br />
299
+ <?php _e( 'End Tag(s)', $this->get_textdomain() ); ?></th>
300
+ <th class="row-title"><?php _e( 'Access Key and', $this->get_textdomain() ); ?><br />
301
+ <?php _e( 'Order', $this->get_textdomain() ); ?></th>
302
+ <th class="row-title rotate"><span><?php _e( 'Visual', $this->get_textdomain() ); ?></span></th>
303
+ <?php echo $pt_title ?>
304
+ <th class="row-title rotate">&#x2714;</th>
305
+ </tr>
306
  <?php
307
+ if ( empty( $options[ 'buttons' ] ) ) {
308
+ $options[ 'buttons' ] = array();
 
 
 
 
309
  }
310
+ $class = '';
311
+ for ( $i = 0; $i < count( $options[ 'buttons' ] ); $i ++ ) {
312
+ $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
313
+ $b = $options[ 'buttons' ][ $i ];
314
+ $b[ 'text' ] = htmlentities( stripslashes( $b[ 'text' ] ), ENT_COMPAT, get_option( 'blog_charset' ) );
315
+ if ( isset( $b[ 'title' ] ) ) {
316
+ $b[ 'title' ] = htmlentities( stripslashes( $b[ 'title' ] ), ENT_COMPAT, get_option( 'blog_charset' ) );
 
 
 
 
 
317
  }
318
+ $b[ 'start' ] = htmlentities( $b[ 'start' ], ENT_COMPAT, get_option( 'blog_charset' ) );
319
+ if ( isset( $b[ 'end' ] ) ) {
320
+ $b[ 'end' ] = htmlentities( $b[ 'end' ], ENT_COMPAT, get_option( 'blog_charset' ) );
321
+ }
322
+ if ( ! isset( $b[ 'access' ] ) ) {
323
+ $b[ 'access' ] = '';
324
+ }
325
+ $b[ 'access' ] = htmlentities( $b[ 'access' ], ENT_COMPAT, get_option( 'blog_charset' ) );
326
+ if ( ! isset( $b[ 'order' ] ) ) {
327
+ $b[ 'order' ] = 0;
328
+ }
329
+ $b[ 'order' ] = intval( $b[ 'order' ] );
330
+ if ( ! isset( $b[ 'visual' ] ) ) {
331
+ $b[ 'visual' ] = 0;
332
+ }
333
+ $b[ 'visual' ] = intval( $b[ 'visual' ] );
334
+ if ( 1 == $b[ 'visual' ] ) {
335
+ $checked = ' checked="checked"';
336
+ } else {
337
+ $checked = '';
338
+ }
339
+ // loop about the post types, create html an values
340
+ $pt_checkboxes = '';
341
+ foreach ( $this->get_post_types_for_js() as $post_type ) {
342
+
343
+ if ( ! isset( $b[ $post_type ] ) ) {
344
+ $b[ $post_type ] = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  }
346
+
347
+ $b[ $post_type ] = intval( $b[ $post_type ] );
348
+
349
+ if ( 1 == $b[ $post_type ] ) {
350
+ $pt_checked = ' checked="checked"';
351
+ } else {
352
+ $pt_checked = '';
353
+ }
354
+
355
+ $pt_checkboxes .= '<td class="num"><input type="checkbox" name="' .
356
+ self::$option_string . '[buttons][' .
357
+ $i . '][' . $post_type . ']" value="1"' .
358
+ $pt_checked . '/></td>' . "\n";
359
+ }
360
+
361
  echo '
362
  <tr id="rmqtb' . $i . '">
363
+ <td><input type="text" name="' . self::$option_string . '[buttons][' . $i
364
+ . '][text]" value="' . $b[ 'text' ] . '" /><br />
365
+ <input type="text" name="' . self::$option_string . '[buttons][' . $i . '][title]" value="'
366
+ . $b[ 'title' ] . '" /></td>
367
+ <td><textarea class="code" name="' . self::$option_string . '[buttons][' . $i
368
+ . '][start]" rows="2" cols="25" >' . $b[ 'start' ] . '</textarea><br />
369
+ <textarea class="code" name="' . self::$option_string . '[buttons][' . $i
370
+ . '][end]" rows="2" cols="25" >' . $b[ 'end' ] . '</textarea></td>
371
+ <td><input class="small-text" type="text" name="' . self::$option_string . '[buttons][' . $i
372
+ . '][access]" value="' . $b[ 'access' ] . '" /><br />
373
+ <input class="small-text" type="text" name="' . self::$option_string . '[buttons][' . $i
374
+ . '][order]" value="' . $b[ 'order' ] . '" /></td>
375
+ <td class="num"><input type="checkbox" name="' . self::$option_string . '[buttons][' . $i
376
+ . '][visual]" value="1"' . $checked . '/></td>' .
377
+ $pt_checkboxes . '
378
+ <td class="num"><input type="checkbox" class="toggle" id="select_all_' . $i . '" value="' . $i . '" /></td>' . '
379
  </tr>
380
  ';
381
+ }
382
+
383
+ // loop about the post types, create html an values for empty new checkboxes
384
+ $pt_new_boxes = '';
385
+ foreach ( $this->get_post_types_for_js() as $post_type ) {
386
+ if ( ! isset( $b[ $post_type ] ) ) {
387
+ $b[ $post_type ] = 0;
388
  }
389
+
390
+ $b[ $post_type ] = intval( $b[ $post_type ] );
391
+
392
+ if ( 1 == $b[ $post_type ] ) {
393
+ $pt_checked = ' checked="checked"';
394
+ } else {
395
+ $pt_checked = '';
 
 
 
 
 
 
 
 
 
 
396
  }
397
+
398
+ $pt_new_boxes .= '<td class="num"><input type="checkbox" name="' .
399
+ self::$option_string . '[buttons][' .
400
+ $i . '][' . $post_type . ']" value="1" /></td>' . "\n";
401
+ }
402
+ ?>
403
+ <tr id="rmqtb<?php echo $i ?>">
404
+ <td>
405
+ <input type="text" placeholder="<?php _e( 'Button Label*', $this->get_textdomain() ); ?>" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][text]" value="" /><br />
406
+ <input type="text" placeholder="<?php _e( 'Title Attribute', $this->get_textdomain() ); ?>" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][title]" value="" />
407
+ </td>
408
+ <td>
409
+ <textarea placeholder="<?php _e( 'Start Tag(s)*', $this->get_textdomain() ); ?>" class="code" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][start]" rows="2" cols="25"></textarea><br />
410
+ <textarea placeholder="<?php _e( 'End Tag(s)', $this->get_textdomain() ); ?>" class="code" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][end]" rows="2" cols="25"></textarea>
411
+ </td>
412
+ <td>
413
+ <input type="text" placeholder="<?php _e( 'Access Key', $this->get_textdomain() ); ?>" title="<?php _e( 'Access Key', $this->get_textdomain() ); ?>" class="small-text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][access]" value="" /><br />
414
+ <input type="text" placeholder="<?php _e( 'Order', $this->get_textdomain() ); ?>" title="<?php _e( 'Order', $this->get_textdomain() ); ?>" class="small-text" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][order]" value="" />
415
+ </td>
416
+ <td class="num">
417
+ <input type="checkbox" name="<?php echo self::$option_string; ?>[buttons][<?php echo $i; ?>][visual]" value="1" />
418
+ </td>
419
+ <?php echo $pt_new_boxes; ?>
420
+ <td class="num">
421
+ <input type="checkbox" class="toggle" id="select_all_<?php echo $i ?>" value="<?php echo $i ?>" />
422
+ </td>
423
+ </tr>
424
+ </table>
425
+
426
+ <?php do_action( 'addquicktag_settings_form_page', $options ); ?>
427
+
428
+ <p class="submit">
429
+ <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" />
430
+ </p>
431
+
432
+ </form>
433
+
434
+ <div class="metabox-holder has-right-sidebar">
435
+
436
+ <div class="inner-sidebar">
437
+ <?php do_action( 'addquicktag_settings_page_sidebar' ); ?>
438
+ </div>
439
+ <!-- .inner-sidebar -->
440
+
441
+ <div id="post-body">
442
+ <div id="post-body-content">
443
+ <?php do_action( 'addquicktag_settings_page' ); ?>
444
+ </div>
445
+ <!-- #post-body-content -->
446
+ </div>
447
+ <!-- #post-body -->
448
+
449
  </div>
450
+ <!-- .metabox-holder -->
451
+
452
+ </div>
453
+ <?php
454
  }
455
+
456
  /*
457
+ * Return information to donate
458
  *
459
  * @uses _e,esc_attr_e
460
  * @access public
462
  * @return void
463
  */
464
  public function get_plugin_infos() {
465
+
466
  ?>
467
  <div class="postbox">
468
+
469
  <h3><span><?php _e( 'Like this plugin?', $this->get_textdomain() ); ?></span></h3>
470
+
471
  <div class="inside">
472
  <p><?php _e( 'Here\'s how you can give back:', $this->get_textdomain() ); ?></p>
473
  <ul>
474
+ <li>
475
+ <a href="http://wordpress.org/support/view/plugin-reviews/addquicktag" title="<?php esc_attr_e( 'The Plugin on the WordPress plugin repository', $this->get_textdomain() ); ?>"><?php esc_attr_e( 'Give the plugin a good rating.', $this->get_textdomain() ); ?></a>
476
+ </li>
477
+ <li>
478
+ <a href="http://wordpress.org/support/plugin/addquicktag" title="<?php esc_attr_e( 'Help inside the community other useres and write answer to this plugin questions.', $this->get_textdomain() ); ?>"><?php esc_attr_e( 'Help other users in the Support Forum.', $this->get_textdomain() ); ?></a>
479
+ </li>
480
+ <li>
481
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=6069955" title="<?php esc_attr_e( 'Donate via PayPal', $this->get_textdomain() ); ?>"><?php esc_attr_e( 'Donate a few euros.', $this->get_textdomain() ); ?></a>
482
+ </li>
483
+ <li>
484
+ <a href="http://www.amazon.de/gp/registry/3NTOGEK181L23/ref=wl_s_3" title="<?php esc_attr_e( 'Frank Bültge\'s Amazon Wish List', $this->get_textdomain() ); ?>"><?php esc_attr_e( 'Get me something from my wish list.', $this->get_textdomain() ); ?></a>
485
+ </li>
486
+ <li>
487
+ <a href="https://github.com/bueltge/AddQuicktag" title="<?php esc_attr_e( 'Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues.', $this->get_textdomain() ); ?>"><?php esc_attr_e( 'Github Repo for Contribute, Issues & Bugs', $this->get_textdomain() ); ?></a>
488
+ </li>
489
  </ul>
490
  </div>
491
  </div>
492
+ <?php
493
  }
494
+
495
  /*
496
  * Return informations about the plugin
497
  *
501
  * @return void
502
  */
503
  public function get_about_plugin() {
504
+
505
  ?>
506
  <div class="postbox">
507
+
508
  <h3><span><?php _e( 'About this plugin', $this->get_textdomain() ); ?></span></h3>
509
+
510
  <div class="inside">
511
  <p>
512
  <strong><?php _e( 'Version:', $this->get_textdomain() ); ?></strong>
513
  <?php echo parent :: get_plugin_data( 'Version' ); ?>
514
  </p>
515
+
516
  <p>
517
  <strong><?php _e( 'Description:', $this->get_textdomain() ); ?></strong>
518
  <?php echo parent :: get_plugin_data( 'Description' ); ?>
519
  </p>
520
  </div>
521
+
522
  </div>
523
+ <?php
524
  }
525
+
526
  /*
527
  * Save network settings
528
  *
532
  * @return void
533
  */
534
  public function save_network_settings_page() {
535
+
536
+ if ( ! wp_verify_nonce( $_REQUEST[ '_wpnonce' ], self::$nonce_string ) ) {
537
  wp_die( 'Sorry, you failed the nonce test.' );
538
+ }
539
+
540
  // validate options
541
+ $value = $this->validate_settings( $_POST[ self::$option_string ] );
542
+
543
  // update options
544
  update_site_option( self::$option_string, $value );
545
  // redirect to settings page in network
551
  );
552
  exit();
553
  }
554
+
555
  /*
556
  * Retrun string vor update message
557
  *
561
  * @return string $notice
562
  */
563
  public function get_network_admin_notices() {
564
+
565
  // if updated and the right page
566
+ if ( isset( $_GET[ 'updated' ] ) &&
567
+ 'settings_page_addquicktag/inc/class-settings-network' === $GLOBALS[ 'current_screen' ] ->id
568
+ ) {
569
  $message = __( 'Options saved.', $this->get_textdomain() );
570
+ $notice = '<div id="message" class="updated"><p>' . $message . '</p></div>';
571
  echo $notice;
572
  }
573
  }
574
+
575
  /**
576
  * Validate settings for options
 
577
  * @uses normalize_whitespace
578
  * @access public
579
+ *
580
  * @param array $value
581
+ *
582
  * @since 2.0.0
583
  * @return string $value
584
  */
585
  public function validate_settings( $value ) {
586
+
587
+ // Save core buttons changes
588
+ if ( isset( $value[ 'core_buttons' ] ) ) {
589
+ $core_buttons = $value[ 'core_buttons' ];
590
+ }
591
+
592
+ // Save Code buttons
593
+ if ( isset( $value[ 'code_buttons' ] ) ) {
594
+ $code_buttons = $value[ 'code_buttons' ];
595
+ }
596
+
597
+ // set allowed values for import, only the defaults of plugin and custom post types
598
  $allowed_settings = (array) array_merge(
599
  $this->get_post_types_for_js(),
600
  array( 'text', 'title', 'start', 'end', 'access', 'order', 'visual' )
601
  );
602
+
603
+ $buttons = '';
604
  // filter for allowed values
605
+ foreach ( $value[ 'buttons' ] as $key => $button ) {
606
+
607
+ foreach ( $button as $label => $val ) {
608
+
609
+ if ( ! in_array( $label, $allowed_settings ) ) {
610
+ unset( $button[ $label ] );
611
+ }
612
  }
613
+
614
+ $buttons[ ] = $button;
615
  }
616
+
617
  // return filtered array
618
+ $filtered_values[ 'buttons' ] = $buttons;
619
+ $value = $filtered_values;
620
+
621
  $buttons = array();
622
+ for ( $i = 0; $i < count( $value[ 'buttons' ] ); $i ++ ) {
623
+
624
+ $b = $value[ 'buttons' ][ $i ];
625
+ if ( ! empty( $b[ 'text' ] ) && ! empty( $b[ 'start' ] ) ) {
626
+
627
+ $b[ 'text' ] = esc_html( $b[ 'text' ] );
628
+ $b[ 'title' ] = esc_html( $b[ 'title' ] );
629
+ $b[ 'start' ] = stripslashes( $b[ 'start' ] );
630
+ $b[ 'end' ] = stripslashes( $b[ 'end' ] );
631
+
632
+ if ( isset( $b[ 'access' ] ) ) {
633
+ $b[ 'access' ] = esc_html( $b[ 'access' ] );
634
+ }
635
+
636
+ if ( isset( $b[ 'order' ] ) ) {
637
+ $b[ 'order' ] = intval( $b[ 'order' ] );
638
+ }
639
+
640
+ // visual settings
641
+ if ( isset( $b[ 'visual' ] ) ) {
642
+ $b[ 'visual' ] = intval( $b[ 'visual' ] );
643
+ } else {
644
+ $b[ 'visual' ] = 0;
645
+ }
646
+
647
+ // post types
648
+ foreach ( $this->get_post_types_for_js() as $post_type ) {
649
+
650
+ if ( isset( $b[ $post_type ] ) ) {
651
+ $b[ $post_type ] = intval( $b[ $post_type ] );
652
+ } else {
653
+ $b[ $post_type ] = 0;
654
  }
655
+
 
656
  }
657
+
658
+ $buttons[ ] = $b;
659
+ }
660
+
661
+ }
662
+
663
+ // Check for wrong empty values and kill
664
+ foreach ( $value[ 'buttons' ] as $key => $b ) {
665
+
666
+ if ( empty( $b[ 'text' ] ) && empty( $b[ 'start' ] ) ) {
667
+ unset( $value[ 'buttons' ][ $key ] );
668
+ }
669
+ }
670
+ // reorder the array
671
+ $value[ 'buttons' ] = array_values( $value[ 'buttons' ] );
672
+
673
+ // Add core buttons to array of options
674
+ if ( ! empty( $core_buttons ) ) {
675
+
676
+ foreach ( $core_buttons as $key => $var ) {
677
+ $core_buttons[ $key ] = (int) $var;
678
+ }
679
+
680
+ $value[ 'core_buttons' ] = $core_buttons;
681
+ }
682
+
683
+ // Add code buttons to array of options
684
+ if ( ! empty( $code_buttons ) ) {
685
+
686
+ foreach ( $code_buttons as $key => $var ) {
687
+ $code_buttons[ $key ] = (int) $var;
688
+ }
689
+
690
+ $value[ 'code_buttons' ] = $code_buttons;
691
  }
692
+
 
693
  return $value;
694
  }
695
+
696
  /**
697
  * Register settings for options
 
698
  * @uses register_setting
699
  * @access public
700
  * @since 2.0.0
701
  * @return void
702
  */
703
  public function register_settings() {
704
+
705
  register_setting( self::$option_string . '_group', self::$option_string, array( $this, 'validate_settings' ) );
706
  }
707
+
708
  /**
709
  * Unregister and delete settings; clean database
 
710
  * @uses unregister_setting, delete_option
711
  * @access public
712
  * @since 0.0.2
713
  * @return void
714
  */
715
  public function unregister_settings() {
716
+
717
  unregister_setting( self::$option_string . '_group', self::$option_string );
718
  delete_option( self::$option_string );
719
  }
720
+
721
+ /**
722
+ * Enqueue scripts and stylesheets
723
+ * @since 0.0.2
724
+ *
725
+ * @param $where
726
+ */
727
  public function print_scripts( $where ) {
728
+
729
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
730
+
731
  wp_register_script(
732
+ self::$option_string . '_admin_script',
733
+ plugins_url( '/js/settings' . $suffix . '.js', parent::get_plugin_string() ),
734
  array( 'jquery', 'quicktags' ),
735
  '',
736
  TRUE
737
  );
738
  wp_enqueue_script( self::$option_string . '_admin_script' );
739
+
740
+ wp_register_style(
741
+ self::$option_string . '_admin_style',
742
+ plugins_url( '/css/settings' . $suffix . '.css', parent::get_plugin_string() ),
743
+ array(),
744
+ FALSE,
745
+ 'screen'
746
+ );
747
+ wp_enqueue_style( self::$option_string . '_admin_style' );
748
  }
749
+
750
  /**
751
  * Add help text
 
752
  * @uses normalize_whitespace
753
+ *
754
  * @param string $contextual_help
755
  * @param string $screen_id
756
  * @param string $screen
757
+ *
758
  * @since 2.0.0
759
  * @return string $contextual_help
760
  */
761
  public function contextual_help( $contextual_help, $screen_id, $screen ) {
762
+
763
+ if ( 'settings_page_' . self::$option_string . '_group' !== $screen_id ) {
764
  return $contextual_help;
765
+ }
766
+
767
+ $contextual_help =
768
  '<p>' . __( '' ) . '</p>';
769
+
770
  return normalize_whitespace( $contextual_help );
771
  }
772
+
773
  }
774
+
775
  $add_quicktag_settings = Add_Quicktag_Settings :: get_object();
inc/class-tinymce.php CHANGED
@@ -1,8 +1,7 @@
1
  <?php
2
  /**
3
  * AddQuicktag - to TinyMCE Editor
4
- *
5
- * @license GPLv3
6
  * @package AddQuicktag
7
  * @subpackage AddQuicktag 2 TinyMce
8
  * @author Frank Bueltge <frank@bueltge.de>
@@ -13,59 +12,84 @@ if ( ! function_exists( 'add_action' ) ) {
13
  exit;
14
  }
15
 
 
 
 
 
16
  class Add_Quicktag_2_TinyMce extends Add_Quicktag {
17
-
18
- protected static $classobj = NULL;
19
-
 
 
20
  static private $option_string = 'rmnlQuicktagSettings_tmce';
21
-
22
  /**
23
  * Handler for the action 'init'. Instantiates this class.
24
- *
25
  * @access public
26
  * @since 2.0.0
27
- * @return $classobj
28
  */
29
  public static function get_object() {
30
-
31
- if ( NULL === self :: $classobj ) {
32
- self :: $classobj = new self;
 
 
33
  }
34
-
35
- return self :: $classobj;
36
  }
37
-
38
  /**
39
  * Constructor, init on defined hooks of WP and include second class
40
- *
41
  * @access public
42
  * @since 0.0.2
43
  * @uses add_action
44
- * @return void
45
  */
46
- public function __construct() {
47
-
48
  add_filter( 'mce_external_plugins', array( $this, 'add_externel_buttons' ) );
49
- add_filter( 'mce_buttons_2', array( $this, 'extend_editor_buttons' ), 10, 2 );
50
  }
51
-
 
 
 
 
 
 
 
52
  public function add_externel_buttons( $plugins ) {
53
-
54
- if ( FALSE == is_array($plugins) )
55
  $plugins = array();
56
-
57
- $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
58
-
59
- $url = plugins_url('/tinymce/editor_plugin' . $suffix . '.js', __FILE__);
60
- $plugins = array_merge( $plugins, array( self :: $option_string => $url ) );
61
-
 
62
  return $plugins;
63
  }
64
-
 
 
 
 
 
 
 
 
 
65
  public function extend_editor_buttons( $buttons, $editor_id = FALSE ) {
66
-
67
- return array_merge( array( self :: $option_string ), $buttons );
 
 
68
  }
69
-
70
  } // end class
71
- $add_quicktag_2_tinymce = Add_Quicktag_2_TinyMce :: get_object();
1
  <?php
2
  /**
3
  * AddQuicktag - to TinyMCE Editor
4
+ * @license GPLv2
 
5
  * @package AddQuicktag
6
  * @subpackage AddQuicktag 2 TinyMce
7
  * @author Frank Bueltge <frank@bueltge.de>
12
  exit;
13
  }
14
 
15
+ /**
16
+ * Class Add_Quicktag_2_TinyMce
17
+ * Add teh list box to the tinymce
18
+ */
19
  class Add_Quicktag_2_TinyMce extends Add_Quicktag {
20
+
21
+ /**
22
+ * Key for custom button
23
+ * @var string
24
+ */
25
  static private $option_string = 'rmnlQuicktagSettings_tmce';
26
+
27
  /**
28
  * Handler for the action 'init'. Instantiates this class.
 
29
  * @access public
30
  * @since 2.0.0
31
+ * @return \Add_Quicktag|\Add_Quicktag_2_TinyMce $instance
32
  */
33
  public static function get_object() {
34
+
35
+ static $instance;
36
+
37
+ if ( NULL === $instance ) {
38
+ $instance = new self();
39
  }
40
+
41
+ return $instance;
42
  }
43
+
44
  /**
45
  * Constructor, init on defined hooks of WP and include second class
 
46
  * @access public
47
  * @since 0.0.2
48
  * @uses add_action
49
+ * @return \Add_Quicktag_2_TinyMce
50
  */
51
+ private function __construct() {
52
+
53
  add_filter( 'mce_external_plugins', array( $this, 'add_externel_buttons' ) );
54
+ add_filter( 'mce_buttons_2', array( $this, 'extend_editor_buttons' ), 10, 2 );
55
  }
56
+
57
+ /**
58
+ * Add the script url to plugins of TinyMCE
59
+ *
60
+ * @param $plugins
61
+ *
62
+ * @return array
63
+ */
64
  public function add_externel_buttons( $plugins ) {
65
+
66
+ if ( FALSE == is_array( $plugins ) ) {
67
  $plugins = array();
68
+ }
69
+
70
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
71
+
72
+ $url = plugins_url( '/tinymce/editor_plugin' . $suffix . '.js', __FILE__ );
73
+ $plugins = array_merge( $plugins, array( self::$option_string => $url ) );
74
+
75
  return $plugins;
76
  }
77
+
78
+ /**
79
+ * Add key for address the button via script
80
+ *
81
+ * @param bool $editor_id
82
+ *
83
+ * @return array
84
+ *
85
+ * @param $buttons
86
+ */
87
  public function extend_editor_buttons( $buttons, $editor_id = FALSE ) {
88
+
89
+ $buttons = array_merge( array( self::$option_string ), $buttons );
90
+
91
+ return $buttons;
92
  }
93
+
94
  } // end class
95
+ $add_quicktag_2_tinymce = Add_Quicktag_2_TinyMce::get_object();
inc/tinymce/editor_plugin.dev.js CHANGED
@@ -1,115 +1,140 @@
1
  /**
2
  * AddQuicktag Script to add listbox to visual-editor
3
- *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
- * @version 07/11/2012
7
- * @since 2.0.0
8
  */
9
 
10
- jQuery( document ).ready( function( $ ) {
11
-
12
- if ( typeof addquicktag_tags == 'undefined' )
13
  return;
14
-
15
- if ( typeof addquicktag_post_type == 'undefined' )
16
  return;
17
-
18
- if ( typeof addquicktag_pt_for_js == 'undefined' )
19
  return;
20
-
21
  // wrong post type
22
- if ( -1 == $.inArray( addquicktag_post_type, addquicktag_pt_for_js ) )
23
  return;
24
-
25
  // break, if not an button for visual and post type
26
- var visual = 0;
27
- var post_type = 0;
28
- for ( i = 0; i < addquicktag_tags.buttons.length; i++ ) {
 
 
29
  // if not visual button in the list, return
30
- if ( 1 === parseInt( addquicktag_tags.buttons[i]['visual'] ) )
31
  visual = addquicktag_tags.buttons[i]['visual'];
32
  // check for active on this post type on each buttons
33
- if ( 1 === parseInt( addquicktag_tags.buttons[i][addquicktag_post_type] ) )
34
  post_type = addquicktag_tags.buttons[i][addquicktag_post_type];
35
  }
36
- if ( 1 !== parseInt( visual ) )
 
37
  return;
38
- if ( 1 !== parseInt( post_type ) )
 
39
  return;
40
-
41
- // Load plugin specific language pack
42
- tinymce.PluginManager.requireLangPack( 'rmnlQuicktagSettings_tmce' );
43
-
44
- /*
45
- * @see http://www.tinymce.com/wiki.php/API3:class.tinymce.ui.ListBox
46
- */
47
- tinymce.create('tinymce.plugins.AddQuicktag', {
48
- createControl: function(n, cm) {
49
- switch (n) {
50
- case 'rmnlQuicktagSettings_tmce':
51
- var tiny_tags = addquicktag_tags['buttons'],
52
- i = 0,
53
- rmnlQuicktagSettings_tmce_options = '',
54
- mlb = cm.createListBox('rmnlQuicktagSettings_tmce', {
55
- title : 'Quicktags',
56
- onselect : function(v) {
57
- var selection = tinyMCE.activeEditor.selection.getContent(),
58
- marked = true;
59
-
60
- switch (v) {
61
- case 'null' :
62
- marked = false;
63
- break;
64
- default :
65
- break;
66
- }
67
-
68
- if ( marked == true ) {
69
-
70
- if ( typeof tiny_tags[v].end == 'undefined' )
71
- tiny_tags[v].end = '';
72
-
73
- tinyMCE.activeEditor.selection.setContent(
74
- tiny_tags[v].start + selection + tiny_tags[v].end
75
- );
76
- }
77
- }
78
- });
79
-
80
- // add values to the listbox
81
- if ( typeof tiny_tags !== 'undefined' ) {
82
- for ( i = 0; i < tiny_tags.length; i++ ) {
83
-
84
- // check for active on this post type
85
- if ( 1 === parseInt( tiny_tags[i][addquicktag_post_type] ) ) {
86
-
87
- if ( 1 == tiny_tags[i].visual )
88
- mlb.add( tiny_tags[i].text, String(i) );
89
- }
90
- }
91
- } else {
92
- mlb.add('rmnlQuicktagSettings_tmce.addquicktag_select_error', 'null');
93
  }
94
-
95
- // Return the new listbox instance
96
- return mlb;
97
- break;
98
  }
99
- return null;
100
- },
101
-
102
- getInfo : function() {
103
  return {
104
- longname : 'AddQuicktag Plugin for TinyMCE in WordPress',
105
- author : 'Frank Bueltge',
106
- authorurl : 'http://bueltge.de/',
107
- infourl : 'http://wordpress.org/extend/plugins/addquicktag/',
108
- version : tinymce.majorVersion + "." + tinymce.minorVersion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  };
110
- }
 
111
  });
112
-
113
- // Register plugin
114
- tinymce.PluginManager.add( 'rmnlQuicktagSettings_tmce', tinymce.plugins.AddQuicktag );
115
  });
1
  /**
2
  * AddQuicktag Script to add listbox to visual-editor
3
+ *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 05/22/2014
7
+ * @since 2.3.0
8
  */
9
 
10
+ jQuery(document).ready(function ($) {
11
+
12
+ if (typeof addquicktag_tags == 'undefined')
13
  return;
14
+
15
+ if (typeof addquicktag_post_type == 'undefined')
16
  return;
17
+
18
+ if (typeof addquicktag_pt_for_js == 'undefined')
19
  return;
20
+
21
  // wrong post type
22
+ if (-1 == $.inArray(addquicktag_post_type, addquicktag_pt_for_js))
23
  return;
24
+
25
  // break, if not an button for visual and post type
26
+ var visual = 0,
27
+ post_type = 0,
28
+ i = 0;
29
+
30
+ for (i = 0; i < addquicktag_tags.buttons.length; i++) {
31
  // if not visual button in the list, return
32
+ if (1 === parseInt(addquicktag_tags.buttons[i]['visual']))
33
  visual = addquicktag_tags.buttons[i]['visual'];
34
  // check for active on this post type on each buttons
35
+ if (1 === parseInt(addquicktag_tags.buttons[i][addquicktag_post_type]))
36
  post_type = addquicktag_tags.buttons[i][addquicktag_post_type];
37
  }
38
+
39
+ if (1 !== parseInt(visual))
40
  return;
41
+
42
+ if (1 !== parseInt(post_type))
43
  return;
44
+
45
+ // Add listbox plugin to TinyMCE editor
46
+ tinymce.PluginManager.add('rmnlQuicktagSettings_tmce', function (editor) {
47
+
48
+ editor.addButton('rmnlQuicktagSettings_tmce', function () {
49
+
50
+ var tiny_tags = addquicktag_tags['buttons'],
51
+ values = [],
52
+ i = 0;
53
+
54
+ for (i = 0; i < tiny_tags.length; i++) {
55
+
56
+ // check for active on this post type
57
+ if (1 === parseInt(tiny_tags[i][addquicktag_post_type])) {
58
+
59
+ if (1 == tiny_tags[i].visual) {
60
+ values.push({text: tiny_tags[i].text, value: String(i)});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
+ }
 
 
 
63
  }
64
+
 
 
 
65
  return {
66
+ type : 'listbox',
67
+ //name: 'align',
68
+ text : 'Quicktags',
69
+ label : 'Select :',
70
+ fixedWidth: true,
71
+ onselect : function (v) {
72
+
73
+ var // Set short var for the value identifier
74
+ v = v.control._value,
75
+ marked = false;
76
+
77
+ if (typeof( tinymce.activeEditor.selection.getContent() ) != 'undefined')
78
+ marked = true;
79
+
80
+ if (marked == true) {
81
+
82
+ var content = tinymce.activeEditor.selection.getContent(),
83
+ start_content = tinymce.activeEditor.selection.getStart().nodeName,
84
+ all = tinymce.activeEditor.selection.getNode(),
85
+ start = tiny_tags[v].start,
86
+ start_tag = start.match(/[a-z]+/),
87
+ end = tiny_tags[v].end;
88
+
89
+ if (typeof end == 'undefined')
90
+ end = '';
91
+
92
+
93
+ /*
94
+ // For debugging purpose
95
+ console.log(v);
96
+ console.log('TinyTags: ' + tiny_tags[v]);
97
+ console.log('start_content: ' + start_content);
98
+ console.log('start_content.nodeName: ' + tinymce.activeEditor.selection.getStart().nodeName);
99
+ console.log('start_content.outerHMTL: ' + tinymce.activeEditor.selection.getStart().outerHMTL);
100
+ console.log('Content: ' + content);
101
+ console.log(all);
102
+ console.log('Start tag: ' + start);
103
+ console.log('Start tag, only: ' + start.match(/[a-z]+/));
104
+ console.log('End tag: ' + end);
105
+ //console.log(start_content.indexOf( start ));
106
+ console.log('Search nodeName: ' + start_content.search(start));
107
+ /**/
108
+
109
+
110
+ // Add tag to content
111
+ if (start.match(/[a-z]+/i) != start_content.toLowerCase()) {
112
+ tinymce.activeEditor.selection.setContent(
113
+ tiny_tags[v].start + content + tiny_tags[v].end
114
+ );
115
+ }
116
+
117
+ // Remove existing tag
118
+ if (start.match(/[a-z]+/i) == start_content.toLowerCase()) {
119
+
120
+ // Remove content with tag
121
+ tinyMCE.activeEditor.dom.remove(
122
+ tinymce.activeEditor.selection.getNode(
123
+ start_content.toLowerCase()
124
+ )
125
+ );
126
+ // Add content, without tag
127
+ tinymce.activeEditor.selection.setContent(
128
+ content
129
+ );
130
+
131
+ }
132
+
133
+ }
134
+ },
135
+ values : values,
136
  };
137
+ });
138
+
139
  });
 
 
 
140
  });
inc/tinymce/editor_plugin.js CHANGED
@@ -3,8 +3,8 @@
3
  *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
- * @version 07/11/2012
7
- * @since 2.0.0
8
  */
9
 
10
- jQuery(document).ready(function(a){if(typeof addquicktag_tags=="undefined")return;if(typeof addquicktag_post_type=="undefined")return;if(typeof addquicktag_pt_for_js=="undefined")return;if(-1==a.inArray(addquicktag_post_type,addquicktag_pt_for_js))return;var b=0;var c=0;for(i=0;i<addquicktag_tags.buttons.length;i++){if(1===parseInt(addquicktag_tags.buttons[i]["visual"]))b=addquicktag_tags.buttons[i]["visual"];if(1===parseInt(addquicktag_tags.buttons[i][addquicktag_post_type]))c=addquicktag_tags.buttons[i][addquicktag_post_type]}if(1!==parseInt(b))return;if(1!==parseInt(c))return;tinymce.PluginManager.requireLangPack("rmnlQuicktagSettings_tmce");tinymce.create("tinymce.plugins.AddQuicktag",{createControl:function(a,b){switch(a){case"rmnlQuicktagSettings_tmce":var c=addquicktag_tags["buttons"],d=0,e="",f=b.createListBox("rmnlQuicktagSettings_tmce",{title:"Quicktags",onselect:function(a){var b=tinyMCE.activeEditor.selection.getContent(),d=true;switch(a){case"null":d=false;break;default:break}if(d==true){if(typeof c[a].end=="undefined")c[a].end="";tinyMCE.activeEditor.selection.setContent(c[a].start+b+c[a].end)}}});if(typeof c!=="undefined"){for(d=0;d<c.length;d++){if(1===parseInt(c[d][addquicktag_post_type])){if(1==c[d].visual)f.add(c[d].text,String(d))}}}else{f.add("rmnlQuicktagSettings_tmce.addquicktag_select_error","null")}return f;break}return null},getInfo:function(){return{longname:"AddQuicktag Plugin for TinyMCE in WordPress",author:"Frank Bueltge",authorurl:"http://bueltge.de/",infourl:"http://wordpress.org/extend/plugins/addquicktag/",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("rmnlQuicktagSettings_tmce",tinymce.plugins.AddQuicktag)})
3
  *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 05/22/2014
7
+ * @since 2.3.0
8
  */
9
 
10
+ jQuery(document).ready(function(t){if("undefined"!=typeof addquicktag_tags&&"undefined"!=typeof addquicktag_post_type&&"undefined"!=typeof addquicktag_pt_for_js&&-1!=t.inArray(addquicktag_post_type,addquicktag_pt_for_js)){var e=0,a=0,i=0;for(i=0;i<addquicktag_tags.buttons.length;i++)1===parseInt(addquicktag_tags.buttons[i].visual)&&(e=addquicktag_tags.buttons[i].visual),1===parseInt(addquicktag_tags.buttons[i][addquicktag_post_type])&&(a=addquicktag_tags.buttons[i][addquicktag_post_type]);1===parseInt(e)&&1===parseInt(a)&&tinymce.PluginManager.add("rmnlQuicktagSettings_tmce",function(t){t.addButton("rmnlQuicktagSettings_tmce",function(){var t=addquicktag_tags.buttons,e=[],a=0;for(a=0;a<t.length;a++)1===parseInt(t[a][addquicktag_post_type])&&1==t[a].visual&&e.push({text:t[a].text,value:String(a)});return{type:"listbox",text:"Quicktags",label:"Select :",fixedWidth:!0,onselect:function(e){var e=e.control._value,a=!1;if("undefined"!=typeof tinymce.activeEditor.selection.getContent()&&(a=!0),1==a){var i=tinymce.activeEditor.selection.getContent(),n=tinymce.activeEditor.selection.getStart().nodeName,d=(tinymce.activeEditor.selection.getNode(),t[e].start),o=(d.match(/[a-z]+/),t[e].end);"undefined"==typeof o&&(o=""),d.match(/[a-z]+/i)!=n.toLowerCase()&&tinymce.activeEditor.selection.setContent(t[e].start+i+t[e].end),d.match(/[a-z]+/i)==n.toLowerCase()&&(tinyMCE.activeEditor.dom.remove(tinymce.activeEditor.selection.getNode(n.toLowerCase())),tinymce.activeEditor.selection.setContent(i))}},values:e}})})}});
inc/tinymce/langs/de.js CHANGED
@@ -1,5 +1,5 @@
1
  tinyMCE.addI18n('de.aqtwe',{
2
  aqtwe_select_header : 'weitere Formate',
3
- aqtwe_select_error : 'keine Qicktags erkannt'
4
  });
5
 
1
  tinyMCE.addI18n('de.aqtwe',{
2
  aqtwe_select_header : 'weitere Formate',
3
+ aqtwe_select_error : 'keine Quicktags erkannt'
4
  });
5
 
inc/tinymce/langs/en.js CHANGED
@@ -1,5 +1,5 @@
1
  tinyMCE.addI18n('en.aqtwe',{
2
  aqtwe_select_header : 'further styles',
3
- aqtwe_select_error : 'no Qicktags found'
4
  });
5
 
1
  tinyMCE.addI18n('en.aqtwe',{
2
  aqtwe_select_header : 'further styles',
3
+ aqtwe_select_error : 'no Quicktags found'
4
  });
5
 
js/add-quicktags.dev.js CHANGED
@@ -1,39 +1,62 @@
1
  /**
2
  * AddQuicktag Script to add buttons to html-editor
3
- *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
- * @version 07/11/2012
7
  * @since 2.0.0
8
  */
9
 
10
- jQuery( document ).ready( function( $ ) {
11
-
12
- if ( typeof addquicktag_tags == 'undefined' )
13
  return;
14
-
15
- if ( typeof addquicktag_post_type == 'undefined' )
16
  return;
17
-
18
- if ( typeof addquicktag_pt_for_js == 'undefined' )
19
  return;
20
-
21
  var tags = addquicktag_tags['buttons'];
22
- if ( typeof tags == 'undefined' )
23
  return;
24
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  // check post type
26
- if ( $.inArray( "addquicktag_post_type", addquicktag_pt_for_js ) ) {
27
-
28
- for ( var i = 0; i < tags.length; i++ ) {
29
  // check for active on this post type
30
- if ( 1 === parseInt( tags[i][addquicktag_post_type] ) ) {
31
-
32
- if ( typeof tags[i].title == 'undefined' ) tags[i].title = ' ';
33
- if ( typeof tags[i].end == 'undefined' ) tags[i].end = '';
34
- if ( typeof tags[i].access == 'undefined' ) tags[i].access = '';
35
-
36
- /**
37
  * @param id string required Button HTML ID
38
  * @param display string required Button's value="..."
39
  * @param arg1 string || function required Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
@@ -51,20 +74,57 @@ jQuery( document ).ready( function( $ ) {
51
  tags[i].access,
52
  tags[i].title
53
  );
54
- /* old function
55
- edButtons[edButtons.length] = new edButton(
56
- // id, display, tagStart, tagEnd, access_key, title
57
- tags[i].text.toLowerCase(),
58
- tags[i].text,
59
- tags[i].start,
60
- tags[i].end,
61
- tags[i].access,
62
- tags[i].title
63
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
  }
67
-
68
  } // end check post type
69
-
70
  });
1
  /**
2
  * AddQuicktag Script to add buttons to html-editor
3
+ *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 05/22/2014
7
  * @since 2.0.0
8
  */
9
 
10
+ jQuery(document).ready(function ($) {
11
+
12
+ if (typeof addquicktag_tags == 'undefined')
13
  return;
14
+
15
+ if (typeof addquicktag_post_type == 'undefined')
16
  return;
17
+
18
+ if (typeof addquicktag_pt_for_js == 'undefined')
19
  return;
20
+
21
  var tags = addquicktag_tags['buttons'];
22
+ if (typeof tags == 'undefined')
23
  return;
24
+
25
+ // window for input
26
+ function qt_callback_input_window(e, c, ed) {
27
+
28
+ var prmt = prompt('Enter Tag Name');
29
+
30
+ if (prmt === null)
31
+ return;
32
+
33
+ this.tagStart = '[tag]' + prmt + '[/tag]';
34
+
35
+ QTags.TagButton.prototype.callback.call(this, e, c, ed);
36
+ }
37
+
38
+ function get_selected_text(canvas) { // "canvas" is what they call the textarea of the editor
39
+ canvas.focus();
40
+
41
+ if (document.selection) { // IE
42
+ return document.selection.createRange().text;
43
+ } else { // standards
44
+ return canvas.value.substring(canvas.selectionStart, canvas.selectionEnd);
45
+ }
46
+ }
47
+
48
  // check post type
49
+ if ($.inArray("addquicktag_post_type", addquicktag_pt_for_js)) {
50
+
51
+ for (var i = 0; i < tags.length; i++) {
52
  // check for active on this post type
53
+ if (1 === parseInt(tags[i][addquicktag_post_type])) {
54
+
55
+ if (typeof tags[i].title == 'undefined') tags[i].title = ' ';
56
+ if (typeof tags[i].end == 'undefined') tags[i].end = '';
57
+ if (typeof tags[i].access == 'undefined') tags[i].access = '';
58
+
59
+ /**
60
  * @param id string required Button HTML ID
61
  * @param display string required Button's value="..."
62
  * @param arg1 string || function required Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
74
  tags[i].access,
75
  tags[i].title
76
  );
77
+
78
+ // @TODO Solution for special code tags in quicktags
79
+ /**
80
+ * ideas for code buttons and optional window with input possibility
81
+ *
82
+ *
83
+ // @see http://bililite.com/blog/2012/08/20/custom-buttons-in-the-wordpress-html-editor/
84
+ QTags.addButton('toHTML', 'HTML Entities', function(el, canvas){
85
+ QTags.insertContent(get_selected_text(canvas).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'));
86
+ }, 'Encode HTML Entities');
87
+ QTags.addButton('fromHTML', 'Decode HTML', function(el, canvas){
88
+ QTags.insertContent(get_selected_text(canvas).replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
89
+ }, 'Decode HTML Entities');
90
+
91
+ var code_languages = ['html', 'javascript', 'css', 'bash', 'php', 'vb'];
92
+ // Insert before the code button
93
+ edButtons[109] = {
94
+ html: function( id_prefix ) {
95
+ return '<select id="' + id_prefix + 'code_language" class="language-select">' +
96
+ '<option>blank</option>' + // include a blank option
97
+ '<option>' + code_languages.join( '</option><option>' ) + '</option>' +
98
+ '</select>';
99
+ }
100
+ };
101
+ $('body').on('change', 'select.language-select', function() {
102
+ var lang = $(this).val();
103
+ // 110 is the code qt-tag from core, wp-includes/js/quicktags.js
104
+ edButtons[110].tagStart = lang ? '<code class="language-' + lang + '">' : '<code>';
105
+
106
+ });
107
+
108
+
109
+ // Add pre button for preformatted text
110
+ QTags.addButton( 'qt_pre', 'pre', '<pre>', '</pre>', '', 'Preformatted text', '108' );
111
  */
112
+
113
+ /**
114
+ * @TODO New idea for multible edit windows
115
+ // for edit window
116
+ QTags.addButton(
117
+ tags[i].text.toLowerCase(),
118
+ tags[i].text,
119
+ qt_callback_input_window,
120
+ tags[i].end,
121
+ tags[i].access,
122
+ tags[i].title
123
+ );
124
+ */
125
  }
126
  }
127
+
128
  } // end check post type
129
+
130
  });
js/add-quicktags.js CHANGED
@@ -3,8 +3,8 @@
3
  *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
- * @version 07/11/2012
7
  * @since 2.0.0
8
  */
9
 
10
- jQuery(document).ready(function(a){if(typeof addquicktag_tags=="undefined")return;if(typeof addquicktag_post_type=="undefined")return;if(typeof addquicktag_pt_for_js=="undefined")return;var b=addquicktag_tags["buttons"];if(typeof b=="undefined")return;if(a.inArray("addquicktag_post_type",addquicktag_pt_for_js)){for(var c=0;c<b.length;c++){if(1===parseInt(b[c][addquicktag_post_type])){if(typeof b[c].title=="undefined")b[c].title=" ";if(typeof b[c].end=="undefined")b[c].end="";if(typeof b[c].access=="undefined")b[c].access="";QTags.addButton(b[c].text.toLowerCase(),b[c].text,b[c].start,b[c].end,b[c].access,b[c].title)}}}})
3
  *
4
  * @package AddQuicktag Plugin
5
  * @author Frank Bueltge <frank@bueltge.de>
6
+ * @version 05/22/2014
7
  * @since 2.0.0
8
  */
9
 
10
+ jQuery(document).ready(function(t){if("undefined"!=typeof addquicktag_tags&&"undefined"!=typeof addquicktag_post_type&&"undefined"!=typeof addquicktag_pt_for_js){var e=addquicktag_tags.buttons;if("undefined"!=typeof e&&t.inArray("addquicktag_post_type",addquicktag_pt_for_js))for(var d=0;d<e.length;d++)1===parseInt(e[d][addquicktag_post_type])&&("undefined"==typeof e[d].title&&(e[d].title=" "),"undefined"==typeof e[d].end&&(e[d].end=""),"undefined"==typeof e[d].access&&(e[d].access=""),QTags.addButton(e[d].text.toLowerCase(),e[d].text,e[d].start,e[d].end,e[d].access,e[d].title))}});
js/add-quicktags_32.dev.js CHANGED
@@ -14,7 +14,7 @@ jQuery( document ).ready( function( $ ) {
14
 
15
  if ( typeof tags !== 'undefined' && wpaqToolbar ) {
16
 
17
- var wpaqBut;
18
 
19
  for ( var i = 0; i < tags.length; i++ ) {
20
  if ( typeof tags[i].title == 'undefined' ) tags[i].title = ' ';
@@ -35,7 +35,7 @@ jQuery( document ).ready( function( $ ) {
35
  wpaqBut._idx = wpaqNr; //store our current index at element itself
36
  wpaqBut.value = tags[i].text;
37
  wpaqBut.title = tags[i].title;
38
- wpaqBut.onclick = function() { edInsertTag( edCanvas, this._idx ); return false; }
39
  wpaqToolbar.appendChild( wpaqBut );
40
  }
41
 
14
 
15
  if ( typeof tags !== 'undefined' && wpaqToolbar ) {
16
 
17
+ var wpaqBut, wpaqNr;
18
 
19
  for ( var i = 0; i < tags.length; i++ ) {
20
  if ( typeof tags[i].title == 'undefined' ) tags[i].title = ' ';
35
  wpaqBut._idx = wpaqNr; //store our current index at element itself
36
  wpaqBut.value = tags[i].text;
37
  wpaqBut.title = tags[i].title;
38
+ wpaqBut.onclick = function() { edInsertTag( edCanvas, this._idx ); return false; };
39
  wpaqToolbar.appendChild( wpaqBut );
40
  }
41
 
js/add-quicktags_32.js CHANGED
@@ -4,4 +4,5 @@
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
- jQuery(document).ready(function(a){if(typeof addquicktag_tags=="undefined")return;var b=addquicktag_tags["buttons"];var c=document.getElementById("ed_toolbar");if(typeof b!=="undefined"&&c){var d;for(var e=0;e<b.length;e++){if(typeof b[e].title=="undefined")b[e].title=" ";if(typeof b[e].end=="undefined")b[e].end="";if(typeof b[e].access=="undefined")b[e].access="";wpaqNr=edButtons.length;edButtons[wpaqNr]=new edButton(b[e].text.toLowerCase(),b[e].text,b[e].start,b[e].end,b[e].access,b[e].title);d=c.lastChild;while(d.nodeType!=1){d=d.previousSibling}d=d.cloneNode(true);d.id="ed_"+wpaqNr;d._idx=wpaqNr;d.value=b[e].text;d.title=b[e].title;d.onclick=function(){edInsertTag(edCanvas,this._idx);return false};c.appendChild(d)}}})
 
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
+ jQuery(document).ready(function($){if(typeof addquicktag_tags=="undefined")return;var tags=addquicktag_tags["buttons"];var wpaqToolbar=document.getElementById("ed_toolbar");if(typeof tags!=="undefined"&&wpaqToolbar){var wpaqBut;for(var i=0;i<tags.length;i++){if(typeof tags[i].title=="undefined")tags[i].title=" ";if(typeof tags[i].end=="undefined")tags[i].end="";if(typeof tags[i].access=="undefined")tags[i].access="";wpaqNr=edButtons.length;edButtons[wpaqNr]=new edButton(tags[i].text.toLowerCase(),
8
+ tags[i].text,tags[i].start,tags[i].end,tags[i].access,tags[i].title);wpaqBut=wpaqToolbar.lastChild;while(wpaqBut.nodeType!=1)wpaqBut=wpaqBut.previousSibling;wpaqBut=wpaqBut.cloneNode(true);wpaqBut.id="ed_"+wpaqNr;wpaqBut._idx=wpaqNr;wpaqBut.value=tags[i].text;wpaqBut.title=tags[i].title;wpaqBut.onclick=function(){edInsertTag(edCanvas,this._idx);return false;};wpaqToolbar.appendChild(wpaqBut);}}});
js/settings.dev.js CHANGED
@@ -1,26 +1,38 @@
1
  /**
2
  * AddQuicktag Script settings page of the plugin
3
- * @since 08/02/2012
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
  jQuery( document ).ready( function( $ ) {
8
 
9
  $( 'input:checkbox.toggle' ).click( function( event ) {
10
- var i = $(this).attr('value');
11
- console.log(i);
12
 
13
  if ( this.checked ) {
14
  // Iterate each checkbox
15
- $('#rmqtb' + i +' input:checkbox').each(function() {
16
  this.checked = true;
17
  });
18
  } else {
19
  // Iterate each checkbox
20
- $('#rmqtb' + i +' input:checkbox').each(function() {
21
  this.checked = false;
22
- });
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
- });
25
 
26
- });
1
  /**
2
  * AddQuicktag Script settings page of the plugin
3
+ * @since 05/22/2014
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
  jQuery( document ).ready( function( $ ) {
8
 
9
  $( 'input:checkbox.toggle' ).click( function( event ) {
10
+ var i = $( this ).attr( 'value' ),
11
+ sel = '#rmqtb' + i +' input:checkbox';
12
 
13
  if ( this.checked ) {
14
  // Iterate each checkbox
15
+ $( sel ).each( function() {
16
  this.checked = true;
17
  });
18
  } else {
19
  // Iterate each checkbox
20
+ $( sel ).each( function() {
21
  this.checked = false;
22
+ } );
23
+ }
24
+ } );
25
+
26
+ $( 'table.rmnlQuicktagSettings' ).delegate( 'td','mouseover mouseout', function(e) {
27
+ var hover = 'hover';
28
+
29
+ if ( e.type == 'mouseover' ) {
30
+ $( this ).parent().addClass( hover );
31
+ $( 'colgroup' ).eq( $( this ).index() ).addClass( hover );
32
+ } else {
33
+ $( this ).parent().removeClass( hover );
34
+ $( 'colgroup' ).eq( $( this ).index() ).removeClass( hover );
35
  }
36
+ } );
37
 
38
+ } );
js/settings.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * AddQuicktag Script settings page of the plugin
3
- * @since 08/02/2012
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
- jQuery(document).ready(function(a){a("input:checkbox.toggle").click(function(b){var c=a(this).attr("value");if(this.checked){a("#rmqtb"+c+" input:checkbox").each(function(){this.checked=true})}else{a("#rmqtb"+c+" input:checkbox").each(function(){this.checked=false})}})})
1
  /**
2
  * AddQuicktag Script settings page of the plugin
3
+ * @since 05/22/2014
4
  * @package AddQuicktag Plugin
5
  */
6
 
7
+ jQuery(document).ready(function(e){e("input:checkbox.toggle").click(function(){var t=e(this).attr("value"),c="#rmqtb"+t+" input:checkbox";e(c).each(this.checked?function(){this.checked=!0}:function(){this.checked=!1})}),e("table.rmnlQuicktagSettings").delegate("td","mouseover mouseout",function(t){var c="hover";"mouseover"==t.type?(e(this).parent().addClass(c),e("colgroup").eq(e(this).index()).addClass(c)):(e(this).parent().removeClass(c),e("colgroup").eq(e(this).index()).removeClass(c))})});
languages/addquicktag-de_DE.mo CHANGED
Binary file
languages/addquicktag-de_DE.po CHANGED
@@ -3,229 +3,252 @@ msgstr ""
3
  "Project-Id-Version: AddQuicktag v2.2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-07-16 14:38:53+0000\n"
7
- "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: \n"
14
- "X-Poedit-Country: \n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: \n"
18
- "X-Poedit-Bookmarks: \n"
 
 
19
  "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
 
 
22
  #. translators: plugin header field 'Name'
23
  #: addquicktag.php:0
24
- #@ addquicktag
25
  msgid "AddQuicktag"
26
  msgstr "AddQuicktag"
27
 
 
28
  #. translators: plugin header field 'PluginURI'
29
  #: addquicktag.php:0
30
- #@ addquicktag
31
  msgid "http://bueltge.de/wp-addquicktags-de-plugin/120/"
32
  msgstr ""
33
 
 
34
  #. translators: plugin header field 'Author'
35
  #: addquicktag.php:0
36
- #@ addquicktag
37
  msgid "Frank Bültge"
38
  msgstr ""
39
 
 
40
  #. translators: plugin header field 'AuthorURI'
41
  #: addquicktag.php:0
42
- #@ addquicktag
43
  msgid "http://bueltge.de"
44
  msgstr ""
45
 
46
- #: inc/class-settings.php:128
47
- #: inc/class-settings.php:145
48
- #: inc/class-settings.php:163
49
- #: inc/class-settings.php:171
50
- #@ default
51
- #@ addquicktag
52
  msgid "Settings"
53
  msgstr "Einstellungen"
54
 
 
55
  #: inc/class-settings.php:196
56
- #@ addquicktag
57
  msgid "Add or delete Quicktag buttons"
58
  msgstr "Ergänze oder lösche Quicktag Buttons"
59
 
 
60
  #: inc/class-settings.php:237
61
- #@ addquicktag
62
  msgid "Button Label*"
63
  msgstr "Button Name*"
64
 
 
65
  #: inc/class-settings.php:238
66
- #@ addquicktag
67
  msgid "Title Attribute"
68
  msgstr "Title Attribut"
69
 
 
70
  #: inc/class-settings.php:239
71
- #@ addquicktag
72
  msgid "Start Tag(s)*"
73
  msgstr "Start Tag(s)*"
74
 
 
75
  #: inc/class-settings.php:240
76
- #@ addquicktag
77
  msgid "End Tag(s)"
78
  msgstr "Ende Tag(s)"
79
 
 
80
  #: inc/class-settings.php:241
81
- #@ addquicktag
82
  msgid "Access Key"
83
  msgstr "Zugriffstaste"
84
 
 
85
  #: inc/class-settings.php:341
86
- #@ addquicktag
87
- msgid "Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields."
88
- msgstr "Ergänze neue Buttons, in dem die unteren Felder ausgefüllt werden. Felder mit * sind Pflichtfelder, müssen ausgefüllt werden. Um einen Button zu löschen, einfach die Felder des Buttons leeren und speichern."
 
 
 
 
89
 
 
90
  #: inc/class-settings.php:343
91
- #@ default
92
  msgid "Save Changes"
93
- msgstr ""
94
 
 
95
  #: inc/class-settings.php:378
96
- #@ addquicktag
97
  msgid "Like this plugin?"
98
  msgstr "Du magst das Plugin?"
99
 
 
100
  #: inc/class-settings.php:380
101
- #@ addquicktag
102
  msgid "Here's how you can give back:"
103
  msgstr "Über folgende Möglichkeiten kannst du etwas zurück geben:"
104
 
 
105
  #: inc/class-settings.php:382
106
- #@ addquicktag
107
  msgid "The Plugin on the WordPress plugin repository"
108
  msgstr "Das Plugin im offiziellen WordPress Repository"
109
 
 
110
  #: inc/class-settings.php:382
111
- #@ addquicktag
112
  msgid "Give the plugin a good rating."
113
  msgstr "Gib dem Plugin eine gute Wertung"
114
 
 
115
  #: inc/class-settings.php:383
116
- #@ addquicktag
117
  msgid "Donate via PayPal"
118
  msgstr "Spende via Paypal"
119
 
 
120
  #: inc/class-settings.php:383
121
- #@ addquicktag
122
  msgid "Donate a few euros."
123
  msgstr "Spende einige Euros"
124
 
 
125
  #: inc/class-settings.php:384
126
- #@ addquicktag
127
  msgid "Frank Bültge's Amazon Wish List"
128
  msgstr "Frank Bültge's Amazon Wunschliste"
129
 
 
130
  #: inc/class-settings.php:384
131
- #@ addquicktag
132
  msgid "Get me something from my wish list."
133
  msgstr "Suche dir was aus und lass mir ein Objekt meiner Wunschliste zukommen."
134
 
 
135
  #: inc/class-settings.php:404
136
- #@ addquicktag
137
  msgid "About this plugin"
138
  msgstr "Über das Plugin"
139
 
 
140
  #: inc/class-settings.php:407
141
- #@ addquicktag
142
  msgid "Version:"
143
  msgstr "Version:"
144
 
 
145
  #: inc/class-settings.php:411
146
- #@ addquicktag
147
  msgid "Description:"
148
  msgstr "Beschreibung:"
149
 
 
150
  #: inc/class-settings.php:242
151
- #@ addquicktag
152
  msgid "Order"
153
  msgstr "Reihenfolge"
154
 
 
155
  #: inc/class-settings.php:243
156
- #@ addquicktag
157
  msgid "Visual"
158
  msgstr "Visuell"
159
 
 
160
  #. translators: plugin header field 'Description'
161
  #: addquicktag.php:0
162
- #@ addquicktag
163
- msgid "Allows you to easily add custom Quicktags to the html- and visual-editor."
164
- msgstr "Erlaubt das einfache Hinzufügen von Quicktags zum html- und visuellen Editor."
 
165
 
 
166
  #: inc/class-imexport.php:70
167
- #@ addquicktag
168
  msgid "Export"
169
  msgstr "Exportieren"
170
 
 
171
  #: inc/class-imexport.php:72
172
- #@ addquicktag
173
- msgid "When you click the button below the plugin will create an XML file for you to save to your computer."
174
- msgstr "Wenn du unten auf Export-Datei herunterladen klickst, wird das Plugin eine XML-Datei für dich erstellen, die du auf deinem Computer speichern kannst."
 
 
 
175
 
 
176
  #: inc/class-imexport.php:73
177
- #@ addquicktag
178
  msgid "This format, a custom XML, will contain your options from quicktags."
179
- msgstr "Dieses Format, ein benutzerdefniertes XML, beinhaltet Einstellungen der Quicktags."
 
 
180
 
 
181
  #: inc/class-imexport.php:74
182
- #@ addquicktag
183
- msgid "Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site."
184
- msgstr "Nachdem die heruntergeladene Datei gespeichert wurde, kannst du die Import-Funktion in einer anderen WordPress Installation nutzen."
 
 
 
185
 
 
186
  #: inc/class-imexport.php:78
187
- #@ addquicktag
188
  msgid "Download Export File"
189
  msgstr "Export-Datei herunterladen"
190
 
 
191
  #: inc/class-imexport.php:86
192
- #@ addquicktag
193
  msgid "Import"
194
  msgstr "Importieren"
195
 
 
196
  #: inc/class-imexport.php:88
197
- #@ addquicktag
198
- msgid "If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import."
199
- msgstr "Wenn du Quicktags von einer anderen WordPress Installation hast, dann kann das Plugin diese Einstellungen importieren. Zum Starten des Imports wähle eine Datei und klicke auf Datei aktualisieren und importieren."
 
 
 
 
200
 
 
201
  #: inc/class-imexport.php:93
202
- #@ addquicktag
203
  msgid "Upload file and import"
204
  msgstr "Datei aktualisieren und importieren"
205
 
 
206
  #: inc/class-imexport.php:184
207
- #@ addquicktag
208
  msgid "Options not update - you don&lsquo;t have the privilidges to do this!"
209
- msgstr "Einstellungen wurden nicht aktualisiert - du hast keine ausreichenden Rechte um dies zu tun!"
 
 
210
 
 
211
  #: inc/class-settings.php:456
212
- #@ addquicktag
213
  msgid "Options saved."
214
  msgstr "Einstellungen gespeichert."
215
 
 
216
  #. translators: plugin header field 'Version'
217
  #: addquicktag.php:0
218
- #@ addquicktag
219
  msgid "2.2.0"
220
  msgstr ""
221
 
 
222
  #: inc/class-settings.php:385
223
- #@ addquicktag
224
- msgid "Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues."
225
- msgstr "Bitte gib Feedback, Erweiterungen und Hinweis im Github Repo, nutze Issues."
 
 
226
 
 
227
  #: inc/class-settings.php:385
228
- #@ addquicktag
229
  msgid "Github Repo for Contribute, Issues & Bugs"
230
  msgstr "Github Repo für Erweiterungen, Hinweise & Fehler"
231
-
3
  "Project-Id-Version: AddQuicktag v2.2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-01-15 13:17+0100\n"
7
+ "Last-Translator: Frank Bueltge <frank@bueltge.de>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
 
13
  "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
15
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
16
+ "X-Textdomain-Support: yes\n"
17
+ "Language: de_DE\n"
18
+ "X-Generator: Poedit 1.6.3\n"
19
  "X-Poedit-SearchPath-0: .\n"
 
20
 
21
+ # @ addquicktag
22
  #. translators: plugin header field 'Name'
23
  #: addquicktag.php:0
 
24
  msgid "AddQuicktag"
25
  msgstr "AddQuicktag"
26
 
27
+ # @ addquicktag
28
  #. translators: plugin header field 'PluginURI'
29
  #: addquicktag.php:0
 
30
  msgid "http://bueltge.de/wp-addquicktags-de-plugin/120/"
31
  msgstr ""
32
 
33
+ # @ addquicktag
34
  #. translators: plugin header field 'Author'
35
  #: addquicktag.php:0
 
36
  msgid "Frank Bültge"
37
  msgstr ""
38
 
39
+ # @ addquicktag
40
  #. translators: plugin header field 'AuthorURI'
41
  #: addquicktag.php:0
 
42
  msgid "http://bueltge.de"
43
  msgstr ""
44
 
45
+ # @ default
46
+ # @ addquicktag
47
+ #: inc/class-settings.php:128 inc/class-settings.php:145
48
+ #: inc/class-settings.php:163 inc/class-settings.php:171
 
 
49
  msgid "Settings"
50
  msgstr "Einstellungen"
51
 
52
+ # @ addquicktag
53
  #: inc/class-settings.php:196
 
54
  msgid "Add or delete Quicktag buttons"
55
  msgstr "Ergänze oder lösche Quicktag Buttons"
56
 
57
+ # @ addquicktag
58
  #: inc/class-settings.php:237
 
59
  msgid "Button Label*"
60
  msgstr "Button Name*"
61
 
62
+ # @ addquicktag
63
  #: inc/class-settings.php:238
 
64
  msgid "Title Attribute"
65
  msgstr "Title Attribut"
66
 
67
+ # @ addquicktag
68
  #: inc/class-settings.php:239
 
69
  msgid "Start Tag(s)*"
70
  msgstr "Start Tag(s)*"
71
 
72
+ # @ addquicktag
73
  #: inc/class-settings.php:240
 
74
  msgid "End Tag(s)"
75
  msgstr "Ende Tag(s)"
76
 
77
+ # @ addquicktag
78
  #: inc/class-settings.php:241
 
79
  msgid "Access Key"
80
  msgstr "Zugriffstaste"
81
 
82
+ # @ addquicktag
83
  #: inc/class-settings.php:341
84
+ msgid ""
85
+ "Fill in the fields above to add or edit the quicktags. Fields with * are "
86
+ "required. To delete a tag simply empty all fields."
87
+ msgstr ""
88
+ "Ergänze neue Buttons, in dem die oberen Felder ausgefüllt werden. Felder mit "
89
+ "* sind Pflichtfelder, müssen ausgefüllt werden. Um einen Button zu löschen, "
90
+ "einfach die Felder des Buttons leeren und speichern."
91
 
92
+ # @ default
93
  #: inc/class-settings.php:343
 
94
  msgid "Save Changes"
95
+ msgstr "Änderungen speichern"
96
 
97
+ # @ addquicktag
98
  #: inc/class-settings.php:378
 
99
  msgid "Like this plugin?"
100
  msgstr "Du magst das Plugin?"
101
 
102
+ # @ addquicktag
103
  #: inc/class-settings.php:380
 
104
  msgid "Here's how you can give back:"
105
  msgstr "Über folgende Möglichkeiten kannst du etwas zurück geben:"
106
 
107
+ # @ addquicktag
108
  #: inc/class-settings.php:382
 
109
  msgid "The Plugin on the WordPress plugin repository"
110
  msgstr "Das Plugin im offiziellen WordPress Repository"
111
 
112
+ # @ addquicktag
113
  #: inc/class-settings.php:382
 
114
  msgid "Give the plugin a good rating."
115
  msgstr "Gib dem Plugin eine gute Wertung"
116
 
117
+ # @ addquicktag
118
  #: inc/class-settings.php:383
 
119
  msgid "Donate via PayPal"
120
  msgstr "Spende via Paypal"
121
 
122
+ # @ addquicktag
123
  #: inc/class-settings.php:383
 
124
  msgid "Donate a few euros."
125
  msgstr "Spende einige Euros"
126
 
127
+ # @ addquicktag
128
  #: inc/class-settings.php:384
 
129
  msgid "Frank Bültge's Amazon Wish List"
130
  msgstr "Frank Bültge's Amazon Wunschliste"
131
 
132
+ # @ addquicktag
133
  #: inc/class-settings.php:384
 
134
  msgid "Get me something from my wish list."
135
  msgstr "Suche dir was aus und lass mir ein Objekt meiner Wunschliste zukommen."
136
 
137
+ # @ addquicktag
138
  #: inc/class-settings.php:404
 
139
  msgid "About this plugin"
140
  msgstr "Über das Plugin"
141
 
142
+ # @ addquicktag
143
  #: inc/class-settings.php:407
 
144
  msgid "Version:"
145
  msgstr "Version:"
146
 
147
+ # @ addquicktag
148
  #: inc/class-settings.php:411
 
149
  msgid "Description:"
150
  msgstr "Beschreibung:"
151
 
152
+ # @ addquicktag
153
  #: inc/class-settings.php:242
 
154
  msgid "Order"
155
  msgstr "Reihenfolge"
156
 
157
+ # @ addquicktag
158
  #: inc/class-settings.php:243
 
159
  msgid "Visual"
160
  msgstr "Visuell"
161
 
162
+ # @ addquicktag
163
  #. translators: plugin header field 'Description'
164
  #: addquicktag.php:0
165
+ msgid ""
166
+ "Allows you to easily add custom Quicktags to the html- and visual-editor."
167
+ msgstr ""
168
+ "Erlaubt das einfache Hinzufügen von Quicktags zum html- und visuellen Editor."
169
 
170
+ # @ addquicktag
171
  #: inc/class-imexport.php:70
 
172
  msgid "Export"
173
  msgstr "Exportieren"
174
 
175
+ # @ addquicktag
176
  #: inc/class-imexport.php:72
177
+ msgid ""
178
+ "When you click the button below the plugin will create an XML file for you "
179
+ "to save to your computer."
180
+ msgstr ""
181
+ "Wenn du unten auf Export-Datei herunterladen klickst, wird das Plugin eine "
182
+ "XML-Datei für dich erstellen, die du auf deinem Computer speichern kannst."
183
 
184
+ # @ addquicktag
185
  #: inc/class-imexport.php:73
 
186
  msgid "This format, a custom XML, will contain your options from quicktags."
187
+ msgstr ""
188
+ "Dieses Format, ein benutzerdefniertes XML, beinhaltet Einstellungen der "
189
+ "Quicktags."
190
 
191
+ # @ addquicktag
192
  #: inc/class-imexport.php:74
193
+ msgid ""
194
+ "Once you’ve saved the download file, you can use the Import function in "
195
+ "another WordPress installation to import this site."
196
+ msgstr ""
197
+ "Nachdem die heruntergeladene Datei gespeichert wurde, kannst du die Import-"
198
+ "Funktion in einer anderen WordPress Installation nutzen."
199
 
200
+ # @ addquicktag
201
  #: inc/class-imexport.php:78
 
202
  msgid "Download Export File"
203
  msgstr "Export-Datei herunterladen"
204
 
205
+ # @ addquicktag
206
  #: inc/class-imexport.php:86
 
207
  msgid "Import"
208
  msgstr "Importieren"
209
 
210
+ # @ addquicktag
211
  #: inc/class-imexport.php:88
212
+ msgid ""
213
+ "If you have quicktags from other installs, the plugin can import those into "
214
+ "this site. To get started, choose a file to import."
215
+ msgstr ""
216
+ "Wenn du Quicktags von einer anderen WordPress Installation hast, dann kann "
217
+ "das Plugin diese Einstellungen importieren. Zum Starten des Imports wähle "
218
+ "eine Datei und klicke auf Datei aktualisieren und importieren."
219
 
220
+ # @ addquicktag
221
  #: inc/class-imexport.php:93
 
222
  msgid "Upload file and import"
223
  msgstr "Datei aktualisieren und importieren"
224
 
225
+ # @ addquicktag
226
  #: inc/class-imexport.php:184
 
227
  msgid "Options not update - you don&lsquo;t have the privilidges to do this!"
228
+ msgstr ""
229
+ "Einstellungen wurden nicht aktualisiert - du hast keine ausreichenden Rechte "
230
+ "um dies zu tun!"
231
 
232
+ # @ addquicktag
233
  #: inc/class-settings.php:456
 
234
  msgid "Options saved."
235
  msgstr "Einstellungen gespeichert."
236
 
237
+ # @ addquicktag
238
  #. translators: plugin header field 'Version'
239
  #: addquicktag.php:0
 
240
  msgid "2.2.0"
241
  msgstr ""
242
 
243
+ # @ addquicktag
244
  #: inc/class-settings.php:385
245
+ msgid ""
246
+ "Please give me feedback, contribute and file technical bugs on this GitHub "
247
+ "Repo, use Issues."
248
+ msgstr ""
249
+ "Bitte gib Feedback, Erweiterungen und Hinweis im Github Repo, nutze Issues."
250
 
251
+ # @ addquicktag
252
  #: inc/class-settings.php:385
 
253
  msgid "Github Repo for Contribute, Issues & Bugs"
254
  msgstr "Github Repo für Erweiterungen, Hinweise & Fehler"
 
languages/addquicktag-pt_BR.mo ADDED
Binary file
languages/addquicktag-pt_BR.po ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: AddQuicktag v1.5.7\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-07-19 09:41+0100\n"
6
+ "PO-Revision-Date: 2013-08-05 14:06-0300\n"
7
+ "Last-Translator: Aluízio Leye Larangeira <contato@aluizioll.com.br>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
15
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
16
+ "X-Poedit-Basepath: ../\n"
17
+ "X-Textdomain-Support: yes\n"
18
+ "Language: pt_BR\n"
19
+ "X-Generator: Poedit 1.5.7\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ # @ addquicktag
23
+ #: inc/class-imexport.php:70
24
+ msgid "Export"
25
+ msgstr "Exportar"
26
+
27
+ # @ addquicktag
28
+ #: inc/class-imexport.php:72
29
+ msgid ""
30
+ "When you click the button below the plugin will create an XML file for you "
31
+ "to save to your computer."
32
+ msgstr ""
33
+ "Quando você clica no botão abaixo, o plugin irá criar um arquivo XML para "
34
+ "você salvar em seu computador."
35
+
36
+ # @ addquicktag
37
+ #: inc/class-imexport.php:73
38
+ msgid "This format, a custom XML, will contain your options from quicktags."
39
+ msgstr ""
40
+ "Este formato, um XML personalizado, irá conter suas opções de QuickTags."
41
+
42
+ # @ addquicktag
43
+ #: inc/class-imexport.php:74
44
+ msgid ""
45
+ "Once you’ve saved the download file, you can use the Import function in "
46
+ "another WordPress installation to import this site."
47
+ msgstr ""
48
+ "Assim que tiver salvado o arquivo de download, você pode utilizar a função "
49
+ "de Importação em outra instalação do WordPress para importar este site."
50
+
51
+ # @ addquicktag
52
+ #: inc/class-imexport.php:78
53
+ msgid "Download Export File"
54
+ msgstr "Baixar Arquivo de Exportação"
55
+
56
+ # @ addquicktag
57
+ #: inc/class-imexport.php:86
58
+ msgid "Import"
59
+ msgstr "Importar"
60
+
61
+ # @ addquicktag
62
+ #: inc/class-imexport.php:88
63
+ msgid ""
64
+ "If you have quicktags from other installs, the plugin can import those into "
65
+ "this site. To get started, choose a file to import."
66
+ msgstr ""
67
+ "Se você tiver QuickTags de outras instalações, o plugin pode importá-las "
68
+ "neste site. Para começar, escolha o arquivo a ser importado."
69
+
70
+ # @ addquicktag
71
+ #: inc/class-imexport.php:93
72
+ msgid "Upload file and import"
73
+ msgstr "Enviar arquivo e importar"
74
+
75
+ # @ secure_wp
76
+ #: inc/class-imexport.php:184
77
+ msgid "Options not update - you don&lsquo;t have the privilidges to do this!"
78
+ msgstr ""
79
+ "Configurações não atualizadas - você não possui privilégios para fazer isso!"
80
+
81
+ #: inc/class-settings.php:128 inc/class-settings.php:145
82
+ #: inc/class-settings.php:163 inc/class-settings.php:171
83
+ msgid "Settings"
84
+ msgstr "Configurações"
85
+
86
+ # @ addquicktag
87
+ #: inc/class-settings.php:196
88
+ msgid "Add or delete Quicktag buttons"
89
+ msgstr "Adicionar ou excluir botões de Quicktag"
90
+
91
+ # @ addquicktag
92
+ #: inc/class-settings.php:238
93
+ msgid "Button Label*"
94
+ msgstr "Rótulo do Botão*"
95
+
96
+ # @ addquicktag
97
+ #: inc/class-settings.php:239
98
+ msgid "Title Attribute"
99
+ msgstr "Atributo \"Title\""
100
+
101
+ # @ addquicktag
102
+ #: inc/class-settings.php:240
103
+ msgid "Start Tag(s)*"
104
+ msgstr "Tag(s) de Abertura*"
105
+
106
+ # @ addquicktag
107
+ #: inc/class-settings.php:241
108
+ msgid "End Tag(s)"
109
+ msgstr "Tag(s) de Fechamento"
110
+
111
+ # @ addquicktag
112
+ #: inc/class-settings.php:242
113
+ msgid "Access Key"
114
+ msgstr "Tecla de Acesso"
115
+
116
+ # @ addquicktag
117
+ #: inc/class-settings.php:243
118
+ msgid "Order"
119
+ msgstr "Ordem"
120
+
121
+ # @ addquicktag
122
+ #: inc/class-settings.php:244
123
+ msgid "Visual"
124
+ msgstr "Visual"
125
+
126
+ # @ addquicktag
127
+ #: inc/class-settings.php:342
128
+ msgid ""
129
+ "Fill in the fields below to add or edit the quicktags. Fields with * are "
130
+ "required. To delete a tag simply empty all fields."
131
+ msgstr ""
132
+ "Preencha os campos abaixo para adicionar ou editar os QuickTags. Os campos "
133
+ "com * são obrigatórios. Para excluir uma tag simplesmente limpe todos os "
134
+ "campos."
135
+
136
+ # @ default
137
+ #: inc/class-settings.php:344
138
+ msgid "Save Changes"
139
+ msgstr "Salvar Alterações"
140
+
141
+ # @ addquicktag
142
+ #: inc/class-settings.php:379
143
+ msgid "Like this plugin?"
144
+ msgstr "Gosta deste plugin?"
145
+
146
+ # @ addquicktag
147
+ #: inc/class-settings.php:381
148
+ msgid "Here's how you can give back:"
149
+ msgstr "Aqui você pode dar feedback:"
150
+
151
+ # @ addquicktag
152
+ #: inc/class-settings.php:383
153
+ msgid "Give the plugin a good rating."
154
+ msgstr "Dê uma nota ao plugin."
155
+
156
+ # @ addquicktag
157
+ #: inc/class-settings.php:384
158
+ msgid "Donate a few euros."
159
+ msgstr "Doe alguns Euros."
160
+
161
+ # @ addquicktag
162
+ #: inc/class-settings.php:385
163
+ msgid "Get me something from my wish list."
164
+ msgstr "Dê-me algo de minha lista de desejos."
165
+
166
+ #: inc/class-settings.php:386
167
+ msgid ""
168
+ "Please give me feedback, contribute and file technical bugs on this GitHub "
169
+ "Repo, use Issues."
170
+ msgstr ""
171
+ "Por favor me dê feedback, contribua e apresente erros técnicos sobre este "
172
+ "plugin no repositório GitHub, em \"Issues\"."
173
+
174
+ #: inc/class-settings.php:386
175
+ msgid "Github Repo for Contribute, Issues & Bugs"
176
+ msgstr "Repositório Github para Contribuir, Questões & Bugs"
177
+
178
+ # @ addquicktag
179
+ #: inc/class-settings.php:405
180
+ msgid "About this plugin"
181
+ msgstr "Sobre este plugin"
182
+
183
+ #: inc/class-settings.php:408
184
+ msgid "Version:"
185
+ msgstr "Versão:"
186
+
187
+ # @ addquicktag
188
+ #: inc/class-settings.php:412
189
+ msgid "Description:"
190
+ msgstr "Descrição:"
191
+
192
+ # @ addquicktag
193
+ #: inc/class-settings.php:463
194
+ msgid "Options saved."
195
+ msgstr "As configurações foram salvas."
languages/addquicktag-tr_TR.mo ADDED
Binary file
languages/addquicktag-tr_TR.po ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: AddQuicktag v2.2.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-10-27 02:40+0200\n"
7
+ "Last-Translator: gürkan özsoy <turk3005@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Textdomain-Support: yes\n"
16
+ "X-Generator: Poedit 1.5.4\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ # @ addquicktag
20
+ #. translators: plugin header field 'Name'
21
+ #: addquicktag.php:0
22
+ msgid "AddQuicktag"
23
+ msgstr "AddQuicktag"
24
+
25
+ # @ addquicktag
26
+ #. translators: plugin header field 'PluginURI'
27
+ #: addquicktag.php:0
28
+ msgid "http://bueltge.de/wp-addquicktags-de-plugin/120/"
29
+ msgstr "http://bueltge.de/WP-addquicktags-de-plugin/120/"
30
+
31
+ # @ addquicktag
32
+ #. translators: plugin header field 'Author'
33
+ #: addquicktag.php:0
34
+ msgid "Frank Bültge"
35
+ msgstr "Frank Bültge"
36
+
37
+ # @ addquicktag
38
+ #. translators: plugin header field 'AuthorURI'
39
+ #: addquicktag.php:0
40
+ msgid "http://bueltge.de"
41
+ msgstr "http://bueltge.de"
42
+
43
+ # @ default
44
+ # @ addquicktag
45
+ #: inc/class-settings.php:128
46
+ #: inc/class-settings.php:145
47
+ #: inc/class-settings.php:163
48
+ #: inc/class-settings.php:171
49
+ msgid "Settings"
50
+ msgstr "Ayarlar"
51
+
52
+ # @ addquicktag
53
+ #: inc/class-settings.php:196
54
+ msgid "Add or delete Quicktag buttons"
55
+ msgstr "Quicktag Etiketi Ekle veya Sil"
56
+
57
+ # @ addquicktag
58
+ #: inc/class-settings.php:237
59
+ msgid "Button Label*"
60
+ msgstr "Buton Etiketi*"
61
+
62
+ # @ addquicktag
63
+ #: inc/class-settings.php:238
64
+ msgid "Title Attribute"
65
+ msgstr "Özellik Başlığı"
66
+
67
+ # @ addquicktag
68
+ #: inc/class-settings.php:239
69
+ msgid "Start Tag(s)*"
70
+ msgstr "Başlangıç Etiket(ler)i *"
71
+
72
+ # @ addquicktag
73
+ #: inc/class-settings.php:240
74
+ msgid "End Tag(s)"
75
+ msgstr "Bitiş Etiket(ler)i"
76
+
77
+ # @ addquicktag
78
+ #: inc/class-settings.php:241
79
+ msgid "Access Key"
80
+ msgstr "Erişim Anahtarı"
81
+
82
+ # @ addquicktag
83
+ #: inc/class-settings.php:341
84
+ msgid "Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields."
85
+ msgstr "Quicktag eklemek için yukarıdaki alanları doldurun. * ile işaretli alanları doldurmak zorunludur. Eklediğiniz butonu silmek için tüm alanları boşaltın."
86
+
87
+ # @ default
88
+ #: inc/class-settings.php:343
89
+ msgid "Save Changes"
90
+ msgstr "Değişiklikler Kaydedildi"
91
+
92
+ # @ addquicktag
93
+ #: inc/class-settings.php:378
94
+ msgid "Like this plugin?"
95
+ msgstr "Bu eklentiyi beğendiniz mi?"
96
+
97
+ # @ addquicktag
98
+ #: inc/class-settings.php:380
99
+ msgid "Here's how you can give back:"
100
+ msgstr "Buradan geri bildirimde bulunabilirsiniz:"
101
+
102
+ # @ addquicktag
103
+ #: inc/class-settings.php:382
104
+ msgid "The Plugin on the WordPress plugin repository"
105
+ msgstr "Bu eklenti Wordpress eklenti deposunda"
106
+
107
+ # @ addquicktag
108
+ #: inc/class-settings.php:382
109
+ msgid "Give the plugin a good rating."
110
+ msgstr "Eklentiye iyi bir derece verin."
111
+
112
+ # @ addquicktag
113
+ #: inc/class-settings.php:383
114
+ msgid "Donate via PayPal"
115
+ msgstr "PayPal Üzerinden Bağışta Bulunun"
116
+
117
+ # @ addquicktag
118
+ #: inc/class-settings.php:383
119
+ msgid "Donate a few euros."
120
+ msgstr "Birkaç EURO bağışta bulunun."
121
+
122
+ # @ addquicktag
123
+ #: inc/class-settings.php:384
124
+ msgid "Frank Bültge's Amazon Wish List"
125
+ msgstr "Frank Bültge'nin Amazon Dilek Listesi"
126
+
127
+ # @ addquicktag
128
+ #: inc/class-settings.php:384
129
+ msgid "Get me something from my wish list."
130
+ msgstr "Dilek listemden birşeyler satın alabilirsiniz."
131
+
132
+ # @ addquicktag
133
+ #: inc/class-settings.php:404
134
+ msgid "About this plugin"
135
+ msgstr "Bu eklenti hakkında"
136
+
137
+ # @ addquicktag
138
+ #: inc/class-settings.php:407
139
+ msgid "Version:"
140
+ msgstr "Versiyon:"
141
+
142
+ # @ addquicktag
143
+ #: inc/class-settings.php:411
144
+ msgid "Description:"
145
+ msgstr "Tanımlama:"
146
+
147
+ # @ addquicktag
148
+ #: inc/class-settings.php:242
149
+ msgid "Order"
150
+ msgstr "Sıra"
151
+
152
+ # @ addquicktag
153
+ #: inc/class-settings.php:243
154
+ msgid "Visual"
155
+ msgstr "Görsel"
156
+
157
+ # @ addquicktag
158
+ #. translators: plugin header field 'Description'
159
+ #: addquicktag.php:0
160
+ msgid "Allows you to easily add custom Quicktags to the html- and visual-editor."
161
+ msgstr "HTML ve görsel-editöre kolayca özel Quicktags eklemenizi sağlar."
162
+
163
+ # @ addquicktag
164
+ #: inc/class-imexport.php:70
165
+ msgid "Export"
166
+ msgstr "Dışa Aktar"
167
+
168
+ # @ addquicktag
169
+ #: inc/class-imexport.php:72
170
+ msgid "When you click the button below the plugin will create an XML file for you to save to your computer."
171
+ msgstr "Bilgisayarınıza kaydetmek için aşağıdaki düğmeye tıkladığınız zaman eklenti bir XML dosyası oluşturur."
172
+
173
+ # @ addquicktag
174
+ #: inc/class-imexport.php:73
175
+ msgid "This format, a custom XML, will contain your options from quicktags."
176
+ msgstr "Bu bir XML dosyası olup, bu dosya formatı sizin quicktags seçeneklerinizi içerecektir."
177
+
178
+ # @ addquicktag
179
+ #: inc/class-imexport.php:74
180
+ msgid "Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site."
181
+ msgstr "Bir kere kaydettiğiniz dosyayı, bir başka Wordpress kurulumu için içe aktarma fonksiyonu ile kullanabilirsiniz."
182
+
183
+ # @ addquicktag
184
+ #: inc/class-imexport.php:78
185
+ msgid "Download Export File"
186
+ msgstr "Dışa Aktar Dosyasını İndir"
187
+
188
+ # @ addquicktag
189
+ #: inc/class-imexport.php:86
190
+ msgid "Import"
191
+ msgstr "İçe Aktar"
192
+
193
+ # @ addquicktag
194
+ #: inc/class-imexport.php:88
195
+ msgid "If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import."
196
+ msgstr "Eğer elinizde hazır bir quicktags dosyası varsa bu siteye yükleyebilirsiniz. İçe aktarmak için bir dosya seçerek başlayın."
197
+
198
+ # @ addquicktag
199
+ #: inc/class-imexport.php:93
200
+ msgid "Upload file and import"
201
+ msgstr "Dosya Yükle ve İçe Aktar"
202
+
203
+ # @ addquicktag
204
+ #: inc/class-imexport.php:184
205
+ msgid "Options not update - you don&lsquo;t have the privilidges to do this!"
206
+ msgstr "Seçenekler güncellenmedi - Bunu yapma yetkisine sahip değilsiniz!"
207
+
208
+ # @ addquicktag
209
+ #: inc/class-settings.php:456
210
+ msgid "Options saved."
211
+ msgstr "Seçenekler kaydedildi."
212
+
213
+ # @ addquicktag
214
+ #. translators: plugin header field 'Version'
215
+ #: addquicktag.php:0
216
+ msgid "2.2.0"
217
+ msgstr "2.2.0"
218
+
219
+ # @ addquicktag
220
+ #: inc/class-settings.php:385
221
+ msgid "Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues."
222
+ msgstr "Kullanım hataları, sorunlar gibi teknik konular ile eklentiye katkıda bulunmak için GitHub Repo üzerinden bana geri bildirimde bulunun."
223
+
224
+ # @ addquicktag
225
+ #: inc/class-settings.php:385
226
+ msgid "Github Repo for Contribute, Issues & Bugs"
227
+ msgstr "Hata &amp; Sorunlar ile Kakıtda Bulunmak İçin Github Repo"
228
+
languages/addquicktag-uk_UA.mo ADDED
Binary file
languages/addquicktag-uk_UA.po ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: AddQuicktag v2.2.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-05-20 23:14+0100\n"
7
+ "Last-Translator: Frank Bültge <frank@bueltge.de>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Textdomain-Support: yes\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #@ addquicktag
19
+ #. translators: plugin header field 'Name
20
+ #: addquicktag.php:0
21
+ msgid "AddQuicktag"
22
+ msgstr "Додати швидкий тег"
23
+
24
+ #@ addquicktag
25
+ #: addquicktag.php:0
26
+ msgid "http://bueltge.de/wp-addquicktags-de-plugin/120/"
27
+ msgstr "http://bueltge.de/wp-addquicktags-de-plugin/120/"
28
+
29
+ #@ addquicktag
30
+ #: addquicktag.php:0
31
+ msgid "Frank Bültge"
32
+ msgstr "Frank Bültge"
33
+
34
+ #@ addquicktag
35
+ #: addquicktag.php:0
36
+ msgid "http://bueltge.de"
37
+ msgstr "http://bueltge.de"
38
+
39
+ #@ default
40
+ #@ addquicktag
41
+ #: inc/class-settings.php:128
42
+ #: inc/class-settings.php:145
43
+ #: inc/class-settings.php:163
44
+ #: inc/class-settings.php:171
45
+ msgid "Settings"
46
+ msgstr "Налаштування"
47
+
48
+ #@ addquicktag
49
+ #: inc/class-settings.php:196
50
+ msgid "Add or delete Quicktag buttons"
51
+ msgstr "Додати або видалити кнопки швидких тегів"
52
+
53
+ #@ addquicktag
54
+ #: inc/class-settings.php:237
55
+ msgid "Button Label*"
56
+ msgstr "Кнопка Label *"
57
+
58
+ #@ addquicktag
59
+ #: inc/class-settings.php:238
60
+ msgid "Title Attribute"
61
+ msgstr "Назва Атрибуту"
62
+
63
+ #@ addquicktag
64
+ #: inc/class-settings.php:239
65
+ msgid "Start Tag(s)*"
66
+ msgstr "Початковий тег (і) *"
67
+
68
+ #@ addquicktag
69
+ #: inc/class-settings.php:240
70
+ msgid "End Tag(s)"
71
+ msgstr "Кінець тегів (у)"
72
+
73
+ #@ addquicktag
74
+ #: inc/class-settings.php:241
75
+ msgid "Access Key"
76
+ msgstr "Ключ доступу"
77
+
78
+ #@ addquicktag
79
+ #: inc/class-settings.php:341
80
+ msgid "Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields."
81
+ msgstr "Заповніть поля внизу, щоб додати або редагувати Швидкі теги. Поля, відмічені * обов&#39;язкові для заповнення. Щоб видалити тег просто очистить всі поля."
82
+
83
+ #@ default
84
+ #: inc/class-settings.php:343
85
+ msgid "Save Changes"
86
+ msgstr "Зберегти зміни"
87
+
88
+ #@ addquicktag
89
+ #: inc/class-settings.php:378
90
+ msgid "Like this plugin?"
91
+ msgstr "Подобається цей плагін?"
92
+
93
+ #@ addquicktag
94
+ #: inc/class-settings.php:380
95
+ msgid "Here's how you can give back:"
96
+ msgstr "Ось як ви можете повернути:"
97
+
98
+ #@ addquicktag
99
+ #: inc/class-settings.php:382
100
+ msgid "The Plugin on the WordPress plugin repository"
101
+ msgstr "Плагін на сховищі плагінів WordPress"
102
+
103
+ #@ addquicktag
104
+ #: inc/class-settings.php:382
105
+ msgid "Give the plugin a good rating."
106
+ msgstr "Дайте Плагіну хороший рейтинг."
107
+
108
+ #@ addquicktag
109
+ #: inc/class-settings.php:383
110
+ msgid "Donate via PayPal"
111
+ msgstr "Пожертвувати через PayPal"
112
+
113
+ #@ addquicktag
114
+ #: inc/class-settings.php:383
115
+ msgid "Donate a few euros."
116
+ msgstr "Пожертвувати кілька євро."
117
+
118
+ #@ addquicktag
119
+ #: inc/class-settings.php:384
120
+ msgid "Frank Bültge's Amazon Wish List"
121
+ msgstr "Список побажань Frank Bültge's на Amazon"
122
+
123
+ #@ addquicktag
124
+ #: inc/class-settings.php:384
125
+ msgid "Get me something from my wish list."
126
+ msgstr "Дайте мені що-небудь з мого списку побажань."
127
+
128
+ #@ addquicktag
129
+ #: inc/class-settings.php:404
130
+ msgid "About this plugin"
131
+ msgstr "Про цей плагін"
132
+
133
+ #@ addquicktag
134
+ #: inc/class-settings.php:407
135
+ msgid "Version:"
136
+ msgstr "Версія:"
137
+
138
+ #@ addquicktag
139
+ #: inc/class-settings.php:411
140
+ msgid "Description:"
141
+ msgstr "Опис:"
142
+
143
+ #@ addquicktag
144
+ #: inc/class-settings.php:242
145
+ msgid "Order"
146
+ msgstr "Порядок"
147
+
148
+ #@ addquicktag
149
+ #: inc/class-settings.php:243
150
+ msgid "Visual"
151
+ msgstr "Візуальний"
152
+
153
+ #@ addquicktag
154
+ #: addquicktag.php:0
155
+ msgid "Allows you to easily add custom Quicktags to the html- and visual-editor."
156
+ msgstr "Дозволяє легко додавати власні Швидкі теги в HTML-та візуального редактора."
157
+
158
+ #@ addquicktag
159
+ #: inc/class-imexport.php:70
160
+ msgid "Export"
161
+ msgstr "Експорт"
162
+
163
+ #@ addquicktag
164
+ #: inc/class-imexport.php:72
165
+ msgid "When you click the button below the plugin will create an XML file for you to save to your computer."
166
+ msgstr "При натисканні на кнопку нижче плагін створить XML файл для вас, щоб зберегти на свій комп&#39;ютер."
167
+
168
+ #@ addquicktag
169
+ #: inc/class-imexport.php:73
170
+ msgid "This format, a custom XML, will contain your options from quicktags."
171
+ msgstr "Цей формат, звичайний XML, міститиме ваші варіанти від швидких тегів."
172
+
173
+ #@ addquicktag
174
+ #: inc/class-imexport.php:74
175
+ msgid "Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site."
176
+ msgstr "Після того як ви зберегли файл, ви можете використовувати функцію імпорту в іншому WordPress та імпортувати установки на сайт."
177
+
178
+ #@ addquicktag
179
+ #: inc/class-imexport.php:78
180
+ msgid "Download Export File"
181
+ msgstr "Завантажити Експорт файлу"
182
+
183
+ #@ addquicktag
184
+ #: inc/class-imexport.php:86
185
+ msgid "Import"
186
+ msgstr "Імпорт"
187
+
188
+ #@ addquicktag
189
+ #: inc/class-imexport.php:88
190
+ msgid "If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import."
191
+ msgstr "Якщо у вас є швидкі теги з інших установок, плагін може імпортувати їх в це місце. Щоб почати роботу, вибрати файл для імпорту."
192
+
193
+ #@ addquicktag
194
+ #: inc/class-imexport.php:93
195
+ msgid "Upload file and import"
196
+ msgstr "Завантажити та імпортувати"
197
+
198
+ #@ addquicktag
199
+ #: inc/class-imexport.php:184
200
+ msgid "Options not update - you don&lsquo;t have the privilidges to do this!"
201
+ msgstr "Опції не оновилися - ви не маєте привілегій, щоб зробити це!"
202
+
203
+ #@ addquicktag
204
+ #: inc/class-settings.php:456
205
+ msgid "Options saved."
206
+ msgstr "Налаштування збережені."
207
+
208
+ #@ addquicktag
209
+ #: addquicktag.php:0
210
+ msgid "2.2.0"
211
+ msgstr "2.2.0"
212
+
213
+ #@ addquicktag
214
+ #: inc/class-settings.php:385
215
+ msgid "Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues."
216
+ msgstr "Будь ласка, зробіть свій внесок і подати технічні помилки на цьому GitHub репозиторію, використовуючи питання."
217
+
218
+ #@ addquicktag
219
+ #: inc/class-settings.php:385
220
+ msgid "Github Repo for Contribute, Issues & Bugs"
221
+ msgstr "Github репозиторій для сприяння, питання і помилки"
222
+
readme.md CHANGED
Binary file
readme.txt CHANGED
@@ -3,16 +3,12 @@ Contributors: Bueltge, inpsyde
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6069955
4
  Tags: quicktag, editor, tinymce, add buttons, button, buttons, visual editor
5
  Requires at least: 3.0
6
- Tested up to: 3.8.3
7
- Stable tag: 2.2.2
8
 
9
  This plugin make it easy, Quicktags add to the html - and visual-editor.
10
 
11
  == Description ==
12
-
13
- = WordPress 3.9 Hint =
14
- *Currently don't work the plugin with WordPress 3.9 and the visual editor. See this [thread](http://wordpress.org/support/topic/not-working-in-wordpress-39?replies=2#post-5466033) for more information.*
15
-
16
  This plugin make it easy, Quicktags add to the html - and visual-editor.. It is possible to ex- and import your Quicktags.
17
 
18
  WP-AddQuicktag for WordPress is in originally by [Roel Meurders](http://roel.meurders.nl/ "Roel Meurders"). The versions of the Repo to AddQuicktag are newer versions, completly rewrite with version 2.0.0 and more functionalities.
@@ -30,7 +26,7 @@ Have a look at the premium plugins in our [market](http://marketpress.com).
30
 
31
  == Installation ==
32
  = Requirements =
33
- * WordPress version 3.0 and later (tested at 3.6-alpha (nightly build))
34
 
35
  = Installation =
36
  1. Unpack the download-package
@@ -58,6 +54,9 @@ If you will use this plugin with an older version of WordPress, please use an ol
58
  * French translation by [Jean-Michel MEYER](http://www.li-an.fr/blog)
59
  * Japanese translation by [Yuuichi](http://www.u-1.net/2011/12/29/2498/)
60
  * Slovak translation by [Branco](http://webhostinggeeks.com/user-reviews/)
 
 
 
61
 
62
  = Hook for custom post types =
63
  The plugin add the quicktag on default to post types/ID `post`, `page` and `comment`. If you will also the plugin for other post types you can use a filter; see the follow example or an example plugin in the [Gist 1595155](https://gist.github.com/1595155).
@@ -150,6 +149,18 @@ The plugin comes with various translations, please refer to the [WordPress Codex
150
 
151
 
152
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
153
  = 2.2.2 (02/09/2013) =
154
  * Add Filter Hook for custom button, see [issue #9](https://github.com/bueltge/AddQuicktag/issues/9)
155
  * Small check for undefined var on settings page
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6069955
4
  Tags: quicktag, editor, tinymce, add buttons, button, buttons, visual editor
5
  Requires at least: 3.0
6
+ Tested up to: 4.0-alpha
7
+ Stable tag: trunk
8
 
9
  This plugin make it easy, Quicktags add to the html - and visual-editor.
10
 
11
  == Description ==
 
 
 
 
12
  This plugin make it easy, Quicktags add to the html - and visual-editor.. It is possible to ex- and import your Quicktags.
13
 
14
  WP-AddQuicktag for WordPress is in originally by [Roel Meurders](http://roel.meurders.nl/ "Roel Meurders"). The versions of the Repo to AddQuicktag are newer versions, completly rewrite with version 2.0.0 and more functionalities.
26
 
27
  == Installation ==
28
  = Requirements =
29
+ * WordPress version 3.0 and later (see _Compatible up to_)
30
 
31
  = Installation =
32
  1. Unpack the download-package
54
  * French translation by [Jean-Michel MEYER](http://www.li-an.fr/blog)
55
  * Japanese translation by [Yuuichi](http://www.u-1.net/2011/12/29/2498/)
56
  * Slovak translation by [Branco](http://webhostinggeeks.com/user-reviews/)
57
+ * Brazilian Portuguese translation by [Aluízio Leye Larangeira](http://www.aluizioll.com.br/category/traducao/)
58
+ * Turkish translation by [Turk3005](http://wordpress.org/support/profile/turk3005)
59
+ * Ukranian translation by [Michael Yunat](http://getvoip.com/blog)
60
 
61
  = Hook for custom post types =
62
  The plugin add the quicktag on default to post types/ID `post`, `page` and `comment`. If you will also the plugin for other post types you can use a filter; see the follow example or an example plugin in the [Gist 1595155](https://gist.github.com/1595155).
149
 
150
 
151
  == Changelog ==
152
+ = 2.3.0-RC1 (05/22/2014) =
153
+ * Use on default all post types with active UI, incl. Custom and Defaul Post types
154
+ * New settings UI to easier add quicktags to each post type
155
+ * Add Widget area, now it is possible to use Quicktags on widgets with WP editor
156
+ * Add brazilian translation
157
+ * Add turkish translation
158
+ * Add possibility to remove default quicktags
159
+ * Changes on settings style, check in MP6 design, WP 3.8
160
+ * Add ukranian translation
161
+ * Add solution to remove core quicktag, Beta Status
162
+ * Fix TinyMCE Select Box in WordPress 3.9*
163
+
164
  = 2.2.2 (02/09/2013) =
165
  * Add Filter Hook for custom button, see [issue #9](https://github.com/bueltge/AddQuicktag/issues/9)
166
  * Small check for undefined var on settings page