<?php
/**
 * @package DJ-SectionsAnywhere
 * @copyright Copyright (C) 2017  DJ-Extensions.com LTD, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 *
 * DJContentFilters is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * DJContentFilters is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with DJContentFilters. If not, see <http://www.gnu.org/licenses/>.
 *
 */
defined('_JEXEC') or die;
?>
<?php

$el = $this->el('div', [
    'class' => [
        ($attrs['modal_padding']) ? 'uk-padding-' . $attrs['modal_padding'] : 'uk-padding-remove',
        'modal-close-outside'
    ],
    'uk-modal' => true
]);

$modalBody = $this->el('div', [
    'class' => [
        'uk-modal-dialog uk-modal-body',
        (($attrs['modal_width']) ? 'uk-width-' . $attrs['modal_width'] : 'uk-width')
    ]
]);

if (isset($attrs->modal_title) && $attrs->modal_title) {
    $modalHeadline = $this->el('span', [
        'class' => [
            'uk-' . $attrs->modal_title_style
        ]
    ]);
}


?>

<?= $el($props, $attrs) ?>
<?= $modalBody($props) ?>



<?php if (isset($attrs->modal_title) && $attrs->modal_title) : ?>
    <?= $modalHeadline($props, $attrs->modal_title) ?>
<?php endif; ?>

<div class="uk-width uk-grid">
    <?php echo $builder->render($children); ?>
</div>
<?php if (isset($attrs->modal_close_btn) && $attrs->modal_close_btn) : ?>
    <p class="uk-text-right">
        <button class="uk-button <?php echo $attrs->modal_close_style;?> uk-modal-close"
                type="button"><?php echo $attrs->modal_close_btn; ?></button>
    </p>
<?php endif; ?>

<?= $modalBody->end() ?>
<?= $el->end() ?>

