default.php
6 days ago
default_image.php
6 days ago
default_media.php
6 days ago
default_thumb.php
6 days ago
index.html
6 days ago
default.php
157 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 | JHtml::fetch('vaphtml.assets.select2'); |
| 15 | |
| 16 | $media = $this->media; |
| 17 | |
| 18 | $vik = VAPApplication::getInstance(); |
| 19 | |
| 20 | /** |
| 21 | * Trigger event to display custom HTML. |
| 22 | * In case it is needed to include any additional fields, |
| 23 | * it is possible to create a plugin and attach it to an event |
| 24 | * called "onDisplayViewMedia". The event method receives the |
| 25 | * view instance as argument. |
| 26 | * |
| 27 | * @since 1.7 |
| 28 | */ |
| 29 | $forms = $this->onDisplayView(); |
| 30 | |
| 31 | ?> |
| 32 | |
| 33 | <form name="adminForm" action="index.php" method="post" enctype="multipart/form-data" id="adminForm"> |
| 34 | |
| 35 | <?php echo $vik->openCard(); ?> |
| 36 | |
| 37 | <div class="span12"> |
| 38 | |
| 39 | <div class="row-fluid"> |
| 40 | |
| 41 | <div class="span12"> |
| 42 | <?php |
| 43 | echo $vik->openFieldset(JText::translate('VAPMANAGEMEDIATITLE1')); |
| 44 | echo $this->loadTemplate('media'); |
| 45 | ?> |
| 46 | |
| 47 | <!-- Define role to detect the supported hook --> |
| 48 | <!-- {"rule":"customizer","event":"onDisplayViewMedia","key":"media","type":"field"} --> |
| 49 | |
| 50 | <?php |
| 51 | /** |
| 52 | * Look for any additional fields to be pushed within |
| 53 | * the "Media File" fieldset (left-side). |
| 54 | * |
| 55 | * @since 1.7 |
| 56 | */ |
| 57 | if (isset($forms['media'])) |
| 58 | { |
| 59 | echo $forms['media']; |
| 60 | |
| 61 | // unset details form to avoid displaying it twice |
| 62 | unset($forms['media']); |
| 63 | } |
| 64 | |
| 65 | echo $vik->closeFieldset(); |
| 66 | ?> |
| 67 | </div> |
| 68 | |
| 69 | </div> |
| 70 | |
| 71 | <div class="row-fluid"> |
| 72 | |
| 73 | <div class="span6"> |
| 74 | <?php |
| 75 | echo $vik->openFieldset(JText::translate('VAPMANAGEMEDIA3')); |
| 76 | echo $this->loadTemplate('image'); |
| 77 | ?> |
| 78 | |
| 79 | <!-- Define role to detect the supported hook --> |
| 80 | <!-- {"rule":"customizer","event":"onDisplayViewMedia","key":"image","type":"field"} --> |
| 81 | |
| 82 | <?php |
| 83 | /** |
| 84 | * Look for any additional fields to be pushed within |
| 85 | * the "Image" fieldset (left-side). |
| 86 | * |
| 87 | * @since 1.7 |
| 88 | */ |
| 89 | if (isset($forms['image'])) |
| 90 | { |
| 91 | echo $forms['image']; |
| 92 | |
| 93 | // unset details form to avoid displaying it twice |
| 94 | unset($forms['image']); |
| 95 | } |
| 96 | |
| 97 | echo $vik->closeFieldset(); ?> |
| 98 | </div> |
| 99 | |
| 100 | <div class="span6"> |
| 101 | <?php |
| 102 | echo $vik->openFieldset(JText::translate('VAPMANAGEMEDIATITLE4')); |
| 103 | echo $this->loadTemplate('thumb'); |
| 104 | ?> |
| 105 | |
| 106 | <!-- Define role to detect the supported hook --> |
| 107 | <!-- {"rule":"customizer","event":"onDisplayViewMedia","key":"thumb","type":"field"} --> |
| 108 | |
| 109 | <?php |
| 110 | /** |
| 111 | * Look for any additional fields to be pushed within |
| 112 | * the "Thumbnail" fieldset (left-side). |
| 113 | * |
| 114 | * @since 1.7 |
| 115 | */ |
| 116 | if (isset($forms['thumb'])) |
| 117 | { |
| 118 | echo $forms['thumb']; |
| 119 | |
| 120 | // unset details form to avoid displaying it twice |
| 121 | unset($forms['thumb']); |
| 122 | } |
| 123 | |
| 124 | echo $vik->closeFieldset(); ?> |
| 125 | </div> |
| 126 | |
| 127 | </div> |
| 128 | |
| 129 | </div> |
| 130 | |
| 131 | <?php echo $vik->closeCard(); ?> |
| 132 | |
| 133 | <?php echo JHtml::fetch('form.token'); ?> |
| 134 | |
| 135 | <input type="hidden" name="media" value="<?php echo $media['name']; ?>" /> |
| 136 | <input type="hidden" name="task" value="" /> |
| 137 | <input type="hidden" name="option" value="com_vikappointments" /> |
| 138 | </form> |
| 139 | |
| 140 | <script> |
| 141 | |
| 142 | // validate |
| 143 | |
| 144 | var validator = new VikFormValidator('#adminForm'); |
| 145 | |
| 146 | Joomla.submitbutton = function(task) { |
| 147 | if (task.indexOf('save') !== -1) { |
| 148 | if (validator.validate()) { |
| 149 | Joomla.submitform(task, document.adminForm); |
| 150 | } |
| 151 | } else { |
| 152 | Joomla.submitform(task, document.adminForm); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | </script> |
| 157 |