<?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
 */
defined('_JEXEC') or die;
$el = $this->el('div', [

	'class' =>  $this->expr([
		'djc_introdescription',
		'uk-text-{introdescription_text_style}' => ['introdescription_text_style' => $element['introdescription_text_style']],
		'uk-text-{introdescription_text_size} {@!introdescription_text_style}' => ['introdescription_text_size' => $element['introdescription_text_size'], 'introdescription_text_style' => $element['introdescription_text_style']],
		'uk-text-{introdescription_text_color}'  => ['introdescription_text_color' => $element['introdescription_text_color']],
		'uk-dropcap {@introdescription_dropcap}' => ['introdescription_dropcap' => $element['introdescription_dropcap']],
		'uk-column-{introdescription_column}[@{introdescription_column_breakpoint}]' => ['introdescription_column' => $element['introdescription_column'], 'introdescription_column_breakpoint' => $element['introdescription_column_breakpoint']],
		'uk-column-divider {@introdescription_column} {@introdescription_column_divider}' => ['introdescription_column' => $element['introdescription_column'], 'introdescription_column_divider' => $element['introdescription_column_divider']],
		'uk-margin[-{introdescription_margin}]-top {@!introdescription_margin: remove}',
		'uk-margin-remove-top {@introdescription_margin: remove}',
		'uk-margin-remove-bottom',
		'uk-inline {@position_inline_introdescription}' => ['position_inline_introdescription' => $element['position_inline_introdescription']],
	], $element),
	'grid' => true,


]);

// Column
$breakpoints = ['xl', 'l', 'm', 's', ''];

if ($element['introdescription_column'] && false !== $index = array_search($element['introdescription_column_breakpoint'], $breakpoints)) {

	list(, $columns) = explode('-', $element['introdescription_column']);

	foreach (array_splice($breakpoints, $index + 1, 4) as $breakpoint) {

		if ($columns < 2) {
			break;
		}

		$el->attr('class', ['uk-column-1-' . (--$columns) . ($breakpoint ? "@{$breakpoint}" : '')]);
	}
}

//Style position && size of an element
$el->attr('style', [
	'position:{position_introdescription};' => ['position_introdescription' => $element['position_introdescription']],
	'left: {position_left_introdescription}px;' => ['position_left_introdescription' => $element['position_left_introdescription']],
	'right: {position_right_introdescription}px;' => ['position_right_introdescription' => $element['position_right_introdescription']],
	'top: {position_top_introdescription}px;' => ['position_top_introdescription' => $element['position_top_introdescription']],
	'bottom: {position_bottom_introdescription}px;' => ['position_bottom_introdescription' => $element['position_bottom_introdescription']],
	'z-index:{position_z_index_introdescription};' => ['position_z_index_introdescription' => $element['position_z_index_introdescription']],
	'width:{introdescription_width};' => ['introdescription_width' => $element['introdescription_width']],
	'height:{introdescription_height};' => ['introdescription_height' => $element['introdescription_height']],


], $element);

echo $el($props, $attrs, $props['introdescription']);
