Version Description
- Add fix, see Forum thread 'array_multisort error'
- See Quicktag button in visual editor, onbly if an button is actove for visual
- Change hooks for include scripts
- Add filter for page in backend
- Add edit comments to use quicktags
Download this release
Release Info
Developer | Bueltge |
Plugin | AddQuicktag |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.4 to 2.1.0
- addquicktag.php +271 -232
- addquicktag_quickedit_comment.php.example +50 -0
- inc/class-settings.php +480 -479
- inc/tinymce/editor_plugin.dev.js +11 -1
- inc/tinymce/editor_plugin.js +1 -1
- inc/tinymce/langs/de.js +4 -4
- js/add-quicktags.dev.js +28 -28
- js/add-quicktags.js +6 -6
- js/add-quicktags_32.dev.js +43 -43
- js/add-quicktags_32.js +6 -6
- languages/addquicktag-fr_FR.mo +0 -0
- languages/addquicktag-fr_FR.po +71 -122
- readme.txt +138 -111
addquicktag.php
CHANGED
@@ -1,240 +1,279 @@
|
|
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.0.4
|
9 |
-
* Author: Frank Bültge
|
10 |
-
* Author URI: http://bueltge.de
|
11 |
-
* License: GPLv3
|
12 |
-
*/
|
13 |
-
|
14 |
-
/**
|
15 |
-
License:
|
16 |
-
==============================================================================
|
17 |
-
Copyright 2011 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 |
*
|
|
|
40 |
*/
|
41 |
class Add_Quicktag {
|
42 |
-
|
43 |
-
static private $classobj;
|
44 |
-
|
45 |
-
static private $option_string = 'rmnlQuicktagSettings';
|
46 |
-
|
47 |
-
static private $admin_pages_for_js = array( 'post.php', '
|
48 |
-
// use filter 'addquicktag_post_types' for add custom post_types
|
49 |
-
static private $post_types_for_js
|
50 |
-
|
51 |
-
static private $plugin;
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
// get string of plugin
|
59 |
-
self :: $plugin = plugin_basename( __FILE__ );
|
60 |
-
|
61 |
-
// on uninstall remove capability from roles
|
62 |
-
register_uninstall_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
|
63 |
-
// on deactivate delete all settings in database
|
64 |
-
// register_deactivation_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
|
65 |
-
|
66 |
-
// load translation files
|
67 |
-
add_action( 'admin_init', array( $this, 'localize_plugin' ) );
|
68 |
-
// Include settings
|
69 |
-
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-settings.php';
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
//
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
if (
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
else
|
113 |
-
$tmp[] = 0;
|
114 |
-
}
|
115 |
-
array_multisort( $tmp, SORT_ASC, $options['buttons'] );
|
116 |
-
}
|
117 |
-
?>
|
118 |
-
<script type="text/javascript">
|
119 |
-
var addquicktag_tags = <?php echo json_encode( $options ); ?>;
|
120 |
-
</script>
|
121 |
-
<?php
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Enqueue Scripts for plugin
|
126 |
-
*
|
127 |
-
* @param $where string
|
128 |
-
* @since 2.0.0
|
129 |
-
* @access public
|
130 |
-
* @return void
|
131 |
-
*/
|
132 |
-
public function admin_enqueue_scripts( $where ) {
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
*
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
*
|
217 |
-
*
|
218 |
-
* @
|
219 |
-
* @return string
|
220 |
-
*/
|
221 |
-
public function
|
222 |
-
|
223 |
-
return self ::
|
224 |
-
}
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
} // end class
|
233 |
-
|
234 |
-
if ( function_exists( 'add_action' ) && class_exists( 'Add_Quicktag' ) ) {
|
235 |
-
add_action( 'plugins_loaded', array( 'Add_Quicktag', 'get_object' ) );
|
236 |
-
} else {
|
237 |
-
header( 'Status: 403 Forbidden' );
|
238 |
-
header( 'HTTP/1.1 403 Forbidden' );
|
239 |
-
exit();
|
240 |
-
}
|
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.1.0
|
9 |
+
* Author: Frank Bültge
|
10 |
+
* Author URI: http://bueltge.de
|
11 |
+
* License: GPLv3
|
12 |
+
*/
|
13 |
+
|
14 |
+
/**
|
15 |
+
License:
|
16 |
+
==============================================================================
|
17 |
+
Copyright 2011 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 |
+
static private $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( 'post.php', 'comment.php' );
|
50 |
+
// use filter 'addquicktag_post_types' for add custom post_types
|
51 |
+
static private $post_types_for_js = array( 'post', 'page', 'comment' );
|
52 |
+
|
53 |
+
static private $plugin;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Constructor, init the functions inside WP
|
57 |
+
*
|
58 |
+
* @since 2.0.0
|
59 |
+
* @return void
|
60 |
+
*/
|
61 |
+
function __construct() {
|
62 |
+
|
63 |
+
if ( ! is_admin() )
|
64 |
+
return;
|
65 |
+
|
66 |
// get string of plugin
|
67 |
+
self :: $plugin = plugin_basename( __FILE__ );
|
68 |
+
|
69 |
+
// on uninstall remove capability from roles
|
70 |
+
register_uninstall_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
|
71 |
+
// on deactivate delete all settings in database
|
72 |
+
// register_deactivation_hook( __FILE__, array('Add_Quicktag', 'uninstall' ) );
|
73 |
+
|
74 |
+
// load translation files
|
75 |
+
add_action( 'admin_init', array( $this, 'localize_plugin' ) );
|
76 |
+
// Include settings
|
77 |
+
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-settings.php';
|
78 |
+
// Include solution for TinyMCE
|
79 |
+
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc/class-tinymce.php';
|
80 |
+
|
81 |
+
// filter for custom post types
|
82 |
+
self::$post_types_for_js = apply_filters( 'addquicktag_post_types', self::$post_types_for_js );
|
83 |
+
$admin_pages_for_js = apply_filters( 'addquicktag_pages', self::$admin_pages_for_js );
|
84 |
+
foreach ( $admin_pages_for_js as $page ) {
|
85 |
+
add_action( 'admin_print_scripts-' . $page, array( $this, 'print_scripts' ) );
|
86 |
+
add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_enqueue_scripts') );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Uninstall data in options table, if the plugin was uninstall via backend
|
92 |
+
*
|
93 |
+
* @since 2.0.0
|
94 |
+
* @return void
|
95 |
+
*/
|
96 |
+
public function uninstall() {
|
97 |
+
|
98 |
+
delete_option( self :: $option_string );
|
99 |
+
delete_site_option( self :: $option_string );
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Print json data in head
|
104 |
+
*
|
105 |
+
* @since 2.0.0
|
106 |
+
* @return void
|
107 |
+
*/
|
108 |
+
public function print_scripts() {
|
109 |
+
global $current_screen;
|
110 |
+
|
111 |
+
if ( isset( $current_screen->id ) &&
|
112 |
+
! in_array(
|
113 |
+
$current_screen->id,
|
114 |
+
self :: $post_types_for_js
|
115 |
+
)
|
116 |
+
)
|
117 |
+
return NULL;
|
118 |
+
|
119 |
+
if ( is_multisite() && is_plugin_active_for_network( $this -> get_plugin_string() ) )
|
120 |
+
$options = get_site_option( self :: $option_string );
|
121 |
+
else
|
122 |
+
$options = get_option( self :: $option_string );
|
123 |
+
|
124 |
+
if ( ! $options )
|
125 |
+
return NULL;
|
126 |
+
|
127 |
+
if ( 1 < count($options['buttons']) ) {
|
128 |
+
// sort array by order value
|
129 |
+
$tmp = array();
|
130 |
+
foreach( $options['buttons'] as $order ) {
|
131 |
+
if ( isset( $order['order'] ) )
|
132 |
+
$tmp[] = $order['order'];
|
133 |
else
|
134 |
+
$tmp[] = 0;
|
135 |
+
}
|
136 |
+
array_multisort( $tmp, SORT_ASC, $options['buttons'] );
|
137 |
+
}
|
138 |
+
?>
|
139 |
+
<script type="text/javascript">
|
140 |
+
var addquicktag_tags = <?php echo json_encode( $options ); ?>;
|
141 |
+
</script>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Enqueue Scripts for plugin
|
147 |
+
*
|
148 |
+
* @param $where string
|
149 |
+
* @since 2.0.0
|
150 |
+
* @access public
|
151 |
+
* @return void
|
152 |
+
*/
|
153 |
+
public function admin_enqueue_scripts( $where ) {
|
154 |
+
global $current_screen;
|
155 |
+
|
156 |
+
if ( isset( $current_screen->id ) &&
|
157 |
+
! in_array(
|
158 |
+
$current_screen->id,
|
159 |
+
self :: $post_types_for_js
|
160 |
+
)
|
161 |
+
)
|
162 |
+
return NULL;
|
163 |
+
|
164 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
165 |
+
|
166 |
+
if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) ) {
|
167 |
+
wp_enqueue_script(
|
168 |
+
self :: get_textdomain() . '_script',
|
169 |
+
plugins_url( '/js/add-quicktags' . $suffix. '.js', __FILE__ ),
|
170 |
+
array( 'jquery', 'quicktags' ),
|
171 |
+
'',
|
172 |
+
TRUE
|
173 |
+
);
|
174 |
+
} else {
|
175 |
+
wp_enqueue_script(
|
176 |
+
self :: get_textdomain() . '_script',
|
177 |
+
plugins_url( '/js/add-quicktags_32' . $suffix. '.js', __FILE__ ),
|
178 |
+
array( 'jquery', 'quicktags' ),
|
179 |
+
'',
|
180 |
+
TRUE
|
181 |
+
);
|
182 |
+
}
|
183 |
+
// Alternative to JSON function
|
184 |
+
// wp_localize_script( self :: get_textdomain() . '_script', 'addquicktag_tags', get_option( self :: $option_string ) );
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Handler for the action 'init'. Instantiates this class.
|
189 |
+
*
|
190 |
+
* @since 2.0.0
|
191 |
+
* @access public
|
192 |
+
* @return $classobj
|
193 |
+
*/
|
194 |
+
public function get_object() {
|
195 |
+
|
196 |
+
if ( NULL === self :: $classobj ) {
|
197 |
+
self :: $classobj = new self;
|
198 |
+
}
|
199 |
+
|
200 |
+
return self :: $classobj;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Localize_plugin function.
|
205 |
+
*
|
206 |
+
* @uses load_plugin_textdomain, plugin_basename
|
207 |
+
* @access public
|
208 |
+
* @since 2.0.0
|
209 |
+
* @return void
|
210 |
+
*/
|
211 |
+
public function localize_plugin() {
|
212 |
+
|
213 |
+
load_plugin_textdomain( $this -> get_textdomain(), FALSE, dirname( plugin_basename(__FILE__) ) . '/languages' );
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* return plugin comment data
|
218 |
+
*
|
219 |
+
* @since 2.0.0
|
220 |
+
* @access public
|
221 |
+
* @param $value string, default = 'TextDomain'
|
222 |
+
* Name, PluginURI, Version, Description, Author, AuthorURI, TextDomain, DomainPath, Network, Title
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
public function get_plugin_data( $value = 'TextDomain' ) {
|
226 |
+
|
227 |
+
if ( ! function_exists( 'get_plugin_data' ) )
|
228 |
+
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
229 |
+
|
230 |
+
$plugin_data = get_plugin_data( __FILE__ );
|
231 |
+
$plugin_value = $plugin_data[$value];
|
232 |
+
|
233 |
+
return $plugin_value;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Return string of plugin
|
238 |
+
*
|
239 |
+
* @since 2.0.0
|
240 |
+
* @return string
|
241 |
+
*/
|
242 |
+
public function get_plugin_string() {
|
243 |
+
|
244 |
+
return self :: $plugin;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Retrun textdomain string
|
249 |
+
*
|
250 |
+
* @since 2.0.0
|
251 |
+
* @access public
|
252 |
+
* @return string
|
253 |
+
*/
|
254 |
+
public function get_textdomain() {
|
255 |
+
|
256 |
+
return self :: get_plugin_data( 'TextDomain' );
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Return string for options
|
261 |
+
*
|
262 |
+
* @since 2.0.0
|
263 |
+
* @retrun string
|
264 |
+
*/
|
265 |
+
public function get_option_string() {
|
266 |
+
|
267 |
+
return self :: $option_string;
|
268 |
+
}
|
269 |
+
|
270 |
|
271 |
} // end class
|
272 |
+
|
273 |
+
if ( function_exists( 'add_action' ) && class_exists( 'Add_Quicktag' ) ) {
|
274 |
+
add_action( 'plugins_loaded', array( 'Add_Quicktag', 'get_object' ) );
|
275 |
+
} else {
|
276 |
+
header( 'Status: 403 Forbidden' );
|
277 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
278 |
+
exit();
|
279 |
+
}
|
addquicktag_quickedit_comment.php.example
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Use AddQuicktag on Quickedit of comments
|
4 |
+
* Plugin URI: http://bueltge.de/
|
5 |
+
* Description: Add the quicktags fomr AddQuicktag plugin to the editor of Quickedit on comments
|
6 |
+
* Author: Frank Bültge
|
7 |
+
* Version: 0.0.1
|
8 |
+
* Licence: GPLv3
|
9 |
+
* Author URI: http://bueltge.de
|
10 |
+
*/
|
11 |
+
|
12 |
+
// This file is not called from WordPress. We don't like that.
|
13 |
+
if ( ! function_exists( 'add_filter' ) ) {
|
14 |
+
echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
|
15 |
+
exit;
|
16 |
+
}
|
17 |
+
|
18 |
+
if ( ! function_exists( 'my_addquicktag_post_types' ) ) {
|
19 |
+
|
20 |
+
// add custom function to filter hook 'addquicktag_post_types'
|
21 |
+
add_filter( 'addquicktag_post_types', 'my_addquicktag_post_types' );
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Return array $post_types with custom post types strings
|
25 |
+
*
|
26 |
+
* @param $post_type Array
|
27 |
+
* @return $post_type Array
|
28 |
+
*/
|
29 |
+
function my_addquicktag_post_types( $post_types ) {
|
30 |
+
|
31 |
+
$post_types[] = 'edit-comments';
|
32 |
+
|
33 |
+
return $post_types;
|
34 |
+
}
|
35 |
+
|
36 |
+
add_filter( 'addquicktag_pages', 'my_addquicktag_pages' );
|
37 |
+
/**
|
38 |
+
* Return array $page with custom page strings
|
39 |
+
*
|
40 |
+
* @param $page Array
|
41 |
+
* @return $page Array
|
42 |
+
*/
|
43 |
+
function my_addquicktag_pages( $page ) {
|
44 |
+
|
45 |
+
$page[] = 'edit-comments.php';
|
46 |
+
|
47 |
+
return $page;
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
inc/class-settings.php
CHANGED
@@ -1,479 +1,480 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* AddQuicktag - Settings
|
4 |
-
* @license GPLv3
|
5 |
-
* @package AddQuicktag
|
6 |
-
* @subpackage AddQuicktag Settings
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! function_exists( 'add_action' ) ) {
|
10 |
-
echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
|
11 |
-
exit;
|
12 |
-
}
|
13 |
-
|
14 |
-
class Add_Quicktag_Settings extends Add_Quicktag {
|
15 |
-
|
16 |
-
static private $classobj = NULL;
|
17 |
-
// string for translation
|
18 |
-
static public $textdomain;
|
19 |
-
// string for options in table options
|
20 |
-
static private $option_string;
|
21 |
-
// string for plugin file
|
22 |
-
static private $plugin;
|
23 |
-
// string for nonce fields
|
24 |
-
static public $nonce_string;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Handler for the action 'init'. Instantiates this class.
|
28 |
-
*
|
29 |
-
* @access public
|
30 |
-
* @since 2.0.0
|
31 |
-
* @return $classobj
|
32 |
-
*/
|
33 |
-
public function get_object() {
|
34 |
-
|
35 |
-
if ( NULL === self :: $classobj ) {
|
36 |
-
self :: $classobj = new self;
|
37 |
-
}
|
38 |
-
|
39 |
-
return self :: $classobj;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Constructor, init on defined hooks of WP and include second class
|
44 |
-
*
|
45 |
-
* @access public
|
46 |
-
* @since 0.0.2
|
47 |
-
* @uses register_activation_hook, register_uninstall_hook, add_action
|
48 |
-
* @return void
|
49 |
-
*/
|
50 |
-
public function __construct() {
|
51 |
-
|
52 |
-
if ( ! is_admin() )
|
53 |
-
return NULL;
|
54 |
-
|
55 |
-
// textdomain from parent class
|
56 |
-
self :: $textdomain = parent :: get_textdomain();
|
57 |
-
$this -> option_string = parent :: get_option_string();
|
58 |
-
$this -> plugin = parent :: get_plugin_string();
|
59 |
-
$this -> nonce_string = 'addquicktag_nonce';
|
60 |
-
|
61 |
-
register_uninstall_hook( __FILE__, array( 'Add_Quicktag_Settings', 'unregister_settings' ) );
|
62 |
-
// settings for an active multisite
|
63 |
-
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) ) {
|
64 |
-
add_action( 'network_admin_menu', array( $this, 'add_settings_page' ) );
|
65 |
-
// add settings link
|
66 |
-
add_filter( 'network_admin_plugin_action_links', array( $this, 'network_admin_plugin_action_links' ), 10, 2 );
|
67 |
-
// save settings on network
|
68 |
-
add_action( 'network_admin_edit_' . $this -> option_string, array( $this, 'save_network_settings_page' ) );
|
69 |
-
// return message for update settings
|
70 |
-
add_action( 'network_admin_notices', array( $this, 'get_network_admin_notices' ) );
|
71 |
-
} else {
|
72 |
-
add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
|
73 |
-
// add settings link
|
74 |
-
add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
|
75 |
-
// use settings API
|
76 |
-
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
77 |
-
}
|
78 |
-
// add meta boxes on settings pages
|
79 |
-
add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_plugin_infos' ) );
|
80 |
-
add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_about_plugin' ) );
|
81 |
-
// include class for im/export
|
82 |
-
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-imexport.php';
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Return Textdomain string
|
88 |
-
*
|
89 |
-
* @access public
|
90 |
-
* @since 2.0.0
|
91 |
-
* @return string
|
92 |
-
*/
|
93 |
-
public function get_textdomain() {
|
94 |
-
|
95 |
-
return self :: $textdomain;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Add settings link on plugins.php in backend
|
100 |
-
*
|
101 |
-
* @uses
|
102 |
-
* @access public
|
103 |
-
* @param array $links, string $file
|
104 |
-
* @since 2.0.0
|
105 |
-
* @return string $links
|
106 |
-
*/
|
107 |
-
public function plugin_action_links( $links, $file ) {
|
108 |
-
|
109 |
-
if ( parent :: get_plugin_string() == $file )
|
110 |
-
$links[] = '<a href="options-general.php?page=addquicktag/inc/class-settings.php">' . __('Settings') . '</a>';
|
111 |
-
|
112 |
-
return $links;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Add settings link on plugins.php on network admin in backend
|
117 |
-
*
|
118 |
-
* @uses
|
119 |
-
* @access public
|
120 |
-
* @param array $links, string $file
|
121 |
-
* @since 2.0.0
|
122 |
-
* @return string $links
|
123 |
-
*/
|
124 |
-
public function network_admin_plugin_action_links( $links, $file ) {
|
125 |
-
|
126 |
-
if ( parent :: get_plugin_string() == $file )
|
127 |
-
$links[] = '<a href="settings.php?page=addquicktag/inc/class-settings.php">' . __('Settings') . '</a>';
|
128 |
-
|
129 |
-
return $links;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Add settings page in WP backend
|
134 |
-
*
|
135 |
-
* @uses add_options_page
|
136 |
-
* @access public
|
137 |
-
* @since 2.0.0
|
138 |
-
* @return void
|
139 |
-
*/
|
140 |
-
public function add_settings_page () {
|
141 |
-
|
142 |
-
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) ) {
|
143 |
-
add_submenu_page(
|
144 |
-
'settings.php',
|
145 |
-
parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this -> get_textdomain() ),
|
146 |
-
parent :: get_plugin_data( 'Name' ),
|
147 |
-
'manage_options',
|
148 |
-
plugin_basename(__FILE__),
|
149 |
-
array( $this, 'get_settings_page' )
|
150 |
-
);
|
151 |
-
} else {
|
152 |
-
add_options_page(
|
153 |
-
parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this -> get_textdomain() ),
|
154 |
-
parent :: get_plugin_data( 'Name' ),
|
155 |
-
'manage_options',
|
156 |
-
plugin_basename(__FILE__),
|
157 |
-
array( $this, 'get_settings_page' )
|
158 |
-
);
|
159 |
-
add_action( 'contextual_help', array( $this, 'contextual_help' ), 10, 3 );
|
160 |
-
}
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Return form and markup on settings page
|
165 |
-
*
|
166 |
-
* @uses settings_fields, normalize_whitespace, is_plugin_active_for_network, get_site_option, get_option
|
167 |
-
* @access public
|
168 |
-
* @since 0.0.2
|
169 |
-
* @return void
|
170 |
-
*/
|
171 |
-
public function get_settings_page() {
|
172 |
-
|
173 |
-
?>
|
174 |
-
<div class="wrap">
|
175 |
-
<?php screen_icon('options-general'); ?>
|
176 |
-
<h2><?php echo parent :: get_plugin_data( 'Name' ); ?></h2>
|
177 |
-
|
178 |
-
<h3><?php _e('Add or delete Quicktag buttons', $this -> get_textdomain() ); ?></h3>
|
179 |
-
<?php
|
180 |
-
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) )
|
181 |
-
$action = 'edit.php?action=' . $this -> option_string;
|
182 |
-
else
|
183 |
-
$action = 'options.php';
|
184 |
-
?>
|
185 |
-
<form method="post" action="<?php echo $action; ?>">
|
186 |
-
<?php
|
187 |
-
settings_fields( $this -> option_string . '_group' );
|
188 |
-
|
189 |
-
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) )
|
190 |
-
$options = get_site_option( $this -> option_string );
|
191 |
-
else
|
192 |
-
$options = get_option( $this -> option_string );
|
193 |
-
|
194 |
-
if ( ! $options )
|
195 |
-
$options['buttons'] = array();
|
196 |
-
|
197 |
-
if ( 1 < count($options['buttons']) ) {
|
198 |
-
// sort array by order value
|
199 |
-
$tmp = array();
|
200 |
-
foreach( $options['buttons'] as $order ) {
|
201 |
-
if ( isset( $order['order'] ) )
|
202 |
-
$tmp[] = $order['order'];
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
<th class="row-title"><?php _e('
|
213 |
-
<th class="row-title"><?php _e('
|
214 |
-
<th class="row-title"><?php _e('
|
215 |
-
<th class="row-title"
|
216 |
-
<th class="row-title" style="width:5%;"><?php _e('
|
217 |
-
<th class="row-title" style="width:5%;"><?php _e('
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
$
|
226 |
-
$b
|
227 |
-
$b['
|
228 |
-
$b['
|
229 |
-
$b['
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
. $
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][
|
267 |
-
<td><
|
268 |
-
<td><textarea class="code" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][
|
269 |
-
<td><
|
270 |
-
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][
|
271 |
-
<td><input type="
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
<p
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
*
|
303 |
-
*
|
304 |
-
* @
|
305 |
-
* @
|
306 |
-
* @
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
<
|
314 |
-
|
315 |
-
<
|
316 |
-
|
317 |
-
<li><a href="
|
318 |
-
<li><a href="
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
*
|
328 |
-
*
|
329 |
-
* @
|
330 |
-
* @
|
331 |
-
* @
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
<
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
*
|
355 |
-
*
|
356 |
-
* @
|
357 |
-
* @
|
358 |
-
* @
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
*
|
378 |
-
*
|
379 |
-
* @
|
380 |
-
* @
|
381 |
-
* @
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
if
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
$
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
*
|
398 |
-
*
|
399 |
-
* @
|
400 |
-
* @
|
401 |
-
* @
|
402 |
-
* @
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
$b['
|
412 |
-
$b['
|
413 |
-
$b['
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
*
|
433 |
-
*
|
434 |
-
* @
|
435 |
-
* @
|
436 |
-
* @
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
*
|
446 |
-
*
|
447 |
-
* @
|
448 |
-
* @
|
449 |
-
* @
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
*
|
460 |
-
*
|
461 |
-
* @
|
462 |
-
* @param string $
|
463 |
-
* @param string $
|
464 |
-
* @
|
465 |
-
* @
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* AddQuicktag - Settings
|
4 |
+
* @license GPLv3
|
5 |
+
* @package AddQuicktag
|
6 |
+
* @subpackage AddQuicktag Settings
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! function_exists( 'add_action' ) ) {
|
10 |
+
echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
class Add_Quicktag_Settings extends Add_Quicktag {
|
15 |
+
|
16 |
+
static private $classobj = NULL;
|
17 |
+
// string for translation
|
18 |
+
static public $textdomain;
|
19 |
+
// string for options in table options
|
20 |
+
static private $option_string;
|
21 |
+
// string for plugin file
|
22 |
+
static private $plugin;
|
23 |
+
// string for nonce fields
|
24 |
+
static public $nonce_string;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Handler for the action 'init'. Instantiates this class.
|
28 |
+
*
|
29 |
+
* @access public
|
30 |
+
* @since 2.0.0
|
31 |
+
* @return $classobj
|
32 |
+
*/
|
33 |
+
public function get_object() {
|
34 |
+
|
35 |
+
if ( NULL === self :: $classobj ) {
|
36 |
+
self :: $classobj = new self;
|
37 |
+
}
|
38 |
+
|
39 |
+
return self :: $classobj;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Constructor, init on defined hooks of WP and include second class
|
44 |
+
*
|
45 |
+
* @access public
|
46 |
+
* @since 0.0.2
|
47 |
+
* @uses register_activation_hook, register_uninstall_hook, add_action
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
if ( ! is_admin() )
|
53 |
+
return NULL;
|
54 |
+
|
55 |
+
// textdomain from parent class
|
56 |
+
self :: $textdomain = parent :: get_textdomain();
|
57 |
+
$this -> option_string = parent :: get_option_string();
|
58 |
+
$this -> plugin = parent :: get_plugin_string();
|
59 |
+
$this -> nonce_string = 'addquicktag_nonce';
|
60 |
+
|
61 |
+
register_uninstall_hook( __FILE__, array( 'Add_Quicktag_Settings', 'unregister_settings' ) );
|
62 |
+
// settings for an active multisite
|
63 |
+
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) ) {
|
64 |
+
add_action( 'network_admin_menu', array( $this, 'add_settings_page' ) );
|
65 |
+
// add settings link
|
66 |
+
add_filter( 'network_admin_plugin_action_links', array( $this, 'network_admin_plugin_action_links' ), 10, 2 );
|
67 |
+
// save settings on network
|
68 |
+
add_action( 'network_admin_edit_' . $this -> option_string, array( $this, 'save_network_settings_page' ) );
|
69 |
+
// return message for update settings
|
70 |
+
add_action( 'network_admin_notices', array( $this, 'get_network_admin_notices' ) );
|
71 |
+
} else {
|
72 |
+
add_action( 'admin_menu', array( $this, 'add_settings_page' ) );
|
73 |
+
// add settings link
|
74 |
+
add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
|
75 |
+
// use settings API
|
76 |
+
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
77 |
+
}
|
78 |
+
// add meta boxes on settings pages
|
79 |
+
add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_plugin_infos' ) );
|
80 |
+
add_action( 'addquicktag_settings_page_sidebar', array( $this, 'get_about_plugin' ) );
|
81 |
+
// include class for im/export
|
82 |
+
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-imexport.php';
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Return Textdomain string
|
88 |
+
*
|
89 |
+
* @access public
|
90 |
+
* @since 2.0.0
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
public function get_textdomain() {
|
94 |
+
|
95 |
+
return self :: $textdomain;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Add settings link on plugins.php in backend
|
100 |
+
*
|
101 |
+
* @uses
|
102 |
+
* @access public
|
103 |
+
* @param array $links, string $file
|
104 |
+
* @since 2.0.0
|
105 |
+
* @return string $links
|
106 |
+
*/
|
107 |
+
public function plugin_action_links( $links, $file ) {
|
108 |
+
|
109 |
+
if ( parent :: get_plugin_string() == $file )
|
110 |
+
$links[] = '<a href="options-general.php?page=addquicktag/inc/class-settings.php">' . __('Settings') . '</a>';
|
111 |
+
|
112 |
+
return $links;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Add settings link on plugins.php on network admin in backend
|
117 |
+
*
|
118 |
+
* @uses
|
119 |
+
* @access public
|
120 |
+
* @param array $links, string $file
|
121 |
+
* @since 2.0.0
|
122 |
+
* @return string $links
|
123 |
+
*/
|
124 |
+
public function network_admin_plugin_action_links( $links, $file ) {
|
125 |
+
|
126 |
+
if ( parent :: get_plugin_string() == $file )
|
127 |
+
$links[] = '<a href="settings.php?page=addquicktag/inc/class-settings.php">' . __('Settings') . '</a>';
|
128 |
+
|
129 |
+
return $links;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Add settings page in WP backend
|
134 |
+
*
|
135 |
+
* @uses add_options_page
|
136 |
+
* @access public
|
137 |
+
* @since 2.0.0
|
138 |
+
* @return void
|
139 |
+
*/
|
140 |
+
public function add_settings_page () {
|
141 |
+
|
142 |
+
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) ) {
|
143 |
+
add_submenu_page(
|
144 |
+
'settings.php',
|
145 |
+
parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this -> get_textdomain() ),
|
146 |
+
parent :: get_plugin_data( 'Name' ),
|
147 |
+
'manage_options',
|
148 |
+
plugin_basename(__FILE__),
|
149 |
+
array( $this, 'get_settings_page' )
|
150 |
+
);
|
151 |
+
} else {
|
152 |
+
add_options_page(
|
153 |
+
parent :: get_plugin_data( 'Name' ) . ' ' . __( 'Settings', $this -> get_textdomain() ),
|
154 |
+
parent :: get_plugin_data( 'Name' ),
|
155 |
+
'manage_options',
|
156 |
+
plugin_basename(__FILE__),
|
157 |
+
array( $this, 'get_settings_page' )
|
158 |
+
);
|
159 |
+
add_action( 'contextual_help', array( $this, 'contextual_help' ), 10, 3 );
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Return form and markup on settings page
|
165 |
+
*
|
166 |
+
* @uses settings_fields, normalize_whitespace, is_plugin_active_for_network, get_site_option, get_option
|
167 |
+
* @access public
|
168 |
+
* @since 0.0.2
|
169 |
+
* @return void
|
170 |
+
*/
|
171 |
+
public function get_settings_page() {
|
172 |
+
|
173 |
+
?>
|
174 |
+
<div class="wrap">
|
175 |
+
<?php screen_icon('options-general'); ?>
|
176 |
+
<h2><?php echo parent :: get_plugin_data( 'Name' ); ?></h2>
|
177 |
+
|
178 |
+
<h3><?php _e('Add or delete Quicktag buttons', $this -> get_textdomain() ); ?></h3>
|
179 |
+
<?php
|
180 |
+
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) )
|
181 |
+
$action = 'edit.php?action=' . $this -> option_string;
|
182 |
+
else
|
183 |
+
$action = 'options.php';
|
184 |
+
?>
|
185 |
+
<form method="post" action="<?php echo $action; ?>">
|
186 |
+
<?php
|
187 |
+
settings_fields( $this -> option_string . '_group' );
|
188 |
+
|
189 |
+
if ( is_multisite() && is_plugin_active_for_network( $this -> plugin ) )
|
190 |
+
$options = get_site_option( $this -> option_string );
|
191 |
+
else
|
192 |
+
$options = get_option( $this -> option_string );
|
193 |
+
|
194 |
+
if ( ! $options )
|
195 |
+
$options['buttons'] = array();
|
196 |
+
|
197 |
+
if ( 1 < count($options['buttons']) ) {
|
198 |
+
// sort array by order value
|
199 |
+
$tmp = array();
|
200 |
+
foreach( $options['buttons'] as $order ) {
|
201 |
+
if ( isset( $order['order'] ) )
|
202 |
+
$tmp[] = $order['order'];
|
203 |
+
else
|
204 |
+
$tmp[] = 0;
|
205 |
+
}
|
206 |
+
array_multisort( $tmp, SORT_ASC, $options['buttons'] );
|
207 |
+
}
|
208 |
+
?>
|
209 |
+
|
210 |
+
<table class="widefat">
|
211 |
+
<tr>
|
212 |
+
<th class="row-title"><?php _e('Button Label*', $this -> get_textdomain() ); ?></th>
|
213 |
+
<th class="row-title"><?php _e('Title Attribute', $this -> get_textdomain() ); ?></th>
|
214 |
+
<th class="row-title"><?php _e('Start Tag(s)*', $this -> get_textdomain() ); ?></th>
|
215 |
+
<th class="row-title"><?php _e('End Tag(s)', $this -> get_textdomain() ); ?></th>
|
216 |
+
<th class="row-title" style="width:5%;"><?php _e('Access Key', $this -> get_textdomain() ); ?></th>
|
217 |
+
<th class="row-title" style="width:5%;"><?php _e('Order', $this -> get_textdomain() ); ?></th>
|
218 |
+
<th class="row-title" style="width:5%;"><?php _e('Visual', $this -> get_textdomain() ); ?></th>
|
219 |
+
</tr>
|
220 |
+
<?php
|
221 |
+
if ( empty($options['buttons']) )
|
222 |
+
$options['buttons'] = array();
|
223 |
+
$class = '';
|
224 |
+
for ( $i = 0; $i < count( $options['buttons'] ); $i++ ) {
|
225 |
+
$class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
|
226 |
+
$b = $options['buttons'][$i];
|
227 |
+
$b['text'] = htmlentities( stripslashes($b['text']), ENT_COMPAT, get_option('blog_charset') );
|
228 |
+
$b['title'] = htmlentities( stripslashes($b['title']), ENT_COMPAT, get_option('blog_charset') );
|
229 |
+
$b['start'] = htmlentities( $b['start'], ENT_COMPAT, get_option('blog_charset') );
|
230 |
+
$b['end'] = htmlentities( $b['end'], ENT_COMPAT, get_option('blog_charset') );
|
231 |
+
if ( ! isset( $b['access'] ) )
|
232 |
+
$b['access'] = '';
|
233 |
+
$b['access'] = htmlentities( $b['access'], ENT_COMPAT, get_option('blog_charset') );
|
234 |
+
if ( ! isset( $b['order'] ) )
|
235 |
+
$b['order'] = 0;
|
236 |
+
$b['order'] = intval( $b['order'] );
|
237 |
+
if ( ! isset( $b['visual'] ) )
|
238 |
+
$b['visual'] = 0;
|
239 |
+
$b['visual'] = intval( $b['visual'] );
|
240 |
+
if ( 1 == $b['visual'] )
|
241 |
+
$checked = ' checked="checked"';
|
242 |
+
else
|
243 |
+
$checked = '';
|
244 |
+
$nr = $i + 1;
|
245 |
+
echo '
|
246 |
+
<tr>
|
247 |
+
<td><input type="text" name="' . $this -> option_string . '[buttons][' . $i
|
248 |
+
. '][text]" value="' . $b['text'] . '" style="width: 95%;" /></td>
|
249 |
+
<td><input type="text" name="' . $this -> option_string . '[buttons][' . $i . '][title]" value="'
|
250 |
+
. $b['title'] . '" style="width: 95%;" /></td>
|
251 |
+
<td><textarea class="code" name="' . $this -> option_string . '[buttons][' . $i
|
252 |
+
. '][start]" rows="2" cols="25" style="width: 95%;">' . $b['start'] . '</textarea></td>
|
253 |
+
<td><textarea class="code" name="' . $this -> option_string . '[buttons][' . $i
|
254 |
+
. '][end]" rows="2" cols="25" style="width: 95%;">' . $b['end'] . '</textarea></td>
|
255 |
+
<td><input type="text" name="' . $this -> option_string . '[buttons][' . $i
|
256 |
+
. '][access]" value="' . $b['access'] . '" style="width: 95%;" /></td>
|
257 |
+
<td><input type="text" name="' . $this -> option_string . '[buttons][' . $i
|
258 |
+
. '][order]" value="' . $b['order'] . '" style="width: 95%;" /></td>
|
259 |
+
<td><input type="checkbox" name="' . $this -> option_string . '[buttons][' . $i
|
260 |
+
. '][visual]" value="1"' . $checked . ' style="width: 95%;" /></td>
|
261 |
+
</tr>
|
262 |
+
';
|
263 |
+
}
|
264 |
+
?>
|
265 |
+
<tr>
|
266 |
+
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][text]" value="" style="width: 95%;" /></td>
|
267 |
+
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][title]" value="" style="width: 95%;" /></td>
|
268 |
+
<td><textarea class="code" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][start]" rows="2" cols="25" style="width: 95%;"></textarea></td>
|
269 |
+
<td><textarea class="code" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][end]" rows="2" cols="25" style="width: 95%;"></textarea></td>
|
270 |
+
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][access]" value="" class="code" style="width: 95%;" /></td>
|
271 |
+
<td><input type="text" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][order]" value="" style="width: 95%;" /></td>
|
272 |
+
<td><input type="checkbox" name="<?php echo $this -> option_string; ?>[buttons][<?php echo $i; ?>][visual]" value="1" style="width: 95%;" /></td>
|
273 |
+
</tr>
|
274 |
+
</table>
|
275 |
+
|
276 |
+
<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>
|
277 |
+
<p class="submit">
|
278 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
279 |
+
</p>
|
280 |
+
|
281 |
+
</form>
|
282 |
+
|
283 |
+
<div class="metabox-holder has-right-sidebar">
|
284 |
+
|
285 |
+
<div class="inner-sidebar">
|
286 |
+
<?php do_action( 'addquicktag_settings_page_sidebar' ); ?>
|
287 |
+
</div> <!-- .inner-sidebar -->
|
288 |
+
|
289 |
+
<div id="post-body">
|
290 |
+
<div id="post-body-content">
|
291 |
+
<?php do_action( 'addquicktag_settings_page' ); ?>
|
292 |
+
</div> <!-- #post-body-content -->
|
293 |
+
</div> <!-- #post-body -->
|
294 |
+
|
295 |
+
</div> <!-- .metabox-holder -->
|
296 |
+
|
297 |
+
</div>
|
298 |
+
<?php
|
299 |
+
}
|
300 |
+
|
301 |
+
/*
|
302 |
+
* Return informations to donate
|
303 |
+
*
|
304 |
+
* @uses _e,esc_attr_e
|
305 |
+
* @access public
|
306 |
+
* @since 2.0.0
|
307 |
+
* @return void
|
308 |
+
*/
|
309 |
+
public function get_plugin_infos() {
|
310 |
+
?>
|
311 |
+
<div class="postbox">
|
312 |
+
|
313 |
+
<h3><span><?php _e( 'Like this plugin?', $this -> get_textdomain() ); ?></span></h3>
|
314 |
+
<div class="inside">
|
315 |
+
<p><?php _e( 'Here\'s how you can give back:', $this -> get_textdomain() ); ?></p>
|
316 |
+
<ul>
|
317 |
+
<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>
|
318 |
+
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&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>
|
319 |
+
<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>
|
320 |
+
</ul>
|
321 |
+
</div>
|
322 |
+
</div>
|
323 |
+
<?php
|
324 |
+
}
|
325 |
+
|
326 |
+
/*
|
327 |
+
* Return informations about the plugin
|
328 |
+
*
|
329 |
+
* @uses _e,esc_attr_e
|
330 |
+
* @access public
|
331 |
+
* @since 2.0.0
|
332 |
+
* @return void
|
333 |
+
*/
|
334 |
+
public function get_about_plugin() {
|
335 |
+
?>
|
336 |
+
<div class="postbox">
|
337 |
+
|
338 |
+
<h3><span><?php _e( 'About this plugin', $this -> get_textdomain() ); ?></span></h3>
|
339 |
+
<div class="inside">
|
340 |
+
<p>
|
341 |
+
<strong><?php _e( 'Version:', $this -> get_textdomain() ); ?></strong>
|
342 |
+
<?php echo parent :: get_plugin_data( 'Version' ); ?>
|
343 |
+
</p>
|
344 |
+
<p>
|
345 |
+
<strong><?php _e( 'Description:', $this -> get_textdomain() ); ?></strong>
|
346 |
+
<?php echo parent :: get_plugin_data( 'Description' ); ?>
|
347 |
+
</p>
|
348 |
+
</div>
|
349 |
+
</div>
|
350 |
+
<?php
|
351 |
+
}
|
352 |
+
|
353 |
+
/*
|
354 |
+
* Save network settings
|
355 |
+
*
|
356 |
+
* @uses update_site_option, wp_redirect, add_query_arg, network_admin_url
|
357 |
+
* @access public
|
358 |
+
* @since 2.0.0
|
359 |
+
* @return void
|
360 |
+
*/
|
361 |
+
public function save_network_settings_page() {
|
362 |
+
// validate options
|
363 |
+
$value = $this -> validate_settings( $_POST[$this -> option_string] );
|
364 |
+
// update options
|
365 |
+
update_site_option( $this -> option_string, $value );
|
366 |
+
// redirect to settings page in network
|
367 |
+
wp_redirect(
|
368 |
+
add_query_arg(
|
369 |
+
array('page' => 'addquicktag/inc/class-settings.php', 'updated' => 'true'),
|
370 |
+
network_admin_url( 'settings.php' )
|
371 |
+
)
|
372 |
+
);
|
373 |
+
exit();
|
374 |
+
}
|
375 |
+
|
376 |
+
/*
|
377 |
+
* Retrun string vor update message
|
378 |
+
*
|
379 |
+
* @uses
|
380 |
+
* @access public
|
381 |
+
* @since 2.0.0
|
382 |
+
* @return string $notice
|
383 |
+
*/
|
384 |
+
public function get_network_admin_notices() {
|
385 |
+
|
386 |
+
// if updated and the right page
|
387 |
+
if ( isset( $_GET['updated'] ) &&
|
388 |
+
'settings_page_addquicktag/inc/class-settings-network' === $GLOBALS['current_screen'] -> id
|
389 |
+
) {
|
390 |
+
$message = __( 'Options saved.', $this -> get_textdomain() );
|
391 |
+
$notice = '<div id="message" class="updated"><p>' .$message . '</p></div>';
|
392 |
+
echo $notice;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Validate settings for options
|
398 |
+
*
|
399 |
+
* @uses normalize_whitespace
|
400 |
+
* @access public
|
401 |
+
* @param array $value
|
402 |
+
* @since 2.0.0
|
403 |
+
* @return string $value
|
404 |
+
*/
|
405 |
+
public function validate_settings( $value ) {
|
406 |
+
|
407 |
+
$buttons = array();
|
408 |
+
for ( $i = 0; $i < count( $value['buttons']); $i++ ) {
|
409 |
+
$b = $value['buttons'][$i];
|
410 |
+
if ($b['text'] != '' && $b['start'] != '') {
|
411 |
+
$b['text'] = esc_html( $b['text'] );
|
412 |
+
$b['title'] = esc_html( $b['title'] );
|
413 |
+
$b['start'] = stripslashes( $b['start'] );
|
414 |
+
$b['end'] = stripslashes( $b['end'] );
|
415 |
+
if ( isset( $b['access'] ) )
|
416 |
+
$b['access'] = esc_html( $b['access'] );
|
417 |
+
if ( isset( $b['order'] ) )
|
418 |
+
$b['order'] = intval( $b['order'] );
|
419 |
+
if ( isset( $b['visual'] ) )
|
420 |
+
$b['visual'] = intval( $b['visual'] );
|
421 |
+
else
|
422 |
+
$b['visual'] = 0;
|
423 |
+
$buttons[] = $b;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
$value['buttons'] = $buttons;
|
427 |
+
|
428 |
+
return $value;
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Register settings for options
|
433 |
+
*
|
434 |
+
* @uses register_setting
|
435 |
+
* @access public
|
436 |
+
* @since 2.0.0
|
437 |
+
* @return void
|
438 |
+
*/
|
439 |
+
public function register_settings() {
|
440 |
+
|
441 |
+
register_setting( $this -> option_string . '_group', $this -> option_string, array( $this, 'validate_settings' ) );
|
442 |
+
}
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Unregister and delete settings; clean database
|
446 |
+
*
|
447 |
+
* @uses unregister_setting, delete_option
|
448 |
+
* @access public
|
449 |
+
* @since 0.0.2
|
450 |
+
* @return void
|
451 |
+
*/
|
452 |
+
public function unregister_settings() {
|
453 |
+
|
454 |
+
unregister_setting( $this -> option_string . '_group', $this -> option_string );
|
455 |
+
delete_option( $this -> option_string );
|
456 |
+
}
|
457 |
+
|
458 |
+
/**
|
459 |
+
* Add help text
|
460 |
+
*
|
461 |
+
* @uses normalize_whitespace
|
462 |
+
* @param string $contextual_help
|
463 |
+
* @param string $screen_id
|
464 |
+
* @param string $screen
|
465 |
+
* @since 2.0.0
|
466 |
+
* @return string $contextual_help
|
467 |
+
*/
|
468 |
+
public function contextual_help( $contextual_help, $screen_id, $screen ) {
|
469 |
+
|
470 |
+
if ( 'settings_page_' . $this -> option_string . '_group' !== $screen_id )
|
471 |
+
return $contextual_help;
|
472 |
+
|
473 |
+
$contextual_help =
|
474 |
+
'<p>' . __( '' ) . '</p>';
|
475 |
+
|
476 |
+
return normalize_whitespace( $contextual_help );
|
477 |
+
}
|
478 |
+
|
479 |
+
}
|
480 |
+
$add_quicktag_settings = Add_Quicktag_Settings :: get_object();
|
inc/tinymce/editor_plugin.dev.js
CHANGED
@@ -8,8 +8,18 @@
|
|
8 |
|
9 |
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
// Load plugin specific language pack
|
12 |
-
tinymce.PluginManager.requireLangPack('rmnlQuicktagSettings_tmce' );
|
13 |
|
14 |
/*
|
15 |
* @see http://www.tinymce.com/wiki.php/API3:class.tinymce.ui.ListBox
|
8 |
|
9 |
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
return;
|
11 |
+
|
12 |
+
// if not visual button
|
13 |
+
var visual = 0;
|
14 |
+
for ( i=0; i < addquicktag_tags.buttons.length; i++ ) {
|
15 |
+
if ( 0 != addquicktag_tags.buttons[i]['visual'] )
|
16 |
+
visual = addquicktag_tags.buttons[i]['visual'];
|
17 |
+
}
|
18 |
+
if ( 0 == visual )
|
19 |
+
return;
|
20 |
+
|
21 |
// Load plugin specific language pack
|
22 |
+
tinymce.PluginManager.requireLangPack( 'rmnlQuicktagSettings_tmce' );
|
23 |
|
24 |
/*
|
25 |
* @see http://www.tinymce.com/wiki.php/API3:class.tinymce.ui.ListBox
|
inc/tinymce/editor_plugin.js
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
* @package AddQuicktag Plugin
|
5 |
*/
|
6 |
|
7 |
-
(function(){if(typeof addquicktag_tags=="undefined")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"];var d=0;var e="";var f=b.createListBox("rmnlQuicktagSettings_tmce",{title:"Quicktags",onselect:function(a){var b=tinyMCE.activeEditor.selection.getContent();var d=true;switch(a){case"null":var 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==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)})()
|
4 |
* @package AddQuicktag Plugin
|
5 |
*/
|
6 |
|
7 |
+
(function(){if(typeof addquicktag_tags=="undefined")return;var a=0;for(i=0;i<addquicktag_tags.buttons.length;i++){if(0!=addquicktag_tags.buttons[i]["visual"])a=addquicktag_tags.buttons[i]["visual"]}if(0==a)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"];var d=0;var e="";var f=b.createListBox("rmnlQuicktagSettings_tmce",{title:"Quicktags",onselect:function(a){var b=tinyMCE.activeEditor.selection.getContent();var d=true;switch(a){case"null":var 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==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)})()
|
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 Qicktags erkannt'
|
4 |
+
});
|
5 |
|
js/add-quicktags.dev.js
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
/**
|
2 |
-
* AddQuicktag Script to add buttons to html-editor
|
3 |
-
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
-
*/
|
6 |
-
|
7 |
-
jQuery( document ).ready( function( $ ) {
|
8 |
-
|
9 |
-
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
-
return;
|
11 |
-
|
12 |
-
var tags = addquicktag_tags['buttons'];
|
13 |
-
|
14 |
-
if ( typeof tags !== 'undefined' ) {
|
15 |
-
|
16 |
-
for ( var i = 0; i < tags.length; i++ ) {
|
17 |
-
if ( typeof tags[i].title == 'undefined' ) tags[i].title = ' ';
|
18 |
-
if ( typeof tags[i].end == 'undefined' ) tags[i].end = '';
|
19 |
-
if ( typeof tags[i].access == 'undefined' ) tags[i].access = '';
|
20 |
-
|
21 |
-
edButtons[edButtons.length] = new edButton(
|
22 |
-
// id, display, tagStart, tagEnd, access_key, title
|
23 |
-
tags[i].text.toLowerCase(), tags[i].text, tags[i].start, tags[i].end, tags[i].access, tags[i].title
|
24 |
-
);
|
25 |
-
}
|
26 |
-
|
27 |
-
} // end if tags
|
28 |
-
|
29 |
-
});
|
1 |
+
/**
|
2 |
+
* AddQuicktag Script to add buttons to html-editor
|
3 |
+
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
+
*/
|
6 |
+
|
7 |
+
jQuery( document ).ready( function( $ ) {
|
8 |
+
|
9 |
+
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
+
return;
|
11 |
+
|
12 |
+
var tags = addquicktag_tags['buttons'];
|
13 |
+
|
14 |
+
if ( typeof tags !== 'undefined' ) {
|
15 |
+
|
16 |
+
for ( var i = 0; i < tags.length; i++ ) {
|
17 |
+
if ( typeof tags[i].title == 'undefined' ) tags[i].title = ' ';
|
18 |
+
if ( typeof tags[i].end == 'undefined' ) tags[i].end = '';
|
19 |
+
if ( typeof tags[i].access == 'undefined' ) tags[i].access = '';
|
20 |
+
|
21 |
+
edButtons[edButtons.length] = new edButton(
|
22 |
+
// id, display, tagStart, tagEnd, access_key, title
|
23 |
+
tags[i].text.toLowerCase(), tags[i].text, tags[i].start, tags[i].end, tags[i].access, tags[i].title
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
} // end if tags
|
28 |
+
|
29 |
+
});
|
js/add-quicktags.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
/**
|
2 |
-
* AddQuicktag Script to add buttons to html-editor
|
3 |
-
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
-
*/
|
6 |
-
|
7 |
-
jQuery(document).ready(function(a){if(typeof addquicktag_tags=="undefined")return;var b=addquicktag_tags["buttons"];if(typeof b!=="undefined"){for(var c=0;c<b.length;c++){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="";edButtons[edButtons.length]=new edButton(b[c].text.toLowerCase(),b[c].text,b[c].start,b[c].end,b[c].access,b[c].title)}}})
|
1 |
+
/**
|
2 |
+
* AddQuicktag Script to add buttons to html-editor
|
3 |
+
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
+
*/
|
6 |
+
|
7 |
+
jQuery(document).ready(function(a){if(typeof addquicktag_tags=="undefined")return;var b=addquicktag_tags["buttons"];if(typeof b!=="undefined"){for(var c=0;c<b.length;c++){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="";edButtons[edButtons.length]=new edButton(b[c].text.toLowerCase(),b[c].text,b[c].start,b[c].end,b[c].access,b[c].title)}}})
|
js/add-quicktags_32.dev.js
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
/**
|
2 |
-
* AddQuicktag Script to add buttons to html-editor for WordPress version smaller 3.3
|
3 |
-
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
-
*/
|
6 |
-
|
7 |
-
jQuery( document ).ready( function( $ ) {
|
8 |
-
|
9 |
-
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
-
return;
|
11 |
-
|
12 |
-
var tags = addquicktag_tags['buttons'];
|
13 |
-
var wpaqToolbar = document.getElementById("ed_toolbar");
|
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 = ' ';
|
21 |
-
if ( typeof tags[i].end == 'undefined' ) tags[i].end = '';
|
22 |
-
if ( typeof tags[i].access == 'undefined' ) tags[i].access = '';
|
23 |
-
|
24 |
-
wpaqNr = edButtons.length;
|
25 |
-
edButtons[wpaqNr] = new edButton(
|
26 |
-
// id, display, tagStart, tagEnd, access_key, title
|
27 |
-
tags[i].text.toLowerCase(), tags[i].text, tags[i].start, tags[i].end, tags[i].access, tags[i].title
|
28 |
-
);
|
29 |
-
wpaqBut = wpaqToolbar.lastChild;
|
30 |
-
while ( wpaqBut.nodeType != 1 ) {
|
31 |
-
wpaqBut = wpaqBut.previousSibling;
|
32 |
-
}
|
33 |
-
wpaqBut = wpaqBut.cloneNode( true );
|
34 |
-
wpaqBut.id = 'ed_' + wpaqNr;
|
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 |
-
|
42 |
-
} // end if tags
|
43 |
-
|
44 |
-
});
|
1 |
+
/**
|
2 |
+
* AddQuicktag Script to add buttons to html-editor for WordPress version smaller 3.3
|
3 |
+
* @since 2.0.0
|
4 |
* @package AddQuicktag Plugin
|
5 |
+
*/
|
6 |
+
|
7 |
+
jQuery( document ).ready( function( $ ) {
|
8 |
+
|
9 |
+
if ( typeof addquicktag_tags == 'undefined' )
|
10 |
+
return;
|
11 |
+
|
12 |
+
var tags = addquicktag_tags['buttons'];
|
13 |
+
var wpaqToolbar = document.getElementById("ed_toolbar");
|
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 = ' ';
|
21 |
+
if ( typeof tags[i].end == 'undefined' ) tags[i].end = '';
|
22 |
+
if ( typeof tags[i].access == 'undefined' ) tags[i].access = '';
|
23 |
+
|
24 |
+
wpaqNr = edButtons.length;
|
25 |
+
edButtons[wpaqNr] = new edButton(
|
26 |
+
// id, display, tagStart, tagEnd, access_key, title
|
27 |
+
tags[i].text.toLowerCase(), tags[i].text, tags[i].start, tags[i].end, tags[i].access, tags[i].title
|
28 |
+
);
|
29 |
+
wpaqBut = wpaqToolbar.lastChild;
|
30 |
+
while ( wpaqBut.nodeType != 1 ) {
|
31 |
+
wpaqBut = wpaqBut.previousSibling;
|
32 |
+
}
|
33 |
+
wpaqBut = wpaqBut.cloneNode( true );
|
34 |
+
wpaqBut.id = 'ed_' + wpaqNr;
|
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 |
+
|
42 |
+
} // end if tags
|
43 |
+
|
44 |
+
});
|
js/add-quicktags_32.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
/**
|
2 |
-
* AddQuicktag Script to add buttons to html-editor for WordPress version smaller 3.3
|
3 |
-
* @since 2.0.0
|
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)}}})
|
1 |
+
/**
|
2 |
+
* AddQuicktag Script to add buttons to html-editor for WordPress version smaller 3.3
|
3 |
+
* @since 2.0.0
|
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)}}})
|
languages/addquicktag-fr_FR.mo
CHANGED
Binary file
|
languages/addquicktag-fr_FR.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: AddQuicktag v1.5.7\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: \n"
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Li-An <lian00@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -19,28 +19,49 @@ msgstr ""
|
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
|
21 |
# @ addquicktag
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
msgstr "AddQuicktag"
|
26 |
|
27 |
# @ addquicktag
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
msgstr "http://bueltge.de/wp-addquicktags-de-plugin/120/"
|
32 |
|
33 |
# @ addquicktag
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
msgstr "Frank Bültge"
|
38 |
|
39 |
# @ addquicktag
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
#: inc/class-settings.php:110
|
46 |
#: inc/class-settings.php:127
|
@@ -55,163 +76,91 @@ msgid "Add or delete Quicktag buttons"
|
|
55 |
msgstr "Ajouter ou supprimer des boutons Quicktag"
|
56 |
|
57 |
# @ addquicktag
|
58 |
-
#: inc/class-settings.php:
|
59 |
msgid "Button Label*"
|
60 |
msgstr "Label du bouton*"
|
61 |
|
62 |
# @ addquicktag
|
63 |
-
#: inc/class-settings.php:
|
64 |
msgid "Title Attribute"
|
65 |
msgstr "Attribut de titre"
|
66 |
|
67 |
# @ addquicktag
|
68 |
-
#: inc/class-settings.php:
|
69 |
msgid "Start Tag(s)*"
|
70 |
msgstr "Début du/des tag(s)*"
|
71 |
|
72 |
# @ addquicktag
|
73 |
-
#: inc/class-settings.php:
|
74 |
msgid "End Tag(s)"
|
75 |
msgstr "Fin du(des) tag(s)"
|
76 |
|
77 |
# @ addquicktag
|
78 |
-
#: inc/class-settings.php:
|
79 |
msgid "Access Key"
|
80 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
# @ addquicktag
|
83 |
-
#: inc/class-settings.php:
|
|
|
|
|
|
|
|
|
|
|
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 "Remplissez les champs ci-dessous ou éditez les quicktags. Les champs marqués d'un * sont obligatoires. Pour effacer un tag, videz simplement tous les champs."
|
86 |
|
87 |
# @ default
|
88 |
-
#: inc/class-settings.php:
|
89 |
msgid "Save Changes"
|
90 |
msgstr "Sauvegarder les modifications"
|
91 |
|
92 |
# @ addquicktag
|
93 |
-
#: inc/class-settings.php:
|
94 |
msgid "Like this plugin?"
|
95 |
msgstr "Vous aimez ce plugin ?"
|
96 |
|
97 |
-
# @ addquicktag
|
98 |
-
#: inc/class-settings.php:312
|
99 |
-
msgid "Here's how you can give back:"
|
100 |
-
msgstr "Über folgende Möglichkeiten kannst du etwas zurück geben:"
|
101 |
-
|
102 |
# @ addquicktag
|
103 |
#: inc/class-settings.php:314
|
104 |
-
msgid "
|
105 |
-
msgstr "
|
106 |
|
107 |
# @ addquicktag
|
108 |
-
#: inc/class-settings.php:
|
109 |
msgid "Give the plugin a good rating."
|
110 |
-
msgstr "
|
111 |
-
|
112 |
-
# @ addquicktag
|
113 |
-
#: inc/class-settings.php:315
|
114 |
-
msgid "Donate via PayPal"
|
115 |
-
msgstr "Spende via Paypal"
|
116 |
|
117 |
# @ addquicktag
|
118 |
-
#: inc/class-settings.php:
|
119 |
msgid "Donate a few euros."
|
120 |
-
msgstr "
|
121 |
-
|
122 |
-
# @ addquicktag
|
123 |
-
#: inc/class-settings.php:316
|
124 |
-
msgid "Frank Bültge's Amazon Wish List"
|
125 |
-
msgstr "Frank Bültge's Amazon Wunschliste"
|
126 |
|
127 |
# @ addquicktag
|
128 |
-
#: inc/class-settings.php:
|
129 |
msgid "Get me something from my wish list."
|
130 |
-
msgstr "
|
131 |
|
132 |
# @ addquicktag
|
133 |
-
#: inc/class-settings.php:
|
134 |
msgid "About this plugin"
|
135 |
msgstr "À propos de ce plugin"
|
136 |
|
137 |
-
#: inc/class-settings.php:
|
138 |
msgid "Version:"
|
139 |
msgstr "Version:"
|
140 |
|
141 |
# @ addquicktag
|
142 |
-
#: inc/class-settings.php:
|
143 |
msgid "Description:"
|
144 |
-
msgstr "
|
145 |
-
|
146 |
-
# @ addquicktag
|
147 |
-
#: inc/class-settings.php:214
|
148 |
-
msgid "Order"
|
149 |
-
msgstr "Reihenfolge"
|
150 |
-
|
151 |
-
# @ addquicktag
|
152 |
-
#: inc/class-settings.php:215
|
153 |
-
msgid "Visual"
|
154 |
-
msgstr "Visuell"
|
155 |
-
|
156 |
-
# @ addquicktag
|
157 |
-
#. translators: plugin header field 'Description'
|
158 |
-
#: addquicktag.php:0
|
159 |
-
msgid "Allows you to easily add custom Quicktags to the html- and visual-editor."
|
160 |
-
msgstr "Erlaubt das einfache Hinzufügen von Quicktags zum html- und visuellen Editor."
|
161 |
-
|
162 |
-
# @ addquicktag
|
163 |
-
#. translators: plugin header field 'Version'
|
164 |
-
#: addquicktag.php:0
|
165 |
-
msgid "2.0.0"
|
166 |
-
msgstr "2.0.0"
|
167 |
-
|
168 |
-
# @ addquicktag
|
169 |
-
#: inc/class-imexport.php:64
|
170 |
-
msgid "Export"
|
171 |
-
msgstr "Exporter"
|
172 |
-
|
173 |
-
# @ addquicktag
|
174 |
-
#: inc/class-imexport.php:66
|
175 |
-
msgid "When you click the button below the plugin will create an XML file for you to save to your computer."
|
176 |
-
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."
|
177 |
-
|
178 |
-
# @ addquicktag
|
179 |
-
#: inc/class-imexport.php:67
|
180 |
-
msgid "This format, a custom XML, will contain your options from quicktags."
|
181 |
-
msgstr "Dieses Format, ein benutzerdefniertes XML, beinhaltet Einstellungen der Quicktags."
|
182 |
-
|
183 |
-
# @ addquicktag
|
184 |
-
#: inc/class-imexport.php:68
|
185 |
-
msgid "Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site."
|
186 |
-
msgstr "Nachdem die heruntergeladene Datei gespeichert wurde, kannst du die Import-Funktion in einer anderen WordPress Installation nutzen."
|
187 |
-
|
188 |
-
# @ addquicktag
|
189 |
-
#: inc/class-imexport.php:72
|
190 |
-
msgid "Download Export File"
|
191 |
-
msgstr "Export-Datei herunterladen"
|
192 |
-
|
193 |
-
# @ addquicktag
|
194 |
-
#: inc/class-imexport.php:80
|
195 |
-
msgid "Import"
|
196 |
-
msgstr "Importer"
|
197 |
-
|
198 |
-
# @ addquicktag
|
199 |
-
#: inc/class-imexport.php:82
|
200 |
-
msgid "If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import."
|
201 |
-
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."
|
202 |
-
|
203 |
-
# @ addquicktag
|
204 |
-
#: inc/class-imexport.php:87
|
205 |
-
msgid "Upload file and import"
|
206 |
-
msgstr "Uploader et importer fichier"
|
207 |
-
|
208 |
-
# @ secure_wp
|
209 |
-
#: inc/class-imexport.php:178
|
210 |
-
msgid "Options not update - you don‘t have the privilidges to do this!"
|
211 |
-
msgstr "Options pas mises à jour - vous n'avez pas les droits pour réaliser cette action !"
|
212 |
|
213 |
# @ addquicktag
|
214 |
-
#: inc/class-settings.php:
|
215 |
msgid "Options saved."
|
216 |
msgstr "Options sauvegardées."
|
217 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: AddQuicktag v1.5.7\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-06-28 10:02+0100\n"
|
6 |
+
"PO-Revision-Date: 2012-06-28 10:08+0100\n"
|
7 |
"Last-Translator: Li-An <lian00@gmail.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
|
21 |
# @ addquicktag
|
22 |
+
#: inc/class-imexport.php:64
|
23 |
+
msgid "Export"
|
24 |
+
msgstr "Exporter"
|
|
|
25 |
|
26 |
# @ addquicktag
|
27 |
+
#: inc/class-imexport.php:66
|
28 |
+
msgid "When you click the button below the plugin will create an XML file for you to save to your computer."
|
29 |
+
msgstr "Quand vous cliquez sur le bouton ci-dessous, le plugin va créer un fichier XML à sauvegarder sur votre ordinateur."
|
|
|
30 |
|
31 |
# @ addquicktag
|
32 |
+
#: inc/class-imexport.php:67
|
33 |
+
msgid "This format, a custom XML, will contain your options from quicktags."
|
34 |
+
msgstr "Ce format, un XML personnalisé, contiendra vos options de quicktags."
|
|
|
35 |
|
36 |
# @ addquicktag
|
37 |
+
#: inc/class-imexport.php:68
|
38 |
+
msgid "Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site."
|
39 |
+
msgstr "Une fois le fichier téléchargé, vous pouvez utiliser la fonction d'importation dans une autre installation Wordpress pour importer ces réglages."
|
40 |
+
|
41 |
+
# @ addquicktag
|
42 |
+
#: inc/class-imexport.php:72
|
43 |
+
msgid "Download Export File"
|
44 |
+
msgstr "Télécharger le fichier d'exportation"
|
45 |
+
|
46 |
+
# @ addquicktag
|
47 |
+
#: inc/class-imexport.php:80
|
48 |
+
msgid "Import"
|
49 |
+
msgstr "Importer"
|
50 |
+
|
51 |
+
# @ addquicktag
|
52 |
+
#: inc/class-imexport.php:82
|
53 |
+
msgid "If you have quicktags from other installs, the plugin can import those into this site. To get started, choose a file to import."
|
54 |
+
msgstr "Si vous avez des quicktags d'autres installations, le plugin peut les importer dans ce site. Pour commencer, veuillez choisir un fichier à importer."
|
55 |
+
|
56 |
+
# @ addquicktag
|
57 |
+
#: inc/class-imexport.php:87
|
58 |
+
msgid "Upload file and import"
|
59 |
+
msgstr "Uploader et importer fichier"
|
60 |
+
|
61 |
+
# @ secure_wp
|
62 |
+
#: inc/class-imexport.php:178
|
63 |
+
msgid "Options not update - you don‘t have the privilidges to do this!"
|
64 |
+
msgstr "Options pas mises à jour - vous n'avez pas les droits pour réaliser cette action !"
|
65 |
|
66 |
#: inc/class-settings.php:110
|
67 |
#: inc/class-settings.php:127
|
76 |
msgstr "Ajouter ou supprimer des boutons Quicktag"
|
77 |
|
78 |
# @ addquicktag
|
79 |
+
#: inc/class-settings.php:211
|
80 |
msgid "Button Label*"
|
81 |
msgstr "Label du bouton*"
|
82 |
|
83 |
# @ addquicktag
|
84 |
+
#: inc/class-settings.php:212
|
85 |
msgid "Title Attribute"
|
86 |
msgstr "Attribut de titre"
|
87 |
|
88 |
# @ addquicktag
|
89 |
+
#: inc/class-settings.php:213
|
90 |
msgid "Start Tag(s)*"
|
91 |
msgstr "Début du/des tag(s)*"
|
92 |
|
93 |
# @ addquicktag
|
94 |
+
#: inc/class-settings.php:214
|
95 |
msgid "End Tag(s)"
|
96 |
msgstr "Fin du(des) tag(s)"
|
97 |
|
98 |
# @ addquicktag
|
99 |
+
#: inc/class-settings.php:215
|
100 |
msgid "Access Key"
|
101 |
+
msgstr "Clef d'accès"
|
102 |
+
|
103 |
+
# @ addquicktag
|
104 |
+
#: inc/class-settings.php:216
|
105 |
+
msgid "Order"
|
106 |
+
msgstr "Ordre"
|
107 |
|
108 |
# @ addquicktag
|
109 |
+
#: inc/class-settings.php:217
|
110 |
+
msgid "Visual"
|
111 |
+
msgstr "Visuel"
|
112 |
+
|
113 |
+
# @ addquicktag
|
114 |
+
#: inc/class-settings.php:275
|
115 |
msgid "Fill in the fields below to add or edit the quicktags. Fields with * are required. To delete a tag simply empty all fields."
|
116 |
msgstr "Remplissez les champs ci-dessous ou éditez les quicktags. Les champs marqués d'un * sont obligatoires. Pour effacer un tag, videz simplement tous les champs."
|
117 |
|
118 |
# @ default
|
119 |
+
#: inc/class-settings.php:277
|
120 |
msgid "Save Changes"
|
121 |
msgstr "Sauvegarder les modifications"
|
122 |
|
123 |
# @ addquicktag
|
124 |
+
#: inc/class-settings.php:312
|
125 |
msgid "Like this plugin?"
|
126 |
msgstr "Vous aimez ce plugin ?"
|
127 |
|
|
|
|
|
|
|
|
|
|
|
128 |
# @ addquicktag
|
129 |
#: inc/class-settings.php:314
|
130 |
+
msgid "Here's how you can give back:"
|
131 |
+
msgstr "Voici comment le soutenir:"
|
132 |
|
133 |
# @ addquicktag
|
134 |
+
#: inc/class-settings.php:316
|
135 |
msgid "Give the plugin a good rating."
|
136 |
+
msgstr "Donner au plugin une bonne note."
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
# @ addquicktag
|
139 |
+
#: inc/class-settings.php:317
|
140 |
msgid "Donate a few euros."
|
141 |
+
msgstr "Donner quelques euros."
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
# @ addquicktag
|
144 |
+
#: inc/class-settings.php:318
|
145 |
msgid "Get me something from my wish list."
|
146 |
+
msgstr "Offrez moi quelque chose de ma liste d'envies."
|
147 |
|
148 |
# @ addquicktag
|
149 |
+
#: inc/class-settings.php:337
|
150 |
msgid "About this plugin"
|
151 |
msgstr "À propos de ce plugin"
|
152 |
|
153 |
+
#: inc/class-settings.php:340
|
154 |
msgid "Version:"
|
155 |
msgstr "Version:"
|
156 |
|
157 |
# @ addquicktag
|
158 |
+
#: inc/class-settings.php:344
|
159 |
msgid "Description:"
|
160 |
+
msgstr "Description:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
# @ addquicktag
|
163 |
+
#: inc/class-settings.php:389
|
164 |
msgid "Options saved."
|
165 |
msgstr "Options sauvegardées."
|
166 |
|
readme.txt
CHANGED
@@ -1,111 +1,138 @@
|
|
1 |
-
=== AddQuicktag ===
|
2 |
-
Contributors: Bueltge
|
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.
|
7 |
-
Stable tag: 2.0
|
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.
|
15 |
-
|
16 |
-
The plugin add the quicktag on default to post types `post` and `
|
17 |
-
|
18 |
-
// add custom function to filter hook 'addquicktag_post_types'
|
19 |
-
add_filter( 'addquicktag_post_types', 'my_addquicktag_post_types' );
|
20 |
-
/**
|
21 |
-
* Return array $post_types with custom post types
|
22 |
-
*
|
23 |
-
* @param $post_type Array
|
24 |
-
* @return $post_type Array
|
25 |
-
*/
|
26 |
-
function my_addquicktag_post_types( $post_types ) {
|
27 |
-
|
28 |
-
$post_types[] = '
|
29 |
-
|
30 |
-
return $post_types;
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
*
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
*
|
103 |
-
*
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
*
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== AddQuicktag ===
|
2 |
+
Contributors: Bueltge
|
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.5-Alpha
|
7 |
+
Stable tag: 2.1.0
|
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.
|
15 |
+
|
16 |
+
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).
|
17 |
+
|
18 |
+
// add custom function to filter hook 'addquicktag_post_types'
|
19 |
+
add_filter( 'addquicktag_post_types', 'my_addquicktag_post_types' );
|
20 |
+
/**
|
21 |
+
* Return array $post_types with custom post types
|
22 |
+
*
|
23 |
+
* @param $post_type Array
|
24 |
+
* @return $post_type Array
|
25 |
+
*/
|
26 |
+
function my_addquicktag_post_types( $post_types ) {
|
27 |
+
|
28 |
+
$post_types[] = 'edit-comments';
|
29 |
+
|
30 |
+
return $post_types;
|
31 |
+
}
|
32 |
+
|
33 |
+
Also it is possible to filter the pages inside the backend. On default was the scripts include the pages `post.php`, `comment.php`. The follow example change this for an another page.
|
34 |
+
|
35 |
+
add_filter( 'addquicktag_pages', 'my_addquicktag_pages' );
|
36 |
+
/**
|
37 |
+
* Return array $page with custom page strings
|
38 |
+
*
|
39 |
+
* @param $page Array
|
40 |
+
* @return $page Array
|
41 |
+
*/
|
42 |
+
function my_addquicktag_pages( $page ) {
|
43 |
+
|
44 |
+
$page[] = 'edit-comments.php';
|
45 |
+
|
46 |
+
return $page;
|
47 |
+
}
|
48 |
+
|
49 |
+
See this Gist als example for add the Quicktags to the editor of comments: [Gist: 3076698](https://gist.github.com/3076698).
|
50 |
+
If you need the functionality, that the Quicktags of this plugin works on the Quickedit of comments as well, remove the `.example`-part of `addquicktag_quickedit_comment.php.example` filename. The file is a stand alone helper plugin for Add Quicktag and you'll need to activate this file (plugin) separately in 'Manage Plugins'.
|
51 |
+
|
52 |
+
= Bugs, technical hints or contribute =
|
53 |
+
Please give me feedback, contribute and file technical bugs on [GitHub Repo](https://github.com/bueltge/AddQuicktag).
|
54 |
+
|
55 |
+
= More Plugins =
|
56 |
+
Please see also my [Premium Plugins](http://wpplugins.com/author/malo.conny/). Maybe you find an solution for your requirement.
|
57 |
+
|
58 |
+
= Interested in WordPress tips and tricks =
|
59 |
+
You may also be interested in WordPress tips and tricks at [WP Engineer](http://wpengineer.com/) or for german people [bueltge.de](http://bueltge.de/)
|
60 |
+
|
61 |
+
|
62 |
+
== Installation ==
|
63 |
+
= Requirements =
|
64 |
+
* WordPress version 3.0 and later (tested at 3.5-Alpha (nightly build))
|
65 |
+
|
66 |
+
= Installation =
|
67 |
+
1. Unpack the download-package
|
68 |
+
1. Upload the files to the `/wp-content/plugins/` directory
|
69 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress or for the Network, if you will use in Multisite for all Sites
|
70 |
+
1. Got to 'Settings' menu and configure the plugin
|
71 |
+
|
72 |
+
**Version before WordPress smaller 3.0**
|
73 |
+
|
74 |
+
If you will use this plugin with an older version of WordPress, please use an older version of this plugin, smaller version 2.0.0 - you find it in the [repo](http://wordpress.org/extend/plugins/addquicktag/download/). But i will not support this version. The version 2.0.0 and higher was rewrite with all new posibilties of the WordPress Core.
|
75 |
+
|
76 |
+
|
77 |
+
== Screenshots ==
|
78 |
+
1. Settings area in WordPress 3.3
|
79 |
+
2. Settings area in WordPress Network of an Multisite install 3.3
|
80 |
+
3. HTML Editor with new Quicktags
|
81 |
+
4. Visual editor with new Quicktags
|
82 |
+
|
83 |
+
|
84 |
+
== Other Notes ==
|
85 |
+
= Acknowledgements =
|
86 |
+
**Thanks to**
|
87 |
+
|
88 |
+
* German Translation by [myself](http://bueltge.de) ;)
|
89 |
+
* French translation by [Jean-Michel MEYER](http://www.li-an.fr/blog)
|
90 |
+
* Japanese translation by [Yuuichi](http://www.u-1.net/2011/12/29/2498/)
|
91 |
+
|
92 |
+
= Licence =
|
93 |
+
Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me and leave a [small donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6069955 "Paypal Donate link") for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)
|
94 |
+
|
95 |
+
= Translations =
|
96 |
+
The plugin comes with various translations, please refer to the [WordPress Codex](http://codex.wordpress.org/Installing_WordPress_in_Your_Language "Installing WordPress in Your Language") for more information about activating the translation. If you want to help to translate the plugin to your language, please have a look at the .pot file which contains all defintions and may be used with a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) (Windows) or the plugin [Localization](http://wordpress.org/extend/plugins/codestyling-localization/) for WordPress.
|
97 |
+
|
98 |
+
|
99 |
+
== Changelog ==
|
100 |
+
= 2.1.0 =
|
101 |
+
* Add fix, see [Forum thread 'array_multisort error'](http://wordpress.org/support/topic/plugin-addquicktag-array_multisort-error#post-2920394)
|
102 |
+
* See Quicktag button in visual editor, onbly if an button is actove for visual
|
103 |
+
* Change hooks for include scripts
|
104 |
+
* Add filter for page in backend
|
105 |
+
* Add edit comments to use quicktags
|
106 |
+
|
107 |
+
= 2.0.4 =
|
108 |
+
* Add fix for use older settings from previous versions
|
109 |
+
* Unicode fix for upload XML file
|
110 |
+
|
111 |
+
= 2.0.3 =
|
112 |
+
* Add Filter 'addquicktag_post_types' for use the plugin also on custom post types
|
113 |
+
* Update readme and add an example for this filter; also an Gist for use faster
|
114 |
+
|
115 |
+
= 2.0.2 =
|
116 |
+
* change hook for include styles and scriptes for compatibility in WP 3.4
|
117 |
+
|
118 |
+
= 2.0.1 =
|
119 |
+
* Bugfix on JS for WP smaller 3.3; use quickbuttons clean on html-editor with core-buttons
|
120 |
+
|
121 |
+
= 2.0.0 =
|
122 |
+
* complete redesign, new code from the first line
|
123 |
+
* add function for add quicktags on html and visual editor
|
124 |
+
* works also on Multisite Network
|
125 |
+
* new settings page
|
126 |
+
* add fallback in JS to use this new version also in WordPress smaller 3.3
|
127 |
+
|
128 |
+
= v1.6.5 (02/02/2011) =
|
129 |
+
* changes for admin-hints
|
130 |
+
* kill php warnings on debug-mode
|
131 |
+
|
132 |
+
= v1.6.4 (12/22/2010) =
|
133 |
+
* small changes for depreaced WP functions
|
134 |
+
|
135 |
+
= v1.6.3 (16/06/2009) =
|
136 |
+
* Add belarussian language file, thanks to Fat Cow
|
137 |
+
|
138 |
+
Please see the older changes on version on the [the official website](http://bueltge.de/wp-addquicktags-de-plugin/120/#historie "AddQuicktag")!
|