PluginProbe
Meow Gallery / 4.2.1
Meow Gallery v4.2.1
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 4.3.1 All 156 releases
meow-gallery / classes / builders / square.php

square.php in Meow Gallery 4.2.1, at classes/builders/square.php

31 lines 955 B
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_Square extends Meow_MGL_Builders_Core {
4
5 public function __construct( $atts, $infinite, $isPreview = false ) {
6 parent::__construct( $atts, $infinite, $isPreview );
7 $this->layout = 'square';
8 }
9
10 function inline_css() {
11 $class_id = '#' . $this->class_id;
12 $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : get_option( 'mgl_square_gutter', 10 );
13 $columns = isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 );
14 $isPreview = $this->isPreview;
15 ob_start();
16 include dirname( __FILE__ ) . '/square.css.php';
17 $html = ob_get_clean();
18 return $html;
19 }
20
21 function build_next_cell( $id, $data ) {
22 $html = parent::build_next_cell( $id, $data );
23 $columns = ( isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 ) ) + 1;
24 $html = str_replace( '100vw', 100 / $columns . 'vw', $html );
25 return $html;
26 }
27
28 }
29
30 ?>
31