@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | if ('true' === $this->get_setting('printCss')) { |
90 | 90 | $theme = $this->get_theme(); |
91 | - wp_enqueue_style('metaslider-' . $this->get_setting('type') . '-slider-' . $theme, METASLIDER_ASSETS_URL . "sliders/nivoslider/themes/{$theme}/{$theme}.css", false, METASLIDER_VERSION); |
|
91 | + wp_enqueue_style('metaslider-'.$this->get_setting('type').'-slider-'.$theme, METASLIDER_ASSETS_URL."sliders/nivoslider/themes/{$theme}/{$theme}.css", false, METASLIDER_VERSION); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | { |
116 | 116 | $return_value = "<div class='slider-wrapper theme-{$this->get_theme()}'>"; |
117 | 117 | $return_value .= "\n <div class='ribbon'></div>"; |
118 | - $return_value .= "\n <div id='" . $this->get_identifier() . "' class='nivoSlider'>"; |
|
118 | + $return_value .= "\n <div id='".$this->get_identifier()."' class='nivoSlider'>"; |
|
119 | 119 | |
120 | 120 | foreach ($this->slides as $slide) { |
121 | - $return_value .= "\n " . $slide; |
|
121 | + $return_value .= "\n ".$slide; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $return_value .= "\n </div>\n </div>"; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | protected function get_html() |
45 | 45 | { |
46 | - $return_value = "<ul id='" . $this->get_identifier() . "' class='rslides'>"; |
|
46 | + $return_value = "<ul id='".$this->get_identifier()."' class='rslides'>"; |
|
47 | 47 | |
48 | 48 | $first = true; |
49 | 49 | foreach ($this->slides as $slide) { |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | if (!$first) { |
53 | 53 | $style = " style='display: none;'"; |
54 | 54 | } |
55 | - $return_value .= "\n <li{$style}>" . $slide . '</li>'; |
|
56 | - $first = false; |
|
55 | + $return_value .= "\n <li{$style}>".$slide.'</li>'; |
|
56 | + $first = false; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $return_value .= "\n </ul>"; |
@@ -49,10 +49,10 @@ |
||
49 | 49 | */ |
50 | 50 | protected function get_html() |
51 | 51 | { |
52 | - $return_value = "<div id='" . $this->get_identifier() . "' class='coin-slider'>"; |
|
52 | + $return_value = "<div id='".$this->get_identifier()."' class='coin-slider'>"; |
|
53 | 53 | |
54 | 54 | foreach ($this->slides as $slide) { |
55 | - $return_value .= "\n" . $slide; |
|
55 | + $return_value .= "\n".$slide; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $return_value .= "\n </div>"; |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | define('WP_USE_THEMES', false); |
4 | 4 | |
5 | -require(dirname(dirname(dirname(__DIR__))) . '/wp-blog-header.php'); |
|
5 | +require(dirname(dirname(dirname(__DIR__))).'/wp-blog-header.php'); |
|
6 | 6 | |
7 | 7 | if (isset($_GET['slider_id']) && (int)$_GET['slider_id'] > 0) { |
8 | 8 | add_filter('show_admin_bar', '__return_false'); |
@@ -316,10 +316,10 @@ discard block |
||
316 | 316 | |
317 | 317 | // documentation tab |
318 | 318 | $screen->add_help_tab(array( |
319 | - 'id' => 'documentation', |
|
320 | - 'title' => __('Documentation'), |
|
321 | - 'content' => "<p><a href='http://www.metaslider.com/documentation/' target='blank'>Meta Slider Documentation</a></p>" |
|
322 | - )); |
|
319 | + 'id' => 'documentation', |
|
320 | + 'title' => __('Documentation'), |
|
321 | + 'content' => "<p><a href='http://www.metaslider.com/documentation/' target='blank'>Meta Slider Documentation</a></p>" |
|
322 | + )); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -480,10 +480,10 @@ discard block |
||
480 | 480 | |
481 | 481 | // insert the post |
482 | 482 | $id = wp_insert_post(array( |
483 | - 'post_title' => __('New Slider', 'metaslider'), |
|
484 | - 'post_status' => 'publish', |
|
485 | - 'post_type' => 'ml-slider' |
|
486 | - )); |
|
483 | + 'post_title' => __('New Slider', 'metaslider'), |
|
484 | + 'post_status' => 'publish', |
|
485 | + 'post_type' => 'ml-slider' |
|
486 | + )); |
|
487 | 487 | |
488 | 488 | // insert the post meta |
489 | 489 | add_post_meta($id, 'ml-slider_settings', $defaults, true); |
@@ -507,9 +507,9 @@ discard block |
||
507 | 507 | |
508 | 508 | // send the post to trash |
509 | 509 | wp_update_post(array( |
510 | - 'ID' => $id, |
|
511 | - 'post_status' => 'trash' |
|
512 | - )); |
|
510 | + 'ID' => $id, |
|
511 | + 'post_status' => 'trash' |
|
512 | + )); |
|
513 | 513 | |
514 | 514 | return $this->find_slider('date', 'DESC'); |
515 | 515 | } |
@@ -20,30 +20,30 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | define('METASLIDER_VERSION', '2.6.3'); |
23 | -define('METASLIDER_BASE_URL', plugins_url('ml-slider') . '/'); //plugin_dir_url(__FILE__) |
|
24 | -define('METASLIDER_ASSETS_URL', METASLIDER_BASE_URL . 'assets/'); |
|
23 | +define('METASLIDER_BASE_URL', plugins_url('ml-slider').'/'); //plugin_dir_url(__FILE__) |
|
24 | +define('METASLIDER_ASSETS_URL', METASLIDER_BASE_URL.'assets/'); |
|
25 | 25 | define('METASLIDER_BASE_DIR_LONG', __DIR__); |
26 | -define('METASLIDER_INC_DIR', METASLIDER_BASE_DIR_LONG . '/inc/'); |
|
26 | +define('METASLIDER_INC_DIR', METASLIDER_BASE_DIR_LONG.'/inc/'); |
|
27 | 27 | |
28 | 28 | // include slider classes |
29 | -require_once(METASLIDER_INC_DIR . 'slider/metaslider.class.php'); |
|
30 | -require_once(METASLIDER_INC_DIR . 'slider/metaslider.coin.class.php'); |
|
31 | -require_once(METASLIDER_INC_DIR . 'slider/metaslider.flex.class.php'); |
|
32 | -require_once(METASLIDER_INC_DIR . 'slider/metaslider.nivo.class.php'); |
|
33 | -require_once(METASLIDER_INC_DIR . 'slider/metaslider.responsive.class.php'); |
|
29 | +require_once(METASLIDER_INC_DIR.'slider/metaslider.class.php'); |
|
30 | +require_once(METASLIDER_INC_DIR.'slider/metaslider.coin.class.php'); |
|
31 | +require_once(METASLIDER_INC_DIR.'slider/metaslider.flex.class.php'); |
|
32 | +require_once(METASLIDER_INC_DIR.'slider/metaslider.nivo.class.php'); |
|
33 | +require_once(METASLIDER_INC_DIR.'slider/metaslider.responsive.class.php'); |
|
34 | 34 | |
35 | 35 | // include slide classes |
36 | -require_once(METASLIDER_INC_DIR . 'slide/metaslide.class.php'); |
|
37 | -require_once(METASLIDER_INC_DIR . 'slide/metaslide.image.class.php'); |
|
36 | +require_once(METASLIDER_INC_DIR.'slide/metaslide.class.php'); |
|
37 | +require_once(METASLIDER_INC_DIR.'slide/metaslide.image.class.php'); |
|
38 | 38 | |
39 | 39 | // include image helper |
40 | -require_once(METASLIDER_INC_DIR . 'metaslider.imagehelper.class.php'); |
|
40 | +require_once(METASLIDER_INC_DIR.'metaslider.imagehelper.class.php'); |
|
41 | 41 | |
42 | 42 | // include widget |
43 | -require_once(METASLIDER_INC_DIR . 'metaslider.widget.class.php'); |
|
43 | +require_once(METASLIDER_INC_DIR.'metaslider.widget.class.php'); |
|
44 | 44 | |
45 | 45 | // include system check |
46 | -require_once(METASLIDER_INC_DIR . 'metaslider.systemcheck.class.php'); |
|
46 | +require_once(METASLIDER_INC_DIR.'metaslider.systemcheck.class.php'); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Register the plugin. |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function upgrade_to_pro($links) |
107 | 107 | { |
108 | 108 | if (function_exists('is_plugin_active') && !is_plugin_active('ml-slider-pro/ml-slider-pro.php')) { |
109 | - $links[] = '<a href="http://www.metaslider.com/upgrade" target="_blank">' . __('Go Pro', 'metaslider') . '</a>'; |
|
109 | + $links[] = '<a href="http://www.metaslider.com/upgrade" target="_blank">'.__('Go Pro', 'metaslider').'</a>'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $links; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function iframe() |
129 | 129 | { |
130 | - wp_enqueue_style('metaslider-admin-styles', METASLIDER_ASSETS_URL . 'metaslider/admin.css', false, METASLIDER_VERSION); |
|
130 | + wp_enqueue_style('metaslider-admin-styles', METASLIDER_ASSETS_URL.'metaslider/admin.css', false, METASLIDER_VERSION); |
|
131 | 131 | wp_enqueue_script('google-font-api', 'http://fonts.googleapis.com/css?family=PT+Sans:400,700'); |
132 | 132 | |
133 | 133 | $link = apply_filters('metaslider_hoplink', 'http://www.metaslider.com/upgrade/'); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function load_plugin_textdomain() |
158 | 158 | { |
159 | - load_plugin_textdomain('metaslider', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
|
159 | + load_plugin_textdomain('metaslider', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | */ |
221 | 221 | public function register_admin_styles() |
222 | 222 | { |
223 | - wp_enqueue_style('metaslider-admin-styles', METASLIDER_ASSETS_URL . 'metaslider/admin.css', false, METASLIDER_VERSION); |
|
224 | - wp_enqueue_style('metaslider-colorbox-styles', METASLIDER_ASSETS_URL . 'colorbox/colorbox.css', false, METASLIDER_VERSION); |
|
225 | - wp_enqueue_style('metaslider-tipsy-styles', METASLIDER_ASSETS_URL . 'tipsy/tipsy.css', false, METASLIDER_VERSION); |
|
223 | + wp_enqueue_style('metaslider-admin-styles', METASLIDER_ASSETS_URL.'metaslider/admin.css', false, METASLIDER_VERSION); |
|
224 | + wp_enqueue_style('metaslider-colorbox-styles', METASLIDER_ASSETS_URL.'colorbox/colorbox.css', false, METASLIDER_VERSION); |
|
225 | + wp_enqueue_style('metaslider-tipsy-styles', METASLIDER_ASSETS_URL.'tipsy/tipsy.css', false, METASLIDER_VERSION); |
|
226 | 226 | |
227 | 227 | do_action('metaslider_register_admin_styles'); |
228 | 228 | } |
@@ -248,10 +248,10 @@ discard block |
||
248 | 248 | // plugin dependencies |
249 | 249 | wp_enqueue_script('jquery-ui-core', array('jquery')); |
250 | 250 | wp_enqueue_script('jquery-ui-sortable', array('jquery', 'jquery-ui-core')); |
251 | - wp_enqueue_script('metaslider-colorbox', METASLIDER_ASSETS_URL . 'colorbox/jquery.colorbox-min.js', array('jquery'), METASLIDER_VERSION); |
|
252 | - wp_enqueue_script('metaslider-tipsy', METASLIDER_ASSETS_URL . 'tipsy/jquery.tipsy.js', array('jquery'), METASLIDER_VERSION); |
|
253 | - wp_enqueue_script('metaslider-admin-script', METASLIDER_ASSETS_URL . 'metaslider/admin.js', array('jquery', 'metaslider-tipsy', 'media-upload'), METASLIDER_VERSION); |
|
254 | - wp_enqueue_script('metaslider-admin-addslide', METASLIDER_ASSETS_URL . 'metaslider/image/image.js', array('metaslider-admin-script'), METASLIDER_VERSION); |
|
251 | + wp_enqueue_script('metaslider-colorbox', METASLIDER_ASSETS_URL.'colorbox/jquery.colorbox-min.js', array('jquery'), METASLIDER_VERSION); |
|
252 | + wp_enqueue_script('metaslider-tipsy', METASLIDER_ASSETS_URL.'tipsy/jquery.tipsy.js', array('jquery'), METASLIDER_VERSION); |
|
253 | + wp_enqueue_script('metaslider-admin-script', METASLIDER_ASSETS_URL.'metaslider/admin.js', array('jquery', 'metaslider-tipsy', 'media-upload'), METASLIDER_VERSION); |
|
254 | + wp_enqueue_script('metaslider-admin-addslide', METASLIDER_ASSETS_URL.'metaslider/image/image.js', array('metaslider-admin-script'), METASLIDER_VERSION); |
|
255 | 255 | |
256 | 256 | // localise the JS |
257 | 257 | wp_localize_script('metaslider-admin-addslide', 'metaslider_image', array( |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | 'confirm' => __('Are you sure?', 'metaslider'), |
267 | 267 | 'ajaxurl' => admin_url('admin-ajax.php'), |
268 | 268 | 'resize_nonce' => wp_create_nonce('metaslider_resize'), |
269 | - 'iframeurl' => METASLIDER_BASE_URL . 'preview.php', |
|
269 | + 'iframeurl' => METASLIDER_BASE_URL.'preview.php', |
|
270 | 270 | 'useWithCaution' => __("Caution: This setting is for advanced developers only. If you're unsure, leave it checked.", 'metaslider') |
271 | 271 | )); |
272 | 272 | |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | $page = add_menu_page($title, $title, 'edit_others_posts', 'metaslider', array( |
284 | 284 | $this, |
285 | 285 | 'render_admin_page' |
286 | - ), METASLIDER_ASSETS_URL . 'metaslider/matchalabs.png', 9501); |
|
286 | + ), METASLIDER_ASSETS_URL.'metaslider/matchalabs.png', 9501); |
|
287 | 287 | |
288 | 288 | // ensure our JavaScript is only loaded on the Meta Slider admin page |
289 | - add_action('admin_print_scripts-' . $page, array($this, 'register_admin_scripts')); |
|
290 | - add_action('admin_print_styles-' . $page, array($this, 'register_admin_styles')); |
|
291 | - add_action('load-' . $page, array($this, 'help_tab')); |
|
289 | + add_action('admin_print_scripts-'.$page, array($this, 'register_admin_scripts')); |
|
290 | + add_action('admin_print_styles-'.$page, array($this, 'register_admin_styles')); |
|
291 | + add_action('load-'.$page, array($this, 'help_tab')); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | $link .= '?utm_source=lite&utm_medium=nag&utm_campaign=pro'; |
303 | 303 | |
304 | - $goPro = "<div style='display: none;' id='screen-options-link-wrap'><a target='_blank' class='show-settings' href='{$link}'>Meta Slider v" . METASLIDER_VERSION . ' - ' . __('Upgrade to Pro $19', 'metaslider') . '</a></div>'; |
|
304 | + $goPro = "<div style='display: none;' id='screen-options-link-wrap'><a target='_blank' class='show-settings' href='{$link}'>Meta Slider v".METASLIDER_VERSION.' - '.__('Upgrade to Pro $19', 'metaslider').'</a></div>'; |
|
305 | 305 | |
306 | 306 | echo $goPro; |
307 | 307 | } |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | |
666 | 666 | foreach ($row['options'] as $k => $v) { |
667 | 667 | $checked = checked($k, $row['value'], false); |
668 | - $return .= "<input class='select-slider' id='{$k}' rel='{$k}' type='radio' name='settings[type]' value='{$k}' {$checked} > |
|
668 | + $return .= "<input class='select-slider' id='{$k}' rel='{$k}' type='radio' name='settings[type]' value='{$k}' {$checked} > |
|
669 | 669 | <label for='{$k}'>{$v['label']}</label>"; |
670 | 670 | } |
671 | 671 | |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $return .= "<tr class='{$row['type']}'><td class='tipsy-tooltip' title=\"{$row['helptext']}\">{$row['label']}</td><td><select class='option {$row['class']} {$id}' name='settings[{$id}]'>"; |
683 | 683 | foreach ($row['options'] as $k => $v) { |
684 | 684 | $selected = selected($k, $row['value'], false); |
685 | - $return .= "<option class='{$v['class']}' value='{$k}' {$selected}>{$v['label']}</option>"; |
|
685 | + $return .= "<option class='{$v['class']}' value='{$k}' {$selected}>{$v['label']}</option>"; |
|
686 | 686 | } |
687 | 687 | $return .= '</select></td></tr>'; |
688 | 688 | } |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | |
695 | 695 | foreach ($row['options'] as $k => $v) { |
696 | 696 | $selected = selected($k, $row['value'], false); |
697 | - $themes .= "<option class='{$v['class']}' value='{$k}' {$selected}>{$v['label']}</option>"; |
|
697 | + $themes .= "<option class='{$v['class']}' value='{$k}' {$selected}>{$v['label']}</option>"; |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | $return .= apply_filters('metaslider_get_available_themes', $themes, $this->slider->get_setting('theme')); |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | <form accept-charset="UTF-8" action="?page=metaslider&id=<?php echo $this->slider->id ?>" method="post"> |
789 | 789 | <?php |
790 | 790 | if ($this->slider) { |
791 | - wp_nonce_field('metaslider_save_' . $this->slider->id); |
|
791 | + wp_nonce_field('metaslider_save_'.$this->slider->id); |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | $title = ''; |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | if ($tabs = $this->all_meta_sliders()) { |
798 | 798 | if ($max_tabs && count($tabs) > $max_tabs) { |
799 | 799 | if (isset($_GET['add']) && 'true' === $_GET['add']) { |
800 | - echo "<div id='message' class='updated'><p>" . __("New slideshow created. Click 'Add Slide' to get started!", 'metaslider') . '</p></div>'; |
|
800 | + echo "<div id='message' class='updated'><p>".__("New slideshow created. Click 'Add Slide' to get started!", 'metaslider').'</p></div>'; |
|
801 | 801 | } |
802 | 802 | echo "<div style='margin-top: 20px;'><label for='select-slider'>Select Slider: </label>"; |
803 | 803 | echo "<select name='select-slider' onchange='if (this.value) window.location.href=this.value'>"; |
@@ -813,15 +813,15 @@ discard block |
||
813 | 813 | |
814 | 814 | echo "<option value='?page=metaslider&id={$tab['id']}'{$selected}>{$tab['title']}</option>"; |
815 | 815 | } |
816 | - echo '</select> ' . __('or', 'metaslider') . ' '; |
|
817 | - echo "<a href='{$add_url}'>" . __('Add New Slideshow', 'metaslider') . '</a></div>'; |
|
816 | + echo '</select> '.__('or', 'metaslider').' '; |
|
817 | + echo "<a href='{$add_url}'>".__('Add New Slideshow', 'metaslider').'</a></div>'; |
|
818 | 818 | } else { |
819 | 819 | echo "<h3 class='nav-tab-wrapper'>"; |
820 | 820 | foreach ($tabs as $tab) { |
821 | 821 | if ($tab['active']) { |
822 | - echo "<div class='nav-tab nav-tab-active'><input type='text' name='title' value='" . $tab['title'] . "' onfocus='this.style.width = ((this.value.length + 1) * 9) + \"px\"' ></div>"; |
|
822 | + echo "<div class='nav-tab nav-tab-active'><input type='text' name='title' value='".$tab['title']."' onfocus='this.style.width = ((this.value.length + 1) * 9) + \"px\"' ></div>"; |
|
823 | 823 | } else { |
824 | - echo "<a href='?page=metaslider&id={$tab['id']}' class='nav-tab'>" . $tab['title'] . '</a>'; |
|
824 | + echo "<a href='?page=metaslider&id={$tab['id']}' class='nav-tab'>".$tab['title'].'</a>'; |
|
825 | 825 | } |
826 | 826 | } |
827 | 827 | echo "<a href='{$add_url}' id='create_new_tab' class='nav-tab'>+</a>"; |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | } else { |
831 | 831 | echo "<h3 class='nav-tab-wrapper'>"; |
832 | 832 | echo "<a href='{$add_url}' id='create_new_tab' class='nav-tab'>+</a>"; |
833 | - echo "<div class='bubble'>" . __('Create your first slideshow') . '</div>'; |
|
833 | + echo "<div class='bubble'>".__('Create your first slideshow').'</div>'; |
|
834 | 834 | echo '</h3>'; |
835 | 835 | } ?> |
836 | 836 | |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | 'max' => 20, |
1123 | 1123 | 'step' => 1, |
1124 | 1124 | 'value' => $this->slider->get_setting('spw'), |
1125 | - 'label' => __('Number of squares', 'metaslider') . ' (' . __('Width', 'metaslider') . ')', |
|
1125 | + 'label' => __('Number of squares', 'metaslider').' ('.__('Width', 'metaslider').')', |
|
1126 | 1126 | 'class' => 'option nivo', |
1127 | 1127 | 'helptext' => __('Number of squares', 'metaslider'), |
1128 | 1128 | 'after' => '' |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | 'max' => 20, |
1136 | 1136 | 'step' => 1, |
1137 | 1137 | 'value' => $this->slider->get_setting('sph'), |
1138 | - 'label' => __('Number of squares', 'metaslider') . ' (' . __('Height', 'metaslider') . ')', |
|
1138 | + 'label' => __('Number of squares', 'metaslider').' ('.__('Height', 'metaslider').')', |
|
1139 | 1139 | 'class' => 'option nivo', |
1140 | 1140 | 'helptext' => __('Number of squares', 'metaslider'), |
1141 | 1141 | 'after' => '' |
@@ -1377,9 +1377,9 @@ discard block |
||
1377 | 1377 | <div class="wrap"> |
1378 | 1378 | <?php |
1379 | 1379 | if (count($sliders)) { |
1380 | - echo "<h3 style='margin-bottom: 20px;'>" . __('Insert Meta Slider', 'metaslider') . '</h3>'; |
|
1380 | + echo "<h3 style='margin-bottom: 20px;'>".__('Insert Meta Slider', 'metaslider').'</h3>'; |
|
1381 | 1381 | echo "<select id='metaslider-select'>"; |
1382 | - echo '<option disabled=disabled>' . __('Choose slideshow', 'metaslider') . '</option>'; |
|
1382 | + echo '<option disabled=disabled>'.__('Choose slideshow', 'metaslider').'</option>'; |
|
1383 | 1383 | foreach ($sliders as $slider) { |
1384 | 1384 | echo "<option value='{$slider['id']}'>{$slider['title']}</option>"; |
1385 | 1385 | } |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | * Implements hook_image_default_styles(). |
10 | 10 | */ |
11 | 11 | function magnific_popup_image_default_styles() { |
12 | - $styles = array(); |
|
13 | - $module_path = drupal_get_path('module', 'magnific_popup'); |
|
14 | - // Exported image style: thumbnail. |
|
15 | - $styles['magnific_popup_thumbnail'] = array( |
|
12 | + $styles = array(); |
|
13 | + $module_path = drupal_get_path('module', 'magnific_popup'); |
|
14 | + // Exported image style: thumbnail. |
|
15 | + $styles['magnific_popup_thumbnail'] = array( |
|
16 | 16 | 'name' => 'magnific_popup_thumbnail', |
17 | 17 | 'label' => t('Magnific Popup: Default Thumbnail'), |
18 | 18 | 'effects' => array( |
19 | - 4 => array( |
|
19 | + 4 => array( |
|
20 | 20 | 'label' => 'Scale and crop', |
21 | 21 | 'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.', |
22 | 22 | 'effect callback' => 'image_scale_and_crop_effect', |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | 'module' => 'image', |
27 | 27 | 'name' => 'image_scale_and_crop', |
28 | 28 | 'data' => array( |
29 | - 'width' => 480, |
|
30 | - 'height' => 360 |
|
29 | + 'width' => 480, |
|
30 | + 'height' => 360 |
|
31 | 31 | ), |
32 | 32 | 'weight' => -10 |
33 | - ) |
|
33 | + ) |
|
34 | 34 | ) |
35 | - ); |
|
35 | + ); |
|
36 | 36 | |
37 | - return $styles; |
|
37 | + return $styles; |
|
38 | 38 | } |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | * Implements hook_field_formatter_info(). |
11 | 11 | */ |
12 | 12 | function magnific_popup_field_formatter_info() { |
13 | - $gallery_options = _magnific_popup_gallery_options(); |
|
14 | - return array( |
|
13 | + $gallery_options = _magnific_popup_gallery_options(); |
|
14 | + return array( |
|
15 | 15 | 'magnific_popup_file_field_formatter' => array( |
16 | - 'label' => t('Magnific Popup'), |
|
17 | - 'field types' => array('file', 'image'), |
|
18 | - 'settings' => array( |
|
16 | + 'label' => t('Magnific Popup'), |
|
17 | + 'field types' => array('file', 'image'), |
|
18 | + 'settings' => array( |
|
19 | 19 | 'gallery_style' => key($gallery_options) |
20 | - ) |
|
20 | + ) |
|
21 | 21 | ) |
22 | - ); |
|
22 | + ); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -32,31 +32,31 @@ discard block |
||
32 | 32 | * @return array |
33 | 33 | */ |
34 | 34 | function magnific_popup_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) { |
35 | - $display = $instance['display'][$view_mode]; |
|
36 | - $settings = $display['settings']; |
|
35 | + $display = $instance['display'][$view_mode]; |
|
36 | + $settings = $display['settings']; |
|
37 | 37 | |
38 | - // Gallery Mode is TRUE when this field supports multiple items. |
|
39 | - $gallery_available = 1 !== $field['cardinality']; |
|
40 | - $gallery_options = _magnific_popup_gallery_options(); |
|
38 | + // Gallery Mode is TRUE when this field supports multiple items. |
|
39 | + $gallery_available = 1 !== $field['cardinality']; |
|
40 | + $gallery_options = _magnific_popup_gallery_options(); |
|
41 | 41 | |
42 | - $element = array(); |
|
43 | - $element['gallery_available'] = array( |
|
42 | + $element = array(); |
|
43 | + $element['gallery_available'] = array( |
|
44 | 44 | '#type' => 'markup', |
45 | 45 | '#prefix' => '<p>', |
46 | 46 | '#suffix' => '</p>' |
47 | - ); |
|
48 | - $element['gallery_available']['#markup'] = $gallery_available ? |
|
47 | + ); |
|
48 | + $element['gallery_available']['#markup'] = $gallery_available ? |
|
49 | 49 | t('This field configuration <strong>supports multiple items</strong> and can display itself as a gallery of items!') : |
50 | 50 | t('This field configuration <strong>does not support multiple items</strong> and cannot display itself as a gallery of items.'); |
51 | - $element['gallery_style'] = array( |
|
51 | + $element['gallery_style'] = array( |
|
52 | 52 | '#type' => 'select', |
53 | 53 | '#title' => t('Gallery Type'), |
54 | 54 | '#options' => $gallery_options, |
55 | 55 | '#disabled' => !$gallery_available, |
56 | 56 | '#default_value' => $settings['gallery_style'], |
57 | 57 | '#description' => t('Choose how this gallery displays its triggering element(s).') |
58 | - ); |
|
59 | - return $element; |
|
58 | + ); |
|
59 | + return $element; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | * @return |
68 | 68 | */ |
69 | 69 | function magnific_popup_field_formatter_settings_summary($field, $instance, $view_mode) { |
70 | - $display = $instance['display'][$view_mode]; |
|
71 | - $settings = $display['settings']; |
|
72 | - $gallery_options = _magnific_popup_gallery_options(); |
|
73 | - $summary = t('Gallery Type: @gallery_type', array('@gallery_type' => $gallery_options[$settings['gallery_style']])); |
|
74 | - return $summary; |
|
70 | + $display = $instance['display'][$view_mode]; |
|
71 | + $settings = $display['settings']; |
|
72 | + $gallery_options = _magnific_popup_gallery_options(); |
|
73 | + $summary = t('Gallery Type: @gallery_type', array('@gallery_type' => $gallery_options[$settings['gallery_style']])); |
|
74 | + return $summary; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -85,86 +85,86 @@ discard block |
||
85 | 85 | * @param $displays |
86 | 86 | */ |
87 | 87 | function magnific_popup_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) { |
88 | - // Items are some kind of entity reference, be it via image or file type. |
|
89 | - // Load the corresponding items into a common format for our formatter_view(). |
|
90 | - $static = &drupal_static(__FUNCTION__, array('loaded_items' => array(), 'thumbnail_schemes' => NULL)); |
|
91 | - $loaded_items = &$static['loaded_items']; |
|
92 | - $thumbnail_schemes = &$static['thumbnail_schemes']; |
|
93 | - if (!isset($thumbnail_schemes)) { |
|
88 | + // Items are some kind of entity reference, be it via image or file type. |
|
89 | + // Load the corresponding items into a common format for our formatter_view(). |
|
90 | + $static = &drupal_static(__FUNCTION__, array('loaded_items' => array(), 'thumbnail_schemes' => NULL)); |
|
91 | + $loaded_items = &$static['loaded_items']; |
|
92 | + $thumbnail_schemes = &$static['thumbnail_schemes']; |
|
93 | + if (!isset($thumbnail_schemes)) { |
|
94 | 94 | $thumbnail_schemes = module_invoke_all('magnific_popup_thumbnail_schemes'); |
95 | - } |
|
96 | - // Iterate through $items looking for valid gallery items. Refactor them into |
|
97 | - // a consistent format for magnific_popup_field_formatter_view(). |
|
98 | - $wrappers = array(); |
|
99 | - foreach ($entities as $entity_id => $entity) { |
|
95 | + } |
|
96 | + // Iterate through $items looking for valid gallery items. Refactor them into |
|
97 | + // a consistent format for magnific_popup_field_formatter_view(). |
|
98 | + $wrappers = array(); |
|
99 | + foreach ($entities as $entity_id => $entity) { |
|
100 | 100 | foreach ($items[$entity_id] as $delta => &$item) { |
101 | - // Fail-safe check to not load items |
|
102 | - if (empty($item['uri'])) { |
|
101 | + // Fail-safe check to not load items |
|
102 | + if (empty($item['uri'])) { |
|
103 | 103 | continue; |
104 | - } |
|
105 | - // Check if we've already parsed this fid, and build it if not. |
|
106 | - if (!isset($loaded_items[$item['fid']])) { |
|
104 | + } |
|
105 | + // Check if we've already parsed this fid, and build it if not. |
|
106 | + if (!isset($loaded_items[$item['fid']])) { |
|
107 | 107 | $loaded_items[$item['fid']] = FALSE; |
108 | 108 | $scheme = file_uri_scheme($item['uri']); |
109 | 109 | // Attempt to re-use, or load from scratch, a wrapper for this scheme. |
110 | 110 | if (empty($wrappers[$scheme])) { |
111 | - // Create a new wrapper. |
|
112 | - $wrappers[$scheme] = file_stream_wrapper_get_instance_by_uri($item['uri']); |
|
111 | + // Create a new wrapper. |
|
112 | + $wrappers[$scheme] = file_stream_wrapper_get_instance_by_uri($item['uri']); |
|
113 | 113 | } |
114 | 114 | else { |
115 | - // Attempt to re-use an existing wrapper. |
|
116 | - $wrappers[$scheme]->setUri($item['uri']); |
|
115 | + // Attempt to re-use an existing wrapper. |
|
116 | + $wrappers[$scheme]->setUri($item['uri']); |
|
117 | 117 | } |
118 | 118 | // Check that the resource was accessible. |
119 | 119 | if ($wrappers[$scheme] && FALSE !== $wrappers[$scheme]->url_stat($item['uri'], STREAM_URL_STAT_QUIET)) { |
120 | - $wrapper = $wrappers[$scheme]; |
|
121 | - // Determine the file's info and store it. |
|
122 | - $thumbnail_path = FALSE; |
|
123 | - // MediaYouTubeStreamWrapper implements getLocalThumbnailPath() to |
|
124 | - // find the thumbnail path. |
|
125 | - if (method_exists($wrapper,'getLocalThumbnailPath')) { |
|
120 | + $wrapper = $wrappers[$scheme]; |
|
121 | + // Determine the file's info and store it. |
|
122 | + $thumbnail_path = FALSE; |
|
123 | + // MediaYouTubeStreamWrapper implements getLocalThumbnailPath() to |
|
124 | + // find the thumbnail path. |
|
125 | + if (method_exists($wrapper,'getLocalThumbnailPath')) { |
|
126 | 126 | $thumbnail_path = $wrapper->getLocalThumbnailPath(); |
127 | - } |
|
128 | - // Try the standard method to get a thumbnail. |
|
129 | - else { |
|
127 | + } |
|
128 | + // Try the standard method to get a thumbnail. |
|
129 | + else { |
|
130 | 130 | if ($uri = $wrapper->getUri()) { |
131 | - $thumbnail_path = $uri; |
|
131 | + $thumbnail_path = $uri; |
|
132 | + } |
|
132 | 133 | } |
133 | - } |
|
134 | - // Adjust $thumbnail_path based on the $scheme. |
|
135 | - // @todo Make the default thumbnail_style configurable. |
|
136 | - $thumbnail_style = 'magnific_popup_thumbnail'; |
|
137 | - if (!empty($thumbnail_schemes[$scheme])) { |
|
134 | + // Adjust $thumbnail_path based on the $scheme. |
|
135 | + // @todo Make the default thumbnail_style configurable. |
|
136 | + $thumbnail_style = 'magnific_popup_thumbnail'; |
|
137 | + if (!empty($thumbnail_schemes[$scheme])) { |
|
138 | 138 | $thumbnail_style = $thumbnail_schemes[$scheme]; |
139 | - } |
|
140 | - $thumbnail_path = image_style_url($thumbnail_style, $thumbnail_path); |
|
141 | - // Get the title if it exists, or fallback to the filename. |
|
142 | - $title = !empty($item['title']) ? $item['title'] : $item['filename']; |
|
143 | - // Get the alt if it exists, or fallback to the title. |
|
144 | - $alt = !empty($item['alt']) ? $item['alt'] : $title; |
|
145 | - // Build the finished gallery item. |
|
146 | - $gallery_item = array( |
|
139 | + } |
|
140 | + $thumbnail_path = image_style_url($thumbnail_style, $thumbnail_path); |
|
141 | + // Get the title if it exists, or fallback to the filename. |
|
142 | + $title = !empty($item['title']) ? $item['title'] : $item['filename']; |
|
143 | + // Get the alt if it exists, or fallback to the title. |
|
144 | + $alt = !empty($item['alt']) ? $item['alt'] : $title; |
|
145 | + // Build the finished gallery item. |
|
146 | + $gallery_item = array( |
|
147 | 147 | 'item' => $item, |
148 | 148 | 'title' => $title, |
149 | 149 | 'alt' => $alt, |
150 | 150 | 'thumbnail_path' => $thumbnail_path, |
151 | 151 | 'target_uri' => $wrapper->getExternalUrl() |
152 | - ); |
|
153 | - $loaded_items[$item['fid']] = $gallery_item; |
|
152 | + ); |
|
153 | + $loaded_items[$item['fid']] = $gallery_item; |
|
154 | 154 | } |
155 | - } |
|
156 | - // Replace $item with the parsed version of info for this fid. |
|
157 | - $item = $loaded_items[$item['fid']]; |
|
158 | - // Check if this item was unloadable and if so remove it from the list. |
|
159 | - if (empty($item)) { |
|
155 | + } |
|
156 | + // Replace $item with the parsed version of info for this fid. |
|
157 | + $item = $loaded_items[$item['fid']]; |
|
158 | + // Check if this item was unloadable and if so remove it from the list. |
|
159 | + if (empty($item)) { |
|
160 | 160 | unset($items[$entity_id][$delta]); |
161 | - } |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | // Remove the pointer. |
164 | 164 | if (isset($item)) { |
165 | - unset($item); |
|
165 | + unset($item); |
|
166 | + } |
|
166 | 167 | } |
167 | - } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -179,50 +179,50 @@ discard block |
||
179 | 179 | * @return array |
180 | 180 | */ |
181 | 181 | function magnific_popup_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) { |
182 | - if (!_magnific_popup_check_status()) { |
|
182 | + if (!_magnific_popup_check_status()) { |
|
183 | 183 | return FALSE; |
184 | - } |
|
185 | - // Add Magnific Popup library to page. |
|
186 | - drupal_add_library('magnific_popup', 'magnific_popup_formatter', FALSE); |
|
187 | - // Add API-derived extension JavaScript to the page; we do this here instead |
|
188 | - // of another hook to prevent adding JS when it isn't necessary (i.e. when we |
|
189 | - // aren't actually displaying any Magnific Popup content on the page). |
|
190 | - _magnific_popup_add_api_js(); |
|
191 | - // Create the main container. |
|
192 | - $element = array(); |
|
193 | - $settings = $display['settings']; |
|
194 | - $popup_gallery = array( |
|
184 | + } |
|
185 | + // Add Magnific Popup library to page. |
|
186 | + drupal_add_library('magnific_popup', 'magnific_popup_formatter', FALSE); |
|
187 | + // Add API-derived extension JavaScript to the page; we do this here instead |
|
188 | + // of another hook to prevent adding JS when it isn't necessary (i.e. when we |
|
189 | + // aren't actually displaying any Magnific Popup content on the page). |
|
190 | + _magnific_popup_add_api_js(); |
|
191 | + // Create the main container. |
|
192 | + $element = array(); |
|
193 | + $settings = $display['settings']; |
|
194 | + $popup_gallery = array( |
|
195 | 195 | '#type' => 'container', |
196 | 196 | '#attributes' => array( |
197 | - 'class' => array() |
|
197 | + 'class' => array() |
|
198 | 198 | ) |
199 | - ); |
|
200 | - // Determine if/what the allowed trigger item is (which will get a thumbnail). |
|
201 | - $trigger_item = key($items); |
|
202 | - if ('random_item' === $settings['gallery_style']) { |
|
199 | + ); |
|
200 | + // Determine if/what the allowed trigger item is (which will get a thumbnail). |
|
201 | + $trigger_item = key($items); |
|
202 | + if ('random_item' === $settings['gallery_style']) { |
|
203 | 203 | $trigger_item = array_rand($items); |
204 | - } |
|
205 | - // Figure out the base-class for the gallery/nogallery, which is generally |
|
206 | - // something like 'mfp-nogallery-image' or 'mfp-gallery-iframe'. |
|
207 | - $gallery_base_class = 'no_gallery' === $settings['gallery_style'] ? |
|
204 | + } |
|
205 | + // Figure out the base-class for the gallery/nogallery, which is generally |
|
206 | + // something like 'mfp-nogallery-image' or 'mfp-gallery-iframe'. |
|
207 | + $gallery_base_class = 'no_gallery' === $settings['gallery_style'] ? |
|
208 | 208 | 'mfp-nogallery' : 'mfp-gallery'; |
209 | - if ('image' === $field['type']) { |
|
209 | + if ('image' === $field['type']) { |
|
210 | 210 | $gallery_base_class .= '-image'; |
211 | - } |
|
212 | - else { |
|
211 | + } |
|
212 | + else { |
|
213 | 213 | $gallery_base_class .= '-iframe'; |
214 | - } |
|
215 | - $popup_gallery['#attributes']['class'][] = $gallery_base_class; |
|
216 | - // Add each item to our container. |
|
217 | - foreach ($items as $delta => $item) { |
|
214 | + } |
|
215 | + $popup_gallery['#attributes']['class'][] = $gallery_base_class; |
|
216 | + // Add each item to our container. |
|
217 | + foreach ($items as $delta => $item) { |
|
218 | 218 | $popup_gallery['item-' . $delta] = array( |
219 | - '#theme' => 'link', |
|
220 | - '#text' => '', |
|
221 | - '#path' => $item['target_uri'], |
|
222 | - '#options' => array( |
|
219 | + '#theme' => 'link', |
|
220 | + '#text' => '', |
|
221 | + '#path' => $item['target_uri'], |
|
222 | + '#options' => array( |
|
223 | 223 | 'attributes' => array('class' => array(), 'style' => array()), |
224 | 224 | 'html' => TRUE |
225 | - ) |
|
225 | + ) |
|
226 | 226 | ); |
227 | 227 | $popup_gallery['item-' . $delta]['#options']['attributes']['class'][] = 'mfp-item'; |
228 | 228 | // This item has a thumbnail image if: |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | // - the Gallery Type is "first item" and this $delta is the first item, or |
232 | 232 | // - the Gallery Type is "random item" and this $delta is the random item. |
233 | 233 | if ('all_items' === $settings['gallery_style'] || 'no_gallery' === $settings['gallery_style'] || $delta == $trigger_item) { |
234 | - $image = array( |
|
234 | + $image = array( |
|
235 | 235 | // Try to use a "figure" theme implementation if it exists, or fall back |
236 | 236 | // to "image". |
237 | 237 | '#theme' => array('figure', 'image'), |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | '#alt' => $item['alt'], |
240 | 240 | '#title' => $item['title'], |
241 | 241 | '#attributes' => array( |
242 | - 'class' => array('mfp-thumbnail') |
|
242 | + 'class' => array('mfp-thumbnail') |
|
243 | 243 | ) |
244 | - ); |
|
245 | - $popup_gallery['item-' . $delta]['#text'] = render($image); |
|
244 | + ); |
|
245 | + $popup_gallery['item-' . $delta]['#text'] = render($image); |
|
246 | 246 | } |
247 | 247 | else { |
248 | - $popup_gallery['item-' . $delta]['#options']['attributes']['style'][] = 'display: none;'; |
|
248 | + $popup_gallery['item-' . $delta]['#options']['attributes']['style'][] = 'display: none;'; |
|
249 | + } |
|
249 | 250 | } |
250 | - } |
|
251 | - if (count($items)) { |
|
251 | + if (count($items)) { |
|
252 | 252 | $element[0] = $popup_gallery; |
253 | - } |
|
254 | - // dpm(array( |
|
253 | + } |
|
254 | + // dpm(array( |
|
255 | 255 | // 'function' => __function__, |
256 | 256 | // 'entity_type' => $entity_type, |
257 | 257 | // 'entity' => $entity, |
@@ -260,18 +260,18 @@ discard block |
||
260 | 260 | // 'langcode' => $langcode, |
261 | 261 | // 'items' => $items, |
262 | 262 | // 'display' => $display, |
263 | - // )); |
|
264 | - return $element; |
|
263 | + // )); |
|
264 | + return $element; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
268 | 268 | * @return array |
269 | 269 | */ |
270 | 270 | function _magnific_popup_gallery_options() { |
271 | - return array( |
|
271 | + return array( |
|
272 | 272 | 'all_items' => t('Gallery: All Items Displayed'), |
273 | 273 | 'first_item' => t('Gallery: First Item Displayed'), |
274 | 274 | 'random_item' => t('Gallery: Random Item Displayed'), |
275 | 275 | 'no_gallery' => t('No Gallery: Display Each Item Separately') |
276 | - ); |
|
276 | + ); |
|
277 | 277 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | '#suffix' => '</p>' |
47 | 47 | ); |
48 | 48 | $element['gallery_available']['#markup'] = $gallery_available ? |
49 | - t('This field configuration <strong>supports multiple items</strong> and can display itself as a gallery of items!') : |
|
50 | - t('This field configuration <strong>does not support multiple items</strong> and cannot display itself as a gallery of items.'); |
|
49 | + t('This field configuration <strong>supports multiple items</strong> and can display itself as a gallery of items!') : t('This field configuration <strong>does not support multiple items</strong> and cannot display itself as a gallery of items.'); |
|
51 | 50 | $element['gallery_style'] = array( |
52 | 51 | '#type' => 'select', |
53 | 52 | '#title' => t('Gallery Type'), |
@@ -122,7 +121,7 @@ discard block |
||
122 | 121 | $thumbnail_path = FALSE; |
123 | 122 | // MediaYouTubeStreamWrapper implements getLocalThumbnailPath() to |
124 | 123 | // find the thumbnail path. |
125 | - if (method_exists($wrapper,'getLocalThumbnailPath')) { |
|
124 | + if (method_exists($wrapper, 'getLocalThumbnailPath')) { |
|
126 | 125 | $thumbnail_path = $wrapper->getLocalThumbnailPath(); |
127 | 126 | } |
128 | 127 | // Try the standard method to get a thumbnail. |
@@ -215,7 +214,7 @@ discard block |
||
215 | 214 | $popup_gallery['#attributes']['class'][] = $gallery_base_class; |
216 | 215 | // Add each item to our container. |
217 | 216 | foreach ($items as $delta => $item) { |
218 | - $popup_gallery['item-' . $delta] = array( |
|
217 | + $popup_gallery['item-'.$delta] = array( |
|
219 | 218 | '#theme' => 'link', |
220 | 219 | '#text' => '', |
221 | 220 | '#path' => $item['target_uri'], |
@@ -224,7 +223,7 @@ discard block |
||
224 | 223 | 'html' => TRUE |
225 | 224 | ) |
226 | 225 | ); |
227 | - $popup_gallery['item-' . $delta]['#options']['attributes']['class'][] = 'mfp-item'; |
|
226 | + $popup_gallery['item-'.$delta]['#options']['attributes']['class'][] = 'mfp-item'; |
|
228 | 227 | // This item has a thumbnail image if: |
229 | 228 | // - the Gallery Type is "all items" (because all items have thumbs), or |
230 | 229 | // - the Gallery Type is "no gallery", or |
@@ -242,10 +241,10 @@ discard block |
||
242 | 241 | 'class' => array('mfp-thumbnail') |
243 | 242 | ) |
244 | 243 | ); |
245 | - $popup_gallery['item-' . $delta]['#text'] = render($image); |
|
244 | + $popup_gallery['item-'.$delta]['#text'] = render($image); |
|
246 | 245 | } |
247 | 246 | else { |
248 | - $popup_gallery['item-' . $delta]['#options']['attributes']['style'][] = 'display: none;'; |
|
247 | + $popup_gallery['item-'.$delta]['#options']['attributes']['style'][] = 'display: none;'; |
|
249 | 248 | } |
250 | 249 | } |
251 | 250 | if (count($items)) { |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | if (empty($wrappers[$scheme])) { |
111 | 111 | // Create a new wrapper. |
112 | 112 | $wrappers[$scheme] = file_stream_wrapper_get_instance_by_uri($item['uri']); |
113 | - } |
|
114 | - else { |
|
113 | + } else { |
|
115 | 114 | // Attempt to re-use an existing wrapper. |
116 | 115 | $wrappers[$scheme]->setUri($item['uri']); |
117 | 116 | } |
@@ -208,8 +207,7 @@ discard block |
||
208 | 207 | 'mfp-nogallery' : 'mfp-gallery'; |
209 | 208 | if ('image' === $field['type']) { |
210 | 209 | $gallery_base_class .= '-image'; |
211 | - } |
|
212 | - else { |
|
210 | + } else { |
|
213 | 211 | $gallery_base_class .= '-iframe'; |
214 | 212 | } |
215 | 213 | $popup_gallery['#attributes']['class'][] = $gallery_base_class; |
@@ -243,8 +241,7 @@ discard block |
||
243 | 241 | ) |
244 | 242 | ); |
245 | 243 | $popup_gallery['item-' . $delta]['#text'] = render($image); |
246 | - } |
|
247 | - else { |
|
244 | + } else { |
|
248 | 245 | $popup_gallery['item-' . $delta]['#options']['attributes']['style'][] = 'display: none;'; |
249 | 246 | } |
250 | 247 | } |
@@ -7,24 +7,24 @@ |
||
7 | 7 | * Implements hook_magnific_popup_thumbnail_schemes(). |
8 | 8 | */ |
9 | 9 | function magnific_popup_youtube_magnific_popup_thumbnail_schemes() { |
10 | - $thumbnail_schemes = array( |
|
10 | + $thumbnail_schemes = array( |
|
11 | 11 | 'youtube' => 'magnific_popup_yt_preview_wplay' |
12 | - ); |
|
13 | - return $thumbnail_schemes; |
|
12 | + ); |
|
13 | + return $thumbnail_schemes; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Implements hook_magnific_popup_iframe_patterns(). |
18 | 18 | */ |
19 | 19 | function magnific_popup_youtube_magnific_popup_iframe_patterns() { |
20 | - $iframe_patterns = array( |
|
20 | + $iframe_patterns = array( |
|
21 | 21 | 'youtube' => array( |
22 | - 'index' => 'youtube.com/', |
|
23 | - 'id' => 'v=', |
|
24 | - 'src' => '//www.youtube.com/embed/%id%?rel=0&modestbranding=1&playerapiid=mfp-iframe&controls=2&autoplay=1' |
|
22 | + 'index' => 'youtube.com/', |
|
23 | + 'id' => 'v=', |
|
24 | + 'src' => '//www.youtube.com/embed/%id%?rel=0&modestbranding=1&playerapiid=mfp-iframe&controls=2&autoplay=1' |
|
25 | 25 | ) |
26 | - ); |
|
27 | - return $iframe_patterns; |
|
26 | + ); |
|
27 | + return $iframe_patterns; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | require_once('includes/magnific_popup_youtube.image_styles.inc'); |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | * Implements hook_image_default_styles(). |
10 | 10 | */ |
11 | 11 | function magnific_popup_youtube_image_default_styles() { |
12 | - $styles = array(); |
|
13 | - $module_path = drupal_get_path('module', 'magnific_popup_youtube'); |
|
14 | - // Exported image style: youtube_play_preview. |
|
15 | - $styles['magnific_popup_yt_preview_wplay'] = array( |
|
12 | + $styles = array(); |
|
13 | + $module_path = drupal_get_path('module', 'magnific_popup_youtube'); |
|
14 | + // Exported image style: youtube_play_preview. |
|
15 | + $styles['magnific_popup_yt_preview_wplay'] = array( |
|
16 | 16 | 'name' => 'magnific_popup_yt_preview_wplay', |
17 | 17 | 'label' => t('Magnific Popup: YouTube Preview w/Play button overlay'), |
18 | 18 | 'effects' => array( |
19 | - 4 => array( |
|
19 | + 4 => array( |
|
20 | 20 | 'label' => 'Scale and crop', |
21 | 21 | 'help' => 'Scale and crop will maintain the aspect-ratio of the original image, then crop the larger dimension. This is most useful for creating perfectly square thumbnails without stretching the image.', |
22 | 22 | 'effect callback' => 'image_scale_and_crop_effect', |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | 'module' => 'image', |
27 | 27 | 'name' => 'image_scale_and_crop', |
28 | 28 | 'data' => array( |
29 | - 'width' => 480, |
|
30 | - 'height' => 270 |
|
29 | + 'width' => 480, |
|
30 | + 'height' => 270 |
|
31 | 31 | ), |
32 | 32 | 'weight' => -10 |
33 | - ), |
|
34 | - 2 => array( |
|
33 | + ), |
|
34 | + 2 => array( |
|
35 | 35 | 'label' => 'Overlay (watermark)', |
36 | 36 | 'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.', |
37 | 37 | 'effect callback' => 'canvasactions_file2canvas_effect', |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | 'module' => 'imagecache_canvasactions', |
42 | 42 | 'name' => 'canvasactions_file2canvas', |
43 | 43 | 'data' => array( |
44 | - 'xpos' => 'center', |
|
45 | - 'ypos' => 'bottom', |
|
46 | - 'alpha' => 100, |
|
47 | - 'path' => "{$module_path}/assets/images/youtube-chrome_bottom.png" |
|
44 | + 'xpos' => 'center', |
|
45 | + 'ypos' => 'bottom', |
|
46 | + 'alpha' => 100, |
|
47 | + 'path' => "{$module_path}/assets/images/youtube-chrome_bottom.png" |
|
48 | 48 | ), |
49 | 49 | 'weight' => -9 |
50 | - ), |
|
51 | - 3 => array( |
|
50 | + ), |
|
51 | + 3 => array( |
|
52 | 52 | 'label' => 'Overlay (watermark)', |
53 | 53 | 'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.', |
54 | 54 | 'effect callback' => 'canvasactions_file2canvas_effect', |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | 'module' => 'imagecache_canvasactions', |
59 | 59 | 'name' => 'canvasactions_file2canvas', |
60 | 60 | 'data' => array( |
61 | - 'xpos' => 'center', |
|
62 | - 'ypos' => 'center', |
|
63 | - 'alpha' => 100, |
|
64 | - 'path' => "{$module_path}/images/youtube-play_button.png" |
|
61 | + 'xpos' => 'center', |
|
62 | + 'ypos' => 'center', |
|
63 | + 'alpha' => 100, |
|
64 | + 'path' => "{$module_path}/images/youtube-play_button.png" |
|
65 | 65 | ), |
66 | 66 | 'weight' => -8 |
67 | - ) |
|
67 | + ) |
|
68 | 68 | ) |
69 | - ); |
|
69 | + ); |
|
70 | 70 | |
71 | - return $styles; |
|
71 | + return $styles; |
|
72 | 72 | } |