HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/layout-slider.tar
assets/banner.svg000064400000001111151540320210010017 0ustar00<svg enable-background="new 0 0 120 120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h120v120h-120z" fill="#1880b6"/><g stroke="#324249" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" transform="translate(1 7)"><g fill="#8ed9ef"><path d="m34 74h-3c-1.7 0-3-1.3-3-3v-36c0-1.7 1.3-3 3-3h3"/><path d="m84 32h3c1.7 0 3 1.3 3 3v36c0 1.7-1.3 3-3 3h-3"/><path d="m37 28h44c1.7 0 3 1.3 3 3v44c0 1.7-1.3 3-3 3h-44c-1.7 0-3-1.3-3-3v-44c0-1.7 1.3-3 3-3z"/></g><g fill="#f2f0da"><path d="m40 34h38v38h-38z"/><path d="m40 50h38m-26 22v-22"/></g></g></svg>assets/icon.svg000064400000000663151540320210007515 0ustar00<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m19.39453 5.35547c0-.41406-.33594-.75-.75-.75h-13.28906c-.41406 0-.75.33594-.75.75v13.28906c0 .41406.33594.75.75.75h13.28906c.41406 0 .75-.33594.75-.75zm-1.5.75v4.03906h-11.78906v-4.03906zm-11.78906 5.53906h4.02051v6.25h-4.02051zm5.52051 6.25v-6.25h6.26855v6.25z"/><path d="m20.28027 5.84619h1.5v12.30811h-1.5z"/><path d="m2.21973 5.84619h1.5v12.30811h-1.5z"/></svg>js/slide-control.js000064400000001362151540320210010267 0ustar00/* globals jQuery */

jQuery( function ( $ ) {
	$( '.sow-slide-control' ).on( 'click', function( e ) {
		var $$ = $( this ),
			cycleContainer = $$.parents( '.sow-slider-images' );
			slideValue = $$.attr( 'href' ).substr( 1 );

		e.preventDefault();

		if ( ! isNaN( slideValue ) ) {
			cycleContainer.cycle( 'goto', Math.abs( slideValue - 1 ) );
		} else {
			switch ( slideValue ) {
				case 'first':
					cycleContainer.cycle( 'goto', 0 );
					break;
				case 'last':
					cycleContainer.cycle( 'goto', cycleContainer.find( '.sow-slider-image:not(.cycle-sentinel)' ).length - 1 );
					break;
				case 'next':
					cycleContainer.cycle( 'next' );
					break;
				case 'previous':
					cycleContainer.cycle( 'prev' );
					break;
			}
		}
	} );
} );
js/slide-control.min.js000064400000000704151540320210011050 0ustar00jQuery((function(e){e(".sow-slide-control").on("click",(function(s){var l=e(this),c=l.parents(".sow-slider-images");if(slideValue=l.attr("href").substr(1),s.preventDefault(),isNaN(slideValue))switch(slideValue){case"first":c.cycle("goto",0);break;case"last":c.cycle("goto",c.find(".sow-slider-image:not(.cycle-sentinel)").length-1);break;case"next":c.cycle("next");break;case"previous":c.cycle("prev")}else c.cycle("goto",Math.abs(slideValue-1))}))}));layout-slider.php000064400000036752151540320210010060 0ustar00<?php
/*
Widget Name: Layout Slider
Description: Design responsive slider frames with unique layouts, backgrounds, and content built with Page Builder.
Author: SiteOrigin
Author URI: https://siteorigin.com
Documentation: https://siteorigin.com/widgets-bundle/layout-slider-widget/
*/

if ( ! class_exists( 'SiteOrigin_Widget_Base_Slider' ) ) {
	include_once plugin_dir_path( SOW_BUNDLE_BASE_FILE ) . '/base/inc/widgets/base-slider.class.php';
}

class SiteOrigin_Widget_LayoutSlider_Widget extends SiteOrigin_Widget_Base_Slider {
	protected $buttons = array();

	public function __construct() {
		parent::__construct(
			'sow-layout-slider',
			__( 'SiteOrigin Layout Slider', 'so-widgets-bundle' ),
			array(
				'description' => __( 'Design responsive slider frames with unique layouts, backgrounds, and content built with Page Builder.', 'so-widgets-bundle' ),
				'help' => 'https://siteorigin.com/widgets-bundle/layout-slider-widget/',
				'panels_title' => false,
			),
			array( ),
			false,
			plugin_dir_path( __FILE__ )
		);

		add_action( 'siteorigin_widgets_enqueue_frontend_scripts_sow-layout-slider', array( $this, 'register_shortcode_script' ) );
	}

	public function get_widget_form() {
		$show_heading_fields = apply_filters( 'sow_layout_slider_show_heading_fields', false );

		$units = siteorigin_widgets_get_measurements_list();
		unset( $units[1] ); // Remove %;

		return parent::widget_form( array(
			'frames' => array(
				'type' => 'repeater',
				'label' => __( 'Slider frames', 'so-widgets-bundle' ),
				'item_name' => __( 'Frame', 'so-widgets-bundle' ),
				'item_label' => array(
					'selectorArray' => array(
						array(
							'selector' => '.siteorigin-widget-field-image .media-field-wrapper .current .title',
							'valueMethod' => 'html',
						),
						array(
							'selector' => '.siteorigin-widget-field-videos .siteorigin-widget-field-repeater-items  .media-field-wrapper .current .title',
							'valueMethod' => 'html',
						),
						array(
							'selector' => '.siteorigin-widget-field-videos .siteorigin-widget-field-repeater-items  .media-field-wrapper .current .title',
							'valueMethod' => 'html',
						),
						array(
							'selector' => ".siteorigin-widget-field-videos [id*='url']",
							'update_event' => 'change',
							'value_method' => 'val',
						),
					),
				),

				'fields' => array(
					'content' => array(
						'type' => 'builder',
						'builder_type' => 'layout_slider_builder',
						'label' => __( 'Content', 'so-widgets-bundle' ),
					),

					'background' => array(
						'type' => 'section',
						'label' => __( 'Background', 'so-widgets-bundle' ),
						'fields' => array(
							'image' => array(
								'type' => 'media',
								'label' => __( 'Background image', 'so-widgets-bundle' ),
								'library' => 'image',
								'fallback' => true,
							),

							'image_type' => array(
								'type' => 'select',
								'label' => __( 'Background image type', 'so-widgets-bundle' ),
								'options' => array(
									'cover' => __( 'Cover', 'so-widgets-bundle' ),
									'tile' => __( 'Tile', 'so-widgets-bundle' ),
								),
								'default' => 'cover',
							),

							'opacity' => array(
								'label' => __( 'Background image opacity', 'so-widgets-bundle' ),
								'type' => 'slider',
								'min' => 0,
								'max' => 100,
								'default' => 100,
							),

							'color' => array(
								'type' => 'color',
								'label' => __( 'Background color', 'so-widgets-bundle' ),
								'default' => '#333333',
							),

							'url' => array(
								'type' => 'link',
								'label' => __( 'Destination URL', 'so-widgets-bundle' ),
							),

							'new_window' => array(
								'type' => 'checkbox',
								'label' => __( 'Open URL in a new window', 'so-widgets-bundle' ),
							),

							'videos' => array(
								'type' => 'repeater',
								'item_name' => __( 'Video', 'so-widgets-bundle' ),
								'label' => __( 'Background videos', 'so-widgets-bundle' ),
								'item_label' => array(
									'selectorArray' => array(
										array(
											'selector' => '.siteorigin-widget-field-file .media-field-wrapper .current .title',
											'valueMethod' => 'html',
										),
										array(
											'selector' => "[id*='url']",
											'update_event' => 'change',
											'value_method' => 'val',
										),
									),
								),
								'fields' => $this->video_form_fields(),
							),
						),
					),
				),
			),

			'controls' => array(
				'type' => 'section',
				'label' => __( 'Slider Controls', 'so-widgets-bundle' ),
				'fields' => $this->control_form_fields(),
			),

			'layout' => array(
				'type' => 'section',
				'label' => __( 'Layout', 'so-widgets-bundle' ),
				'fields' => array(
					'desktop' => array(
						'type' => 'section',
						'label' => __( 'Desktop', 'so-widgets-bundle' ),
						'fields' => array(
							'height' => array(
								'type' => 'measurement',
								'label' => __( 'Height', 'so-widgets-bundle' ),
								'units' => $units,
							),

							'padding' => array(
								'type' => 'measurement',
								'label' => __( 'Top and bottom padding', 'so-widgets-bundle' ),
								'default' => '50px',
							),

							'padding_extra_top' => array(
								'type' => 'measurement',
								'label' => __( 'Extra top padding', 'so-widgets-bundle' ),
								'description' => __( 'Additional padding added to the top of the slider', 'so-widgets-bundle' ),
								'default' => '0px',
							),

							'padding_sides' => array(
								'type' => 'measurement',
								'label' => __( 'Side padding', 'so-widgets-bundle' ),
								'default' => '20px',
							),

							'width' => array(
								'type' => 'measurement',
								'label' => __( 'Maximum container width', 'so-widgets-bundle' ),
								'default' => '1280px',
							),
						),
					),
					'mobile' => array(
						'type' => 'section',
						'label' => __( 'Mobile', 'so-widgets-bundle' ),
						'fields' => array(
							'height_responsive' => array(
								'type' => 'measurement',
								'label' => __( 'Height', 'so-widgets-bundle' ),
								'units' => $units,
							),

							'padding' => array(
								'type' => 'measurement',
								'label' => __( 'Top and bottom padding', 'so-widgets-bundle' ),
							),

							'padding_extra_top' => array(
								'type' => 'measurement',
								'label' => __( 'Extra top padding', 'so-widgets-bundle' ),
								'description' => __( 'Additional padding added to the top of the slider', 'so-widgets-bundle' ),
							),

							'padding_sides' => array(
								'type' => 'measurement',
								'label' => __( 'Side padding', 'so-widgets-bundle' ),
							),
						),
					),
					'vertically_align' => array(
						'type' => 'checkbox',
						'label' => __( 'Vertically center align slide contents', 'so-widgets-bundle' ),
						'description' => __( 'For perfect centering, consider setting the Extra top padding setting to 0 when enabling this setting.', 'so-widgets-bundle' ),
					),
				),
			),

			'design' => array(
				'type' => 'section',
				'label' => __( 'Design', 'so-widgets-bundle' ),
				'state_emitter' => array(
					'callback' => 'conditional',
					'args'     => array(
						'meh[hide]: ' . ( $show_heading_fields ? 'false' : 'true' ),
					),
				),
				'state_handler' => array(
					'meh[hide]' => array( 'hide' ),
				),
				'fields' => array(
					'heading_color' => array(
						'type' => 'color',
						'label' => __( 'Heading color', 'so-widgets-bundle' ),
					),

					'heading_shadow' => array(
						'type' => 'slider',
						'label' => __( 'Heading shadow intensity', 'so-widgets-bundle' ),
						'max' => 100,
						'min' => 0,
					),

					'text_size' => array(
						'type' => 'measurement',
						'label' => __( 'Text size', 'so-widgets-bundle' ),
					),

					'text_color' => array(
						'type' => 'color',
						'label' => __( 'Text color', 'so-widgets-bundle' ),
					),
				),
			),
		) );
	}


	private static function can_render() {
		if ( ! defined( 'SITEORIGIN_PANELS_VERSION' ) ) {
			return false;
		}

		if ( is_admin() ) {
			return true;
		}

		// Is this field being rendered inside one of our blocks?
		if ( defined( 'REST_REQUEST' ) && function_exists( 'register_block_type' ) ) {
			return true;
		}

		return false;
	}

	public function form( $instance, $form_type = 'widget' ) {
		if ( siteorigin_widgets_can_render_builder_field() ) {
			parent::form( $instance, $form_type );
			return;
		}
		?>

		<p>
			<?php
			printf(
				esc_html__( 'This widget requires %sSiteOrigin Page Builder%s to be installed and activated.', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/page-builder/" target="_blank" rel="noopener noreferrer">',
				'</a>'
			);
			?>
		</p>
		<?php
	}

	/**
	 * Get everything necessary for the background image.
	 *
	 * @return array
	 */
	public function get_frame_background( $i, $frame ) {
		$background_image = siteorigin_widgets_get_attachment_image_src(
			$frame['background']['image'],
			'full',
			! empty( $frame['background']['image_fallback'] ) ? $frame['background']['image_fallback'] : ''
		);

		return array(
			'color' => ! empty( $frame['background']['color'] ) ? $frame['background']['color'] : false,
			'image' => ! empty( $background_image[0] ) ? $background_image[0] : false,
			'image-width' => ! empty( $background_image[1] ) ? $background_image[1] : 0,
			'image-height' => ! empty( $background_image[2] ) ? $background_image[2] : 0,
			'image-sizing' => $frame['background']['image_type'],
			'url' => ! empty( $frame['background']['url'] ) ? $frame['background']['url'] : false,
			'new_window' => ! empty( $frame['background']['new_window'] ),
			'videos' => $frame['background']['videos'],
			'video-sizing' => 'background',
			'opacity' => (int) $frame['background']['opacity'] / 100,
		);
	}

	/**
	 * Render the actual content of the frame
	 */
	public function render_frame_contents( $i, $frame ) {
		?>
		<div class="sow-slider-image-container">
			<div class="sow-slider-image-wrapper">
				<?php echo $this->process_content( $frame['content'], $frame ); ?>
			</div>
		</div>
		<?php
	}

	public function register_shortcode_script() {
		wp_register_script(
			'sow-layout-slide-control',
			plugin_dir_url( __FILE__ ) . 'js/slide-control' . SOW_BUNDLE_JS_SUFFIX . '.js',
			array( 'jquery', 'sow-slider-slider' ),
			SOW_BUNDLE_VERSION,
			true
		);
	}

	public function add_shortcode( $atts ) {
		ob_start();
		$atts = shortcode_atts( array(
			'slide' => 'next',
			'label' => '',
		), $atts );

		wp_enqueue_script( 'sow-layout-slide-control' );

		if ( is_numeric( $atts['slide'] ) ) {
			$label = sprintf( __( 'Show slide %d', 'so-widgets-bundle' ), $atts['slide'] );
		} elseif (
			$atts['slide'] == 'next' ||
			$atts['slide'] == 'prev' ||
			$atts['slide'] == 'prev' ||
			$atts['slide'] == 'previous' ||
			$atts['slide'] == 'first' ||
			$atts['slide'] == 'last'
		) {
			if ( $atts['slide'] == 'prev' ) {
				$atts['slide'] = 'previous';
			}

			$label = sprintf( __( '%s slide', 'so-widgets-bundle' ), ucfirst( $atts['slide'] ) );
		} else {
			_e( 'Slide control shortcode error: invalid slide value.', 'so-widgets-bundle' );
		}

		if ( isset( $label ) ) {
			// Handle label overriding.
			$label = empty( $atts['label'] ) ? $label : $atts['label'];

			echo '<a class="sow-slide-control" href="#' . esc_attr( $atts['slide'] ) . '" role="button">' . esc_attr( $label ) . '</a>';
		}

		return ob_get_clean();
	}

	/**
	 * Process the content.
	 *
	 * @return string
	 */
	public function process_content( $content, $frame ) {
		if ( function_exists( 'siteorigin_panels_render' ) ) {
			add_shortcode( 'slide_control', array( $this, 'add_shortcode' ) );
			$content_builder_id = substr( md5( json_encode( $content ) ), 0, 8 );
			echo siteorigin_panels_render( 'w' . $content_builder_id, true, $content );
			remove_shortcode( 'slide_control' );
		} else {
			esc_html__( 'This widget requires Page Builder.', 'so-widgets-bundle' );
		}
	}

	/**
	 * The less variables to control the design of the slider
	 *
	 * @return array
	 */
	public function get_less_variables( $instance ) {
		$less = array();

		if ( empty( $instance ) ) {
			return $less;
		}

		// Slider navigation controls
		$less['nav_color_hex'] = $instance['controls']['nav_color_hex'];
		$less['nav_size'] = $instance['controls']['nav_size'];
		$less['nav_align'] = ! empty( $instance['controls']['nav_align'] ) ? $instance['controls']['nav_align'] : 'right';

		// Measurement field type options
		$meas_options = array();

		// Layouts settings.
		if ( ! empty( $instance['layout'] ) ) {
			if ( ! empty( $instance['layout']['desktop'] ) ) {
				$settings = $instance['layout']['desktop'];

				$meas_options['slide_height'] = ! empty( $settings['height'] ) ? $settings['height'] : '';
				$meas_options['slide_padding'] = ! empty( $settings['padding'] ) ? $settings['padding'] : '';
				$meas_options['slide_padding_extra_top'] = ! empty( $settings['padding_extra_top'] ) ? $settings['padding_extra_top'] : '';
				$meas_options['slide_padding_sides'] = ! empty( $settings['padding_sides'] ) ? $settings['padding_sides'] : '';
				$meas_options['slide_width'] = ! empty( $settings['width'] ) ? $settings['width'] : '';
			}

			if ( ! empty( $instance['layout']['mobile'] ) ) {
				$settings = $instance['layout']['mobile'];

				$meas_options['slide_height_responsive'] = ! empty( $settings['height_responsive'] ) ? $settings['height_responsive'] : '';
				$meas_options['slide_padding_responsive'] = ! empty( $settings['padding'] ) ? $settings['padding'] : '';
				$meas_options['slide_padding_sides_responsive'] = ! empty( $settings['padding_sides'] ) ? $settings['padding_sides'] : '';

				if ( ! empty( $settings['padding_extra_top'] ) ) {
					// Add extra padding to top padding.
					$meas_options['slide_padding_top_responsive'] = $settings['padding_extra_top'];
				}
			}
		}

		if ( ! empty( $instance['design']['text_size'] ) ) {
			$meas_options['text_size'] = $instance['design']['text_size'];
		}

		foreach ( $meas_options as $key => $val ) {
			$less[ $key ] = $this->add_default_measurement_unit( $val );
		}

		$less['vertically_align'] = empty( $instance['layout']['vertically_align'] ) ? 'false' : 'true';

		if ( ! empty( $instance['design']['heading_shadow'] ) ) {
			$less['heading_shadow'] = (int) $instance['design']['heading_shadow'];
		}

		if ( ! empty( $instance['design']['heading_color'] ) ) {
			$less['heading_color'] = $instance['design']['heading_color'];
		}

		if ( ! empty( $instance['design']['text_color'] ) ) {
			$less['text_color'] = $instance['design']['text_color'];
		}

		$global_settings = $this->get_global_settings();

		if ( ! empty( $global_settings['responsive_breakpoint'] ) ) {
			$less['responsive_breakpoint'] = $global_settings['responsive_breakpoint'];
		}

		return $less;
	}

	public function add_default_measurement_unit( $val ) {
		if ( ! empty( $val ) ) {
			if ( ! preg_match( '/\d+([a-zA-Z%]+)/', $val ) ) {
				$val .= 'px';
			}
		}

		return $val;
	}

	public function get_form_teaser() {
		if ( class_exists( 'SiteOrigin_Premium' ) ) {
			return false;
		}

		return array(
			sprintf(
				__( 'Add multiple Layout Slider frames in one go with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/multiple-media" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
			sprintf(
				__( 'Add parallax and fixed background images with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/parallax-sliders" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
		);
	}
}

siteorigin_widget_register( 'sow-layout-slider', __FILE__, 'SiteOrigin_Widget_LayoutSlider_Widget' );
styles/default.less000064400000005475151540320210010407 0ustar00@import "../../../base/less/mixins";

@nav_color_hex: #FFFFFF;
@nav_size: 25;
@nav_align: right;

// Layout.
@vertically_align: false;
// Layout Desktop.
@slide_height: default;
@slide_padding: 50px;
@slide_padding_extra_top: 0px;
@slide_padding_sides: 10px;
@slide_width: 1280px;

// Layout Mobile.
@responsive_breakpoint: 780px;
@slide_height_responsive: default;
@slide_padding_responsive: 0px;
@slide_padding_top_responsive: 0px;
@slide_padding_sides_responsive: default;

// Design.
@text_size: default;
@text_color: default;
@heading_shadow: default;
@heading_color: default;

// "Pre-fill" Layout Slider widget area if height is set
& when ( isnumber( @slide_height ) ) {
	@media (min-width: @responsive_breakpoint) {
		min-height: @slide_height;
	}
}

& when ( isnumber( @slide_height_responsive ) ) {
	@media (max-width: @responsive_breakpoint) {
		min-height: @slide_height_responsive;
	}
}

.sow-slider-base {

	ul.sow-slider-images {
		min-height: 0 !important;

		.sow-slider-image-wrapper {
			padding: ~"calc( @{slide_padding} + @{slide_padding_extra_top} )" @slide_padding_sides @slide_padding @slide_padding_sides;
			max-width: @slide_width;
			height: @slide_height;

			& when (@vertically_align = true) {
				display: flex;
				flex-direction: column;
				justify-content: center;
			}

			@media (max-width: @responsive_breakpoint) {
				// If no responsive height is set, remove slider height
				& when not ( isnumber( @slide_height_responsive ) ) {
					height: auto;
				}

				& when ( isnumber( @slide_height_responsive ) ) {
					height: @slide_height_responsive;
				}

				padding-top: @slide_padding_responsive;
				padding-top: calc(~"@{slide_padding_responsive} + @{slide_padding_top_responsive}");

				& when ( isnumber( @slide_padding_sides_responsive ) ) {
					padding-right: @slide_padding_sides_responsive;
					padding-left: @slide_padding_sides_responsive;
				}
				& when ( isnumber( @slide_padding_responsive ) ) {
					padding-bottom: @slide_padding_responsive;
				}
			}

			// These heading tag styles and the paragraph tag styles below are only be used for old version of the
			// layout slider widget which still allowed setting heading and text color and size.
			& when ( iscolor( @heading_color ) ) {
				h1, h2, h3, h4, h5, h6 {
					line-height: 1.375em;
					color: @heading_color;
					margin: 0.1em 0;

					& when ( isnumber( @heading_shadow ) ) {
						text-shadow: 0 2px 2px rgba(0, 0, 0, @heading_shadow/100);
					}

				}
			}

			& when ( iscolor( @text_color ) ) {
				p {
					color: @text_color;
					text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
					margin: 1em 0;
					font-size: @text_size;
				}
			}
		}
	}

	.sow-slider-pagination {
		text-align: @nav_align;

		li a {
			background: @nav_color_hex;
		}
	}

	.sow-slide-nav {

		font-size: ~"@{nav_size}px";

		a {
			color: @nav_color_hex;
		}
	}

}
tpl/default.php000064400000000142151540320210007466 0ustar00<?php

$this->render_template( $instance['controls'], $instance['frames'], $instance['layout'] );