SILENT KILLERPanel

Current Path: > home > codekrsu > > escapematrixonline.com > wp-content > plugins > > carousel-slider > includes


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//escapematrixonline.com/wp-content/plugins//carousel-slider/includes

NameTypeSizeLast ModifiedActions
Abstracts Directory - -
Admin Directory - -
CLI Directory - -
Frontend Directory - -
Integration Directory - -
Interfaces Directory - -
REST Directory - -
Supports Directory - -
Traits Directory - -
Widget Directory - -
Ajax.php File 874 bytes April 10 2025 09:40:10.
Api.php File 4685 bytes June 14 2024 19:04:34.
Assets.php File 5817 bytes April 10 2025 09:40:10.
Autoloader.php File 4124 bytes April 10 2025 09:40:10.
Helper.php File 14211 bytes April 10 2025 09:40:10.
Plugin.php File 7504 bytes April 10 2025 09:40:10.
TemplateParserBase.php File 4964 bytes April 10 2025 09:40:10.
TrackingData.php File 7011 bytes June 14 2024 19:04:34.
ViewHelper.php File 1345 bytes April 10 2025 09:40:10.

Reading File: /home/codekrsu//escapematrixonline.com/wp-content/plugins//carousel-slider/includes/ViewHelper.php

<?php

namespace CarouselSlider;

use CarouselSlider\Supports\Validate;

defined( 'ABSPATH' ) || exit;

/**
 * ViewHelper class
 */
class ViewHelper {


	/**
	 * Array to style
	 *
	 * @param  array  $styles  The styles array.
	 *
	 * @return string
	 */
	public static function array_to_style( array $styles ): string {
		$_styles = [];
		foreach ( $styles as $key => $value ) {
			if ( ! is_string( $key ) || empty( $value ) ) {
				continue;
			}
			$_styles[] = sprintf( '%s:%s', $key, esc_attr( $value ) );
		}

		return implode( ';', $_styles );
	}

	/**
	 * Convert array to html data attribute
	 *
	 * @param  array  $attributes  The attributes list.
	 *
	 * @return array
	 */
	public static function array_to_attribute( array $attributes ): array {
		return array_map(
			function ( $key, $value ) {
				// If boolean value.
				if ( is_bool( $value ) ) {
					return sprintf( '%s="%s"', $key, ( $value ? 'true' : 'false' ) );
				}
				// If array value.
				if ( is_array( $value ) ) {
					return sprintf( '%s="%s"', $key, implode( ' ', $value ) );
				}

				if ( is_string( $value ) && Validate::json( $value ) ) {
					return sprintf( "%s='%s'", $key, $value );
				}

				// If string value.
				return sprintf( '%s="%s"', $key, esc_attr( $value ) );
			},
			array_keys( $attributes ),
			array_values( $attributes )
		);
	}
}

SILENT KILLER Tool