config.php
66 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments - Libraries |
| 4 | * @subpackage html.overrides |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2024 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 | $vik = VAPApplication::getInstance(); |
| 15 | |
| 16 | JText::script('VAP_CONFIRM_MESSAGE_UNSAVE'); |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <div class="config-fieldset"> |
| 21 | |
| 22 | <div class="config-fieldset-body"> |
| 23 | |
| 24 | <p> |
| 25 | <?php |
| 26 | _e( |
| 27 | 'From this section it is possible to override the pages and the layouts of the plugin. Click the button below to open the file manager and start editing the pages.', |
| 28 | 'vikappointments' |
| 29 | ); |
| 30 | ?> |
| 31 | </p> |
| 32 | |
| 33 | <?php echo $vik->alert(__('Go ahead only if you are able to deal with PHP and HTML code.', 'vikappointments'), 'warning'); ?> |
| 34 | |
| 35 | <div> |
| 36 | <a href="admin.php?page=vikappointments&view=overrides" class="button button-hero" id="vap-overrides-btn" style="text-align: center;"> |
| 37 | <?php _e('Open Overrides Manager', 'vikappointments'); ?> |
| 38 | </a> |
| 39 | </div> |
| 40 | |
| 41 | </div> |
| 42 | |
| 43 | </div> |
| 44 | |
| 45 | <script> |
| 46 | (function($) { |
| 47 | 'use strict'; |
| 48 | |
| 49 | $(function() { |
| 50 | $('#vap-overrides-btn').on('click', function(event) { |
| 51 | if (!configObserver.isChanged()) { |
| 52 | // nothing has changed, go ahead |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | // ask for a confirmation |
| 57 | if (!confirm(Joomla.JText._('VAP_CONFIRM_MESSAGE_UNSAVE'))) { |
| 58 | // do not leave the page |
| 59 | event.preventDefault(); |
| 60 | event.stopPropagation(); |
| 61 | return false; |
| 62 | } |
| 63 | }); |
| 64 | }); |
| 65 | })(jQuery); |
| 66 | </script> |