| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/dijon/libraries/regularlabs/layouts/regularlabs/buttons/ |
Upload File : |
<?php
/**
* @package Regular Labs Library
* @version 25.9.9174
*
* @author Peter van Westen <info@regularlabs.com>
* @link https://regularlabs.com
* @copyright Copyright © 2025 Regular Labs All Rights Reserved
* @license GNU General Public License version 2 or later
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper as JHtml;
use Joomla\CMS\Language\Text as JText;
use Joomla\CMS\Uri\Uri as JUri;
/**
* @var object $displayData
*/
if ( ! function_exists('RegularLabsModalRenderButton'))
{
function RegularLabsModalRenderButton($options, $prefix = 'close', $default_text = 'JLIB_HTML_BEHAVIOR_CLOSE')
{
$class = $options[$prefix . 'Class'] ?? ($prefix == 'close' ? 'btn btn-secondary' : 'btn btn-success');
$text = $options[$prefix . 'Text'] ?? JText::_($default_text);
$onclick = $options[$prefix . 'Callback'] ?? '';
$dismiss = $prefix == 'close' || ! empty($options[$prefix . 'Close']) ? 'data-bs-dismiss="modal"' : '';
$icon = ! empty($options[$prefix . 'Icon']) ? '<span class="icon-' . $options[$prefix . 'Icon'] . '" aria-hidden="true"></span>' : '';
return '<button type="button" class="' . $class . '" ' . $dismiss . ' onclick="' . $onclick . '">'
. $icon . $text . ' </button>';
}
}
$button = $displayData;
if (empty($button->modal))
{
return;
}
if (empty($button->name))
{
return;
}
$link = ! empty($button->link) ? JUri::base() . $button->link : null;
$title = ! empty($button->title) ? $button->title : $button->text;
$options = is_array($button->options ?? []) ? $button->options : [];
$buttons = [];
if (isset($options['confirmCallback'])
)
{
$buttons[] = RegularLabsModalRenderButton($options, 'confirm', 'JSAVE');
}
if (isset($options['confirm2Callback'])
)
{
$buttons[] = RegularLabsModalRenderButton($options, 'confirm2', 'JSAVE');
}
$buttons[] = RegularLabsModalRenderButton($options, 'close', 'JLIB_HTML_BEHAVIOR_CLOSE');
$id = str_replace(' ', '', ($button->id ?? strtolower($button->name)) . '_modal');
echo JHtml::_(
'bootstrap.renderModal',
$id,
[
'url' => $link,
'title' => $title,
'height' => array_key_exists('height', $options) ? $options['height'] : '400px',
'width' => array_key_exists('width', $options) ? $options['width'] : '800px',
'bodyHeight' => array_key_exists('bodyHeight', $options) ? $options['bodyHeight'] : '70',
'modalWidth' => array_key_exists('modalWidth', $options) ? $options['modalWidth'] : '80',
'keyboard' => array_key_exists('keyboard', $options) ? $options['keyboard'] : true,
'backdrop' => array_key_exists('backdrop', $options) ? $options['backdrop'] : true,
'footer' => implode('', $buttons),
]
);