PluginProbe
jQuery UI Widgets / trunk
jQuery UI Widgets vtrunk
trunk 0.2 0.21 0.22 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.4 0.42 0.43 0.50 0.60
jquery-ui-widgets / jquery-ui-widgets.php

jquery-ui-widgets.php in jQuery UI Widgets trunk, at jquery-ui-widgets.php

692 lines 42.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: jQuery UI Widgets
4 Plugin URI: http://wordpress.org/plugins/jquery-ui-widgets/
5 Description: Simple, clean, and flexible way to add jQuery UI widgets to your site pages.
6 Version: 0.60
7 Author: David Gwyer
8 Author URI: http://www.wpgoplugins.com
9 License: GPLv2
10 */
11
12 /* Copyright 2009 David Gwyer (email : david@wpgoplugins.com)
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 */
28
29 // Note: jquiw_ prefix is derived from [jq]uery [ui] [w]idgets
30 define( "JQUIW_PLUGIN_URL", WP_PLUGIN_URL . '/' . plugin_basename( dirname( __FILE__ ) ) );
31
32 // --------------------
33 // -- PLUGIN HOOKS --
34 // --------------------
35
36 add_action( 'wp_head', 'jquiw_initialize_scripts' );
37 add_action( 'wp_enqueue_scripts', 'jquiw_enqueue_scripts' );
38 register_activation_hook( __FILE__, 'jquiw_add_defaults' );
39 register_uninstall_hook( __FILE__, 'jquiw_delete_plugin_options' );
40 add_action( 'admin_init', 'jquiw_init' );
41 add_action( 'plugins_loaded', 'jquiw_localize_plugin' );
42 add_action( 'admin_menu', 'jquiw_add_options_page' );
43 add_filter( 'plugin_row_meta', 'jquiw_plugin_action_links', 10, 2 );
44 add_filter( 'plugin_action_links', 'jquiw_plugin_settings_link', 10, 2 );
45 add_action( 'admin_notices', 'jquiw_admin_notice' );
46 register_activation_hook( __FILE__, 'jquiw_admin_notice_set_transient' );
47
48 /* Runs only when the plugin is activated. */
49 function jquiw_admin_notice_set_transient() {
50
51 /* Create transient data */
52 set_transient( 'jquiw-admin-notice', true, 5 );
53 }
54
55 /* Admin Notice on Activation. */
56 function jquiw_admin_notice(){
57
58 /* Check transient, if available display notice */
59 if( get_transient( 'jquiw-admin-notice' ) ){
60 ?>
61 <div class="updated notice is-dismissible">
62 <p><a href="https://wpgoplugins.com/plugins/jquery-ui-widgets-pro/" target="_blank"><strong>jQuery UI Widgets PRO</strong></a> is now available! Access great new features. <b>Try risk free today with our 100% money back guarantee! <span class="dashicons dashicons-smiley"></span></b></p>
63 </div>
64 <?php
65 /* Delete transient, only display this notice once. */
66 delete_transient( 'jquiw-admin-notice' );
67 }
68 }
69 // --------------------------------------
70 // -- DEFINE DEFAULT OPTION SETTINGS --
71 // --------------------------------------
72
73 function jquiw_add_defaults() {
74
75 $tmp = get_option( 'jquiw_options' );
76
77 // The 'base' theme doesn't exist anymore so change to new default theme.
78 if ( $tmp['drp_jquery_theme'] == 'base' ) {
79 $tmp['drp_jquery_theme'] = 'smoothness';
80 update_option( 'jquiw_options', $tmp );
81 }
82
83 if ( ( ( isset( $tmp['chk_default_options_db'] ) && $tmp['chk_default_options_db'] == '1' ) ) || ( ! is_array( $tmp ) ) ) {
84 delete_option( 'jquiw_options' );
85 $arr = array( "txt_custom_theme_path" => "",
86 "txtar_override_css" => ".ui-widget {\r\nfont-family: inherit;\r\nfont-size: inherit;\r\n}",
87 "drp_jquery_theme" => "smoothness",
88 "chk_inc_accordion" => "1",
89 "chk_inc_autocomplete" => "1",
90 "chk_inc_button" => "1",
91 "chk_inc_uicore" => "1",
92 "chk_inc_datepicker" => "1",
93 "chk_inc_dialog" => "1",
94 "chk_inc_draggable" => "1",
95 "chk_inc_droppable" => "1",
96 "chk_inc_menu" => "1",
97 "chk_inc_selectmenu" => "1",
98 "chk_inc_mouse" => "1",
99 "chk_inc_position" => "1",
100 "chk_inc_progressbar" => "1",
101 "chk_inc_resizable" => "1",
102 "chk_inc_selectable" => "1",
103 "chk_inc_slider" => "1",
104 "chk_inc_spinner" => "1",
105 "chk_inc_sortable" => "1",
106 "chk_inc_tabs" => "1",
107 "chk_inc_tooltip" => "1",
108 "chk_inc_widget" => "1",
109 "chk_inc_blind" => "1",
110 "chk_inc_bounce" => "1",
111 "chk_inc_clip" => "1",
112 "chk_inc_coreeffects" => "1",
113 "chk_inc_drop" => "1",
114 "chk_inc_explode" => "1",
115 "chk_inc_fade" => "1",
116 "chk_inc_fold" => "1",
117 "chk_inc_highlight" => "1",
118 "chk_inc_pulsate" => "1",
119 "chk_inc_scale" => "1",
120 "chk_inc_shake" => "1",
121 "chk_inc_slide" => "1",
122 "chk_inc_transfer" => "1",
123 "txtar_jquery_code" => "",
124 "txt_custom_theme" => "",
125 "chk_default_options_db" => ""
126 );
127 update_option( 'jquiw_options', $arr );
128 }
129 }
130
131 // ------------------------------------------------
132 // -- ADD INITIALIZATION SCRIPTS TO THE HEADER --
133 // ------------------------------------------------
134
135 function jquiw_initialize_scripts() {
136
137 $options = get_option( 'jquiw_options' );
138
139 /* If jQuery code text box not empty then add to header. */
140 if ( ! empty( $options['txtar_jquery_code'] ) ) {
141 echo "<script type=\"text/javascript\">\r\n";
142 echo $options['txtar_jquery_code'] . "\r\n";
143 echo "</script>\r\n";
144 }
145
146 /* If custom CSS text box not empty then add to header. */
147 if ( ! empty( $options['txtar_override_css'] ) ) {
148 echo "<style type=\"text/css\">\r\n";
149 echo $options['txtar_override_css'];
150 echo "\r\n</style>\r\n";
151 }
152 }
153
154 // ---------------------------------------------------------
155 // -- REGISTER THE BLOG SCRIPTS AND PLUGIN SETTINGS API --
156 // ---------------------------------------------------------
157
158 function jquiw_init() {
159
160 /* Make sure we always have a theme selected. */
161 $tmp = get_option( 'jquiw_options' );
162 if ( ! isset( $tmp['drp_jquery_theme'] ) ) {
163 $tmp["drp_jquery_theme"] = 'smoothness';
164 update_option( 'jquiw_options', $tmp );
165 }
166 register_setting( 'jquiw_plugin_options', 'jquiw_options' );
167 }
168
169 // --------------------------------------------------
170 // -- ENQUEUE SCRIPTS ON FRONT FACING PAGES ONLY --
171 // --------------------------------------------------
172
173 function jquiw_enqueue_scripts() {
174
175 $options = get_option( 'jquiw_options' );
176 $jquery_theme = empty( $options['drp_jquery_theme'] ) ? 'smoothness' : $options['drp_jquery_theme'];
177 $jquery_css_base = '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/' . $jquery_theme . '/jquery-ui.css';
178
179 /* Register jQuery scripts if selected in Plugin options. */
180 if ( isset( $options['chk_inc_accordion'] ) && $options['chk_inc_accordion'] ) {
181 wp_enqueue_script( 'jquery-ui-accordion' );
182 }
183 if ( isset( $options['chk_inc_autocomplete'] ) && $options['chk_inc_autocomplete'] ) {
184 wp_enqueue_script( 'jquery-ui-autocomplete' );
185 }
186 if ( isset( $options['chk_inc_button'] ) && $options['chk_inc_button'] ) {
187 wp_enqueue_script( 'jquery-ui-button' );
188 }
189 if ( isset( $options['chk_inc_uicore'] ) && $options['chk_inc_uicore'] ) {
190 wp_enqueue_script( 'jquery-ui-core' );
191 }
192 if ( isset( $options['chk_inc_datepicker'] ) && $options['chk_inc_datepicker'] ) {
193 wp_enqueue_script( 'jquery-ui-datepicker' );
194 }
195 if ( isset( $options['chk_inc_dialog'] ) && $options['chk_inc_dialog'] ) {
196 wp_enqueue_script( 'jquery-ui-dialog' );
197 }
198 if ( isset( $options['chk_inc_draggable'] ) && $options['chk_inc_draggable'] ) {
199 wp_enqueue_script( 'jquery-ui-draggable' );
200 }
201 if ( isset( $options['chk_inc_droppable'] ) && $options['chk_inc_droppable'] ) {
202 wp_enqueue_script( 'jquery-ui-droppable' );
203 }
204 if ( isset( $options['chk_inc_menu'] ) && $options['chk_inc_menu'] ) {
205 wp_enqueue_script( 'jquery-ui-menu' );
206 }
207 if ( isset( $options['chk_inc_selectmenu'] ) && $options['chk_inc_selectmenu'] ) {
208 wp_enqueue_script( 'jquery-ui-selectmenu' );
209 }
210 if ( isset( $options['chk_inc_mouse'] ) && $options['chk_inc_mouse'] ) {
211 wp_enqueue_script( 'jquery-ui-mouse' );
212 }
213 if ( isset( $options['chk_inc_position'] ) && $options['chk_inc_position'] ) {
214 wp_enqueue_script( 'jquery-ui-position' );
215 }
216 if ( isset( $options['chk_inc_progressbar'] ) && $options['chk_inc_progressbar'] ) {
217 wp_enqueue_script( 'jquery-ui-progressbar' );
218 }
219 if ( isset( $options['chk_inc_resizable'] ) && $options['chk_inc_resizable'] ) {
220 wp_enqueue_script( 'jquery-ui-resizable' );
221 }
222 if ( isset( $options['chk_inc_selectable'] ) && $options['chk_inc_selectable'] ) {
223 wp_enqueue_script( 'jquery-ui-selectable' );
224 }
225 if ( isset( $options['chk_inc_slider'] ) && $options['chk_inc_slider'] ) {
226 wp_enqueue_script( 'jquery-ui-slider' );
227 }
228 if ( isset( $options['chk_inc_spinner'] ) && $options['chk_inc_spinner'] ) {
229 wp_enqueue_script( 'jquery-ui-spinner' );
230 }
231 if ( isset( $options['chk_inc_sortable'] ) && $options['chk_inc_sortable'] ) {
232 wp_enqueue_script( 'jquery-ui-sortable' );
233 }
234 if ( isset( $options['chk_inc_tabs'] ) && $options['chk_inc_tabs'] ) {
235 wp_enqueue_script( 'jquery-ui-tabs' );
236 }
237 if ( isset( $options['chk_inc_tooltip'] ) && $options['chk_inc_tooltip'] ) {
238 wp_enqueue_script( 'jquery-ui-tooltip' );
239 }
240 if ( isset( $options['chk_inc_widget'] ) && $options['chk_inc_widget'] ) {
241 wp_enqueue_script( 'jquery-ui-widget' );
242 }
243 if ( isset( $options['chk_inc_blind'] ) && $options['chk_inc_blind'] ) {
244 wp_enqueue_script( 'jquery-effects-blind' );
245 }
246 if ( isset( $options['chk_inc_bounce'] ) && $options['chk_inc_bounce'] ) {
247 wp_enqueue_script( 'jquery-effects-bounce' );
248 }
249 if ( isset( $options['chk_inc_clip'] ) && $options['chk_inc_clip'] ) {
250 wp_enqueue_script( 'jquery-effects-clip' );
251 }
252 if ( isset( $options['chk_inc_coreeffects'] ) && $options['chk_inc_coreeffects'] ) {
253 wp_enqueue_script( 'jquery-effects-core' );
254 }
255 if ( isset( $options['chk_inc_drop'] ) && $options['chk_inc_drop'] ) {
256 wp_enqueue_script( 'jquery-effects-drop' );
257 }
258 if ( isset( $options['chk_inc_explode'] ) && $options['chk_inc_explode'] ) {
259 wp_enqueue_script( 'jquery-effects-explode' );
260 }
261 if ( isset( $options['chk_inc_fade'] ) && $options['chk_inc_fade'] ) {
262 wp_enqueue_script( 'jquery-effects-fade' );
263 }
264 if ( isset( $options['chk_inc_fold'] ) && $options['chk_inc_fold'] ) {
265 wp_enqueue_script( 'jquery-effects-fold' );
266 }
267 if ( isset( $options['chk_inc_highlight'] ) && $options['chk_inc_highlight'] ) {
268 wp_enqueue_script( 'jquery-effects-highlight' );
269 }
270 if ( isset( $options['chk_inc_pulsate'] ) && $options['chk_inc_pulsate'] ) {
271 wp_enqueue_script( 'jquery-effects-pulsate' );
272 }
273 if ( isset( $options['chk_inc_scale'] ) && $options['chk_inc_scale'] ) {
274 wp_enqueue_script( 'jquery-effects-scale' );
275 }
276 if ( isset( $options['chk_inc_shake'] ) && $options['chk_inc_shake'] ) {
277 wp_enqueue_script( 'jquery-effects-shake' );
278 }
279 if ( isset( $options['chk_inc_slide'] ) && $options['chk_inc_slide'] ) {
280 wp_enqueue_script( 'jquery-effects-slide' );
281 }
282 if ( isset( $options['chk_inc_transfer'] ) && $options['chk_inc_transfer'] ) {
283 wp_enqueue_script( 'jquery-effects-transfer' );
284 }
285
286 /* Register style sheet. */
287 if ( empty( $options['txt_custom_theme'] ) ) {
288 wp_enqueue_style( 'jquery-ui-standard-css', $jquery_css_base );
289 } else {
290 /* Enqueue custom theme rolled styles. */
291 $upload_dir = wp_upload_dir();
292 $relative_path = trim( $options['txt_custom_theme'], "/" );
293 $full_path_url = trailingslashit( $upload_dir['baseurl'] ) . $relative_path;
294 $full_path_dir = trailingslashit( $upload_dir['basedir'] ) . $relative_path;
295 if ( file_exists( $full_path_dir ) ) {
296 wp_enqueue_style( 'jquery-ui-custom-css', $full_path_url );
297 } else {
298 wp_enqueue_style( 'jquery-ui-standard-css', $jquery_css_base );
299 }
300 }
301 }
302
303 // ---------------------
304 // -- ADD MENU PAGE --
305 // ---------------------
306
307 function jquiw_add_options_page() {
308
309 global $jquiw_page;
310
311 $jquiw_page = add_options_page( 'jQuery UI Widgets Options Page', 'jQuery UI Widgets', 'manage_options', __FILE__, 'jquiw_render_form' );
312 }
313
314 // -----------------------------------------------------------------------------
315 // -- DELETE OPTIONS TABLE ENTRIES ONLY WHEN PLUGIN DEACTIVATED AND DELETED --
316 // -----------------------------------------------------------------------------
317
318 function jquiw_delete_plugin_options() {
319 delete_option( 'jquiw_options' );
320 }
321
322 // --------------------------------------
323 // -- RENDER THE PLUGIN OPTIONS PAGE --
324 // --------------------------------------
325
326 function jquiw_render_form() {
327 ?>
328 <style>
329 a:focus{ box-shadow: none;}
330 .pcdm.dashicons { width: 32px; height: 32px; font-size: 32px; }
331 .pcdm.dashicons-yes { color: #1cc31c; }
332 .pcdm.dashicons-no { color: red; }
333 </style>
334 <div class="wrap">
335 <div style="display:flex;justify-content: space-between;">
336 <h2 style="font-size: 23px;"><?php _e( 'jQuery UI Widgets Options', 'jquery-ui-widgets' ); ?></h2>
337 <div><a target="_blank" title="We love to develop WordPress plugins!" alt="WPGO Plugins Site" href="https://wpgoplugins.com/"><img src="<?php echo plugins_url(); ?>/wp-content-filter/images/wpgo_plugins_logo.png"></a></div>
338 </div>
339
340 <form method="post" action="options.php">
341 <?php settings_fields( 'jquiw_plugin_options' ); ?>
342 <?php $options = get_option( 'jquiw_options' ); ?>
343 <style type="text/css">
344 .info_image {
345 position: relative;
346 top: 3px;
347 left: 2px;
348 width: 14px;
349 height: 14px;
350 }
351 </style>
352
353 <table class="form-table">
354 <tr valign="top">
355 <th scope="row">Like the plugin?</th>
356 <td colspan="3">
357 <p>Then why not upgrade to Pro and access powerful additional features. Try risk free today with our <span style="font-weight: bold;">100% money back guarantee!</span></p>
358 <div style="margin-top:10px;"><input class="button" type="button" value="Upgrade to Pro" onClick="window.open('https://wpgoplugins.com/plugins/jquery-ui-widgets-pro/')"></div>
359 </td>
360 </tr>
361
362 <tr valign="top">
363 <th scope="row">Read all about it!</th>
364 <td colspan="3">
365 <p>Signup to our plugin newsletter for news and updates about our latest work, and what's coming.</p>
366 <div style="margin-top:10px;"><input class="button" type="button" value="Subscribe here..." onClick="window.open('http://eepurl.com/bXZmmD')"></div>
367 </td>
368 </tr>
369
370 <tr valign="top">
371 <th scope="row">Buy me a coffee?</th>
372 <td colspan="3">
373 <p>If you use this FREE Plugin on your website <b><em>please</em></b> consider making a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FHPU3ZABJAX5U" target="_blank">donation</a> to support continued development. Thank you.<span style="margin-left:5px;" class="dashicons dashicons-smiley"></span></p>
374 </td>
375 </tr>
376
377 <tr valign="top">
378 <th scope="row">Keep in touch...</th>
379 <td colspan="3">
380 <div>
381 <span><a href="http://www.twitter.com/dgwyer" title="Follow us on Twitter" target="_blank"><img src="<?php echo plugins_url(); ?>/wp-content-filter/images/twitter.png" /></a></span>
382 <span><a href="https://www.facebook.com/wpgoplugins/" title="Our Facebook page" target="_blank"><img src="<?php echo plugins_url(); ?>/wp-content-filter/images/facebook.png" /></a></span>
383 <span><a href="https://www.youtube.com/channel/UCWzjTLWoyMgtIfpDgJavrTg" title="View our YouTube channel" target="_blank"><img src="<?php echo plugins_url(); ?>/wp-content-filter/images/yt.png" /></a></span>
384 <span><a style="text-decoration:none;" title="Need help with ANY aspect of WordPress? We're here to help!" href="https://wpgoplugins.com/need-help-with-wordpress/" target="_blank"><span style="margin-left:-2px;color:#d41515;font-size:39px;line-height:32px;width:39px;height:39px;" class="dashicons dashicons-sos"></span></a></span>
385 </div>
386 </td>
387 </tr>
388
389 <tr valign="top"><td colspan="2"><hr></td></tr>
390
391 <tr valign="top">
392 <th scope="row"><?php _e( 'Custom jQuery Code', 'jquery-ui-widgets' ); ?></th>
393 <td colspan="3">
394 <?php $res_jquery = jquiw_get_textarea_rows( $options['txtar_jquery_code'], $min = 5, $max = 30 ); ?>
395 <textarea placeholder="e.g. jQuery(document).ready(function($) { // Add jQuery code here... });" class="widefat" style="font-family: Lucida Console;" name="jquiw_options[txtar_jquery_code]" rows="<?php echo $res_jquery['rows']; ?>" type='textarea'><?php if ( isset( $options['txtar_jquery_code'] ) ) {
396 echo $options['txtar_jquery_code'];
397 } ?></textarea><br>
398
399 <p style="margin:5px 0 0 0;">
400 <?php
401 printf( __('Add custom jQuery code above, e.g. %1$s and it will be added automatically to your site. %2$sDon\'t forget to add your jQuery inside the proper wrapper.%3$s', 'jquery-ui-widgets'),
402 '<code>$( "#accordion" ).accordion();</code>',
403 '<b>',
404 '</b>'
405 );
406 ?>
407 </p>
408 </td>
409 </tr>
410 <tr valign="top">
411 <th scope="row"><?php _e( 'Use These jQuery UI Scripts', 'jquery-ui-widgets' ); ?></th>
412 <td width="200">
413 <label><input name="jquiw_options[chk_inc_accordion]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_accordion'] ) ) {
414 checked( '1', $options['chk_inc_accordion'] );
415 } ?>> <?php _e( 'Accordion', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/accordion/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
416 <label><input name="jquiw_options[chk_inc_autocomplete]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_autocomplete'] ) ) {
417 checked( '1', $options['chk_inc_autocomplete'] );
418 } ?>> <?php _e( 'Autocomplete', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/autocomplete/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
419 <label><input name="jquiw_options[chk_inc_button]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_button'] ) ) {
420 checked( '1', $options['chk_inc_button'] );
421 } ?>> <?php _e( 'Button', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/button/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
422 <label><input name="jquiw_options[chk_inc_uicore]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_uicore'] ) ) {
423 checked( '1', $options['chk_inc_uicore'] );
424 } ?>> <?php _e( 'UI Core', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/category/ui-core/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
425 <label><input name="jquiw_options[chk_inc_datepicker]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_datepicker'] ) ) {
426 checked( '1', $options['chk_inc_datepicker'] );
427 } ?>> <?php _e( 'Datepicker', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/datepicker/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
428 <label><input name="jquiw_options[chk_inc_dialog]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_dialog'] ) ) {
429 checked( '1', $options['chk_inc_dialog'] );
430 } ?>> <?php _e( 'Dialog', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/dialog/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
431 <label><input name="jquiw_options[chk_inc_draggable]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_draggable'] ) ) {
432 checked( '1', $options['chk_inc_draggable'] );
433 } ?>> <?php _e( 'Draggable', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/draggable/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
434 </td>
435 <td width="200">
436 <label><input name="jquiw_options[chk_inc_droppable]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_droppable'] ) ) {
437 checked( '1', $options['chk_inc_droppable'] );
438 } ?>> <?php _e( 'Droppable', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/droppable/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
439 <label><input name="jquiw_options[chk_inc_menu]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_menu'] ) ) {
440 checked( '1', $options['chk_inc_menu'] );
441 } ?>> <?php _e( 'Menu', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/menu/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
442 <label><input name="jquiw_options[chk_inc_mouse]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_mouse'] ) ) {
443 checked( '1', $options['chk_inc_mouse'] );
444 } ?>> <?php _e( 'Mouse', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/mouse/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
445 <label><input name="jquiw_options[chk_inc_position]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_position'] ) ) {
446 checked( '1', $options['chk_inc_position'] );
447 } ?>> <?php _e( 'Position', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/position/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
448 <label><input name="jquiw_options[chk_inc_progressbar]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_progressbar'] ) ) {
449 checked( '1', $options['chk_inc_progressbar'] );
450 } ?>> <?php _e( 'Progress Bar', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/progressbar/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
451 <label><input name="jquiw_options[chk_inc_resizable]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_resizable'] ) ) {
452 checked( '1', $options['chk_inc_resizable'] );
453 } ?>> <?php _e( 'Resizable', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/resizable/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
454 <label><input name="jquiw_options[chk_inc_selectable]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_selectable'] ) ) {
455 checked( '1', $options['chk_inc_selectable'] );
456 } ?>> <?php _e( 'Selectable', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/selectable/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
457 </td>
458 <td>
459 <label><input name="jquiw_options[chk_inc_selectmenu]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_selectmenu'] ) ) {
460 checked( '1', $options['chk_inc_selectmenu'] );
461 } ?>> <?php _e( 'Selectmenu', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/selectmenu/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
462 <label><input name="jquiw_options[chk_inc_slider]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_slider'] ) ) {
463 checked( '1', $options['chk_inc_slider'] );
464 } ?>> <?php _e( 'Slider', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/slider/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
465 <label><input name="jquiw_options[chk_inc_spinner]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_spinner'] ) ) {
466 checked( '1', $options['chk_inc_spinner'] );
467 } ?>> <?php _e( 'Spinner', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/spinner/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
468 <label><input name="jquiw_options[chk_inc_sortable]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_sortable'] ) ) {
469 checked( '1', $options['chk_inc_sortable'] );
470 } ?>> <?php _e( 'Sortable', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/sortable/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
471 <label><input name="jquiw_options[chk_inc_tabs]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_tabs'] ) ) {
472 checked( '1', $options['chk_inc_tabs'] );
473 } ?>> <?php _e( 'Tabs', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/tabs/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
474 <label><input name="jquiw_options[chk_inc_tooltip]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_tooltip'] ) ) {
475 checked( '1', $options['chk_inc_tooltip'] );
476 } ?>> <?php _e( 'Tooltip', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/tooltip/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
477 <label><input name="jquiw_options[chk_inc_widget]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_widget'] ) ) {
478 checked( '1', $options['chk_inc_widget'] );
479 } ?>> <?php _e( 'Widget Factory', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/jQuery.widget/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
480 </td>
481 </tr>
482 <tr valign="top">
483 <th scope="row">&nbsp;</th>
484 <td colspan="3"><?php _e( 'Note: Scripts such as UI Core, Mouse, Position etc. are included by default with other widget scripts.', 'jquery-ui-widgets' ); ?></td>
485 </tr>
486 <tr valign="top">
487 <th scope="row"><?php _e( 'Use These jQuery Effect Scripts', 'jquery-ui-widgets' ); ?></th>
488 <td width="200">
489 <label><input name="jquiw_options[chk_inc_blind]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_blind'] ) ) {
490 checked( '1', $options['chk_inc_blind'] );
491 } ?>> <?php _e( 'Blind', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/blind-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
492 <label><input name="jquiw_options[chk_inc_bounce]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_bounce'] ) ) {
493 checked( '1', $options['chk_inc_bounce'] );
494 } ?>> <?php _e( 'Bounce', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/bounce-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
495 <label><input name="jquiw_options[chk_inc_clip]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_clip'] ) ) {
496 checked( '1', $options['chk_inc_clip'] );
497 } ?>> <?php _e( 'Clip', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/clip-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
498 <label><input name="jquiw_options[chk_inc_coreeffects]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_coreeffects'] ) ) {
499 checked( '1', $options['chk_inc_coreeffects'] );
500 } ?>> <?php _e( 'Core Effects', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/category/effects-core/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
501 <label><input name="jquiw_options[chk_inc_drop]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_drop'] ) ) {
502 checked( '1', $options['chk_inc_drop'] );
503 } ?>> <?php _e( 'Drop', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/drop-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
504 </td>
505 <td width="200">
506 <label><input name="jquiw_options[chk_inc_explode]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_explode'] ) ) {
507 checked( '1', $options['chk_inc_explode'] );
508 } ?>> <?php _e( 'Explode', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/explode-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
509 <label><input name="jquiw_options[chk_inc_fade]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_fade'] ) ) {
510 checked( '1', $options['chk_inc_fade'] );
511 } ?>> <?php _e( 'Fade', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/fade-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
512 <label><input name="jquiw_options[chk_inc_fold]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_fold'] ) ) {
513 checked( '1', $options['chk_inc_fold'] );
514 } ?>> <?php _e( 'Fold', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/fold-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
515 <label><input name="jquiw_options[chk_inc_highlight]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_highlight'] ) ) {
516 checked( '1', $options['chk_inc_highlight'] );
517 } ?>> <?php _e( 'Highlight', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/highlight-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
518 <label><input name="jquiw_options[chk_inc_pulsate]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_pulsate'] ) ) {
519 checked( '1', $options['chk_inc_pulsate'] );
520 } ?>> <?php _e( 'Pulsate', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/pulsate-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
521 </td>
522 <td>
523 <label><input name="jquiw_options[chk_inc_scale]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_scale'] ) ) {
524 checked( '1', $options['chk_inc_scale'] );
525 } ?>> <?php _e( 'Scale', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/scale-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
526 <label><input name="jquiw_options[chk_inc_shake]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_shake'] ) ) {
527 checked( '1', $options['chk_inc_shake'] );
528 } ?>> <?php _e( 'Shake', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/shake-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
529 <label><input name="jquiw_options[chk_inc_slide]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_slide'] ) ) {
530 checked( '1', $options['chk_inc_slide'] );
531 } ?>> <?php _e( 'Slide', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/slide-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
532 <label><input name="jquiw_options[chk_inc_transfer]" type="checkbox" value="1" <?php if ( isset( $options['chk_inc_transfer'] ) ) {
533 checked( '1', $options['chk_inc_transfer'] );
534 } ?>> <?php _e( 'Transfer', 'jquery-ui-widgets' ); ?></label><a href="http://api.jqueryui.com/transfer-effect/" target="_blank"><img src="<?php echo plugins_url(); ?>/jquery-ui-widgets/images/info.png" class="info_image"></a><br>
535 </td>
536 </tr>
537 <tr valign="top">
538 <th scope="row">&nbsp;</th>
539 <td colspan="3"><?php _e( 'Note: The Core Effects script is included by default with other effect scripts.', 'jquery-ui-widgets' ); ?></td>
540 </tr>
541 <tr valign="top">
542 <th scope="row"><?php _e( 'Select jQuery UI Theme', 'jquery-ui-widgets' ); ?></th>
543 <td colspan="3">
544 <select name='jquiw_options[drp_jquery_theme]'>
545 <option value='black-tie' <?php selected( 'black-tie', $options['drp_jquery_theme'] ); ?>><?php _e( 'Black Tie', 'jquery-ui-widgets' ); ?></option>
546 <option value='blitzer' <?php selected( 'blitzer', $options['drp_jquery_theme'] ); ?>><?php _e( 'Blitzer', 'jquery-ui-widgets' ); ?></option>
547 <option value='cupertino' <?php selected( 'cupertino', $options['drp_jquery_theme'] ); ?>><?php _e( 'Cupertino', 'jquery-ui-widgets' ); ?></option>
548 <option value='dark-hive' <?php selected( 'dark-hive', $options['drp_jquery_theme'] ); ?>><?php _e( 'Dark Hive', 'jquery-ui-widgets' ); ?></option>
549 <option value='dot-luv' <?php selected( 'dot-luv', $options['drp_jquery_theme'] ); ?>><?php _e( 'Dot Luv', 'jquery-ui-widgets' ); ?></option>
550 <option value='eggplant' <?php selected( 'eggplant', $options['drp_jquery_theme'] ); ?>><?php _e( 'Eggplant', 'jquery-ui-widgets' ); ?></option>
551 <option value='excite-bike' <?php selected( 'excite-bike', $options['drp_jquery_theme'] ); ?>><?php _e( 'Excite Bike', 'jquery-ui-widgets' ); ?></option>
552 <option value='flick' <?php selected( 'flick', $options['drp_jquery_theme'] ); ?>><?php _e( 'Flick', 'jquery-ui-widgets' ); ?></option>
553 <option value='hot-sneaks' <?php selected( 'hot-sneaks', $options['drp_jquery_theme'] ); ?>><?php _e( 'Hot Sneaks', 'jquery-ui-widgets' ); ?></option>
554 <option value='humanity' <?php selected( 'humanity', $options['drp_jquery_theme'] ); ?>><?php _e( 'Humanity', 'jquery-ui-widgets' ); ?></option>
555 <option value='le-frog' <?php selected( 'le-frog', $options['drp_jquery_theme'] ); ?>><?php _e( 'Le Frog', 'jquery-ui-widgets' ); ?></option>
556 <option value='mint-choc' <?php selected( 'mint-choc', $options['drp_jquery_theme'] ); ?>><?php _e( 'Mint Choc', 'jquery-ui-widgets' ); ?></option>
557 <option value='overcast' <?php selected( 'overcast', $options['drp_jquery_theme'] ); ?>><?php _e( 'Overcast', 'jquery-ui-widgets' ); ?></option>
558 <option value='pepper-grinder' <?php selected( 'pepper-grinder', $options['drp_jquery_theme'] ); ?>><?php _e( 'Pepper Grinder', 'jquery-ui-widgets' ); ?></option>
559 <option value='redmond' <?php selected( 'redmond', $options['drp_jquery_theme'] ); ?>><?php _e( 'Redmond', 'jquery-ui-widgets' ); ?></option>
560 <option value='smoothness' <?php selected( 'smoothness', $options['drp_jquery_theme'] ); ?>><?php _e( 'Smoothness', 'jquery-ui-widgets' ); ?></option>
561 <option value='south-street' <?php selected( 'south-street', $options['drp_jquery_theme'] ); ?>><?php _e( 'South Street', 'jquery-ui-widgets' ); ?></option>
562 <option value='start' <?php selected( 'start', $options['drp_jquery_theme'] ); ?>><?php _e( 'Start', 'jquery-ui-widgets' ); ?></option>
563 <option value='sunny' <?php selected( 'sunny', $options['drp_jquery_theme'] ); ?>><?php _e( 'Sunny', 'jquery-ui-widgets' ); ?></option>
564 <option value='swanky-purse' <?php selected( 'swanky-purse', $options['drp_jquery_theme'] ); ?>><?php _e( 'Swanky Purse', 'jquery-ui-widgets' ); ?></option>
565 <option value='trontastic' <?php selected( 'trontastic', $options['drp_jquery_theme'] ); ?>><?php _e( 'Trontastic', 'jquery-ui-widgets' ); ?></option>
566 <option value='ui-darkness' <?php selected( 'ui-darkness', $options['drp_jquery_theme'] ); ?>><?php _e( 'UI Darkness', 'jquery-ui-widgets' ); ?></option>
567 <option value='ui-lightness' <?php selected( 'ui-lightness', $options['drp_jquery_theme'] ); ?>><?php _e( 'UI Lightness', 'jquery-ui-widgets' ); ?></option>
568 <option value='vader' <?php selected( 'vader', $options['drp_jquery_theme'] ); ?>><?php _e( 'Vader', 'jquery-ui-widgets' ); ?></option>
569 </select><br>
570 <?php _e( 'Choose a standard jQuery UI theme to render widgets. Preview these themes on the jQuery UI', 'jquery-ui-widgets' ); ?>
571 <a href="http://jqueryui.com/themeroller/#themeGallery" target="_blank"><?php _e( 'ThemeRoller page', 'jquery-ui-widgets' ); ?></a>.<br><br>
572 <input class="widefat" type="text" size="57" name="jquiw_options[txt_custom_theme]" value="<?php echo $options['txt_custom_theme']; ?>"><br>
573 <?php $upload_dir = wp_upload_dir(); ?>
574
575 <?php
576 printf( __('Create a %1$scustom theme%2$s to override the standard theme. Upload to %3$s%4$s%5$s and enter the path/name of the custom stylesheet above, relative to this folder. See the Plugin %6$sFAQ%7$s for detailed instructions on using custom themes.', 'jquery-ui-widgets'),
577 '<a href="http://jqueryui.com/themeroller/" target="_blank">',
578 '</a>',
579 '<code style="font-style:normal;">',
580 $upload_dir['baseurl'].'/',
581 '</code>',
582 '<a href="http://wordpress.org/extend/plugins/jquery-ui-widgets/faq/" target="_blank">',
583 '</a>'
584 );
585 ?>
586 <br>
587 <?php
588 /* Enqueue custom theme rolled styles. */
589 $upload_dir = wp_upload_dir();
590 $relative_path = trim( $options['txt_custom_theme'], "/" );
591 $full_path_url = trailingslashit( $upload_dir['baseurl'] ) . $relative_path;
592 $full_path_dir = trailingslashit( $upload_dir['basedir'] ) . $relative_path;
593 if ( ! file_exists( $full_path_dir ) ) {
594 printf( __('%1$Cannot find the file: %2$%3$%4$. Reverting to the standard theme. Please enter a valid custom stylesheet path.%5$', 'jquery-ui-widgets'),
595 '<div class="error inline">',
596 '<code style="background-color: #ffebe8;">',
597 $full_path_url,
598 '</code>',
599 '</div>'
600 );
601 }
602 ?>
603 </td>
604 </tr>
605 <tr valign="top">
606 <th scope="row"><?php _e( 'Override jQuery UI Theme Styles', 'jquery-ui-widgets' ); ?></th>
607 <td colspan="3">
608 <?php $res_css = jquiw_get_textarea_rows( $options['txtar_override_css'], $min = 5, $max = 20 ); ?>
609 <textarea class="widefat" style="font-family: Lucida Console;" name="jquiw_options[txtar_override_css]" rows="<?php echo $res_css['rows']; ?>" type='textarea'><?php echo $options['txtar_override_css']; ?></textarea><br><?php _e( 'Edit the custom CSS rules above to override the current jQuery UI theme (whether a standard or custom theme). This is a great place to tweak the theme styles.', 'jquery-ui-widgets' ); ?>
610 </td>
611 </tr>
612 <tr>
613 <td colspan="3">
614 <div style="margin-top:0;"></div>
615 </td>
616 </tr>
617 <tr valign="top" style="border-top:#dddddd 1px solid;">
618 <th scope="row"><?php _e( 'Database Options', 'jquery-ui-widgets' ); ?></th>
619 <td colspan="3">
620 <label><input name="jquiw_options[chk_default_options_db]" type="checkbox" value="1" <?php if ( isset( $options['chk_default_options_db'] ) ) {
621 checked( '1', $options['chk_default_options_db'] );
622 } ?>> <?php _e( 'Restore defaults upon Plugin deactivation/reactivation', 'jquery-ui-widgets' ); ?></label>
623 <br><span class="description"><?php _e( 'Only check this if you want to reset Plugin settings upon reactivation.', 'jquery-ui-widgets' ); ?></span>
624 </td>
625 </tr>
626 </table>
627 <p class="submit">
628 <input type="submit" class="button-primary" value="<?php _e( 'Save Changes', 'jquery-ui-widgets' ) ?>">
629 </p>
630 </form>
631
632 </div>
633 <?php
634 }
635
636 // --------------------------------------------------------
637 // -- DISPLAY A SETTINGS LINK ON THE MAIN PLUGINS PAGE --
638 // --------------------------------------------------------
639
640 function jquiw_plugin_action_links( $links, $file ) {
641
642 //if ( $file == plugin_basename( __FILE__ ) ) {
643 // add a link to pro plugin
644 //$links[] = '<a style="color:limegreen;" href="https://wpgoplugins.com/plugins/jquery-ui-widgets-pro/" target="_blank" title="Try out the Pro version today. Risk FREE - 100% money back guarantee!"><span class="dashicons dashicons-awards"></span></a>';
645 //}
646
647 return $links;
648 }
649
650 function jquiw_plugin_settings_link( $links, $file ) {
651
652 if ( $file == plugin_basename( __FILE__ ) ) {
653 $pccf_links = '<a href="' . get_admin_url() . 'options-general.php?page=jquery-ui-widgets/jquery-ui-widgets.php">' . __( 'Settings' ) . '</a>';
654 array_unshift( $links, $pccf_links );
655 }
656
657 if ( $file == plugin_basename( __FILE__ ) ) {
658 $pccf_links = '<a style="color:#d54e21;" href="https://wpgoplugins.com/plugins/jquery-ui-widgets-pro/" target="_blank" title="Go PRO - 100% money back guarantee"><span class="dashicons dashicons-megaphone"></span></a>';
659 array_push( $links, $pccf_links );
660 }
661
662 return $links;
663 }
664
665 // ------------------------------------------------------------------------------------
666 // -- CALCULATE NUMBER OF TEXTAREA ROWS, AND CLASS FOR WIDTH, DEPENDING ON CONTENT --
667 // ------------------------------------------------------------------------------------
668
669 function jquiw_get_textarea_rows( $content = null, $min = 3, $max = 25, $default_class = 'gray', $extra_class = 'gray-medium-textarea' ) {
670
671 $res = array(); // Initialize array
672 if ( empty( $content ) ) {
673 $res['rows'] = $min;
674 $res['class'] = $default_class;
675 } else {
676 $arr = explode( "\n", $content );
677 $rows = ( count( $arr ) < ( $min + 1 ) ) ? $min : count( $arr ); // Min of 3 lines.
678 $rows = ( count( $arr ) > $max ) ? $max : $rows; // Max of 25 lines.
679 $res['rows'] = $rows;
680 $res['class'] = $extra_class;
681 }
682
683 return $res;
684 }
685
686 /**
687 * Add Plugin localization support.
688 */
689 function jquiw_localize_plugin() {
690
691 load_plugin_textdomain( 'jquery-ui-widgets', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
692 }