calendar
2 days ago
login
2 days ago
payment
2 days ago
alert.php
2 days ago
carttotals.php
2 days ago
checkout.php
2 days ago
couponform.php
2 days ago
index.html
2 days ago
login.php
2 days ago
options.php
2 days ago
paymentmethods.php
2 days ago
quickcontact.php
2 days ago
reviews.php
2 days ago
timeline.php
2 days ago
waitlist.php
2 days ago
alert.php
100 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | /** |
| 15 | * Layout variables |
| 16 | * ----------------- |
| 17 | * @var string $text The text to display within the alert. |
| 18 | * @var string $type The alert type. |
| 19 | * @var string $id A unique alert signature. |
| 20 | * @var boolean $dismiss True if the alert can be dismissed. |
| 21 | * @var mixed $expdate If specified, indicates the date for |
| 22 | * the cookie expiration. |
| 23 | * @var array $attrs A list of field attributes. |
| 24 | */ |
| 25 | extract($displayData); |
| 26 | |
| 27 | // fetch attributes string |
| 28 | $attrs_str = ''; |
| 29 | |
| 30 | foreach ($attrs as $k => $v) |
| 31 | { |
| 32 | if ($k != 'class') |
| 33 | { |
| 34 | $attrs_str .= ' ' . $k; |
| 35 | |
| 36 | if (!is_bool($v)) |
| 37 | { |
| 38 | $attrs_str .= ' = "' . $this->escape($v) . '"'; |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ?> |
| 44 | |
| 45 | <div class="alert alert-<?php echo $type . (!empty($attrs['class']) ? ' ' . $attrs['class'] : ''); ?>"<?php echo $attrs_str; ?>> |
| 46 | |
| 47 | <?php |
| 48 | if ($dismiss) |
| 49 | { |
| 50 | ?> |
| 51 | <button type="button" class="close" data-dismiss="alert" data-signature="<?php echo $id; ?>" data-expdate="<?php echo $expdate; ?>">×</button> |
| 52 | <?php |
| 53 | } |
| 54 | ?> |
| 55 | |
| 56 | <div class="alert-message"> |
| 57 | <?php |
| 58 | /** |
| 59 | * Add support for alert icons in Joomla 4. |
| 60 | * Do not add the icon in case the text starts with a |
| 61 | * paragraph or a div. |
| 62 | */ |
| 63 | if (VersionListener::isJoomla4x() && !preg_match("/^<(?:p|div)/", $text)) |
| 64 | { |
| 65 | if ($type == 'info') |
| 66 | { |
| 67 | ?> |
| 68 | <span class="fas fa-info-circle" aria-hidden="true"></span> |
| 69 | <span class="sr-only"><?php echo JText::translate('INFO'); ?></span> |
| 70 | <?php |
| 71 | } |
| 72 | else if ($type == 'warning') |
| 73 | { |
| 74 | ?> |
| 75 | <span class="fas fa-exclamation-triangle" aria-hidden="true"></span> |
| 76 | <span class="sr-only"><?php echo JText::translate('WARNING'); ?></span> |
| 77 | <?php |
| 78 | } |
| 79 | else if ($type == 'danger') |
| 80 | { |
| 81 | ?> |
| 82 | <span class="fas fa-exclamation-circle" aria-hidden="true"></span> |
| 83 | <span class="sr-only"><?php echo JText::translate('WARNING'); ?></span> |
| 84 | <?php |
| 85 | } |
| 86 | else if ($type == 'success') |
| 87 | { |
| 88 | ?> |
| 89 | <span class="fas fa-check-circle" aria-hidden="true"></span> |
| 90 | <span class="sr-only"><?php echo JText::translate('NOTICE'); ?></span> |
| 91 | <?php |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | echo $text; |
| 96 | ?> |
| 97 | </div> |
| 98 | |
| 99 | </div> |
| 100 |