FancyBox for WordPress - Version 3.1.7

Version Description

  • Fixed incompatibilty with Envira Gallery
  • Fixed incompatibilty with NextGen Gallery
Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin FancyBox for WordPress
Version 3.1.7
Comparing to
See all releases

Code changes from version 3.1.6 to 3.1.7

admin.php CHANGED
@@ -1,150 +1,150 @@
1
- <?php
2
-
3
- function mfbfw_options_page() {
4
- require_once( FBFW_PATH . 'lib/admin-head.php' );
5
-
6
- ?>
7
-
8
- <div class="wrap about-wrap fbfw-wrap">
9
- <div id="icon-plugins" class="icon32"></div>
10
- <div class="inlined">
11
- <div id="pluginDescription">
12
- <h1><?php printf( __( 'Fancybox for WordPress (version %s)', 'mfbfw' ), FBFW_VERSION ); ?></h1>
13
- <p class="about-text">Seamlessly integrates FancyBox into your blog: Upload, activate, and you’re done. Additional configuration optional.</p>
14
- </div>
15
- </div>
16
-
17
- <br/>
18
-
19
- <form method="post" action="options.php" id="options">
20
-
21
- <?php settings_fields( 'mfbfw-options' ); ?>
22
-
23
- <div id="fbfwTabs">
24
- <ul class="nav-tab-wrapper wp-clearfix">
25
- <li><a href="#fbfw-appearance"><?php _e( 'Appearance', 'mfbfw' ); ?></a></li>
26
- <li><a href="#fbfw-animations"><?php _e( 'Animations', 'mfbfw' ); ?></a></li>
27
- <li><a href="#fbfw-behaviour"><?php _e( 'Behaviour', 'mfbfw' ); ?></a></li>
28
- <li><a href="#fbfw-galleries"><?php _e( 'Galleries', 'mfbfw' ); ?></a></li>
29
- <li><a href="#fbfw-other"><?php _e( 'Misc.', 'mfbfw' ); ?></a></li>
30
- <li><a href="#fbfw-support" style="color:green;"><?php _e( 'Support', 'mfbfw' ); ?></a></li>
31
- </ul>
32
-
33
- <div id="fbfw-appearance">
34
- <?php require_once( FBFW_PATH . 'lib/admin-tab-appearance.php' ); ?>
35
- </div>
36
-
37
- <div id="fbfw-animations">
38
- <?php require_once( FBFW_PATH . 'lib/admin-tab-animations.php' ); ?>
39
- </div>
40
-
41
- <div id="fbfw-behaviour">
42
- <?php require_once( FBFW_PATH . 'lib/admin-tab-behaviour.php' ); ?>
43
- </div>
44
-
45
- <div id="fbfw-galleries">
46
- <?php require_once( FBFW_PATH . 'lib/admin-tab-galleries.php' ); ?>
47
- </div>
48
-
49
- <div id="fbfw-other">
50
- <?php require_once( FBFW_PATH . 'lib/admin-tab-other.php' ); ?>
51
- </div>
52
-
53
- <div id="fbfw-support">
54
- <?php require_once( FBFW_PATH . 'lib/admin-tab-support.php' ); ?>
55
- </div>
56
-
57
- </div>
58
-
59
- <p class="submit" style="text-align:center;">
60
- <input type="submit" name="mfbfw_update" class="button-primary"
61
- value="<?php esc_attr_e( 'Save Changes', 'mfbfw' ); ?>"/>
62
- </p>
63
-
64
- </form>
65
-
66
- <form method="post" action="">
67
- <div style="text-align:center;padding:0 0 1.5em;margin:-15px 0 5px;">
68
- <?php wp_nonce_field( 'mfbfw-options-reset' ); ?>
69
- <input type="submit" name="mfbfw_update" id="reset" onClick="return confirmDefaults();"
70
- class="button-secondary" value="<?php esc_attr_e( 'Revert to defaults', 'mfbfw' ); ?>"/>
71
- <input type="hidden" name="action" value="reset"/>
72
- </div>
73
-
74
- <div id="mfbfwd"
75
- style="border-top:1px dashed #DDDDDD;margin:20px 0 40px;overflow:hidden;padding-top:25px;width:100%;float:left;display:block !important;">
76
-
77
- Plugin developed and supported by <a href="https://colorlib.com">Colorlib</a>
78
-
79
- </div>
80
-
81
- </div>
82
-
83
- <div class="modula-wrap">
84
- <a target="_blank" href="http://wp-modula.com/?utm_source=fancybox-for-wp&utm_medium=options-page&utm_campaign=Modula%20Lite" class="modula-link">
85
- <img src="<?php echo FBFW_URL; ?>assets/images/modula-300x300.jpg"/>
86
- <h2>Easy Image Gallery for WP</h2>
87
- <p>Modula is creative! Modula is dynamic! Modula doesn’t always look the same. Just have fun with it! Modula uses a new concept to build its internal grid. The result is a dynamic, creative, interesting and attractive gallery.</p>
88
-
89
- <?php
90
-
91
- $plugin_slug = 'modula-best-grid-gallery';
92
- $plugin_path = 'modula-best-grid-gallery/Modula.php';
93
-
94
- $installed = false;
95
- $activated = false;
96
- if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_slug ) ) {
97
- $installed = true;
98
- }
99
-
100
- if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_path ) ) {
101
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
102
- if ( is_plugin_active( $plugin_path ) ) {
103
- $activated = true;
104
- }
105
- }
106
-
107
- if ( ! $activated ) {
108
-
109
- if ( ! $installed ) {
110
- $label = esc_html__( 'Install & Activate Modula', 'mfbfw' );
111
- $link = wp_nonce_url(
112
- add_query_arg(
113
- array(
114
- 'action' => 'install-plugin',
115
- 'plugin' => $plugin_slug,
116
- ),
117
- network_admin_url( 'update.php' )
118
- ),
119
- 'install-plugin_' . $plugin_slug
120
- );
121
- $action = 'install';
122
- }else{
123
- $label = esc_html__( 'Activate Modula', 'mfbfw' );
124
- $link = add_query_arg(
125
- array(
126
- 'action' => 'activate',
127
- 'plugin' => rawurlencode( $plugin_path ),
128
- 'plugin_status' => 'all',
129
- 'paged' => '1',
130
- '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_path ),
131
- ),
132
- admin_url( 'plugins.php' )
133
- );
134
- $action = 'activate';
135
- }
136
-
137
- echo '<a href="' . esc_url( $link ) . '" class="mfbfw-modula-link button button-primary button-large" data-action="' . esc_attr( $action ) . '">' . esc_html( $label ) . '</a>';
138
-
139
- }
140
-
141
- ?>
142
-
143
- </a>
144
- </div>
145
-
146
-
147
- <?php
148
- }
149
-
150
- ?>
1
+ <?php
2
+
3
+ function mfbfw_options_page() {
4
+ require_once( FBFW_PATH . 'lib/admin-head.php' );
5
+
6
+ ?>
7
+
8
+ <div class="wrap about-wrap fbfw-wrap">
9
+ <div id="icon-plugins" class="icon32"></div>
10
+ <div class="inlined">
11
+ <div id="pluginDescription">
12
+ <h1><?php printf( __( 'Fancybox for WordPress (version %s)', 'mfbfw' ), FBFW_VERSION ); ?></h1>
13
+ <p class="about-text">Seamlessly integrates FancyBox into your blog: Upload, activate, and you’re done. Additional configuration optional.</p>
14
+ </div>
15
+ </div>
16
+
17
+ <br/>
18
+
19
+ <form method="post" action="options.php" id="options">
20
+
21
+ <?php settings_fields( 'mfbfw-options' ); ?>
22
+
23
+ <div id="fbfwTabs">
24
+ <ul class="nav-tab-wrapper wp-clearfix">
25
+ <li><a href="#fbfw-appearance"><?php _e( 'Appearance', 'mfbfw' ); ?></a></li>
26
+ <li><a href="#fbfw-animations"><?php _e( 'Animations', 'mfbfw' ); ?></a></li>
27
+ <li><a href="#fbfw-behaviour"><?php _e( 'Behaviour', 'mfbfw' ); ?></a></li>
28
+ <li><a href="#fbfw-galleries"><?php _e( 'Galleries', 'mfbfw' ); ?></a></li>
29
+ <li><a href="#fbfw-other"><?php _e( 'Misc.', 'mfbfw' ); ?></a></li>
30
+ <li><a href="#fbfw-support" style="color:green;"><?php _e( 'Support', 'mfbfw' ); ?></a></li>
31
+ </ul>
32
+
33
+ <div id="fbfw-appearance">
34
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-appearance.php' ); ?>
35
+ </div>
36
+
37
+ <div id="fbfw-animations">
38
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-animations.php' ); ?>
39
+ </div>
40
+
41
+ <div id="fbfw-behaviour">
42
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-behaviour.php' ); ?>
43
+ </div>
44
+
45
+ <div id="fbfw-galleries">
46
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-galleries.php' ); ?>
47
+ </div>
48
+
49
+ <div id="fbfw-other">
50
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-other.php' ); ?>
51
+ </div>
52
+
53
+ <div id="fbfw-support">
54
+ <?php require_once( FBFW_PATH . 'lib/admin-tab-support.php' ); ?>
55
+ </div>
56
+
57
+ </div>
58
+
59
+ <p class="submit" style="text-align:center;">
60
+ <input type="submit" name="mfbfw_update" class="button-primary"
61
+ value="<?php esc_attr_e( 'Save Changes', 'mfbfw' ); ?>"/>
62
+ </p>
63
+
64
+ </form>
65
+
66
+ <form method="post" action="">
67
+ <div style="text-align:center;padding:0 0 1.5em;margin:-15px 0 5px;">
68
+ <?php wp_nonce_field( 'mfbfw-options-reset' ); ?>
69
+ <input type="submit" name="mfbfw_update" id="reset" onClick="return confirmDefaults();"
70
+ class="button-secondary" value="<?php esc_attr_e( 'Revert to defaults', 'mfbfw' ); ?>"/>
71
+ <input type="hidden" name="action" value="reset"/>
72
+ </div>
73
+
74
+ <div id="mfbfwd"
75
+ style="border-top:1px dashed #DDDDDD;margin:20px 0 40px;overflow:hidden;padding-top:25px;width:100%;float:left;display:block !important;">
76
+
77
+ Plugin developed and supported by <a href="https://colorlib.com">Colorlib</a>
78
+
79
+ </div>
80
+
81
+ </div>
82
+
83
+ <div class="modula-wrap">
84
+ <a target="_blank" href="http://wp-modula.com/?utm_source=fancybox-for-wp&utm_medium=options-page&utm_campaign=Modula%20Lite" class="modula-link">
85
+ <img src="<?php echo FBFW_URL; ?>assets/images/modula-300x300.jpg"/>
86
+ <h2>Easy Image Gallery for WP</h2>
87
+ <p>Modula is creative! Modula is dynamic! Modula doesn’t always look the same. Just have fun with it! Modula uses a new concept to build its internal grid. The result is a dynamic, creative, interesting and attractive gallery.</p>
88
+
89
+ <?php
90
+
91
+ $plugin_slug = 'modula-best-grid-gallery';
92
+ $plugin_path = 'modula-best-grid-gallery/Modula.php';
93
+
94
+ $installed = false;
95
+ $activated = false;
96
+ if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_slug ) ) {
97
+ $installed = true;
98
+ }
99
+
100
+ if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_path ) ) {
101
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
102
+ if ( is_plugin_active( $plugin_path ) ) {
103
+ $activated = true;
104
+ }
105
+ }
106
+
107
+ if ( ! $activated ) {
108
+
109
+ if ( ! $installed ) {
110
+ $label = esc_html__( 'Install & Activate Modula', 'mfbfw' );
111
+ $link = wp_nonce_url(
112
+ add_query_arg(
113
+ array(
114
+ 'action' => 'install-plugin',
115
+ 'plugin' => $plugin_slug,
116
+ ),
117
+ network_admin_url( 'update.php' )
118
+ ),
119
+ 'install-plugin_' . $plugin_slug
120
+ );
121
+ $action = 'install';
122
+ }else{
123
+ $label = esc_html__( 'Activate Modula', 'mfbfw' );
124
+ $link = add_query_arg(
125
+ array(
126
+ 'action' => 'activate',
127
+ 'plugin' => rawurlencode( $plugin_path ),
128
+ 'plugin_status' => 'all',
129
+ 'paged' => '1',
130
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_path ),
131
+ ),
132
+ admin_url( 'plugins.php' )
133
+ );
134
+ $action = 'activate';
135
+ }
136
+
137
+ echo '<a href="' . esc_url( $link ) . '" class="mfbfw-modula-link button button-primary button-large" data-action="' . esc_attr( $action ) . '">' . esc_html( $label ) . '</a>';
138
+
139
+ }
140
+
141
+ ?>
142
+
143
+ </a>
144
+ </div>
145
+
146
+
147
+ <?php
148
+ }
149
+
150
+ ?>
assets/js/jquery.fancybox.js CHANGED
@@ -25,7 +25,7 @@
25
  // Check if fancyBox is already initialized
26
  // ========================================
27
 
28
- if ($.fn.fancybox) {
29
  console.info("fancyBox already initialized");
30
 
31
  return;
@@ -3337,7 +3337,7 @@
3337
  // Create a jQuery plugin
3338
  // ======================
3339
 
3340
- $.fn.fancybox = function(options) {
3341
  var selector;
3342
 
3343
  options = options || {};
25
  // Check if fancyBox is already initialized
26
  // ========================================
27
 
28
+ if ($.fn.fancyboxforwp) {
29
  console.info("fancyBox already initialized");
30
 
31
  return;
3337
  // Create a jQuery plugin
3338
  // ======================
3339
 
3340
+ $.fn.fancyboxforwp = function(options) {
3341
  var selector;
3342
 
3343
  options = options || {};
fancybox.php CHANGED
@@ -1,514 +1,514 @@
1
- <?php
2
-
3
- /*
4
- Plugin Name: FancyBox for WordPress
5
- Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
6
- Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
7
- Version: 3.1.6
8
- Author: Colorlib
9
- Author URI: https://colorlib.com/wp/
10
-
11
- * FancyBox is Copyright (c) 2008 - 2010 Janis Skarnelis
12
- * Dual licensed under the MIT and GPL licenses:
13
- * http://www.opensource.org/licenses/mit-license.php
14
- * http://www.gnu.org/licenses/gpl.html
15
-
16
- */
17
-
18
- /**
19
- * Plugin Init
20
- */
21
- // Constants
22
- define( 'FBFW_VERSION', '3.1.6' );
23
- define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
24
- define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
25
- define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
26
- define( 'FBFW_PREVIOUS_PLUGIN_VERSION', '3.0.14' );
27
- define( 'FBFW_FILE_', __FILE__ );
28
- define( 'PLUGIN_NAME', 'fancybox-for-wordpress' );
29
-
30
-
31
- // Get Main Settings
32
- $mfbfw = get_option( 'mfbfw' );
33
- $mfbfw_version = get_option( 'mfbfw_active_version' );
34
-
35
- // If previous version detected
36
- if ( is_admin() && isset( $mfbfw_version ) && $mfbfw_version < FBFW_VERSION ) {
37
-
38
- // get default settings and add any new ones to the database
39
- $current_settings = get_option( 'mfbfw' );
40
- $default_settings = mfbfw_defaults();
41
- $new_settings = (array) $current_settings + (array) $default_settings;
42
- update_option( 'mfbfw', $new_settings );
43
-
44
- // update version number
45
- update_option( 'mfbfw_active_version', FBFW_VERSION );
46
- } else {
47
-
48
- // update is not needed, add settings if first time activation
49
- $default_settings = mfbfw_defaults();
50
- add_option( 'mfbfw', $default_settings );
51
- add_option( 'mfbfw_active_version', FBFW_VERSION );
52
- }
53
-
54
- /**
55
- * Store default settings in an array
56
- */
57
- function mfbfw_defaults() {
58
-
59
- $default_settings = array(
60
- // Appearance
61
- 'border' => '',
62
- 'borderColor' => '#BBBBBB',
63
- 'paddingColor' => '#FFFFFF',
64
- 'padding' => '10',
65
- 'overlayShow' => 'on',
66
- 'overlayColor' => '#666666',
67
- 'overlayOpacity' => '0.3',
68
- 'titleShow' => 'on',
69
- 'titlePosition' => 'inside',
70
- 'titleColor' => '#333333',
71
- 'showNavArrows' => 'on',
72
- 'titleSize' => '14',
73
- 'showCloseButton' => '',
74
- 'showToolbar' => 'on',
75
- // Animations
76
- 'zoomOpacity' => 'on',
77
- 'zoomSpeedIn' => '500',
78
- 'zoomSpeedChange' => '300',
79
- 'transitionIn' => 'fade',
80
- 'transitionEffect' => 'fade',
81
- // Behaviour
82
- 'hideOnOverlayClick' => 'function(current, event) {
83
- return current.type === "image" ? "close" : false;
84
- },',
85
- 'hideOnContentClick' => '',
86
- 'enableEscapeButton' => 'on',
87
- 'cyclic' => '',
88
- 'mouseWheel' => '',
89
- 'disableWoocommercePages' => '',
90
- 'disableWoocommerceProducts' => '',
91
- // Gallery Type
92
- 'galleryType' => 'all',
93
- 'customExpression' => 'jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();',
94
- // Misc
95
- 'autoDimensions' => 'on',
96
- 'frameWidth' => '560',
97
- 'frameHeight' => '340',
98
- 'loadAtFooter' => '',
99
- 'callbackEnable' => '',
100
- 'callbackOnStart' => 'function() { alert("Start!"); }',
101
- 'callbackOnCancel' => 'function() { alert("Cancel!"); }',
102
- 'callbackOnComplete' => 'function() { alert("Complete!"); }',
103
- 'callbackOnCleanup' => 'function() { alert("CleanUp!"); }',
104
- 'callbackOnClose' => 'function() { alert("Close!"); }',
105
- 'copyTitleFunction' => 'var arr = jQuery("a[data-fancybox]");
106
- jQuery.each(arr, function() {
107
- var title = jQuery(this).children("img").attr("title");
108
- var caption = jQuery(this).next("figcaption").html();
109
- if(caption.length){jQuery(this).attr("title",title+" " + caption)}else{ jQuery(this).attr("title",title);};
110
- }); ',
111
- 'nojQuery' => '',
112
- 'extraCallsEnable' => '',
113
- 'extraCallsData' => '',
114
- 'uninstall' => '',
115
- );
116
-
117
- return $default_settings;
118
- }
119
-
120
- /**
121
- * If requested, when plugin is deactivated, remove settings
122
- */
123
- function mfbfw_deactivate() {
124
-
125
- global $mfbfw;
126
-
127
- if ( isset( $mfbfw['uninstall'] ) && $mfbfw['uninstall'] ) {
128
- delete_option( 'mfbfw' );
129
- delete_option( 'mfbfw_active_version' );
130
- }
131
- }
132
-
133
- register_deactivation_hook( __FILE__, 'mfbfw_deactivate' );
134
-
135
- /**
136
- * Load FancyBox JS with jQuery and
137
- */
138
- function mfbfw_enqueue_scripts() {
139
-
140
- global $mfbfw, $wp_styles;
141
-
142
- // Check if script should be loaded in footer
143
- if ( isset( $mfbfw['loadAtFooter'] ) && $mfbfw['loadAtFooter'] ) {
144
- $footer = true;
145
- } else {
146
- $footer = false;
147
- }
148
-
149
- // Check if plugin should not call jQuery script (for troubleshooting only)
150
- if ( isset( $mfbfw['nojQuery'] ) && $mfbfw['nojQuery'] ) {
151
- $jquery = false;
152
- } else {
153
- $jquery = array( 'jquery' );
154
- }
155
-
156
- // Register Scripts
157
- wp_register_script( 'fancybox', FBFW_URL . 'assets/js/jquery.fancybox.js', $jquery, '1.3.4', $footer ); // Main Fancybox script
158
- // Enqueue Scripts
159
- wp_enqueue_script( 'fancybox' ); // Load fancybox
160
-
161
- if ( isset( $mfbfw['easing'] ) && $mfbfw['easing'] ) {
162
- wp_enqueue_script( 'jqueryeasing' ); // Load easing javascript file if required
163
- }
164
-
165
- if ( isset( $mfbfw['wheel'] ) && $mfbfw['wheel'] ) {
166
- wp_enqueue_script( 'jquerymousewheel' ); // Load mouse wheel javascript file if required
167
- }
168
-
169
- // Register Styles
170
- wp_register_style( 'fancybox', FBFW_URL . 'assets/css/fancybox.css', false, '1.3.4' ); // Main Fancybox style
171
- wp_register_style( 'fancybox-ie', FBFW_URL . 'assets/css/fancybox.ie.css', array( 'fancybox' ), '1.3.4' ); // Main Fancybox style fixes for IE6-8
172
- // Enqueue Styles
173
- wp_enqueue_style( 'fancybox' );
174
- wp_enqueue_style( 'fancybox-ie' );
175
-
176
- // Make IE specific styles load only on IE6-8
177
- $wp_styles->add_data( 'fancybox-ie', 'conditional', 'lt IE 9' );
178
- }
179
-
180
- add_action( 'wp_enqueue_scripts', 'mfbfw_enqueue_scripts' );
181
-
182
- /**
183
- * Print inline styles and load FancyBox with the selected settings
184
- */
185
- function mfbfw_init() {
186
-
187
- global $mfbfw, $mfbfw_version;
188
-
189
- //caption function to display image title
190
- $caption = 'function( instance, item ) {' .
191
- 'var testing = jQuery(this).context.title;' .
192
- 'var caption = jQuery(this).data(\'caption\') || \'\';' .
193
- 'if ( item.type === \'image\' && testing.length ) {' .
194
- 'caption = (caption.length ? caption + \'<br />\' : \'\') + \'<p class="caption-title">\'+testing+\'</p>\' ;' .
195
- '}' .
196
- 'return caption;' .
197
- '}';
198
-
199
- // fix undefined index copyTitleFunction. $mfbfw array misses this index.
200
-
201
- $mfbfw['copyTitleFunction'] = 'var arr = jQuery("a[data-fancybox]");
202
- jQuery.each(arr, function() {
203
- var title = jQuery(this).children("img").attr("title");
204
- var caption = jQuery(this).next("figcaption").html();
205
- if(caption && title){jQuery(this).attr("title",title+" " + caption)}else if(title){ jQuery(this).attr("title",title);}else if(caption){jQuery(this).attr("title",caption);}
206
- }); ';
207
-
208
-
209
- if ( $mfbfw['titlePosition'] == 'inside' ) {
210
- $afterLoad = 'function( instance, current ) {';
211
- $afterLoad .= 'current.$content.append(\'<div class=\"fancybox-custom-caption\" style=\" position: absolute;left:0;right:0;color:#000;padding-top:10px;bottom:-50px;margin:0 auto;text-align:center; \">\' + current.opts.caption + \'</div>\');';
212
- $afterLoad .= '}';
213
- $hideCaption = 'div.fancybox-caption{display:none !important;}';
214
- } else if ( $mfbfw['titlePosition'] == 'over' ) {
215
- $afterLoad = 'function( instance, current ) {';
216
- $afterLoad .= 'current.$content.append(\'<div class=\"fancybox-custom-caption\" style=\" position: absolute;left:0;right:0;color:#000;padding-top:10px;bottom:0;margin:0 auto;text-align:center; \">\' + current.opts.caption + \'</div>\');';
217
- $afterLoad .= '}';
218
- $hideCaption = 'div.fancybox-caption{display:none !important;}';
219
- } else {
220
- $afterLoad .= '""';
221
- $hideCaption = '';
222
- }
223
-
224
-
225
- if ( isset( $mfbfw['autoDimensions'] ) && $mfbfw['autoDimensions'] == true ) {
226
- $frameSize = '';
227
- } else {
228
- $frameSize = ' "width": ' . $mfbfw['frameWidth'] . ',
229
- "height": ' . $mfbfw['frameHeight'] . ',';
230
- }
231
-
232
-
233
- $mfbfw['customExpression'] = str_replace( '"rel"', '"data-fancybox"', $mfbfw['customExpression'] );
234
-
235
- //title position settings
236
- if ( isset( $mfbfw['titlePosition'] ) ) {
237
- if ( $mfbfw['titlePosition'] == 'inside' ) {
238
- $captionPosition = 'div.fancybox-caption p.caption-title {background:#fff; width:auto;padding:10px 30px;}';
239
- } elseif ( $mfbfw['titlePosition'] == 'float' ) {
240
- $captionPosition = 'div.fancybox-caption p.caption-title {background:#fff;color:#000;padding:10px 30px;width:auto;}';
241
- } else {
242
- $captionPosition = 'div.fancybox-caption {position:relative;max-width:50%;margin:0 auto;min-width:480px;padding:15px;}div.fancybox-caption p.caption-title{position:relative;left:0;right:0;margin:0 auto;top:0px;color:#fff;}';
243
- }
244
- }
245
-
246
- if ( ( isset( $mfbfw['disableWoocommerceProducts'] ) && $mfbfw['disableWoocommerceProducts'] == true && fancy_check_if_woocommerce() == 'product' ) || ( isset( $mfbfw['disableWoocommercePages'] ) && $mfbfw['disableWoocommercePages'] == true && fancy_check_if_woocommerce() == 'shop_page' ) ) {
247
-
248
- } else {
249
-
250
-
251
- echo '
252
- <!-- Fancybox for WordPress v' . $mfbfw_version . ' -->
253
- <style type="text/css">
254
- '.$hideCaption.'
255
- ' . ( isset( $mfbfw['overlayShow'] ) ? '' : 'div.fancybox-bg{background:transparent !important;}' ) . '
256
- ' . 'img.fancybox-image{border-width:' . $mfbfw['padding'] . 'px;border-color:' . $mfbfw['paddingColor'] . ';border-style:solid;height:auto;}' . '
257
- ' . ( isset( $mfbfw['overlayColor'] ) && $mfbfw['overlayColor'] ? 'div.fancybox-bg{background-color:' . hexTorgba( $mfbfw['overlayColor'], $mfbfw['overlayOpacity'] ) . ';opacity:1 !important;}' : '' ) . ( isset( $mfbfw['paddingColor'] ) && $mfbfw['paddingColor'] ? 'div.fancybox-content{border-color:' . $mfbfw['paddingColor'] . '}' : '' ) . '
258
- ' . ( isset( $mfbfw['paddingColor'] ) && $mfbfw['paddingColor'] && $mfbfw['titlePosition'] == 'inside' ? 'div#fancybox-title{background-color:' . $mfbfw['paddingColor'] . '}' : '' ) . '
259
- div.fancybox-content{background-color:' . $mfbfw['paddingColor'] . ( isset( $mfbfw['border'] ) && $mfbfw['border'] ? ';border:1px solid ' . $mfbfw['borderColor'] : '' ) . '}
260
- ' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titleColor'] && $mfbfw['titlePosition'] == 'inside' ? 'div#fancybox-title-inside{color:' . $mfbfw['titleColor'] . '}' : '' ) . '
261
- ' . ( isset( $mfbfw['borderRadius'] ) ? 'div.fancybox-content{border-radius:' . $mfbfw['borderRadius'] . 'px}' : '' ) . '
262
- ' . ( isset( $mfbfw['borderRadiusInner'] ) ? 'img#fancybox-img{border-radius:' . $mfbfw['borderRadiusInner'] . 'px}' : '' ) . '
263
- ' . ( isset( $mfbfw['shadowSize'] ) && $mfbfw['shadowOffset'] && $mfbfw['shadowOpacity'] ? 'div.fancybox-content{box-shadow:0 ' . $mfbfw['shadowOffset'] . 'px ' . $mfbfw['shadowSize'] . 'px rgba(0,0,0,' . $mfbfw['shadowOpacity'] . ')}' : '' ) . '
264
- ' . ( isset( $mfbfw['titleShow'] ) ? 'div.fancybox-caption p.caption-title{display:inline-block}' : 'div.fancybox-caption p.caption-title{display:none}div.fancybox-caption{display:none;}' ) . '
265
- ' . ( isset( $mfbfw['titleSize'] ) ? 'div.fancybox-caption p.caption-title{font-size:' . $mfbfw['titleSize'] . 'px}' : 'div.fancybox-caption p.caption-title{font-size:14px}' ) . '
266
- ' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titlePosition'] == 'inside' ? 'div.fancybox-caption p.caption-title{color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#fff}' ) . '
267
- ' . ( isset( $mfbfw['titlePosition'] ) ? 'div.fancybox-caption {color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition . '
268
- </style>';
269
- ?>
270
- <script type="text/javascript">
271
- jQuery(function(){
272
-
273
- jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles
274
- <?php echo $mfbfw['copyTitleFunction'] ?>
275
- }
276
-
277
- // Supported file extensions
278
- var thumbnails = jQuery("a:has(img)").not(".nolightbox").filter( function() { return /\.(jpe?g|png|gif|mp4|webp|bmp|pdf)(\?[^/]*)*$/i.test(jQuery(this).attr('href')) });
279
- <?php if ( $mfbfw['galleryType'] == 'post' ) { ?>
280
-
281
- // Gallery type BY POST and on post or page (so only one post or page is visible)
282
- <?php if ( is_singular() ) { ?>
283
- // Gallery by post
284
- thumbnails.addClass("fancybox").attr("data-fancybox","gallery").getTitle();
285
-
286
- <?php } else { ?>
287
- // Gallery by post
288
- var posts = jQuery(".post");
289
- posts.each(function() {
290
- jQuery(this).find(thumbnails).addClass("fancybox").attr("data-fancybox","gallery"+posts.index(this)).attr("rel","fancybox"+posts.index(this)).getTitle()
291
- });
292
-
293
- <?php } ?>
294
-
295
- // Gallery type ALL
296
- <?php } elseif ( $mfbfw['galleryType'] == 'all' ) { ?>
297
- // Gallery All
298
- thumbnails.addClass("fancybox").attr("data-fancybox","gallery").getTitle();
299
-
300
- // Gallery type NONE
301
- <?php } elseif ( $mfbfw['galleryType'] == 'none' ) { ?>
302
- // No Galleries
303
- thumbnails.each(function(){
304
- var rel = jQuery(this).attr("rel");
305
- var imgTitle = jQuery(this).children("img").attr("title");
306
- jQuery(this).addClass("fancybox").attr("data-fancybox",rel);
307
- jQuery(this).attr("title",imgTitle);
308
- });
309
-
310
- // Else, gallery type is custom, so just print the custom expression
311
- <?php } else { ?>
312
- /* Custom Expression */
313
- <?php echo $mfbfw['customExpression']; ?>
314
- <?php } ?>
315
-
316
- // Call fancybox and apply it on any link with a rel atribute that starts with "fancybox", with the options set on the admin panel
317
- jQuery("a.fancybox").fancybox({
318
- loop: <?php echo ( isset( $mfbfw['cyclic'] ) && $mfbfw['cyclic'] ? 'true' : 'false' ) ?>,
319
- smallBtn: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
320
- zoomOpacity: <?php echo ( isset( $mfbfw['zoomOpacity'] ) && $mfbfw['zoomOpacity'] ? '"auto"' : 'false' ) ?>,
321
- animationEffect: "<?php echo $mfbfw['transitionIn'] ?>",
322
- animationDuration: <?php echo $mfbfw['zoomSpeedIn'] ?>,
323
- transitionEffect: "<?php echo $mfbfw['transitionEffect'] ?>",
324
- transitionDuration : "<?php echo $mfbfw['zoomSpeedChange'] ?>",
325
- overlayShow: <?php echo ( isset( $mfbfw['overlayShow'] ) && $mfbfw['overlayShow'] ? 'true' : 'false' ) ?>,
326
- overlayOpacity: "<?php echo $mfbfw['overlayOpacity'] ?>",
327
- titleShow: <?php echo ( isset( $mfbfw['titleShow'] ) && $mfbfw['titleShow'] ? 'true' : 'false' ) ?>,
328
- titlePosition: "<?php echo $mfbfw['titlePosition'] ?>",
329
- keyboard: <?php echo ( isset( $mfbfw['enableEscapeButton'] ) && $mfbfw['enableEscapeButton'] ? 'true' : 'false' ) ?>,
330
- showCloseButton: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
331
- arrows: <?php echo ( isset( $mfbfw['showNavArrows'] ) && $mfbfw['showNavArrows'] ? 'true' : 'false' ) ?>,
332
- clickContent: <?php echo ( isset( $mfbfw['hideOnContentClick'] ) && $mfbfw['hideOnContentClick'] ? '"close"' : 'false' ) ?>,
333
- clickSlide: <?php echo ( isset( $mfbfw['hideOnOverlayClick'] ) && $mfbfw['hideOnOverlayClick'] ? 'function(current, event) {return current.type === "image" ? "close" : false;}' : 'false' ) ?>,
334
- wheel: <?php echo ( isset( $mfbfw['mouseWheel'] ) && $mfbfw['mouseWheel'] ? 'true' : 'false' ) ?>,
335
- toolbar: <?php echo ( isset( $mfbfw['showToolbar'] ) && $mfbfw['showToolbar'] ? 'true' : 'false' ) ?>,
336
- preventCaptionOverlap: true,
337
- onInit: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnStart'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnStart'] ? $mfbfw['callbackOnStart'] . ',' : 'function() { },' ) ?>
338
- onDeactivate: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCancel'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCancel'] ? $mfbfw['callbackOnCancel'] . ',' : 'function() { },' ) ?>
339
- beforeClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCleanup'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCleanup'] ? $mfbfw['callbackOnCleanup'] . ',' : 'function() { },' ) ?>
340
- afterShow: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnComplete'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnComplete'] ? $mfbfw['callbackOnComplete'] . ',' : 'function() { },' ) ?>
341
- afterClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnClose'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnClose'] ? $mfbfw['callbackOnClose'] . ',' : 'function() { },' ) ?>
342
- caption : <?php echo $caption ?>,
343
- afterLoad : <?php echo $afterLoad ?>,
344
- <?php echo $frameSize ?>
345
- });
346
- <?php if ( isset( $mfbfw['extraCallsEnable'] ) && $mfbfw['extraCallsEnable'] ) {
347
- echo "/* Extra Calls */";
348
- echo $mfbfw['extraCallsData'];
349
- } ?>
350
-
351
- })
352
- </script>
353
- <!-- END Fancybox for WordPress -->
354
- <?php
355
- }
356
- }
357
-
358
- // Check if inline script should be loaded in footer
359
- if ( isset( $mfbfw['loadAtFooter'] ) && $mfbfw['loadAtFooter'] ) {
360
- add_action( 'wp_footer', 'mfbfw_init' );
361
- } else {
362
- add_action( 'wp_head', 'mfbfw_init' );
363
- }
364
-
365
- /**
366
- * Load text domain
367
- */
368
- function mfbfw_textdomain() {
369
-
370
- if ( function_exists( 'load_plugin_textdomain' ) ) {
371
- load_plugin_textdomain( 'mfbfw', FBFW_URL . 'languages', 'fancybox-for-wordpress/languages' );
372
- }
373
- }
374
-
375
- add_action( 'init', 'mfbfw_textdomain' );
376
-
377
- /**
378
- * Register options
379
- */
380
- function mfbfw_admin_options() {
381
-
382
- $settings = get_option( 'mfbfw' );
383
-
384
- if ( isset( $_GET['page'] ) && $_GET['page'] == 'fancybox-for-wordpress' ) {
385
-
386
- if ( isset( $_REQUEST['action'] ) && 'reset' == $_REQUEST['action'] && check_admin_referer( 'mfbfw-options-reset' ) ) {
387
-
388
- $defaults_array = mfbfw_defaults(); // Store defaults in an array
389
- update_option( 'mfbfw', $defaults_array ); // Write defaults to database
390
- wp_safe_redirect( add_query_arg( 'reset', 'true' ) );
391
- die;
392
- }
393
- }
394
-
395
- register_setting( 'mfbfw-options', 'mfbfw' );
396
- }
397
-
398
- add_action( 'admin_init', 'mfbfw_admin_options' );
399
-
400
- /**
401
- * Admin options page
402
- */
403
- function mfbfw_admin_menu() {
404
-
405
- require FBFW_PATH . 'admin.php';
406
-
407
- $mfbfwadmin = add_submenu_page( 'options-general.php', 'Fancybox for WordPress Options', 'Fancybox for WP', 'manage_options', 'fancybox-for-wordpress', 'mfbfw_options_page' );
408
-
409
- add_action( 'admin_print_styles-' . $mfbfwadmin, 'mfbfw_admin_styles' );
410
- add_action( 'admin_print_scripts-' . $mfbfwadmin, 'mfbfw_admin_scripts' );
411
- }
412
-
413
- add_action( 'admin_menu', 'mfbfw_admin_menu' );
414
-
415
- /**
416
- * Load Admin CSS & JS (called in mfbfw_admin_menu())
417
- */
418
- function mfbfw_admin_styles() {
419
- wp_enqueue_style( 'fancybox-admin', FBFW_URL . 'assets/css/fancybox-admin.css', false, FBFW_VERSION ); // Load custom CSS for Admin Page
420
- wp_enqueue_style( 'wp-color-picker' );
421
- wp_enqueue_style( 'jquery-ui', '//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' ); // Load jQuery UI Tabs CSS for Admin Page
422
- }
423
-
424
- function mfbfw_admin_scripts() {
425
- wp_enqueue_script( 'jquery-ui-tabs', array( 'jquery-ui-core' ), true ); // Load jQuery UI Tabs JS for Admin Page
426
- wp_enqueue_script( 'fancybox-admin', FBFW_URL . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker', 'updates' ), FBFW_VERSION, true ); // Load specific JS for Admin Page
427
-
428
- /* Load codemirror editor */
429
- $settings = wp_enqueue_code_editor( array( 'type' => 'text/javascript' ) );
430
- }
431
-
432
- /**
433
- * Settings Button on Plugins Panel
434
- */
435
- function mfbfw_plugin_action_links(
436
- $links,
437
- $file
438
- ) {
439
-
440
- static $this_plugin;
441
- if ( ! $this_plugin ) {
442
- $this_plugin = plugin_basename( __FILE__ );
443
- }
444
-
445
- if ( $file == $this_plugin ) {
446
- $settings_link = '<a href="options-general.php?page=fancybox-for-wordpress">' . __( 'Settings', 'mfbfw' ) . '</a>';
447
- array_unshift( $links, $settings_link );
448
- }
449
-
450
- return $links;
451
- }
452
-
453
- add_filter( 'plugin_action_links', 'mfbfw_plugin_action_links', 10, 2 );
454
-
455
- /*
456
- * Transform from Hex to rgb or rgba
457
- */
458
-
459
- function hexTorgba( $hexColor, $opacity ) {
460
- list( $r, $g, $b ) = sscanf( $hexColor, "#%02x%02x%02x" );
461
- if ( $opacity ) {
462
- $rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $opacity . ')';
463
- } else {
464
- $rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ')';
465
- }
466
-
467
- return $rgb;
468
- }
469
-
470
- /*
471
- *
472
- * Check if WooCommerce Product post
473
- *
474
- */
475
- function fancy_check_if_woocommerce() {
476
- if ( class_exists( 'WooCommerce' ) ) {
477
- if ( is_shop() ) {
478
- return 'shop_page';
479
- } else if ( get_post_type( get_the_id() ) == 'product' ) {
480
- return 'product';
481
- } else {
482
- return 'true';
483
- }
484
- } else {
485
- return 'true';
486
- }
487
- }
488
-
489
- // Ajax request for activate link
490
- add_action( 'wp_ajax_mfbfw_activate_link', 'mfbfw_get_activate_link' );
491
- function mfbfw_get_activate_link() {
492
-
493
- $plugin_path = 'modula-best-grid-gallery/Modula.php';
494
- $link = add_query_arg(
495
- array(
496
- 'action' => 'activate',
497
- 'plugin' => rawurlencode( $plugin_path ),
498
- 'plugin_status' => 'all',
499
- 'paged' => '1',
500
- '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_path ),
501
- ),
502
- admin_url( 'plugins.php' )
503
- );
504
-
505
- wp_die(
506
- wp_json_encode(
507
- array(
508
- 'status' => 'succes',
509
- 'link' => $link,
510
- )
511
- )
512
- );
513
-
514
  }
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: FancyBox for WordPress
5
+ Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/
6
+ Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress.
7
+ Version: 3.1.7
8
+ Author: Colorlib
9
+ Author URI: https://colorlib.com/wp/
10
+
11
+ * FancyBox is Copyright (c) 2008 - 2010 Janis Skarnelis
12
+ * Dual licensed under the MIT and GPL licenses:
13
+ * http://www.opensource.org/licenses/mit-license.php
14
+ * http://www.gnu.org/licenses/gpl.html
15
+
16
+ */
17
+
18
+ /**
19
+ * Plugin Init
20
+ */
21
+ // Constants
22
+ define( 'FBFW_VERSION', '3.1.7' );
23
+ define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
24
+ define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
25
+ define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
26
+ define( 'FBFW_PREVIOUS_PLUGIN_VERSION', '3.0.14' );
27
+ define( 'FBFW_FILE_', __FILE__ );
28
+ define( 'PLUGIN_NAME', 'fancybox-for-wordpress' );
29
+
30
+
31
+ // Get Main Settings
32
+ $mfbfw = get_option( 'mfbfw' );
33
+ $mfbfw_version = get_option( 'mfbfw_active_version' );
34
+
35
+ // If previous version detected
36
+ if ( is_admin() && isset( $mfbfw_version ) && $mfbfw_version < FBFW_VERSION ) {
37
+
38
+ // get default settings and add any new ones to the database
39
+ $current_settings = get_option( 'mfbfw' );
40
+ $default_settings = mfbfw_defaults();
41
+ $new_settings = (array) $current_settings + (array) $default_settings;
42
+ update_option( 'mfbfw', $new_settings );
43
+
44
+ // update version number
45
+ update_option( 'mfbfw_active_version', FBFW_VERSION );
46
+ } else {
47
+
48
+ // update is not needed, add settings if first time activation
49
+ $default_settings = mfbfw_defaults();
50
+ add_option( 'mfbfw', $default_settings );
51
+ add_option( 'mfbfw_active_version', FBFW_VERSION );
52
+ }
53
+
54
+ /**
55
+ * Store default settings in an array
56
+ */
57
+ function mfbfw_defaults() {
58
+
59
+ $default_settings = array(
60
+ // Appearance
61
+ 'border' => '',
62
+ 'borderColor' => '#BBBBBB',
63
+ 'paddingColor' => '#FFFFFF',
64
+ 'padding' => '10',
65
+ 'overlayShow' => 'on',
66
+ 'overlayColor' => '#666666',
67
+ 'overlayOpacity' => '0.3',
68
+ 'titleShow' => 'on',
69
+ 'titlePosition' => 'inside',
70
+ 'titleColor' => '#333333',
71
+ 'showNavArrows' => 'on',
72
+ 'titleSize' => '14',
73
+ 'showCloseButton' => '',
74
+ 'showToolbar' => 'on',
75
+ // Animations
76
+ 'zoomOpacity' => 'on',
77
+ 'zoomSpeedIn' => '500',
78
+ 'zoomSpeedChange' => '300',
79
+ 'transitionIn' => 'fade',
80
+ 'transitionEffect' => 'fade',
81
+ // Behaviour
82
+ 'hideOnOverlayClick' => 'function(current, event) {
83
+ return current.type === "image" ? "close" : false;
84
+ },',
85
+ 'hideOnContentClick' => '',
86
+ 'enableEscapeButton' => 'on',
87
+ 'cyclic' => '',
88
+ 'mouseWheel' => '',
89
+ 'disableWoocommercePages' => '',
90
+ 'disableWoocommerceProducts' => '',
91
+ // Gallery Type
92
+ 'galleryType' => 'all',
93
+ 'customExpression' => 'jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();',
94
+ // Misc
95
+ 'autoDimensions' => 'on',
96
+ 'frameWidth' => '560',
97
+ 'frameHeight' => '340',
98
+ 'loadAtFooter' => '',
99
+ 'callbackEnable' => '',
100
+ 'callbackOnStart' => 'function() { alert("Start!"); }',
101
+ 'callbackOnCancel' => 'function() { alert("Cancel!"); }',
102
+ 'callbackOnComplete' => 'function() { alert("Complete!"); }',
103
+ 'callbackOnCleanup' => 'function() { alert("CleanUp!"); }',
104
+ 'callbackOnClose' => 'function() { alert("Close!"); }',
105
+ 'copyTitleFunction' => 'var arr = jQuery("a[data-fancybox]");
106
+ jQuery.each(arr, function() {
107
+ var title = jQuery(this).children("img").attr("title");
108
+ var caption = jQuery(this).next("figcaption").html();
109
+ if(caption.length){jQuery(this).attr("title",title+" " + caption)}else{ jQuery(this).attr("title",title);};
110
+ }); ',
111
+ 'nojQuery' => '',
112
+ 'extraCallsEnable' => '',
113
+ 'extraCallsData' => '',
114
+ 'uninstall' => '',
115
+ );
116
+
117
+ return $default_settings;
118
+ }
119
+
120
+ /**
121
+ * If requested, when plugin is deactivated, remove settings
122
+ */
123
+ function mfbfw_deactivate() {
124
+
125
+ global $mfbfw;
126
+
127
+ if ( isset( $mfbfw['uninstall'] ) && $mfbfw['uninstall'] ) {
128
+ delete_option( 'mfbfw' );
129
+ delete_option( 'mfbfw_active_version' );
130
+ }
131
+ }
132
+
133
+ register_deactivation_hook( __FILE__, 'mfbfw_deactivate' );
134
+
135
+ /**
136
+ * Load FancyBox JS with jQuery and
137
+ */
138
+ function mfbfw_enqueue_scripts() {
139
+
140
+ global $mfbfw, $wp_styles;
141
+
142
+ // Check if script should be loaded in footer
143
+ if ( isset( $mfbfw['loadAtFooter'] ) && $mfbfw['loadAtFooter'] ) {
144
+ $footer = true;
145
+ } else {
146
+ $footer = false;
147
+ }
148
+
149
+ // Check if plugin should not call jQuery script (for troubleshooting only)
150
+ if ( isset( $mfbfw['nojQuery'] ) && $mfbfw['nojQuery'] ) {
151
+ $jquery = false;
152
+ } else {
153
+ $jquery = array( 'jquery' );
154
+ }
155
+
156
+ // Register Scripts
157
+ wp_register_script( 'fancybox', FBFW_URL . 'assets/js/jquery.fancybox.js', $jquery, '1.3.4', $footer ); // Main Fancybox script
158
+ // Enqueue Scripts
159
+ wp_enqueue_script( 'fancybox' ); // Load fancybox
160
+
161
+ if ( isset( $mfbfw['easing'] ) && $mfbfw['easing'] ) {
162
+ wp_enqueue_script( 'jqueryeasing' ); // Load easing javascript file if required
163
+ }
164
+
165
+ if ( isset( $mfbfw['wheel'] ) && $mfbfw['wheel'] ) {
166
+ wp_enqueue_script( 'jquerymousewheel' ); // Load mouse wheel javascript file if required
167
+ }
168
+
169
+ // Register Styles
170
+ wp_register_style( 'fancybox', FBFW_URL . 'assets/css/fancybox.css', false, '1.3.4' ); // Main Fancybox style
171
+ wp_register_style( 'fancybox-ie', FBFW_URL . 'assets/css/fancybox.ie.css', array( 'fancybox' ), '1.3.4' ); // Main Fancybox style fixes for IE6-8
172
+ // Enqueue Styles
173
+ wp_enqueue_style( 'fancybox' );
174
+ wp_enqueue_style( 'fancybox-ie' );
175
+
176
+ // Make IE specific styles load only on IE6-8
177
+ $wp_styles->add_data( 'fancybox-ie', 'conditional', 'lt IE 9' );
178
+ }
179
+
180
+ add_action( 'wp_enqueue_scripts', 'mfbfw_enqueue_scripts' );
181
+
182
+ /**
183
+ * Print inline styles and load FancyBox with the selected settings
184
+ */
185
+ function mfbfw_init() {
186
+
187
+ global $mfbfw, $mfbfw_version;
188
+
189
+ //caption function to display image title
190
+ $caption = 'function( instance, item ) {' .
191
+ 'var testing = jQuery(this).context.title;' .
192
+ 'var caption = jQuery(this).data(\'caption\') || \'\';' .
193
+ 'if ( item.type === \'image\' && testing.length ) {' .
194
+ 'caption = (caption.length ? caption + \'<br />\' : \'\') + \'<p class="caption-title">\'+testing+\'</p>\' ;' .
195
+ '}' .
196
+ 'return caption;' .
197
+ '}';
198
+
199
+ // fix undefined index copyTitleFunction. $mfbfw array misses this index.
200
+
201
+ $mfbfw['copyTitleFunction'] = 'var arr = jQuery("a[data-fancybox]");
202
+ jQuery.each(arr, function() {
203
+ var title = jQuery(this).children("img").attr("title");
204
+ var caption = jQuery(this).next("figcaption").html();
205
+ if(caption && title){jQuery(this).attr("title",title+" " + caption)}else if(title){ jQuery(this).attr("title",title);}else if(caption){jQuery(this).attr("title",caption);}
206
+ }); ';
207
+
208
+
209
+ if ( $mfbfw['titlePosition'] == 'inside' ) {
210
+ $afterLoad = 'function( instance, current ) {';
211
+ $afterLoad .= 'current.$content.append(\'<div class=\"fancybox-custom-caption\" style=\" position: absolute;left:0;right:0;color:#000;padding-top:10px;bottom:-50px;margin:0 auto;text-align:center; \">\' + current.opts.caption + \'</div>\');';
212
+ $afterLoad .= '}';
213
+ $hideCaption = 'div.fancybox-caption{display:none !important;}';
214
+ } else if ( $mfbfw['titlePosition'] == 'over' ) {
215
+ $afterLoad = 'function( instance, current ) {';
216
+ $afterLoad .= 'current.$content.append(\'<div class=\"fancybox-custom-caption\" style=\" position: absolute;left:0;right:0;color:#000;padding-top:10px;bottom:0;margin:0 auto;text-align:center; \">\' + current.opts.caption + \'</div>\');';
217
+ $afterLoad .= '}';
218
+ $hideCaption = 'div.fancybox-caption{display:none !important;}';
219
+ } else {
220
+ $afterLoad .= '""';
221
+ $hideCaption = '';
222
+ }
223
+
224
+
225
+ if ( isset( $mfbfw['autoDimensions'] ) && $mfbfw['autoDimensions'] == true ) {
226
+ $frameSize = '';
227
+ } else {
228
+ $frameSize = ' "width": ' . $mfbfw['frameWidth'] . ',
229
+ "height": ' . $mfbfw['frameHeight'] . ',';
230
+ }
231
+
232
+
233
+ $mfbfw['customExpression'] = str_replace( '"rel"', '"data-fancybox"', $mfbfw['customExpression'] );
234
+
235
+ //title position settings
236
+ if ( isset( $mfbfw['titlePosition'] ) ) {
237
+ if ( $mfbfw['titlePosition'] == 'inside' ) {
238
+ $captionPosition = 'div.fancybox-caption p.caption-title {background:#fff; width:auto;padding:10px 30px;}';
239
+ } elseif ( $mfbfw['titlePosition'] == 'float' ) {
240
+ $captionPosition = 'div.fancybox-caption p.caption-title {background:#fff;color:#000;padding:10px 30px;width:auto;}';
241
+ } else {
242
+ $captionPosition = 'div.fancybox-caption {position:relative;max-width:50%;margin:0 auto;min-width:480px;padding:15px;}div.fancybox-caption p.caption-title{position:relative;left:0;right:0;margin:0 auto;top:0px;color:#fff;}';
243
+ }
244
+ }
245
+
246
+ if ( ( isset( $mfbfw['disableWoocommerceProducts'] ) && $mfbfw['disableWoocommerceProducts'] == true && fancy_check_if_woocommerce() == 'product' ) || ( isset( $mfbfw['disableWoocommercePages'] ) && $mfbfw['disableWoocommercePages'] == true && fancy_check_if_woocommerce() == 'shop_page' ) ) {
247
+
248
+ } else {
249
+
250
+
251
+ echo '
252
+ <!-- Fancybox for WordPress v' . $mfbfw_version . ' -->
253
+ <style type="text/css">
254
+ '.$hideCaption.'
255
+ ' . ( isset( $mfbfw['overlayShow'] ) ? '' : 'div.fancybox-bg{background:transparent !important;}' ) . '
256
+ ' . 'img.fancybox-image{border-width:' . $mfbfw['padding'] . 'px;border-color:' . $mfbfw['paddingColor'] . ';border-style:solid;height:auto;}' . '
257
+ ' . ( isset( $mfbfw['overlayColor'] ) && $mfbfw['overlayColor'] ? 'div.fancybox-bg{background-color:' . hexTorgba( $mfbfw['overlayColor'], $mfbfw['overlayOpacity'] ) . ';opacity:1 !important;}' : '' ) . ( isset( $mfbfw['paddingColor'] ) && $mfbfw['paddingColor'] ? 'div.fancybox-content{border-color:' . $mfbfw['paddingColor'] . '}' : '' ) . '
258
+ ' . ( isset( $mfbfw['paddingColor'] ) && $mfbfw['paddingColor'] && $mfbfw['titlePosition'] == 'inside' ? 'div#fancybox-title{background-color:' . $mfbfw['paddingColor'] . '}' : '' ) . '
259
+ div.fancybox-content{background-color:' . $mfbfw['paddingColor'] . ( isset( $mfbfw['border'] ) && $mfbfw['border'] ? ';border:1px solid ' . $mfbfw['borderColor'] : '' ) . '}
260
+ ' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titleColor'] && $mfbfw['titlePosition'] == 'inside' ? 'div#fancybox-title-inside{color:' . $mfbfw['titleColor'] . '}' : '' ) . '
261
+ ' . ( isset( $mfbfw['borderRadius'] ) ? 'div.fancybox-content{border-radius:' . $mfbfw['borderRadius'] . 'px}' : '' ) . '
262
+ ' . ( isset( $mfbfw['borderRadiusInner'] ) ? 'img#fancybox-img{border-radius:' . $mfbfw['borderRadiusInner'] . 'px}' : '' ) . '
263
+ ' . ( isset( $mfbfw['shadowSize'] ) && $mfbfw['shadowOffset'] && $mfbfw['shadowOpacity'] ? 'div.fancybox-content{box-shadow:0 ' . $mfbfw['shadowOffset'] . 'px ' . $mfbfw['shadowSize'] . 'px rgba(0,0,0,' . $mfbfw['shadowOpacity'] . ')}' : '' ) . '
264
+ ' . ( isset( $mfbfw['titleShow'] ) ? 'div.fancybox-caption p.caption-title{display:inline-block}' : 'div.fancybox-caption p.caption-title{display:none}div.fancybox-caption{display:none;}' ) . '
265
+ ' . ( isset( $mfbfw['titleSize'] ) ? 'div.fancybox-caption p.caption-title{font-size:' . $mfbfw['titleSize'] . 'px}' : 'div.fancybox-caption p.caption-title{font-size:14px}' ) . '
266
+ ' . ( isset( $mfbfw['titleColor'] ) && $mfbfw['titlePosition'] == 'inside' ? 'div.fancybox-caption p.caption-title{color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#fff}' ) . '
267
+ ' . ( isset( $mfbfw['titlePosition'] ) ? 'div.fancybox-caption {color:' . $mfbfw['titleColor'] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition . '
268
+ </style>';
269
+ ?>
270
+ <script type="text/javascript">
271
+ jQuery(function(){
272
+
273
+ jQuery.fn.getTitle = function() { // Copy the title of every IMG tag and add it to its parent A so that fancybox can show titles
274
+ <?php echo $mfbfw['copyTitleFunction'] ?>
275
+ }
276
+
277
+ // Supported file extensions
278
+ var thumbnails = jQuery("a:has(img)").not(".nolightbox").not('.envira-gallery-link').not('.ngg-simplelightbox').filter( function() { return /\.(jpe?g|png|gif|mp4|webp|bmp|pdf)(\?[^/]*)*$/i.test(jQuery(this).attr('href')) });
279
+ <?php if ( $mfbfw['galleryType'] == 'post' ) { ?>
280
+
281
+ // Gallery type BY POST and on post or page (so only one post or page is visible)
282
+ <?php if ( is_singular() ) { ?>
283
+ // Gallery by post
284
+ thumbnails.addClass("fancyboxforwp").attr("data-fancybox","gallery").getTitle();
285
+
286
+ <?php } else { ?>
287
+ // Gallery by post
288
+ var posts = jQuery(".post");
289
+ posts.each(function() {
290
+ jQuery(this).find(thumbnails).addClass("fancyboxforwp").attr("data-fancybox","gallery"+posts.index(this)).attr("rel","fancybox"+posts.index(this)).getTitle()
291
+ });
292
+
293
+ <?php } ?>
294
+
295
+ // Gallery type ALL
296
+ <?php } elseif ( $mfbfw['galleryType'] == 'all' ) { ?>
297
+ // Gallery All
298
+ thumbnails.addClass("fancyboxforwp").attr("data-fancybox","gallery").getTitle();
299
+
300
+ // Gallery type NONE
301
+ <?php } elseif ( $mfbfw['galleryType'] == 'none' ) { ?>
302
+ // No Galleries
303
+ thumbnails.each(function(){
304
+ var rel = jQuery(this).attr("rel");
305
+ var imgTitle = jQuery(this).children("img").attr("title");
306
+ jQuery(this).addClass("fancyboxforwp").attr("data-fancybox",rel);
307
+ jQuery(this).attr("title",imgTitle);
308
+ });
309
+
310
+ // Else, gallery type is custom, so just print the custom expression
311
+ <?php } else { ?>
312
+ /* Custom Expression */
313
+ <?php echo $mfbfw['customExpression']; ?>
314
+ <?php } ?>
315
+
316
+ // Call fancybox and apply it on any link with a rel atribute that starts with "fancybox", with the options set on the admin panel
317
+ jQuery("a.fancyboxforwp").fancyboxforwp({
318
+ loop: <?php echo ( isset( $mfbfw['cyclic'] ) && $mfbfw['cyclic'] ? 'true' : 'false' ) ?>,
319
+ smallBtn: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
320
+ zoomOpacity: <?php echo ( isset( $mfbfw['zoomOpacity'] ) && $mfbfw['zoomOpacity'] ? '"auto"' : 'false' ) ?>,
321
+ animationEffect: "<?php echo $mfbfw['transitionIn'] ?>",
322
+ animationDuration: <?php echo $mfbfw['zoomSpeedIn'] ?>,
323
+ transitionEffect: "<?php echo $mfbfw['transitionEffect'] ?>",
324
+ transitionDuration : "<?php echo $mfbfw['zoomSpeedChange'] ?>",
325
+ overlayShow: <?php echo ( isset( $mfbfw['overlayShow'] ) && $mfbfw['overlayShow'] ? 'true' : 'false' ) ?>,
326
+ overlayOpacity: "<?php echo $mfbfw['overlayOpacity'] ?>",
327
+ titleShow: <?php echo ( isset( $mfbfw['titleShow'] ) && $mfbfw['titleShow'] ? 'true' : 'false' ) ?>,
328
+ titlePosition: "<?php echo $mfbfw['titlePosition'] ?>",
329
+ keyboard: <?php echo ( isset( $mfbfw['enableEscapeButton'] ) && $mfbfw['enableEscapeButton'] ? 'true' : 'false' ) ?>,
330
+ showCloseButton: <?php echo ( isset( $mfbfw['showCloseButton'] ) && $mfbfw['showCloseButton'] ? 'true' : 'false' ) ?>,
331
+ arrows: <?php echo ( isset( $mfbfw['showNavArrows'] ) && $mfbfw['showNavArrows'] ? 'true' : 'false' ) ?>,
332
+ clickContent: <?php echo ( isset( $mfbfw['hideOnContentClick'] ) && $mfbfw['hideOnContentClick'] ? '"close"' : 'false' ) ?>,
333
+ clickSlide: <?php echo ( isset( $mfbfw['hideOnOverlayClick'] ) && $mfbfw['hideOnOverlayClick'] ? 'function(current, event) {return current.type === "image" ? "close" : false;}' : 'false' ) ?>,
334
+ wheel: <?php echo ( isset( $mfbfw['mouseWheel'] ) && $mfbfw['mouseWheel'] ? 'true' : 'false' ) ?>,
335
+ toolbar: <?php echo ( isset( $mfbfw['showToolbar'] ) && $mfbfw['showToolbar'] ? 'true' : 'false' ) ?>,
336
+ preventCaptionOverlap: true,
337
+ onInit: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnStart'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnStart'] ? $mfbfw['callbackOnStart'] . ',' : 'function() { },' ) ?>
338
+ onDeactivate: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCancel'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCancel'] ? $mfbfw['callbackOnCancel'] . ',' : 'function() { },' ) ?>
339
+ beforeClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnCleanup'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnCleanup'] ? $mfbfw['callbackOnCleanup'] . ',' : 'function() { },' ) ?>
340
+ afterShow: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnComplete'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnComplete'] ? $mfbfw['callbackOnComplete'] . ',' : 'function() { },' ) ?>
341
+ afterClose: <?php echo ( isset( $mfbfw['callbackEnable'], $mfbfw['callbackOnClose'] ) && $mfbfw['callbackEnable'] && $mfbfw['callbackOnClose'] ? $mfbfw['callbackOnClose'] . ',' : 'function() { },' ) ?>
342
+ caption : <?php echo $caption ?>,
343
+ afterLoad : <?php echo $afterLoad ?>,
344
+ <?php echo $frameSize ?>
345
+ });
346
+ <?php if ( isset( $mfbfw['extraCallsEnable'] ) && $mfbfw['extraCallsEnable'] ) {
347
+ echo "/* Extra Calls */";
348
+ echo $mfbfw['extraCallsData'];
349
+ } ?>
350
+
351
+ })
352
+ </script>
353
+ <!-- END Fancybox for WordPress -->
354
+ <?php
355
+ }
356
+ }
357
+
358
+ // Check if inline script should be loaded in footer
359
+ if ( isset( $mfbfw['loadAtFooter'] ) && $mfbfw['loadAtFooter'] ) {
360
+ add_action( 'wp_footer', 'mfbfw_init' );
361
+ } else {
362
+ add_action( 'wp_head', 'mfbfw_init' );
363
+ }
364
+
365
+ /**
366
+ * Load text domain
367
+ */
368
+ function mfbfw_textdomain() {
369
+
370
+ if ( function_exists( 'load_plugin_textdomain' ) ) {
371
+ load_plugin_textdomain( 'mfbfw', FBFW_URL . 'languages', 'fancybox-for-wordpress/languages' );
372
+ }
373
+ }
374
+
375
+ add_action( 'init', 'mfbfw_textdomain' );
376
+
377
+ /**
378
+ * Register options
379
+ */
380
+ function mfbfw_admin_options() {
381
+
382
+ $settings = get_option( 'mfbfw' );
383
+
384
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'fancybox-for-wordpress' ) {
385
+
386
+ if ( isset( $_REQUEST['action'] ) && 'reset' == $_REQUEST['action'] && check_admin_referer( 'mfbfw-options-reset' ) ) {
387
+
388
+ $defaults_array = mfbfw_defaults(); // Store defaults in an array
389
+ update_option( 'mfbfw', $defaults_array ); // Write defaults to database
390
+ wp_safe_redirect( add_query_arg( 'reset', 'true' ) );
391
+ die;
392
+ }
393
+ }
394
+
395
+ register_setting( 'mfbfw-options', 'mfbfw' );
396
+ }
397
+
398
+ add_action( 'admin_init', 'mfbfw_admin_options' );
399
+
400
+ /**
401
+ * Admin options page
402
+ */
403
+ function mfbfw_admin_menu() {
404
+
405
+ require FBFW_PATH . 'admin.php';
406
+
407
+ $mfbfwadmin = add_submenu_page( 'options-general.php', 'Fancybox for WordPress Options', 'Fancybox for WP', 'manage_options', 'fancybox-for-wordpress', 'mfbfw_options_page' );
408
+
409
+ add_action( 'admin_print_styles-' . $mfbfwadmin, 'mfbfw_admin_styles' );
410
+ add_action( 'admin_print_scripts-' . $mfbfwadmin, 'mfbfw_admin_scripts' );
411
+ }
412
+
413
+ add_action( 'admin_menu', 'mfbfw_admin_menu' );
414
+
415
+ /**
416
+ * Load Admin CSS & JS (called in mfbfw_admin_menu())
417
+ */
418
+ function mfbfw_admin_styles() {
419
+ wp_enqueue_style( 'fancybox-admin', FBFW_URL . 'assets/css/fancybox-admin.css', false, FBFW_VERSION ); // Load custom CSS for Admin Page
420
+ wp_enqueue_style( 'wp-color-picker' );
421
+ wp_enqueue_style( 'jquery-ui', '//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' ); // Load jQuery UI Tabs CSS for Admin Page
422
+ }
423
+
424
+ function mfbfw_admin_scripts() {
425
+ wp_enqueue_script( 'jquery-ui-tabs', array( 'jquery-ui-core' ), true ); // Load jQuery UI Tabs JS for Admin Page
426
+ wp_enqueue_script( 'fancybox-admin', FBFW_URL . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker', 'updates' ), FBFW_VERSION, true ); // Load specific JS for Admin Page
427
+
428
+ /* Load codemirror editor */
429
+ $settings = wp_enqueue_code_editor( array( 'type' => 'text/javascript' ) );
430
+ }
431
+
432
+ /**
433
+ * Settings Button on Plugins Panel
434
+ */
435
+ function mfbfw_plugin_action_links(
436
+ $links,
437
+ $file
438
+ ) {
439
+
440
+ static $this_plugin;
441
+ if ( ! $this_plugin ) {
442
+ $this_plugin = plugin_basename( __FILE__ );
443
+ }
444
+
445
+ if ( $file == $this_plugin ) {
446
+ $settings_link = '<a href="options-general.php?page=fancybox-for-wordpress">' . __( 'Settings', 'mfbfw' ) . '</a>';
447
+ array_unshift( $links, $settings_link );
448
+ }
449
+
450
+ return $links;
451
+ }
452
+
453
+ add_filter( 'plugin_action_links', 'mfbfw_plugin_action_links', 10, 2 );
454
+
455
+ /*
456
+ * Transform from Hex to rgb or rgba
457
+ */
458
+
459
+ function hexTorgba( $hexColor, $opacity ) {
460
+ list( $r, $g, $b ) = sscanf( $hexColor, "#%02x%02x%02x" );
461
+ if ( $opacity ) {
462
+ $rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $opacity . ')';
463
+ } else {
464
+ $rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ')';
465
+ }
466
+
467
+ return $rgb;
468
+ }
469
+
470
+ /*
471
+ *
472
+ * Check if WooCommerce Product post
473
+ *
474
+ */
475
+ function fancy_check_if_woocommerce() {
476
+ if ( class_exists( 'WooCommerce' ) ) {
477
+ if ( is_shop() ) {
478
+ return 'shop_page';
479
+ } else if ( get_post_type( get_the_id() ) == 'product' ) {
480
+ return 'product';
481
+ } else {
482
+ return 'true';
483
+ }
484
+ } else {
485
+ return 'true';
486
+ }
487
+ }
488
+
489
+ // Ajax request for activate link
490
+ add_action( 'wp_ajax_mfbfw_activate_link', 'mfbfw_get_activate_link' );
491
+ function mfbfw_get_activate_link() {
492
+
493
+ $plugin_path = 'modula-best-grid-gallery/Modula.php';
494
+ $link = add_query_arg(
495
+ array(
496
+ 'action' => 'activate',
497
+ 'plugin' => rawurlencode( $plugin_path ),
498
+ 'plugin_status' => 'all',
499
+ 'paged' => '1',
500
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_path ),
501
+ ),
502
+ admin_url( 'plugins.php' )
503
+ );
504
+
505
+ wp_die(
506
+ wp_json_encode(
507
+ array(
508
+ 'status' => 'succes',
509
+ 'link' => $link,
510
+ )
511
+ )
512
+ );
513
+
514
  }
lib/admin-head.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] )
4
- echo '<div id="message" class="updated fade"><p><strong>FancyBox for WordPress settings have been reset.</strong></p></div>';
5
-
6
-
7
- // Get array with all the options
8
- $settings = get_option( 'mfbfw' );
9
-
10
- // Get Version
11
- $version = get_option('mfbfw_active_version');
12
-
13
- // Make selects data
14
- $transitionTypeArray = array( 'fade', 'zoom', 'zoom-in-out' ,'none' );
15
- $overlayArray = array( 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 );
16
- $msArray = array( 0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1250, 1500, 1750, 2000 );
17
- $slideEffectArray = array('false','fade','slide','circular','tube','zoom-in-out','rotate');
1
+ <?php
2
+
3
+ if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] )
4
+ echo '<div id="message" class="updated fade"><p><strong>FancyBox for WordPress settings have been reset.</strong></p></div>';
5
+
6
+
7
+ // Get array with all the options
8
+ $settings = get_option( 'mfbfw' );
9
+
10
+ // Get Version
11
+ $version = get_option('mfbfw_active_version');
12
+
13
+ // Make selects data
14
+ $transitionTypeArray = array( 'fade', 'zoom', 'zoom-in-out' ,'none' );
15
+ $overlayArray = array( 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 );
16
+ $msArray = array( 0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1250, 1500, 1750, 2000 );
17
+ $slideEffectArray = array('false','fade','slide','circular','tube','zoom-in-out','rotate');
lib/admin-tab-animations.php CHANGED
@@ -1,78 +1,78 @@
1
- <h3><?php _e( 'Animation Settings <span style="color:green">(basic)</span>', 'mfbfw' ); ?></h3>
2
-
3
- <p><?php _e( 'These settings control the animations when opening and closing Fancybox, and the optional easing effects.', 'mfbfw' ); ?></p>
4
-
5
- <table class="form-table fancy-table" style="clear:none;">
6
- <tbody>
7
- <tr valign="top">
8
- <th scope="row"><?php _e( 'Zoom Options', 'mfbfw' ); ?></th>
9
- <td>
10
- <fieldset>
11
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[zoomOpacity]"
12
- id="zoomOpacity"<?php if ( isset( $settings['zoomOpacity'] ) && $settings['zoomOpacity'] ) {
13
- echo ' checked="yes"';
14
- } ?> />
15
- <label for="zoomOpacity" class="onoffswitch-label"></label>
16
- <span class="switch-text"><?php _e( 'Change content transparency during zoom animations (default: on)', 'mfbfw' ); ?></span>
17
- </fieldset>
18
- </td>
19
- </tr>
20
- <tr valign="top">
21
- <th scope="row"><?php _e( 'Animation Type', 'mfbfw' ); ?></th>
22
- <td>
23
- <fieldset>
24
- <label for="transitionIn">
25
- <select name="mfbfw[transitionIn]" id="transitionIn">
26
- <?php
27
- foreach ( $transitionTypeArray as $key => $ms ) {
28
- echo "<option value='$ms' " . selected( $settings['transitionIn'], $ms, false ) . ">$ms</option>\n";
29
- }
30
- ?>
31
- </select>
32
- <?php _e( 'Animation type when opening FancyBox. (default: fade)', 'mfbfw' ); ?>
33
- </label>
34
- <div class="cf"></div>
35
- <div class="line-spacer"></div>
36
- <label for="zoomSpeedIn">
37
- <select name="mfbfw[zoomSpeedIn]" id="zoomSpeedIn">
38
- <?php
39
- foreach ( $msArray as $key => $ms ) {
40
- echo "<option value='$ms' " . selected( $settings['zoomSpeedIn'], $ms, false ) . ">$ms</option>\n";
41
- }
42
- ?>
43
- </select>
44
- <?php _e( 'Speed in miliseconds of the FancyBox opening animation (default: 500)', 'mfbfw' ); ?>
45
- </label>
46
- </fieldset>
47
- </td>
48
- </tr>
49
- <tr valign="top">
50
- <th scope="row"><?php _e( 'Animation between slides Options', 'mfbfw' ); ?></th>
51
- <td>
52
- <fieldset>
53
- <label for="transitionEffect">
54
- <select name="mfbfw[transitionEffect]" id="animationDuration">
55
- <?php
56
- foreach ( $slideEffectArray as $key => $ms ) {
57
- echo "<option value='$ms' " . selected( $settings['transitionEffect'], $ms, false ) . ">$ms</option>\n";
58
- }
59
- ?>
60
- </select>
61
- <?php _e( 'Select Animation type for the slides(default: fade)', 'mfbfw' ); ?>
62
- </label>
63
- <div class="line-spacer"></div>
64
- <label for="zoomSpeedChange">
65
- <select name="mfbfw[zoomSpeedChange]" id="zoomSpeedChange">
66
- <?php
67
- foreach ( $msArray as $key => $ms ) {
68
- echo "<option value='$ms' " . selected( $settings['zoomSpeedChange'], $ms, false ) . ">$ms</option>\n";
69
- }
70
- ?>
71
- </select>
72
- <?php _e( 'Speed in miliseconds of the animation when navigating thorugh gallery items (default: 300)', 'mfbfw' ); ?>
73
- </label>
74
- </fieldset>
75
- </td>
76
- </tr>
77
- </tbody>
78
  </table>
1
+ <h3><?php _e( 'Animation Settings <span style="color:green">(basic)</span>', 'mfbfw' ); ?></h3>
2
+
3
+ <p><?php _e( 'These settings control the animations when opening and closing Fancybox, and the optional easing effects.', 'mfbfw' ); ?></p>
4
+
5
+ <table class="form-table fancy-table" style="clear:none;">
6
+ <tbody>
7
+ <tr valign="top">
8
+ <th scope="row"><?php _e( 'Zoom Options', 'mfbfw' ); ?></th>
9
+ <td>
10
+ <fieldset>
11
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[zoomOpacity]"
12
+ id="zoomOpacity"<?php if ( isset( $settings['zoomOpacity'] ) && $settings['zoomOpacity'] ) {
13
+ echo ' checked="yes"';
14
+ } ?> />
15
+ <label for="zoomOpacity" class="onoffswitch-label"></label>
16
+ <span class="switch-text"><?php _e( 'Change content transparency during zoom animations (default: on)', 'mfbfw' ); ?></span>
17
+ </fieldset>
18
+ </td>
19
+ </tr>
20
+ <tr valign="top">
21
+ <th scope="row"><?php _e( 'Animation Type', 'mfbfw' ); ?></th>
22
+ <td>
23
+ <fieldset>
24
+ <label for="transitionIn">
25
+ <select name="mfbfw[transitionIn]" id="transitionIn">
26
+ <?php
27
+ foreach ( $transitionTypeArray as $key => $ms ) {
28
+ echo "<option value='$ms' " . selected( $settings['transitionIn'], $ms, false ) . ">$ms</option>\n";
29
+ }
30
+ ?>
31
+ </select>
32
+ <?php _e( 'Animation type when opening FancyBox. (default: fade)', 'mfbfw' ); ?>
33
+ </label>
34
+ <div class="cf"></div>
35
+ <div class="line-spacer"></div>
36
+ <label for="zoomSpeedIn">
37
+ <select name="mfbfw[zoomSpeedIn]" id="zoomSpeedIn">
38
+ <?php
39
+ foreach ( $msArray as $key => $ms ) {
40
+ echo "<option value='$ms' " . selected( $settings['zoomSpeedIn'], $ms, false ) . ">$ms</option>\n";
41
+ }
42
+ ?>
43
+ </select>
44
+ <?php _e( 'Speed in miliseconds of the FancyBox opening animation (default: 500)', 'mfbfw' ); ?>
45
+ </label>
46
+ </fieldset>
47
+ </td>
48
+ </tr>
49
+ <tr valign="top">
50
+ <th scope="row"><?php _e( 'Animation between slides Options', 'mfbfw' ); ?></th>
51
+ <td>
52
+ <fieldset>
53
+ <label for="transitionEffect">
54
+ <select name="mfbfw[transitionEffect]" id="animationDuration">
55
+ <?php
56
+ foreach ( $slideEffectArray as $key => $ms ) {
57
+ echo "<option value='$ms' " . selected( $settings['transitionEffect'], $ms, false ) . ">$ms</option>\n";
58
+ }
59
+ ?>
60
+ </select>
61
+ <?php _e( 'Select Animation type for the slides(default: fade)', 'mfbfw' ); ?>
62
+ </label>
63
+ <div class="line-spacer"></div>
64
+ <label for="zoomSpeedChange">
65
+ <select name="mfbfw[zoomSpeedChange]" id="zoomSpeedChange">
66
+ <?php
67
+ foreach ( $msArray as $key => $ms ) {
68
+ echo "<option value='$ms' " . selected( $settings['zoomSpeedChange'], $ms, false ) . ">$ms</option>\n";
69
+ }
70
+ ?>
71
+ </select>
72
+ <?php _e( 'Speed in miliseconds of the animation when navigating thorugh gallery items (default: 300)', 'mfbfw' ); ?>
73
+ </label>
74
+ </fieldset>
75
+ </td>
76
+ </tr>
77
+ </tbody>
78
  </table>
lib/admin-tab-appearance.php CHANGED
@@ -1,179 +1,179 @@
1
- <h3><?php _e( 'Appearance Settings <span style="color:green">(basic)</span>', 'mfbfw' ); ?></h3>
2
-
3
- <p><?php _e( 'These setting control how Fancybox looks, they let you tweak color, borders and position of elements, like the image title and closing buttons.', 'mfbfw' ); ?></p>
4
-
5
- <table class="form-table fancy-table" style="clear:none;">
6
- <tbody>
7
- <tr valign="top">
8
- <th scope="row"><?php _e( 'Close Button', 'mfbfw' ); ?></th>
9
- <td>
10
- <fieldset>
11
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showCloseButton]"
12
- id="showCloseButton"<?php if ( isset( $settings['showCloseButton'] ) && $settings['showCloseButton'] ) {
13
- echo ' checked="yes"';
14
- } ?> />
15
- <label for="showCloseButton" class="onoffswitch-label">
16
- </label>
17
- <span class="switch-text"><?php _e( 'Show Close button (default: off)', 'mfbfw' ); ?></span>
18
- <div class="cf"></div>
19
- </fieldset>
20
- </td>
21
- </tr>
22
- <tr valign="top">
23
- <th scope="row"><?php _e( 'Toolbar', 'mfbfw' ); ?></th>
24
- <td>
25
- <fieldset>
26
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showToolbar]"
27
- id="showToolbar"<?php if ( isset( $settings['showToolbar'] ) && $settings['showToolbar'] ) {
28
- echo ' checked="yes"';
29
- } ?> />
30
- <label for="showToolbar" class="onoffswitch-label">
31
- </label>
32
- <span class="switch-text"><?php _e( 'Show Toolbar (default: on)', 'mfbfw' ); ?></span>
33
- <div class="cf"></div>
34
- </fieldset>
35
- </td>
36
- </tr>
37
- <tr valign="top">
38
- <th scope="row"><?php _e( 'Border', 'mfbfw' ); ?></th>
39
- <td>
40
- <fieldset>
41
- <input class="onoffswitch-checkbox" type="checkbox" name="mfbfw[border]"
42
- id="border"<?php if ( isset( $settings['border'] ) && $settings['border'] ) {
43
- echo ' checked="yes"';
44
- } ?> />
45
- <label for="border" class="onoffswitch-label"></label>
46
- <span class="switch-text"><?php _e( 'Show Border (default: off)', 'mfbfw' ); ?></span>
47
- <div class="cf"></div>
48
- <div id="borderColorBlock" class="hidden-block">
49
- <label for="borderColor">
50
- <input type="text" class="color-btn" name="mfbfw[borderColor]" id="borderColor"
51
- value="<?php echo $settings['borderColor'] ?>" size="7" maxlength="7"/>
52
- </label>
53
- <p class="description"><?php _e( 'HTML color of the border (default: #BBBBBB)', 'mfbfw' ); ?></p>
54
- </div>
55
- </fieldset>
56
- </td>
57
- </tr>
58
- <tr valign="top">
59
- <th scope="row"><?php _e( 'Padding', 'mfbfw' ); ?></th>
60
- <td>
61
- <fieldset>
62
- <label for="paddingColor">
63
- <input type="text" class="color-btn" name="mfbfw[paddingColor]" id="paddingColor"
64
- value="<?php echo $settings['paddingColor'] ?>" size="7" maxlength="7"/>
65
- </label>
66
- <p class="description"><?php _e( 'HTML color of the padding (default: #FFFFFF)', 'mfbfw' ); ?></p>
67
- <p class="description"><?php _e( '(This should be left on #FFFFFF (white) if you want to display anything other than images, like inline or framed content)', 'mfbfw' ); ?></p>
68
- <div class="line-spacer"></div>
69
- <label for="padding" class="inlined">
70
- <input type="text" class="slider-text" name="mfbfw[padding]" id="padding"
71
- value="<?php echo $settings['padding']; ?>" size="7" maxlength="7"/>
72
- <div class="slider-horizontal" minSl="0" maxSl="100" stepSl="1" rangeSl="min"
73
- style="height:14px;"></div>
74
- <div class="cf"></div>
75
- <p class="description"><span class="slider-spantext"><?php _e( 'Padding size in pixels (default: 10)', 'mfbfw' ); ?></span></p>
76
- </label>
77
- </fieldset>
78
- </td>
79
- </tr>
80
- <tr valign="top">
81
- <th scope="row"><?php _e( 'Overlay Options', 'mfbfw' ); ?></th>
82
- <td>
83
- <fieldset>
84
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[overlayShow]"
85
- id="overlayShow"<?php if ( isset( $settings['overlayShow'] ) && $settings['overlayShow'] ) {
86
- echo ' checked="yes"';
87
- } ?> />
88
- <label for="overlayShow" class="onoffswitch-label"></label>
89
- <span class="switch-text"><?php _e( 'Add overlay (default: on)', 'mfbfw' ); ?></span>
90
- <div class="cf"></div>
91
- <div id="overlayBlock" class="hidden-block">
92
- <label for="overlayColor">
93
- <input type="text" class="color-btn" name="mfbfw[overlayColor]" id="overlayColor"
94
- value="<?php echo $settings['overlayColor']; ?>" size="7" maxlength="7"/>
95
- </label>
96
- <p class="description"><?php _e( 'HTML color of the overlay (default: #666666)', 'mfbfw' ); ?></p>
97
- <div class="line-spacer"></div>
98
- <label for="overlayOpacity" class="inlined">
99
- <input type="text" class="slider-text" name="mfbfw[overlayOpacity]" id="overlayOpacity"
100
- value="<?php echo $settings['overlayOpacity']; ?>" size="7" maxlength="7"/>
101
- <div class="slider-horizontal" minSl="0" maxSl="1" stepSl="0.1" rangeSl="min"
102
- style="height:14px;"></div>
103
- <div class="cf"></div>
104
- <p class="description"><span class="slider-spantext"><?php _e( 'Opacity of overlay. 0 is transparent, 1 is opaque (default: 0.3)', 'mfbfw' ); ?></span></p>
105
- </label>
106
- </div>
107
- </fieldset>
108
- </td>
109
- </tr>
110
- <tr valign="top">
111
- <th scope="row"><?php _e( 'Title', 'mfbfw' ); ?></th>
112
- <td>
113
- <fieldset>
114
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[titleShow]"
115
- id="titleShow"<?php if ( isset( $settings['titleShow'] ) && $settings['titleShow'] ) {
116
- echo ' checked="yes"';
117
- } ?> />
118
- <label for="titleShow" class="onoffswitch-label"></label>
119
- <span class="switch-text"><?php _e( 'Show the title (default: on)', 'mfbfw' ); ?></span>
120
- <div class="cf"></div>
121
- <div id="titleBlock" class="hidden-block">
122
- <label for="titleSize">
123
- <input type="text" name="mfbfw[titleSize]" id="titleSize" size="2" maxlength="4"
124
- value="<?php echo $settings['titleSize']; ?>"/>
125
- <?php _e( 'Title size (default: 14px)', 'mfbfw' ); ?>
126
- </label>
127
- <div class="cf"></div>
128
- <div class="line-spacer"></div>
129
- <input id="titlePositionInside" class="titlePosition" type="radio" value="inside"
130
- name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'inside' ) {
131
- echo ' checked="yes"';
132
- } ?> />
133
- <label for="titlePositionInside">
134
- <?php _e( 'Inside (default)', 'mfbfw' ); ?>
135
- </label>
136
- <input id="titlePositionOutside" class="titlePosition" type="radio" value="float"
137
- name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'float' ) {
138
- echo ' checked="yes"';
139
- } ?> />
140
- <label for="titlePositionOutside">
141
- <?php _e( 'Outside', 'mfbfw' ); ?>
142
- </label>
143
- <input id="titlePositionOver" class="titlePosition" type="radio" value="over"
144
- name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'over' ) {
145
- echo ' checked="yes"';
146
- } ?> />
147
- <label for="titlePositionOver">
148
- <?php _e( 'Over', 'mfbfw' ); ?>
149
- </label>
150
- <div class="line-spacer"></div>
151
- <div id="titleColorBlock">
152
- <label for="titleColor">
153
- <input type="text" class="color-btn" name="mfbfw[titleColor]" id="titleColor"
154
- class="colorpick" value="<?php echo $settings['titleColor']; ?>" size="7"
155
- maxlength="7"/>
156
- </label>
157
- <p class="description"><?php _e( 'Title text color (default: #333333)', 'mfbfw' ); ?></p>
158
- <p class="description"><?php _e( '(Should contrast with the padding color set above)', 'mfbfw' ); ?></p>
159
- </div>
160
- </div>
161
- </fieldset>
162
- </td>
163
- </tr>
164
- <tr valign="top">
165
- <th scope="row"><?php _e( 'Navigation Arrows', 'mfbfw' ); ?></th>
166
- <td>
167
- <fieldset>
168
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showNavArrows]"
169
- id="showNavArrows"<?php if ( isset( $settings['showNavArrows'] ) && $settings['showNavArrows'] ) {
170
- echo ' checked="yes"';
171
- } ?> />
172
- <label for="showNavArrows" class="onoffswitch-label"></label>
173
- <span class="switch-text"><?php _e( 'Show the navigation arrows (default: on)', 'mfbfw' ); ?></span>
174
- <div class="cf"></div>
175
- </fieldset>
176
- </td>
177
- </tr>
178
- </tbody>
179
  </table>
1
+ <h3><?php _e( 'Appearance Settings <span style="color:green">(basic)</span>', 'mfbfw' ); ?></h3>
2
+
3
+ <p><?php _e( 'These setting control how Fancybox looks, they let you tweak color, borders and position of elements, like the image title and closing buttons.', 'mfbfw' ); ?></p>
4
+
5
+ <table class="form-table fancy-table" style="clear:none;">
6
+ <tbody>
7
+ <tr valign="top">
8
+ <th scope="row"><?php _e( 'Close Button', 'mfbfw' ); ?></th>
9
+ <td>
10
+ <fieldset>
11
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showCloseButton]"
12
+ id="showCloseButton"<?php if ( isset( $settings['showCloseButton'] ) && $settings['showCloseButton'] ) {
13
+ echo ' checked="yes"';
14
+ } ?> />
15
+ <label for="showCloseButton" class="onoffswitch-label">
16
+ </label>
17
+ <span class="switch-text"><?php _e( 'Show Close button (default: off)', 'mfbfw' ); ?></span>
18
+ <div class="cf"></div>
19
+ </fieldset>
20
+ </td>
21
+ </tr>
22
+ <tr valign="top">
23
+ <th scope="row"><?php _e( 'Toolbar', 'mfbfw' ); ?></th>
24
+ <td>
25
+ <fieldset>
26
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showToolbar]"
27
+ id="showToolbar"<?php if ( isset( $settings['showToolbar'] ) && $settings['showToolbar'] ) {
28
+ echo ' checked="yes"';
29
+ } ?> />
30
+ <label for="showToolbar" class="onoffswitch-label">
31
+ </label>
32
+ <span class="switch-text"><?php _e( 'Show Toolbar (default: on)', 'mfbfw' ); ?></span>
33
+ <div class="cf"></div>
34
+ </fieldset>
35
+ </td>
36
+ </tr>
37
+ <tr valign="top">
38
+ <th scope="row"><?php _e( 'Border', 'mfbfw' ); ?></th>
39
+ <td>
40
+ <fieldset>
41
+ <input class="onoffswitch-checkbox" type="checkbox" name="mfbfw[border]"
42
+ id="border"<?php if ( isset( $settings['border'] ) && $settings['border'] ) {
43
+ echo ' checked="yes"';
44
+ } ?> />
45
+ <label for="border" class="onoffswitch-label"></label>
46
+ <span class="switch-text"><?php _e( 'Show Border (default: off)', 'mfbfw' ); ?></span>
47
+ <div class="cf"></div>
48
+ <div id="borderColorBlock" class="hidden-block">
49
+ <label for="borderColor">
50
+ <input type="text" class="color-btn" name="mfbfw[borderColor]" id="borderColor"
51
+ value="<?php echo $settings['borderColor'] ?>" size="7" maxlength="7"/>
52
+ </label>
53
+ <p class="description"><?php _e( 'HTML color of the border (default: #BBBBBB)', 'mfbfw' ); ?></p>
54
+ </div>
55
+ </fieldset>
56
+ </td>
57
+ </tr>
58
+ <tr valign="top">
59
+ <th scope="row"><?php _e( 'Padding', 'mfbfw' ); ?></th>
60
+ <td>
61
+ <fieldset>
62
+ <label for="paddingColor">
63
+ <input type="text" class="color-btn" name="mfbfw[paddingColor]" id="paddingColor"
64
+ value="<?php echo $settings['paddingColor'] ?>" size="7" maxlength="7"/>
65
+ </label>
66
+ <p class="description"><?php _e( 'HTML color of the padding (default: #FFFFFF)', 'mfbfw' ); ?></p>
67
+ <p class="description"><?php _e( '(This should be left on #FFFFFF (white) if you want to display anything other than images, like inline or framed content)', 'mfbfw' ); ?></p>
68
+ <div class="line-spacer"></div>
69
+ <label for="padding" class="inlined">
70
+ <input type="text" class="slider-text" name="mfbfw[padding]" id="padding"
71
+ value="<?php echo $settings['padding']; ?>" size="7" maxlength="7"/>
72
+ <div class="slider-horizontal" minSl="0" maxSl="100" stepSl="1" rangeSl="min"
73
+ style="height:14px;"></div>
74
+ <div class="cf"></div>
75
+ <p class="description"><span class="slider-spantext"><?php _e( 'Padding size in pixels (default: 10)', 'mfbfw' ); ?></span></p>
76
+ </label>
77
+ </fieldset>
78
+ </td>
79
+ </tr>
80
+ <tr valign="top">
81
+ <th scope="row"><?php _e( 'Overlay Options', 'mfbfw' ); ?></th>
82
+ <td>
83
+ <fieldset>
84
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[overlayShow]"
85
+ id="overlayShow"<?php if ( isset( $settings['overlayShow'] ) && $settings['overlayShow'] ) {
86
+ echo ' checked="yes"';
87
+ } ?> />
88
+ <label for="overlayShow" class="onoffswitch-label"></label>
89
+ <span class="switch-text"><?php _e( 'Add overlay (default: on)', 'mfbfw' ); ?></span>
90
+ <div class="cf"></div>
91
+ <div id="overlayBlock" class="hidden-block">
92
+ <label for="overlayColor">
93
+ <input type="text" class="color-btn" name="mfbfw[overlayColor]" id="overlayColor"
94
+ value="<?php echo $settings['overlayColor']; ?>" size="7" maxlength="7"/>
95
+ </label>
96
+ <p class="description"><?php _e( 'HTML color of the overlay (default: #666666)', 'mfbfw' ); ?></p>
97
+ <div class="line-spacer"></div>
98
+ <label for="overlayOpacity" class="inlined">
99
+ <input type="text" class="slider-text" name="mfbfw[overlayOpacity]" id="overlayOpacity"
100
+ value="<?php echo $settings['overlayOpacity']; ?>" size="7" maxlength="7"/>
101
+ <div class="slider-horizontal" minSl="0" maxSl="1" stepSl="0.1" rangeSl="min"
102
+ style="height:14px;"></div>
103
+ <div class="cf"></div>
104
+ <p class="description"><span class="slider-spantext"><?php _e( 'Opacity of overlay. 0 is transparent, 1 is opaque (default: 0.3)', 'mfbfw' ); ?></span></p>
105
+ </label>
106
+ </div>
107
+ </fieldset>
108
+ </td>
109
+ </tr>
110
+ <tr valign="top">
111
+ <th scope="row"><?php _e( 'Title', 'mfbfw' ); ?></th>
112
+ <td>
113
+ <fieldset>
114
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[titleShow]"
115
+ id="titleShow"<?php if ( isset( $settings['titleShow'] ) && $settings['titleShow'] ) {
116
+ echo ' checked="yes"';
117
+ } ?> />
118
+ <label for="titleShow" class="onoffswitch-label"></label>
119
+ <span class="switch-text"><?php _e( 'Show the title (default: on)', 'mfbfw' ); ?></span>
120
+ <div class="cf"></div>
121
+ <div id="titleBlock" class="hidden-block">
122
+ <label for="titleSize">
123
+ <input type="text" name="mfbfw[titleSize]" id="titleSize" size="2" maxlength="4"
124
+ value="<?php echo $settings['titleSize']; ?>"/>
125
+ <?php _e( 'Title size (default: 14px)', 'mfbfw' ); ?>
126
+ </label>
127
+ <div class="cf"></div>
128
+ <div class="line-spacer"></div>
129
+ <input id="titlePositionInside" class="titlePosition" type="radio" value="inside"
130
+ name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'inside' ) {
131
+ echo ' checked="yes"';
132
+ } ?> />
133
+ <label for="titlePositionInside">
134
+ <?php _e( 'Inside (default)', 'mfbfw' ); ?>
135
+ </label>
136
+ <input id="titlePositionOutside" class="titlePosition" type="radio" value="float"
137
+ name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'float' ) {
138
+ echo ' checked="yes"';
139
+ } ?> />
140
+ <label for="titlePositionOutside">
141
+ <?php _e( 'Outside', 'mfbfw' ); ?>
142
+ </label>
143
+ <input id="titlePositionOver" class="titlePosition" type="radio" value="over"
144
+ name="mfbfw[titlePosition]"<?php if ( $settings['titlePosition'] == 'over' ) {
145
+ echo ' checked="yes"';
146
+ } ?> />
147
+ <label for="titlePositionOver">
148
+ <?php _e( 'Over', 'mfbfw' ); ?>
149
+ </label>
150
+ <div class="line-spacer"></div>
151
+ <div id="titleColorBlock">
152
+ <label for="titleColor">
153
+ <input type="text" class="color-btn" name="mfbfw[titleColor]" id="titleColor"
154
+ class="colorpick" value="<?php echo $settings['titleColor']; ?>" size="7"
155
+ maxlength="7"/>
156
+ </label>
157
+ <p class="description"><?php _e( 'Title text color (default: #333333)', 'mfbfw' ); ?></p>
158
+ <p class="description"><?php _e( '(Should contrast with the padding color set above)', 'mfbfw' ); ?></p>
159
+ </div>
160
+ </div>
161
+ </fieldset>
162
+ </td>
163
+ </tr>
164
+ <tr valign="top">
165
+ <th scope="row"><?php _e( 'Navigation Arrows', 'mfbfw' ); ?></th>
166
+ <td>
167
+ <fieldset>
168
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[showNavArrows]"
169
+ id="showNavArrows"<?php if ( isset( $settings['showNavArrows'] ) && $settings['showNavArrows'] ) {
170
+ echo ' checked="yes"';
171
+ } ?> />
172
+ <label for="showNavArrows" class="onoffswitch-label"></label>
173
+ <span class="switch-text"><?php _e( 'Show the navigation arrows (default: on)', 'mfbfw' ); ?></span>
174
+ <div class="cf"></div>
175
+ </fieldset>
176
+ </td>
177
+ </tr>
178
+ </tbody>
179
  </table>
lib/admin-tab-behaviour.php CHANGED
@@ -1,102 +1,102 @@
1
- <h3><?php _e( 'Behavior Settings <span style="color:orange">(medium)</span>', 'mfbfw' ); ?></h3>
2
- <p><?php _e( 'The following settings should be left alone unless you know what you are doing.', 'mfbfw' ); ?></p>
3
- <table class="form-table fancy-table" style="clear:none;">
4
- <tbody>
5
- <tr valign="top">
6
- <th scope="row"><?php _e( 'Close on Content Click', 'mfbfw' ); ?></th>
7
- <td>
8
- <fieldset>
9
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[hideOnContentClick]"
10
- id="hideOnContentClick"<?php if ( isset( $settings['hideOnContentClick'] ) && $settings['hideOnContentClick'] ) {
11
- echo ' checked="yes"';
12
- } ?> />
13
- <label for="hideOnContentClick" class="onoffswitch-label"></label>
14
- <span class="switch-text"><?php _e( 'Close FancyBox by clicking on the image (default: off)', 'mfbfw' ); ?></span>
15
- <div class="cf"></div>
16
- <p class="description">
17
- <em><?php _e( '(You may want to leave this off if you display iframed or inline content that containts clickable elements - for example: play buttons for movies, links to other pages)', 'mfbfw' ); ?>
18
- </p>
19
- </fieldset>
20
- </td>
21
- </tr>
22
- <tr valign="top">
23
- <th scope="row"><?php _e( 'Close on Overlay Click', 'mfbfw' ); ?></th>
24
- <td>
25
- <fieldset>
26
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[hideOnOverlayClick]"
27
- id="hideOnOverlayClick"<?php if ( isset( $settings['hideOnOverlayClick'] ) && $settings['hideOnOverlayClick'] ) {
28
- echo ' checked="yes"';
29
- } ?> />
30
- <label for="hideOnOverlayClick" class="onoffswitch-label"></label>
31
- <span class="switch-text"><?php _e( 'Close FancyBox by clicking on the overlay sorrounding it (default: on)', 'mfbfw' ); ?></span>
32
- <div class="cf"></div>
33
- </fieldset>
34
- </td>
35
- </tr>
36
- <tr valign="top">
37
- <th scope="row"><?php _e( 'Keyboard navigation;', 'mfbfw' ); ?></th>
38
- <td>
39
- <fieldset>
40
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[enableEscapeButton]"
41
- id="enableEscapeButton"<?php if ( isset( $settings['enableEscapeButton'] ) && $settings['enableEscapeButton'] ) {
42
- echo ' checked="yes"';
43
- } ?> />
44
- <label for="enableEscapeButton" class="onoffswitch-label"></label>
45
- <span class="switch-text"><?php _e( 'Enable Keyboard Navigation (default: on)', 'mfbfw' ); ?></span>
46
- <div class="cf"></div>
47
- </fieldset>
48
- </td>
49
- </tr>
50
- <tr valign="top">
51
- <th scope="row"><?php _e( 'Loop Galleries', 'mfbfw' ); ?></th>
52
- <td>
53
- <fieldset>
54
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[cyclic]"
55
- id="cyclic"<?php if ( isset( $settings['cyclic'] ) && $settings['cyclic'] ) {
56
- echo ' checked="yes"';
57
- } ?> />
58
- <label for="cyclic" class="onoffswitch-label"></label>
59
- <span class="switch-text"><?php _e( 'This will make galleries loop, allowing you to keep pressing next/back (default: off)', 'mfbfw' ); ?></span>
60
- <div class="cf"></div>
61
- </fieldset>
62
- </td>
63
- </tr>
64
- <tr valign="top">
65
- <th scope="row"><?php _e( 'Mouse Wheel Navigation', 'mfbfw' ); ?></th>
66
- <td>
67
- <fieldset>
68
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[mouseWheel]"
69
- id="mouseWheel"<?php if ( isset( $settings['mouseWheel'] ) && $settings['mouseWheel'] ) {
70
- echo ' checked="yes"';
71
- } ?> />
72
- <label for="mouseWheel" class="onoffswitch-label"></label>
73
- <span class="switch-text"><?php _e( 'Lets visitors navigate galleries with the mouse wheel (default: off)', 'mfbfw' ); ?></span>
74
- <div class="cf"></div>
75
- </fieldset>
76
- </td>
77
- </tr>
78
- <tr valign="top">
79
- <th scope="row"><?php _e( 'Woocommerce:', 'mfbfw' ); ?></th>
80
- <td>
81
- <fieldset>
82
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[disableWoocommercePages]"
83
- id="disableWoocommercePages"<?php if ( isset( $settings['disableWoocommercePages'] ) && $settings['disableWoocommercePages'] ) {
84
- echo ' checked="yes"';
85
- } ?> />
86
- <label for="disableWoocommercePages" class="onoffswitch-label"></label>
87
- <span class="switch-text"><?php _e( 'Disable on Woocommerce Shop page.( Default : off )', 'mfbfw' ); ?></span>
88
- <div class="cf"></div>
89
- </fieldset>
90
- <fieldset>
91
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[disableWoocommerceProducts]"
92
- id="disableWoocommerceProducts"<?php if ( isset( $settings['disableWoocommerceProducts'] ) && $settings['disableWoocommerceProducts'] ) {
93
- echo ' checked="yes"';
94
- } ?> />
95
- <label for="disableWoocommerceProducts" class="onoffswitch-label"></label>
96
- <span class="switch-text"><?php _e( 'Disable on Woocommerce products.( Default : off )', 'mfbfw' ); ?></span>
97
- <div class="cf"></div>
98
- </fieldset>
99
- </td>
100
- </tr>
101
- </tbody>
102
  </table>
1
+ <h3><?php _e( 'Behavior Settings <span style="color:orange">(medium)</span>', 'mfbfw' ); ?></h3>
2
+ <p><?php _e( 'The following settings should be left alone unless you know what you are doing.', 'mfbfw' ); ?></p>
3
+ <table class="form-table fancy-table" style="clear:none;">
4
+ <tbody>
5
+ <tr valign="top">
6
+ <th scope="row"><?php _e( 'Close on Content Click', 'mfbfw' ); ?></th>
7
+ <td>
8
+ <fieldset>
9
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[hideOnContentClick]"
10
+ id="hideOnContentClick"<?php if ( isset( $settings['hideOnContentClick'] ) && $settings['hideOnContentClick'] ) {
11
+ echo ' checked="yes"';
12
+ } ?> />
13
+ <label for="hideOnContentClick" class="onoffswitch-label"></label>
14
+ <span class="switch-text"><?php _e( 'Close FancyBox by clicking on the image (default: off)', 'mfbfw' ); ?></span>
15
+ <div class="cf"></div>
16
+ <p class="description">
17
+ <em><?php _e( '(You may want to leave this off if you display iframed or inline content that containts clickable elements - for example: play buttons for movies, links to other pages)', 'mfbfw' ); ?>
18
+ </p>
19
+ </fieldset>
20
+ </td>
21
+ </tr>
22
+ <tr valign="top">
23
+ <th scope="row"><?php _e( 'Close on Overlay Click', 'mfbfw' ); ?></th>
24
+ <td>
25
+ <fieldset>
26
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[hideOnOverlayClick]"
27
+ id="hideOnOverlayClick"<?php if ( isset( $settings['hideOnOverlayClick'] ) && $settings['hideOnOverlayClick'] ) {
28
+ echo ' checked="yes"';
29
+ } ?> />
30
+ <label for="hideOnOverlayClick" class="onoffswitch-label"></label>
31
+ <span class="switch-text"><?php _e( 'Close FancyBox by clicking on the overlay sorrounding it (default: on)', 'mfbfw' ); ?></span>
32
+ <div class="cf"></div>
33
+ </fieldset>
34
+ </td>
35
+ </tr>
36
+ <tr valign="top">
37
+ <th scope="row"><?php _e( 'Keyboard navigation;', 'mfbfw' ); ?></th>
38
+ <td>
39
+ <fieldset>
40
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[enableEscapeButton]"
41
+ id="enableEscapeButton"<?php if ( isset( $settings['enableEscapeButton'] ) && $settings['enableEscapeButton'] ) {
42
+ echo ' checked="yes"';
43
+ } ?> />
44
+ <label for="enableEscapeButton" class="onoffswitch-label"></label>
45
+ <span class="switch-text"><?php _e( 'Enable Keyboard Navigation (default: on)', 'mfbfw' ); ?></span>
46
+ <div class="cf"></div>
47
+ </fieldset>
48
+ </td>
49
+ </tr>
50
+ <tr valign="top">
51
+ <th scope="row"><?php _e( 'Loop Galleries', 'mfbfw' ); ?></th>
52
+ <td>
53
+ <fieldset>
54
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[cyclic]"
55
+ id="cyclic"<?php if ( isset( $settings['cyclic'] ) && $settings['cyclic'] ) {
56
+ echo ' checked="yes"';
57
+ } ?> />
58
+ <label for="cyclic" class="onoffswitch-label"></label>
59
+ <span class="switch-text"><?php _e( 'This will make galleries loop, allowing you to keep pressing next/back (default: off)', 'mfbfw' ); ?></span>
60
+ <div class="cf"></div>
61
+ </fieldset>
62
+ </td>
63
+ </tr>
64
+ <tr valign="top">
65
+ <th scope="row"><?php _e( 'Mouse Wheel Navigation', 'mfbfw' ); ?></th>
66
+ <td>
67
+ <fieldset>
68
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[mouseWheel]"
69
+ id="mouseWheel"<?php if ( isset( $settings['mouseWheel'] ) && $settings['mouseWheel'] ) {
70
+ echo ' checked="yes"';
71
+ } ?> />
72
+ <label for="mouseWheel" class="onoffswitch-label"></label>
73
+ <span class="switch-text"><?php _e( 'Lets visitors navigate galleries with the mouse wheel (default: off)', 'mfbfw' ); ?></span>
74
+ <div class="cf"></div>
75
+ </fieldset>
76
+ </td>
77
+ </tr>
78
+ <tr valign="top">
79
+ <th scope="row"><?php _e( 'Woocommerce:', 'mfbfw' ); ?></th>
80
+ <td>
81
+ <fieldset>
82
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[disableWoocommercePages]"
83
+ id="disableWoocommercePages"<?php if ( isset( $settings['disableWoocommercePages'] ) && $settings['disableWoocommercePages'] ) {
84
+ echo ' checked="yes"';
85
+ } ?> />
86
+ <label for="disableWoocommercePages" class="onoffswitch-label"></label>
87
+ <span class="switch-text"><?php _e( 'Disable on Woocommerce Shop page.( Default : off )', 'mfbfw' ); ?></span>
88
+ <div class="cf"></div>
89
+ </fieldset>
90
+ <fieldset>
91
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[disableWoocommerceProducts]"
92
+ id="disableWoocommerceProducts"<?php if ( isset( $settings['disableWoocommerceProducts'] ) && $settings['disableWoocommerceProducts'] ) {
93
+ echo ' checked="yes"';
94
+ } ?> />
95
+ <label for="disableWoocommerceProducts" class="onoffswitch-label"></label>
96
+ <span class="switch-text"><?php _e( 'Disable on Woocommerce products.( Default : off )', 'mfbfw' ); ?></span>
97
+ <div class="cf"></div>
98
+ </fieldset>
99
+ </td>
100
+ </tr>
101
+ </tbody>
102
  </table>
lib/admin-tab-galleries.php CHANGED
@@ -1,54 +1,54 @@
1
- <h3><?php _e( 'Gallery Settings <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
2
- <p><?php _e( 'Here you can choose if you want the plugin to group all images into a gallery, or make a gallery for each post. You can also define you own jQuery expression if you like.', 'mfbfw' ); ?></p>
3
- <?php
4
- //customExpression fix for update ( fancybox uses data-fancybox attribute for grouping galleries )
5
- $settings['customExpression'] = str_replace('"rel"','"data-fancybox"',$settings['customExpression']);
6
-
7
- ?>
8
- <table class="form-table" style="clear:none;">
9
- <tbody>
10
- <tr valign="top">
11
- <th scope="row"><?php _e( 'Gallery Type', 'mfbfw' ); ?></th>
12
- <td>
13
- <input id="galleryTypeAll" class="galleryType" type="radio" value="all" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'all' ) echo ' checked="yes"'; ?> />
14
- <label for="galleryTypeAll">
15
- <?php _e( 'Make a gallery for all images on the page (default)', 'mfbfw' ); ?>
16
- </label><br /><br />
17
-
18
- <input id="galleryTypeNone" class="galleryType" type="radio" value="none" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'none' ) echo ' checked="yes"'; ?> />
19
- <label for="galleryTypeNone">
20
- <?php _e( 'Do not group images in gallery automatically (use this if you want to make galleries manually with the <code>REL</code> attribute)', 'mfbfw' ); ?>
21
- </label><br /><br />
22
-
23
- <input id="galleryTypePost" class="galleryType" type="radio" value="post" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'post' ) echo ' checked="yes"'; ?> />
24
- <label for="galleryTypePost">
25
- <?php _e( 'Make a gallery for each post (will only work if your theme uses <code>class="post"</code> on each post, which is common in WordPress', 'mfbfw' ); ?>
26
- </label><br /><br />
27
-
28
- <input id="galleryTypeCustom" class="galleryType" type="radio" value="custom" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'custom' ) echo ' checked="yes"'; ?> />
29
- <label for="galleryTypeCustom">
30
- <?php _e( 'Use a custom expression to apply FancyBox', 'mfbfw' ); ?>
31
- </label><br /><br />
32
- <fieldset>
33
- <div id="customExpressionBlock">
34
- <label for="mfbfw[customExpression]">
35
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
36
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[customExpression]" wrap="physical" id="customExpression"><?php echo ($settings[ 'customExpression' ]); ?></textarea>
37
- </label><br />
38
- <p class="description"><strong><em><?php _e( 'Custom expression guidelines:', 'mfbfw' ); ?></em></strong></p><br />
39
- <p class="description"><em><?php _e('&middot; The custom expression has to apply <code>class="fancybox"</code> to the links where you want to use FancyBox. Do not call the <code>fancybox()</code> function here, the plugin does this for you.', 'mfbfw'); ?></em></p><br />
40
- <p class="description"><em><?php _e('&middot; The jQuery <code>addClass()</code> function is a good way to add the class to the desired links conserving any existing class.', 'mfbfw'); ?></em></p><br />
41
- <p class="description"><em><?php _e('&middot; You can use <code>getTitle()</code> in your expression to copy the title attribute from the <code>IMG</code> tag to the <code>A</code> tag, so that FancyBox can show captions.', 'mfbfw'); ?></em></p><br />
42
- <p class="description"><em><?php _e('&middot; You can use <code>jQuery(thumbnails)</code> like in the example expression to apply FancyBox to thumbnails that link to these extensions: BMP, GIF, JPG, JPEG, PNG (both lowercase and uppercase).', 'mfbfw'); ?></em></p><br />
43
- <p class="description"><em><?php _e('&middot; If you want to do it manually you can use something like <code>jQuery("a:has(img)[href$=\'.jpg\']")</code> or whatever works for you.', 'mfbfw'); ?></em></p><br />
44
- <p class="description"><em><?php _e('See the <a href="http://docs.jquery.com/" target="_blank">jQuery Documentation</a> for more help.', 'mfbfw'); ?></em></p><br /><br />
45
- <p class="description"><strong><em><?php _e('Examples:', 'mfbfw'); ?></em></strong></p><br />
46
- <p class="description"><em><code>jQuery(thumbnails).addClass(&quot;fancybox&quot;).attr(&quot;rel&quot;,&quot;fancybox&quot;).getTitle();</code></em></p><br />
47
- <p class="description"><em><code>jQuery&quot;a:has(img)[href$='.jpg']&quot;).addClass&quot;fancybox&quot;).attr(&quot;rel&quot;,&quot;fancybox&quot;).getTitle();</code></em></p><br /><br />
48
- </div>
49
- </fieldset>
50
- </td>
51
- </tr>
52
-
53
- </tbody>
54
- </table>
1
+ <h3><?php _e( 'Gallery Settings <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
2
+ <p><?php _e( 'Here you can choose if you want the plugin to group all images into a gallery, or make a gallery for each post. You can also define you own jQuery expression if you like.', 'mfbfw' ); ?></p>
3
+ <?php
4
+ //customExpression fix for update ( fancybox uses data-fancybox attribute for grouping galleries )
5
+ $settings['customExpression'] = str_replace('"rel"','"data-fancybox"',$settings['customExpression']);
6
+
7
+ ?>
8
+ <table class="form-table" style="clear:none;">
9
+ <tbody>
10
+ <tr valign="top">
11
+ <th scope="row"><?php _e( 'Gallery Type', 'mfbfw' ); ?></th>
12
+ <td>
13
+ <input id="galleryTypeAll" class="galleryType" type="radio" value="all" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'all' ) echo ' checked="yes"'; ?> />
14
+ <label for="galleryTypeAll">
15
+ <?php _e( 'Make a gallery for all images on the page (default)', 'mfbfw' ); ?>
16
+ </label><br /><br />
17
+
18
+ <input id="galleryTypeNone" class="galleryType" type="radio" value="none" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'none' ) echo ' checked="yes"'; ?> />
19
+ <label for="galleryTypeNone">
20
+ <?php _e( 'Do not group images in gallery automatically (use this if you want to make galleries manually with the <code>REL</code> attribute)', 'mfbfw' ); ?>
21
+ </label><br /><br />
22
+
23
+ <input id="galleryTypePost" class="galleryType" type="radio" value="post" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'post' ) echo ' checked="yes"'; ?> />
24
+ <label for="galleryTypePost">
25
+ <?php _e( 'Make a gallery for each post (will only work if your theme uses <code>class="post"</code> on each post, which is common in WordPress', 'mfbfw' ); ?>
26
+ </label><br /><br />
27
+
28
+ <input id="galleryTypeCustom" class="galleryType" type="radio" value="custom" name="mfbfw[galleryType]"<?php if ( $settings[ 'galleryType' ] == 'custom' ) echo ' checked="yes"'; ?> />
29
+ <label for="galleryTypeCustom">
30
+ <?php _e( 'Use a custom expression to apply FancyBox', 'mfbfw' ); ?>
31
+ </label><br /><br />
32
+ <fieldset>
33
+ <div id="customExpressionBlock">
34
+ <label for="mfbfw[customExpression]">
35
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
36
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[customExpression]" wrap="physical" id="customExpression"><?php echo ($settings[ 'customExpression' ]); ?></textarea>
37
+ </label><br />
38
+ <p class="description"><strong><em><?php _e( 'Custom expression guidelines:', 'mfbfw' ); ?></em></strong></p><br />
39
+ <p class="description"><em><?php _e('&middot; The custom expression has to apply <code>class="fancybox"</code> to the links where you want to use FancyBox. Do not call the <code>fancybox()</code> function here, the plugin does this for you.', 'mfbfw'); ?></em></p><br />
40
+ <p class="description"><em><?php _e('&middot; The jQuery <code>addClass()</code> function is a good way to add the class to the desired links conserving any existing class.', 'mfbfw'); ?></em></p><br />
41
+ <p class="description"><em><?php _e('&middot; You can use <code>getTitle()</code> in your expression to copy the title attribute from the <code>IMG</code> tag to the <code>A</code> tag, so that FancyBox can show captions.', 'mfbfw'); ?></em></p><br />
42
+ <p class="description"><em><?php _e('&middot; You can use <code>jQuery(thumbnails)</code> like in the example expression to apply FancyBox to thumbnails that link to these extensions: BMP, GIF, JPG, JPEG, PNG (both lowercase and uppercase).', 'mfbfw'); ?></em></p><br />
43
+ <p class="description"><em><?php _e('&middot; If you want to do it manually you can use something like <code>jQuery("a:has(img)[href$=\'.jpg\']")</code> or whatever works for you.', 'mfbfw'); ?></em></p><br />
44
+ <p class="description"><em><?php _e('See the <a href="http://docs.jquery.com/" target="_blank">jQuery Documentation</a> for more help.', 'mfbfw'); ?></em></p><br /><br />
45
+ <p class="description"><strong><em><?php _e('Examples:', 'mfbfw'); ?></em></strong></p><br />
46
+ <p class="description"><em><code>jQuery(thumbnails).addClass(&quot;fancybox&quot;).attr(&quot;rel&quot;,&quot;fancybox&quot;).getTitle();</code></em></p><br />
47
+ <p class="description"><em><code>jQuery&quot;a:has(img)[href$='.jpg']&quot;).addClass&quot;fancybox&quot;).attr(&quot;rel&quot;,&quot;fancybox&quot;).getTitle();</code></em></p><br /><br />
48
+ </div>
49
+ </fieldset>
50
+ </td>
51
+ </tr>
52
+
53
+ </tbody>
54
+ </table>
lib/admin-tab-other.php CHANGED
@@ -1,199 +1,199 @@
1
- <h3><?php _e( 'Other Settings <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
2
- <p><?php _e( 'These are additional settings for advanced users.', 'mfbfw' ); ?></p>
3
- <table class="form-table fancy-table" style="clear:none;">
4
- <tbody>
5
- <tr valign="top">
6
- <th scope="row"><?php _e( 'Dimensions', 'mfbfw' ); ?></th>
7
- <td>
8
- <fieldset>
9
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[autoDimensions]"
10
- id="autoDimensions"<?php if ( isset( $settings['autoDimensions'] ) && $settings['autoDimensions'] ) {
11
- echo ' checked="yes"';
12
- } ?> />
13
- <label for="autoDimensions" class="onoffswitch-label"></label>
14
- <span class="switch-text"><?php _e( 'Auto detect dimensions (default: on)', 'mfbfw' ); ?></span>
15
- <div class="cf"></div>
16
- <p class="description">
17
- <em><?php _e( 'Only works with <strong>Ajax</strong> and <strong>Inline</strong> content! Flash dimensions won\'t be autodetected so specify them below if necessary. If you want to insert several pieces of flash content with different dimensions you will have to use the <strong>Additional FancyBox Calls</strong> option.', 'mfbfw' ); ?></em>
18
- </p>
19
- <div class="line-spacer"></div>
20
- <label for="frameWidth">
21
- <input type="text" name="mfbfw[frameWidth]" id="frameWidth"
22
- value="<?php echo $settings['frameWidth']; ?>" size="4" maxlength="4"/>
23
- <?php _e( 'Width for iframe and swf content. Also set for inline content if <em>autoDimensions</em> is disabled (default: 560)', 'mfbfw' ); ?>
24
- </label>
25
- <label for="frameHeight">
26
- <input type="text" name="mfbfw[frameHeight]" id="frameHeight"
27
- value="<?php echo $settings['frameHeight']; ?>" size="4" maxlength="4"/>
28
- <?php _e( 'Height for iframe and swf content. Also set for inline content if <em>autoDimensions</em> is disabled (default: 340)', 'mfbfw' ); ?>
29
- </label>
30
- </fieldset>
31
- </td>
32
- </tr>
33
- <tr valign="top">
34
- <th scope="row"><?php _e( 'Load JavaScript in Footer', 'mfbfw' ); ?></th>
35
- <td>
36
- <fieldset>
37
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[loadAtFooter]"
38
- id="loadAtFooter"<?php if ( isset( $settings['loadAtFooter'] ) && $settings['loadAtFooter'] ) {
39
- echo ' checked="yes"';
40
- } ?> />
41
- <label for="loadAtFooter" class="onoffswitch-label"></label>
42
- <span class="switch-text"><?php _e( 'Loads JavaScript at the end of the blog\'s HTML (experimental) (default: off)', 'mfbfw' ); ?></span>
43
- <div class="cf"></div>
44
- <p class="description">
45
- <em><?php _e( 'This option won\'t be recognized if you use <strong>Parallel Load</strong> plugin. In that case, you can do this from Parallel Load\'s options.', 'mfbfw' ); ?></em>
46
- </p>
47
- </fieldset>
48
- </td>
49
- </tr>
50
- <tr valign="top">
51
- <th scope="row"><?php _e( 'Callbacks', 'mfbfw' ); ?></th>
52
- <td>
53
- <fieldset>
54
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[callbackEnable]"
55
- id="callbackEnable"<?php if ( isset( $settings['callbackEnable'] ) && $settings['callbackEnable'] ) {
56
- echo ' checked="yes"';
57
- } ?> />
58
- <label for="callbackEnable" class="onoffswitch-label"></label>
59
- <span class="switch-text"><?php _e( 'Enable callbacks (default: off)', 'mfbfw' ); ?></span>
60
- <div class="cf"></div>
61
- <p class="description"><em><?php _e( 'Enabling this will show additional settings.', 'mfbfw' ); ?></em>
62
- </p>
63
- <div class="line-spacer"></div>
64
- <div id="callbackBlock">
65
- <?php _e( 'Callback on <strong>Start</strong> event: Will be called right before attempting to load the content', 'mfbfw' ); ?>
66
- <div class="line-spacer"></div>
67
- <label for="callbackOnStart">
68
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
69
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnStart]"
70
- wrap="physical"
71
- id="callbackOnStart"><?php echo( $settings['callbackOnStart'] ); ?></textarea>
72
- </label>
73
- <?php _e( 'Callback on <strong>Cancel</strong> event: Will be called after loading is canceled', 'mfbfw' ); ?>
74
- <div class="line-spacer"></div>
75
- <label for="callbackOnCancel">
76
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
77
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnCancel]"
78
- wrap="physical"
79
- id="callbackOnCancel"><?php echo( $settings['callbackOnCancel'] ); ?></textarea>
80
- </label>
81
- <?php _e( 'Callback on <strong>Complete</strong> event: Will be called once the content is displayed', 'mfbfw' ); ?>
82
- <div class="line-spacer"></div>
83
- <label for="callbackOnComplete">
84
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
85
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnComplete]"
86
- wrap="physical"
87
- id="callbackOnComplete"><?php echo( $settings['callbackOnComplete'] ); ?></textarea>
88
- </label>
89
- <?php _e( 'Callback on <strong>CleanUp</strong> event: Will be called just before closing', 'mfbfw' ); ?>
90
- <div class="line-spacer"></div>
91
- <label for="callbackOnCleanup">
92
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
93
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnCleanup]"
94
- wrap="physical"
95
- id="callbackOnCleanup"><?php echo( $settings['callbackOnCleanup'] ); ?></textarea>
96
- </label>
97
- <?php _e( 'Callback on <strong>Closed</strong> event: Will be called once FancyBox is closed', 'mfbfw' ); ?>
98
- <div class="line-spacer"></div>
99
- <label for="callbackOnClosed">
100
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
101
- <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnClose]"
102
- wrap="physical"
103
- id="callbackOnClosed"><?php echo( $settings['callbackOnClose'] ); ?></textarea>
104
- </label>
105
- <p class="description"><strong><em><?php _e( 'Example:', 'mfbfw' ); ?></em></strong></p>
106
- <p class="description"><em><code>function() { alert('Hello world!'); }</code></em></p>
107
- <p class="description">
108
- <em><?php _e( 'Leave empty any speciic callbacks you don\'t need to use.', 'mfbfw' ); ?></em>
109
- </p>
110
- </div>
111
- </fieldset>
112
- </td>
113
- </tr>
114
- </tbody>
115
- </table>
116
- <h3><?php _e( 'Extra FancyBox Calls <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
117
- <p><?php _e( 'Here you can add as many additional calls to fancybox as you want, with different settings. For example, if you want to use fancybox with iframes or ajax on any specific link, you can configure those calls here without affecting the settings for images.', 'mfbfw' ); ?></p>
118
- <p><?php _e( 'For information on the options available you can use here see <a href="http://fancyapps.com/fancybox/3/">FancyBox\'s API & Options page</a>.', 'mfbfw' ); ?></p>
119
- <table class="form-table fancy-table" style="clear:none;">
120
- <tbody>
121
- <tr valign="top">
122
- <th scope="row"><?php _e( 'Additional FancyBox Calls', 'mfbfw' ); ?></th>
123
- <td>
124
- <fieldset>
125
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[extraCallsEnable]"
126
- id="extraCallsEnable"<?php if ( isset( $settings['extraCallsEnable'] ) && $settings['extraCallsEnable'] ) {
127
- echo ' checked="yes"';
128
- } ?> />
129
- <label for="extraCallsEnable" class="onoffswitch-label"></label>
130
- <span class="switch-text"><?php _e( 'Additional FancyBox Calls (default: off)', 'mfbfw' ); ?></span>
131
- <div class="cf"></div>
132
- <div class="line-spacer"></div>
133
- <div id="extraCallsBlock">
134
- <label for="extraCalls">
135
- <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
136
- <textarea rows="20" cols="50" class="large-text code" name="mfbfw[extraCallsData]"
137
- wrap="physical"
138
- id="extraCalls"><?php echo( $settings['extraCallsData'] ); ?></textarea>
139
- </label>
140
- <p class="description"><strong><em><?php _e( 'Example:', 'mfbfw' ); ?></em></strong></p><br/>
141
- <p class="description"><em><code>
142
- jQuery("#login a").fancybox({<br/>
143
- &nbsp;&nbsp;'transitionIn': 'elastic',<br/>
144
- &nbsp;&nbsp;'speedIn': 600,<br/>
145
- &nbsp;&nbsp;'speedOut': 200,<br/>
146
- &nbsp;&nbsp;'type': 'iframe'<br/>
147
- });
148
- </code></em></p>
149
- </div>
150
- </fieldset>
151
- </td>
152
- </tr>
153
- </tbody>
154
- </table>
155
- <h3><?php _e( 'Troubleshooting Settings', 'mfbfw' ); ?></h3>
156
- <p>
157
- <span style="font-weight:bold;color:red;"><?php _e( 'Settings in this section should only be changed if you are having problems with the plugin!', 'mfbfw' ); ?></span>
158
- </p>
159
- <p><?php _e( 'If the plugin doesn\'t seem to work, first you should check for other plugins that may be conflicting with this one, especially other Lightbox, Slimbox, etc. Make sure all your plugins and WordPress itself are up to date (this plugin has only been tested in WordPress 2.7 and above).', 'mfbfw' ); ?></p>
160
- <p><?php _e( 'Change them one at a time and test to see if they help. Remember that having a cache plugin may prevent changes from taking effect immidiately, so clear cache after saving changes here or deactivate cache until you finish editing these options.', 'mfbfw' ); ?></p>
161
- <br/>
162
- <table class="form-table fancy-table" style="clear:none;">
163
- <tbody>
164
- <tr valign="top">
165
- <th scope="row"><?php _e( 'Do not call jQuery', 'mfbfw' ); ?></th>
166
- <td>
167
- <fieldset>
168
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[nojQuery]"
169
- id="nojQuery"<?php if ( isset( $settings['nojQuery'] ) && $settings['nojQuery'] ) {
170
- echo ' checked="yes"';
171
- } ?> />
172
- <label for="nojQuery" class="onoffswitch-label"></label>
173
- <span class="switch-text"><?php _e( 'Skip jQuery call. Use this only if jQuery is being loaded twice (default: off)', 'mfbfw' ); ?></span>
174
- <div class="cf"></div>
175
- </fieldset>
176
- </td>
177
- </tr>
178
- </tbody>
179
- </table>
180
- <h3><?php _e( 'Uninstall', 'mfbfw' ); ?></h3>
181
- <p><?php _e( 'Like many other plugins, FancyBox for WordPress stores its settings on your WordPress\' options database table. Actually, these settings are not using more than a couple of kilobytes of space, but if you want to completely uninstall this plugin, check the option below, then save changes, and <strong>when you deactivate the plugin</strong>, all its settings will be removed from the database.', 'mfbfw' ); ?></p>
182
- <table class="form-table fancy-table" style="clear:none;">
183
- <tbody>
184
- <tr valign="top">
185
- <th scope="row"><?php _e( 'Remove settings', 'mfbfw' ); ?></th>
186
- <td>
187
- <fieldset>
188
- <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[uninstall]"
189
- id="uninstall"<?php if ( isset( $settings['uninstall'] ) && $settings['uninstall'] ) {
190
- echo ' checked="yes"';
191
- } ?> />
192
- <label for="uninstall" class="onoffswitch-label"></label>
193
- <span class="switch-text"><?php _e( 'Remove Settings when plugin is deactivated from the "Manage Plugins" page. (default: off)', 'mfbfw' ); ?></span>
194
- <div class="cf"></div>
195
- </fieldset>
196
- </td>
197
- </tr>
198
- </tbody>
199
  </table>
1
+ <h3><?php _e( 'Other Settings <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
2
+ <p><?php _e( 'These are additional settings for advanced users.', 'mfbfw' ); ?></p>
3
+ <table class="form-table fancy-table" style="clear:none;">
4
+ <tbody>
5
+ <tr valign="top">
6
+ <th scope="row"><?php _e( 'Dimensions', 'mfbfw' ); ?></th>
7
+ <td>
8
+ <fieldset>
9
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[autoDimensions]"
10
+ id="autoDimensions"<?php if ( isset( $settings['autoDimensions'] ) && $settings['autoDimensions'] ) {
11
+ echo ' checked="yes"';
12
+ } ?> />
13
+ <label for="autoDimensions" class="onoffswitch-label"></label>
14
+ <span class="switch-text"><?php _e( 'Auto detect dimensions (default: on)', 'mfbfw' ); ?></span>
15
+ <div class="cf"></div>
16
+ <p class="description">
17
+ <em><?php _e( 'Only works with <strong>Ajax</strong> and <strong>Inline</strong> content! Flash dimensions won\'t be autodetected so specify them below if necessary. If you want to insert several pieces of flash content with different dimensions you will have to use the <strong>Additional FancyBox Calls</strong> option.', 'mfbfw' ); ?></em>
18
+ </p>
19
+ <div class="line-spacer"></div>
20
+ <label for="frameWidth">
21
+ <input type="text" name="mfbfw[frameWidth]" id="frameWidth"
22
+ value="<?php echo $settings['frameWidth']; ?>" size="4" maxlength="4"/>
23
+ <?php _e( 'Width for iframe and swf content. Also set for inline content if <em>autoDimensions</em> is disabled (default: 560)', 'mfbfw' ); ?>
24
+ </label>
25
+ <label for="frameHeight">
26
+ <input type="text" name="mfbfw[frameHeight]" id="frameHeight"
27
+ value="<?php echo $settings['frameHeight']; ?>" size="4" maxlength="4"/>
28
+ <?php _e( 'Height for iframe and swf content. Also set for inline content if <em>autoDimensions</em> is disabled (default: 340)', 'mfbfw' ); ?>
29
+ </label>
30
+ </fieldset>
31
+ </td>
32
+ </tr>
33
+ <tr valign="top">
34
+ <th scope="row"><?php _e( 'Load JavaScript in Footer', 'mfbfw' ); ?></th>
35
+ <td>
36
+ <fieldset>
37
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[loadAtFooter]"
38
+ id="loadAtFooter"<?php if ( isset( $settings['loadAtFooter'] ) && $settings['loadAtFooter'] ) {
39
+ echo ' checked="yes"';
40
+ } ?> />
41
+ <label for="loadAtFooter" class="onoffswitch-label"></label>
42
+ <span class="switch-text"><?php _e( 'Loads JavaScript at the end of the blog\'s HTML (experimental) (default: off)', 'mfbfw' ); ?></span>
43
+ <div class="cf"></div>
44
+ <p class="description">
45
+ <em><?php _e( 'This option won\'t be recognized if you use <strong>Parallel Load</strong> plugin. In that case, you can do this from Parallel Load\'s options.', 'mfbfw' ); ?></em>
46
+ </p>
47
+ </fieldset>
48
+ </td>
49
+ </tr>
50
+ <tr valign="top">
51
+ <th scope="row"><?php _e( 'Callbacks', 'mfbfw' ); ?></th>
52
+ <td>
53
+ <fieldset>
54
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[callbackEnable]"
55
+ id="callbackEnable"<?php if ( isset( $settings['callbackEnable'] ) && $settings['callbackEnable'] ) {
56
+ echo ' checked="yes"';
57
+ } ?> />
58
+ <label for="callbackEnable" class="onoffswitch-label"></label>
59
+ <span class="switch-text"><?php _e( 'Enable callbacks (default: off)', 'mfbfw' ); ?></span>
60
+ <div class="cf"></div>
61
+ <p class="description"><em><?php _e( 'Enabling this will show additional settings.', 'mfbfw' ); ?></em>
62
+ </p>
63
+ <div class="line-spacer"></div>
64
+ <div id="callbackBlock">
65
+ <?php _e( 'Callback on <strong>Start</strong> event: Will be called right before attempting to load the content', 'mfbfw' ); ?>
66
+ <div class="line-spacer"></div>
67
+ <label for="callbackOnStart">
68
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
69
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnStart]"
70
+ wrap="physical"
71
+ id="callbackOnStart"><?php echo( $settings['callbackOnStart'] ); ?></textarea>
72
+ </label>
73
+ <?php _e( 'Callback on <strong>Cancel</strong> event: Will be called after loading is canceled', 'mfbfw' ); ?>
74
+ <div class="line-spacer"></div>
75
+ <label for="callbackOnCancel">
76
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
77
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnCancel]"
78
+ wrap="physical"
79
+ id="callbackOnCancel"><?php echo( $settings['callbackOnCancel'] ); ?></textarea>
80
+ </label>
81
+ <?php _e( 'Callback on <strong>Complete</strong> event: Will be called once the content is displayed', 'mfbfw' ); ?>
82
+ <div class="line-spacer"></div>
83
+ <label for="callbackOnComplete">
84
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
85
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnComplete]"
86
+ wrap="physical"
87
+ id="callbackOnComplete"><?php echo( $settings['callbackOnComplete'] ); ?></textarea>
88
+ </label>
89
+ <?php _e( 'Callback on <strong>CleanUp</strong> event: Will be called just before closing', 'mfbfw' ); ?>
90
+ <div class="line-spacer"></div>
91
+ <label for="callbackOnCleanup">
92
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
93
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnCleanup]"
94
+ wrap="physical"
95
+ id="callbackOnCleanup"><?php echo( $settings['callbackOnCleanup'] ); ?></textarea>
96
+ </label>
97
+ <?php _e( 'Callback on <strong>Closed</strong> event: Will be called once FancyBox is closed', 'mfbfw' ); ?>
98
+ <div class="line-spacer"></div>
99
+ <label for="callbackOnClosed">
100
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
101
+ <textarea rows="10" cols="50" class="large-text code" name="mfbfw[callbackOnClose]"
102
+ wrap="physical"
103
+ id="callbackOnClosed"><?php echo( $settings['callbackOnClose'] ); ?></textarea>
104
+ </label>
105
+ <p class="description"><strong><em><?php _e( 'Example:', 'mfbfw' ); ?></em></strong></p>
106
+ <p class="description"><em><code>function() { alert('Hello world!'); }</code></em></p>
107
+ <p class="description">
108
+ <em><?php _e( 'Leave empty any speciic callbacks you don\'t need to use.', 'mfbfw' ); ?></em>
109
+ </p>
110
+ </div>
111
+ </fieldset>
112
+ </td>
113
+ </tr>
114
+ </tbody>
115
+ </table>
116
+ <h3><?php _e( 'Extra FancyBox Calls <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
117
+ <p><?php _e( 'Here you can add as many additional calls to fancybox as you want, with different settings. For example, if you want to use fancybox with iframes or ajax on any specific link, you can configure those calls here without affecting the settings for images.', 'mfbfw' ); ?></p>
118
+ <p><?php _e( 'For information on the options available you can use here see <a href="http://fancyapps.com/fancybox/3/">FancyBox\'s API & Options page</a>.', 'mfbfw' ); ?></p>
119
+ <table class="form-table fancy-table" style="clear:none;">
120
+ <tbody>
121
+ <tr valign="top">
122
+ <th scope="row"><?php _e( 'Additional FancyBox Calls', 'mfbfw' ); ?></th>
123
+ <td>
124
+ <fieldset>
125
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[extraCallsEnable]"
126
+ id="extraCallsEnable"<?php if ( isset( $settings['extraCallsEnable'] ) && $settings['extraCallsEnable'] ) {
127
+ echo ' checked="yes"';
128
+ } ?> />
129
+ <label for="extraCallsEnable" class="onoffswitch-label"></label>
130
+ <span class="switch-text"><?php _e( 'Additional FancyBox Calls (default: off)', 'mfbfw' ); ?></span>
131
+ <div class="cf"></div>
132
+ <div class="line-spacer"></div>
133
+ <div id="extraCallsBlock">
134
+ <label for="extraCalls">
135
+ <div class="start-editing"><p><?php _e( 'Click to start editing', 'mfbfw' ); ?></p></div>
136
+ <textarea rows="20" cols="50" class="large-text code" name="mfbfw[extraCallsData]"
137
+ wrap="physical"
138
+ id="extraCalls"><?php echo( $settings['extraCallsData'] ); ?></textarea>
139
+ </label>
140
+ <p class="description"><strong><em><?php _e( 'Example:', 'mfbfw' ); ?></em></strong></p><br/>
141
+ <p class="description"><em><code>
142
+ jQuery("#login a").fancybox({<br/>
143
+ &nbsp;&nbsp;'transitionIn': 'elastic',<br/>
144
+ &nbsp;&nbsp;'speedIn': 600,<br/>
145
+ &nbsp;&nbsp;'speedOut': 200,<br/>
146
+ &nbsp;&nbsp;'type': 'iframe'<br/>
147
+ });
148
+ </code></em></p>
149
+ </div>
150
+ </fieldset>
151
+ </td>
152
+ </tr>
153
+ </tbody>
154
+ </table>
155
+ <h3><?php _e( 'Troubleshooting Settings', 'mfbfw' ); ?></h3>
156
+ <p>
157
+ <span style="font-weight:bold;color:red;"><?php _e( 'Settings in this section should only be changed if you are having problems with the plugin!', 'mfbfw' ); ?></span>
158
+ </p>
159
+ <p><?php _e( 'If the plugin doesn\'t seem to work, first you should check for other plugins that may be conflicting with this one, especially other Lightbox, Slimbox, etc. Make sure all your plugins and WordPress itself are up to date (this plugin has only been tested in WordPress 2.7 and above).', 'mfbfw' ); ?></p>
160
+ <p><?php _e( 'Change them one at a time and test to see if they help. Remember that having a cache plugin may prevent changes from taking effect immidiately, so clear cache after saving changes here or deactivate cache until you finish editing these options.', 'mfbfw' ); ?></p>
161
+ <br/>
162
+ <table class="form-table fancy-table" style="clear:none;">
163
+ <tbody>
164
+ <tr valign="top">
165
+ <th scope="row"><?php _e( 'Do not call jQuery', 'mfbfw' ); ?></th>
166
+ <td>
167
+ <fieldset>
168
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[nojQuery]"
169
+ id="nojQuery"<?php if ( isset( $settings['nojQuery'] ) && $settings['nojQuery'] ) {
170
+ echo ' checked="yes"';
171
+ } ?> />
172
+ <label for="nojQuery" class="onoffswitch-label"></label>
173
+ <span class="switch-text"><?php _e( 'Skip jQuery call. Use this only if jQuery is being loaded twice (default: off)', 'mfbfw' ); ?></span>
174
+ <div class="cf"></div>
175
+ </fieldset>
176
+ </td>
177
+ </tr>
178
+ </tbody>
179
+ </table>
180
+ <h3><?php _e( 'Uninstall', 'mfbfw' ); ?></h3>
181
+ <p><?php _e( 'Like many other plugins, FancyBox for WordPress stores its settings on your WordPress\' options database table. Actually, these settings are not using more than a couple of kilobytes of space, but if you want to completely uninstall this plugin, check the option below, then save changes, and <strong>when you deactivate the plugin</strong>, all its settings will be removed from the database.', 'mfbfw' ); ?></p>
182
+ <table class="form-table fancy-table" style="clear:none;">
183
+ <tbody>
184
+ <tr valign="top">
185
+ <th scope="row"><?php _e( 'Remove settings', 'mfbfw' ); ?></th>
186
+ <td>
187
+ <fieldset>
188
+ <input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[uninstall]"
189
+ id="uninstall"<?php if ( isset( $settings['uninstall'] ) && $settings['uninstall'] ) {
190
+ echo ' checked="yes"';
191
+ } ?> />
192
+ <label for="uninstall" class="onoffswitch-label"></label>
193
+ <span class="switch-text"><?php _e( 'Remove Settings when plugin is deactivated from the "Manage Plugins" page. (default: off)', 'mfbfw' ); ?></span>
194
+ <div class="cf"></div>
195
+ </fieldset>
196
+ </td>
197
+ </tr>
198
+ </tbody>
199
  </table>
lib/admin-tab-support.php CHANGED
@@ -1,13 +1,13 @@
1
- <h3><?php _e( 'Help with Fancybox' ); ?></h3>
2
- <ul style="list-style-type:disc;padding-left:15px;">
3
- <li><?php _e( 'If you have problems or questions about FancyBox itself (and not this WordPress plugin), please start with these links: <a target="_blank" href="http://fancyapps.com/fancybox/3/">How-To</a> & <a target="_blank" href="http://fancyapps.com/fancybox/3/docs/">Documentation</a>.<br />If that does not help, go to <a target="_blank" href="http://groups.google.com/group/fancybox">the FancyBox Google Group</a>, use the <strong>Search</strong> option, and if necesary, post your question.', 'mfbfw' ); ?></li>
4
- </ul>
5
-
6
- <h3><?php _e( 'Help with Fancybox for WordPress plugin' ); ?></h3>
7
- <ul style="list-style-type:disc;padding-left:15px;">
8
- <li><?php _e( 'Try to localize the problem (switch your theme and deactivate plugins until you find the source of the problem). You can also try the Troubleshooting settings of this plugin if necesary.', 'mfbfw' ); ?></li>
9
- <li><?php _e( "Try reverting the plugin's settings to their defaults with the button below.", 'mfbfw' ); ?></li>
10
- <li><?php _e( 'If you still can not get the plugin to work, <a target="_blank" href="http://wordpress.org/support/plugin/fancybox-for-wordpress#postform">write a post in the WordPress Support forums</a> explaining the problem or take a look and the <a target="_blank" href="http://wordpress.org/support/plugin/fancybox-for-wordpress">already posted messages</a>.', 'mfbfw' ); ?></li>
11
- </ul>
12
-
13
  <p style="font-weight:bold;color:red"><span style="color:#333"><?php _e( 'IMPORTANT:' ); ?></span> <?php _e( 'When posting your problem please provide a link to your blog and the page where the error is found, and all relevant information you can, especially your theme, plugins, etc.' ); ?></p>
1
+ <h3><?php _e( 'Help with Fancybox' ); ?></h3>
2
+ <ul style="list-style-type:disc;padding-left:15px;">
3
+ <li><?php _e( 'If you have problems or questions about FancyBox itself (and not this WordPress plugin), please start with these links: <a target="_blank" href="http://fancyapps.com/fancybox/3/">How-To</a> & <a target="_blank" href="http://fancyapps.com/fancybox/3/docs/">Documentation</a>.<br />If that does not help, go to <a target="_blank" href="http://groups.google.com/group/fancybox">the FancyBox Google Group</a>, use the <strong>Search</strong> option, and if necesary, post your question.', 'mfbfw' ); ?></li>
4
+ </ul>
5
+
6
+ <h3><?php _e( 'Help with Fancybox for WordPress plugin' ); ?></h3>
7
+ <ul style="list-style-type:disc;padding-left:15px;">
8
+ <li><?php _e( 'Try to localize the problem (switch your theme and deactivate plugins until you find the source of the problem). You can also try the Troubleshooting settings of this plugin if necesary.', 'mfbfw' ); ?></li>
9
+ <li><?php _e( "Try reverting the plugin's settings to their defaults with the button below.", 'mfbfw' ); ?></li>
10
+ <li><?php _e( 'If you still can not get the plugin to work, <a target="_blank" href="http://wordpress.org/support/plugin/fancybox-for-wordpress#postform">write a post in the WordPress Support forums</a> explaining the problem or take a look and the <a target="_blank" href="http://wordpress.org/support/plugin/fancybox-for-wordpress">already posted messages</a>.', 'mfbfw' ); ?></li>
11
+ </ul>
12
+
13
  <p style="font-weight:bold;color:red"><span style="color:#333"><?php _e( 'IMPORTANT:' ); ?></span> <?php _e( 'When posting your problem please provide a link to your blog and the page where the error is found, and all relevant information you can, especially your theme, plugins, etc.' ); ?></p>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: silkalns
3
  Tags: fancybox, lightbox, jquery, gallery, image, images, photo, photos, picture, pictures, zoom
4
  Requires at least: 3.4
5
  Tested up to: 5.0
6
- Stable tag: 3.1.6
7
  License: GPL/MIT
8
 
9
  Seamlessly integrates FancyBox lightbox into your WordPress blog: Upload, activate, and you're done. Additional configuration optional.
@@ -31,6 +31,10 @@ If you enjoy using FancyBox lightbox for WordPress please leave a [positive feed
31
 
32
  == Changelog ==
33
 
 
 
 
 
34
  = 3.1.6 =
35
  * Removed rollback functionality
36
 
3
  Tags: fancybox, lightbox, jquery, gallery, image, images, photo, photos, picture, pictures, zoom
4
  Requires at least: 3.4
5
  Tested up to: 5.0
6
+ Stable tag: 3.1.7
7
  License: GPL/MIT
8
 
9
  Seamlessly integrates FancyBox lightbox into your WordPress blog: Upload, activate, and you're done. Additional configuration optional.
31
 
32
  == Changelog ==
33
 
34
+ = 3.1.7 =
35
+ * Fixed incompatibilty with Envira Gallery
36
+ * Fixed incompatibilty with NextGen Gallery
37
+
38
  = 3.1.6 =
39
  * Removed rollback functionality
40