layout = 'horizontal'; } function inline_css() { $options = get_option( Meow_MGL_Core::get_plugin_option_name(), null ); $class_id = '#' . $this->class_id; $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : ( $options['horizontal_gutter'] ?? 10 ); $image_height = isset( $this->atts['image_height'] ) ? $this->atts['image_height'] : ( $options['horizontal_image_height'] ?? 500 ); $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : ( $options['horizontal_hide_scrollbar'] ?? false ); $isPreview = $this->isPreview; ob_start(); include dirname( __FILE__ ) . '/horizontal.css.php'; $html = ob_get_clean(); return $html; } function build( $idsStr ) { $options = get_option( Meow_MGL_Core::get_plugin_option_name(), null ); // Generate gallery $classes = $this->build_classes(); $styles = $this->build_styles(); $out = "
"; $gutter = isset( $this->atts['mgl_horizontal_gutter'] ) ? $this->atts['mgl_horizontal_gutter'] : ( $options['horizontal_gutter'] ?? 5 ); $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : ( $options['horizontal_hide_scrollbar'] ?? false ); $classes = $hide_scrollbar ? "$classes hide-scrollbar" : $classes; $attributes = "data-mgl-gutter=\"${gutter}\""; $out = "
"; $out .= '
'; $this->prepare_data( $idsStr ); while ( count( $this->ids ) > 0 ) { $id = array_pop( $this->ids ); $out .= $this->build_next_cell( $id, $this->data[$id] ); } $out .= '
'; $out .= '
'; $out = apply_filters( 'mgl_gallery_written', $out, $this->layout ); // Generate gallery container $container_classes = $this->build_container_classes(); $inline_css = $this->inline_css(); $container = "
{$inline_css}{$out}
"; return $container; } } ?>