PluginProbe
Meow Gallery / 4.2.4
Meow Gallery v4.2.4
5.5.5 5.5.4 5.5.3 5.5.2 5.5.1 5.5.0 5.4.9 5.4.8 5.4.7 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 All 157 releases
meow-gallery / classes / builders / horizontal.php

horizontal.php in Meow Gallery 4.2.4, at classes/builders/horizontal.php

57 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Meow_MGL_Builders_Horizontal extends Meow_MGL_Builders_Core {
4
5 public function __construct( $atts, $infinite, $isPreview = false ) {
6 parent::__construct( $atts, false, $isPreview );
7 $this->layout = 'horizontal';
8 }
9
10 function inline_css() {
11 $class_id = '#' . $this->class_id;
12 $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : get_option( 'mgl_horizontal_gutter', 10 );
13 $image_height = isset( $this->atts['image_height'] ) ? $this->atts['image_height'] : get_option( 'mgl_horizontal_image_height', 500 );
14 $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : get_option( 'mgl_horizontal_hide_scrollbar', false );
15 $isPreview = $this->isPreview;
16 ob_start();
17 include dirname( __FILE__ ) . '/horizontal.css.php';
18 $html = ob_get_clean();
19 return $html;
20 }
21
22 function build( $idsStr ) {
23
24 // Generate gallery
25 $classes = $this->build_classes();
26 $styles = $this->build_styles();
27 $out = "<div id='{$this->class_id}' class='{$classes}' style='{$styles}'>";
28 $gutter = isset( $this->atts['mgl_horizontal_gutter'] ) ?
29 $this->atts['mgl_horizontal_gutter'] : get_option( 'mgl_horizontal_gutter', 5 );
30 $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] :
31 get_option( 'mgl_horizontal_hide_scrollbar', false );
32 $classes = $hide_scrollbar ? "$classes hide-scrollbar" : $classes;
33 $attributes = "data-mgl-gutter=\"${gutter}\"";
34
35 $out = "<div id='{$this->class_id}' class='{$classes}' style='{$styles}' {$attributes}>";
36 $out .= '<div class="meow-horizontal-track">';
37 $this->prepare_data( $idsStr );
38 while ( count( $this->ids ) > 0 ) {
39 $id = array_pop( $this->ids );
40 $out .= $this->build_next_cell( $id, $this->data[$id] );
41 }
42 $out .= '</div>';
43 $out .= '</div>';
44 $out = apply_filters( 'mgl_gallery_written', $out, $this->layout );
45
46 // Generate gallery container
47 $container_classes = $this->build_container_classes();
48 $inline_css = $this->inline_css();
49 $container = "<div class='{$container_classes}'>{$inline_css}{$out}</div>";
50
51 return $container;
52 }
53
54 }
55
56 ?>
57