# meow-gallery/4.2.8/classes/builders/tiles.php

Meow Gallery, version 4.2.8. 63 lines.

- Page: https://pluginprobe.com/plugins/meow-gallery/4.2.8/code/classes/builders/tiles.php
- Raw: https://pluginprobe.com/plugins/meow-gallery/4.2.8/raw/classes/builders/tiles.php
- Modified: 2022-11-14T06:16:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/meow-gallery/4.2.8/code/classes/builders/tiles.php#L10-L20`.

```php
<?php

class Meow_MGL_Builders_Tiles extends Meow_MGL_Builders_Core {

	public function __construct( $atts, $infinite, $isPreview = false ) {
		parent::__construct( $atts, $infinite, $isPreview );
		$this->layout = 'tiles';
	}

	function inline_css() {
		$class_id = '#' . $this->class_id;
		
		$isPreview = $this->isPreview;
		
		$options = get_option( Meow_MGL_Core::get_plugin_option_name(), null );

		$gutter = [];
		if ( isset( $this->atts['gutter'] ) ) {
			$gutter['desktop'] = $this->atts['gutter'];
			$gutter['tablet'] = $this->atts['gutter'];
			$gutter['mobile'] = $this->atts['gutter'];
		}
		else {
			$gutter['desktop'] = $options['tiles_gutter'] ?? 10;
			$gutter['tablet'] = $options['tiles_gutter_tablet'] ?? 10;
			$gutter['mobile'] = $options['tiles_gutter_mobile'] ?? 10;
		}

		$density = [];
		if ( isset( $this->atts['density'] ) ) {
			$density['desktop'] = $this->atts['density'];
			$density['tablet'] = $this->atts['density'];
			$density['mobile'] = $this->atts['density'];
		}
		else {
			$density['desktop'] = $options['tiles_density'] ?? 'high';
			$density['tablet'] = $options['tiles_density_tablet'] ?? 'medium';
			$density['mobile'] = $options['tiles_density_mobile'] ?? 'low';
		}

		ob_start();
		include dirname( __FILE__ ) . '/tiles.css.php';
		$html = ob_get_clean();
		return $html;
	}

	function build_inline_attributes( $id, $data ) {
		if ( isset( $data['meta'] ) && isset( $data['meta']['width'] ) && isset( $data['meta']['height'] ) ) {
			return ' data-mgl-id="' . $id . '" data-mgl-width="' . $data['meta']['width'] . '" data-mgl-height="' . 
				$data['meta']['height'] . '"';
		}
		return null;
	}

	function build_next_cell( $id, $data ) {
		$html = parent::build_next_cell( $id, $data );
		return $html;
	}

}

?>

```
