shortcodes.php
71 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments - Libraries |
| 4 | * @subpackage html.wizard |
| 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 VAPWizardStep $step The wizard step instance. |
| 18 | */ |
| 19 | extract($displayData); |
| 20 | |
| 21 | $shortcodes = $step->getShortcodes(); |
| 22 | |
| 23 | if (!count($shortcodes)) |
| 24 | { |
| 25 | // go ahead only in case of shortcodes |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | $vik = VAPApplication::getInstance(); |
| 30 | |
| 31 | ?> |
| 32 | |
| 33 | <ul class="wizard-step-summary"> |
| 34 | <?php |
| 35 | // display at most 4 shortcodes |
| 36 | for ($i = 0; $i < min(array(4, count($shortcodes))); $i++) |
| 37 | { |
| 38 | ?> |
| 39 | <li> |
| 40 | <b><?php echo $shortcodes[$i]->name; ?></b> |
| 41 | <span class="badge badge-important"><?php echo JText::translate($shortcodes[$i]->title); ?></span> |
| 42 | </li> |
| 43 | <?php |
| 44 | } |
| 45 | |
| 46 | // count remaining shortcodes |
| 47 | $remaining = count($shortcodes) - 4; |
| 48 | |
| 49 | if ($remaining > 0) |
| 50 | { |
| 51 | ?> |
| 52 | <li><?php echo JText::plural('VAPWIZARDOTHER_N_ITEMS', $remaining); ?></li> |
| 53 | <?php |
| 54 | } |
| 55 | ?> |
| 56 | </ul> |
| 57 | |
| 58 | <?php |
| 59 | if ($step->needShortcode('appointments')) |
| 60 | { |
| 61 | echo $vik->alert(__('Define a shortcode also for the appointments section.', 'vikappointments')); |
| 62 | } |
| 63 | else if ($step->needShortcode('packages')) |
| 64 | { |
| 65 | echo $vik->alert(__('Define a shortcode also for the packages section.', 'vikappointments')); |
| 66 | } |
| 67 | else if ($step->needShortcode('subscriptions')) |
| 68 | { |
| 69 | echo $vik->alert(__('Define a shortcode also for the subscriptions section.', 'vikappointments')); |
| 70 | } |
| 71 |