default.php
5 days ago
default_application.php
5 days ago
default_ip.php
5 days ago
default_plugins.php
5 days ago
index.html
5 days ago
default.php
194 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 | JHtml::fetch('vaphtml.assets.fontawesome'); |
| 16 | |
| 17 | $user = $this->user; |
| 18 | |
| 19 | $vik = VAPApplication::getInstance(); |
| 20 | |
| 21 | /** |
| 22 | * Trigger event to display custom HTML. |
| 23 | * In case it is needed to include any additional fields, |
| 24 | * it is possible to create a plugin and attach it to an event |
| 25 | * called "onDisplayViewApiuser". The event method receives the |
| 26 | * view instance as argument. |
| 27 | * |
| 28 | * @since 1.7 |
| 29 | */ |
| 30 | $forms = $this->onDisplayView(); |
| 31 | |
| 32 | ?> |
| 33 | |
| 34 | <form name="adminForm" action="index.php" method="post" id="adminForm"> |
| 35 | |
| 36 | <?php echo $vik->openCard(); ?> |
| 37 | |
| 38 | <!-- RIGHT SIDE --> |
| 39 | |
| 40 | <div class="span6 full-width"> |
| 41 | |
| 42 | <!-- APPLICATION --> |
| 43 | |
| 44 | <div class="row-fluid"> |
| 45 | <div class="span12"> |
| 46 | <?php |
| 47 | echo $vik->openFieldset(JText::translate('VAPMANAGEAPIUSER8')); |
| 48 | echo $this->loadTemplate('application'); |
| 49 | ?> |
| 50 | |
| 51 | <!-- Define role to detect the supported hook --> |
| 52 | <!-- {"rule":"customizer","event":"onDisplayViewApiuser","key":"application","type":"field"} --> |
| 53 | |
| 54 | <?php |
| 55 | /** |
| 56 | * Look for any additional fields to be pushed within |
| 57 | * the "Application" fieldset (left-side). |
| 58 | * |
| 59 | * @since 1.7 |
| 60 | */ |
| 61 | if (isset($forms['application'])) |
| 62 | { |
| 63 | echo $forms['application']; |
| 64 | |
| 65 | // unset application form to avoid displaying it twice |
| 66 | unset($forms['application']); |
| 67 | } |
| 68 | |
| 69 | echo $vik->closeFieldset(); |
| 70 | ?> |
| 71 | </div> |
| 72 | </div> |
| 73 | |
| 74 | <!-- IP RESTRICTIONS --> |
| 75 | |
| 76 | <div class="row-fluid"> |
| 77 | <div class="span12"> |
| 78 | <?php |
| 79 | echo $vik->openFieldset(JText::translate('VAPMANAGEAPIUSER5')); |
| 80 | echo $this->loadTemplate('ip'); |
| 81 | ?> |
| 82 | |
| 83 | <!-- Define role to detect the supported hook --> |
| 84 | <!-- {"rule":"customizer","event":"onDisplayViewApiuser","key":"ip","type":"field"} --> |
| 85 | |
| 86 | <?php |
| 87 | /** |
| 88 | * Look for any additional fields to be pushed within |
| 89 | * the "IP" fieldset (left-side). |
| 90 | * |
| 91 | * @since 1.7 |
| 92 | */ |
| 93 | if (isset($forms['ip'])) |
| 94 | { |
| 95 | echo $forms['ip']; |
| 96 | |
| 97 | // unset IP form to avoid displaying it twice |
| 98 | unset($forms['ip']); |
| 99 | } |
| 100 | |
| 101 | echo $vik->closeFieldset(); |
| 102 | ?> |
| 103 | </div> |
| 104 | </div> |
| 105 | |
| 106 | <!-- Define role to detect the supported hook --> |
| 107 | <!-- {"rule":"customizer","event":"onDisplayViewApiuser","type":"fieldset"} --> |
| 108 | |
| 109 | <?php |
| 110 | if ($forms) |
| 111 | { |
| 112 | /** |
| 113 | * Iterate remaining forms to be displayed within |
| 114 | * the sidebar. |
| 115 | * |
| 116 | * @since 1.7 |
| 117 | */ |
| 118 | foreach ($forms as $formName => $formHtml) |
| 119 | { |
| 120 | $title = JText::translate($formName); |
| 121 | ?> |
| 122 | <div class="row-fluid"> |
| 123 | <div class="span12"> |
| 124 | <?php |
| 125 | echo $vik->openFieldset($title); |
| 126 | echo $formHtml; |
| 127 | echo $vik->closeFieldset(); |
| 128 | ?> |
| 129 | </div> |
| 130 | </div> |
| 131 | <?php |
| 132 | } |
| 133 | } |
| 134 | ?> |
| 135 | |
| 136 | </div> |
| 137 | |
| 138 | <!-- PLUGINS --> |
| 139 | |
| 140 | <div class="span6 full-width"> |
| 141 | <?php |
| 142 | echo $vik->openFieldset(JText::translate('VAPMANAGEAPIUSER21')); |
| 143 | echo $this->loadTemplate('plugins'); |
| 144 | ?> |
| 145 | |
| 146 | <!-- Define role to detect the supported hook --> |
| 147 | <!-- {"rule":"customizer","event":"onDisplayViewApiuser","key":"plugins","type":"field"} --> |
| 148 | |
| 149 | <?php |
| 150 | /** |
| 151 | * Look for any additional fields to be pushed within |
| 152 | * the "Plugins" fieldset (right-side). |
| 153 | * |
| 154 | * @since 1.7 |
| 155 | */ |
| 156 | if (isset($forms['plugins'])) |
| 157 | { |
| 158 | echo $forms['plugins']; |
| 159 | |
| 160 | // unset plugins form to avoid displaying it twice |
| 161 | unset($forms['plugins']); |
| 162 | } |
| 163 | |
| 164 | echo $vik->closeFieldset(); |
| 165 | ?> |
| 166 | </div> |
| 167 | |
| 168 | <?php echo $vik->closeCard(); ?> |
| 169 | |
| 170 | <?php echo JHtml::fetch('form.token'); ?> |
| 171 | |
| 172 | <input type="hidden" name="id" value="<?php echo $user->id; ?>"/> |
| 173 | <input type="hidden" name="task" value=""/> |
| 174 | <input type="hidden" name="option" value="com_vikappointments"/> |
| 175 | </form> |
| 176 | |
| 177 | <script> |
| 178 | |
| 179 | // validate |
| 180 | |
| 181 | var validator = new VikFormValidator('#adminForm'); |
| 182 | |
| 183 | Joomla.submitbutton = function(task) { |
| 184 | if (task.indexOf('save') !== -1) { |
| 185 | if (validator.validate()) { |
| 186 | Joomla.submitform(task, document.adminForm); |
| 187 | } |
| 188 | } else { |
| 189 | Joomla.submitform(task, document.adminForm); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | </script> |
| 194 |