<?php
/**
 * @package DJ-Catalog2-Yootheme
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

namespace YOOtheme;
defined('_JEXEC') or die;
/**
 * @var ImageProvider $imageProvider
 */
$imageProvider = app(ImageProvider::class);

$link = $props['product_image_link'] ? $this->el('a', [
	'href' => $props['product_image_link'],
]) : null;

if ($link) {

	$link->attr([
		'target' => ['_blank {@link_target}'],
		'uk-scroll' => strpos($props['product_image_link'], '#') === 0,
	]);
	$link->attr('style', [
		'width:{product_image_width};' => ['product_image_width' => $element['product_image_width']],
		'height:{product_image_height};' => ['product_image_height' => $element['product_image_height']],
	], $element);

}



if ($link && $props['title'] && $element['title_link']) {

	$props['title'] = $link($element, [
		'class' => [
			'uk-link-{title_hover_style}',
		],
	], $this->striptags($props['title']));

}

if ($link && $props['image'] && $element['product_image_link']) {

	$props['image'] = $link($element, ['class' => [

	]], $props['image']);

}

if ($link && $props['product_image_link']) {


	$link->attr([

		'class' => [
			'djc_product_link',
			'el-link',
			'uk-{link_style: link-(muted|text)}',
			'uk-button uk-button-{!link_style: |link-muted|link-text} [uk-button-{link_size}]',
		],

	]);

}

return $link;
