PluginProbe
Meow Gallery / 4.2.2
Meow Gallery v4.2.2
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 / tiles.php

tiles.php in Meow Gallery 4.2.2, at classes/builders/tiles.php

61 lines 1.7 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_Tiles extends Meow_MGL_Builders_Core {
4
5 public function __construct( $atts, $infinite, $isPreview = false ) {
6 parent::__construct( $atts, $infinite, $isPreview );
7 $this->layout = 'tiles';
8 }
9
10 function inline_css() {
11 $class_id = '#' . $this->class_id;
12
13 $isPreview = $this->isPreview;
14
15 $gutter = [];
16 if ( isset( $this->atts['gutter'] ) ) {
17 $gutter['desktop'] = $this->atts['gutter'];
18 $gutter['tablet'] = $this->atts['gutter'];
19 $gutter['mobile'] = $this->atts['gutter'];
20 }
21 else {
22 $gutter['desktop'] = get_option( 'mgl_tiles_gutter', 10 );
23 $gutter['tablet'] = get_option( 'mgl_tiles_gutter_tablet', 10 );
24 $gutter['mobile'] = get_option( 'mgl_tiles_gutter_mobile', 10 );
25 }
26
27 $density = [];
28 if ( isset( $this->atts['density'] ) ) {
29 $density['desktop'] = $this->atts['density'];
30 $density['tablet'] = $this->atts['density'];
31 $density['mobile'] = $this->atts['density'];
32 }
33 else {
34 $density['desktop'] = get_option( 'mgl_tiles_density', 'high' );
35 $density['tablet'] = get_option( 'mgl_tiles_density_tablet', 'medium' );
36 $density['mobile'] = get_option( 'mgl_tiles_density_mobile', 'low' );
37 }
38
39 ob_start();
40 include dirname( __FILE__ ) . '/tiles.css.php';
41 $html = ob_get_clean();
42 return $html;
43 }
44
45 function build_inline_attributes( $id, $data ) {
46 if ( isset( $data['meta'] ) && isset( $data['meta']['width'] ) && isset( $data['meta']['height'] ) ) {
47 return ' data-mgl-id="' . $id . '" data-mgl-width="' . $data['meta']['width'] . '" data-mgl-height="' .
48 $data['meta']['height'] . '"';
49 }
50 return null;
51 }
52
53 function build_next_cell( $id, $data ) {
54 $html = parent::build_next_cell( $id, $data );
55 return $html;
56 }
57
58 }
59
60 ?>
61