PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / editconfig / view.html.php
vikappointments / admin / views / editconfig Last commit date
tmpl 3 days ago index.html 3 days ago view.html.php 3 days ago
view.html.php
86 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 * VikAppointments global configuration view.
16 *
17 * @since 1.0
18 */
19 class VikAppointmentsVieweditconfig extends JViewVAP
20 {
21 /**
22 * VikAppointments view display method.
23 *
24 * @return void
25 */
26 function display($tpl = null)
27 {
28 $dbo = JFactory::getDbo();
29
30 // set the toolbar
31 $this->addToolBar();
32
33 // get config
34
35 $params = array();
36
37 $q = $dbo->getQuery(true)
38 ->select($dbo->qn(array('param', 'setting')))
39 ->from($dbo->qn('#__vikappointments_config'));
40
41 $dbo->setQuery($q);
42 $dbo->execute();
43
44 if ($dbo->getNumRows())
45 {
46 foreach ($dbo->loadObjectList() as $row)
47 {
48 $params[$row->param] = $row->setting;
49 }
50 }
51
52 // import custom fields loader
53 VAPLoader::import('libraries.customfields.loader');
54
55 // get relevant custom fields only
56 $this->customFields = VAPCustomFieldsLoader::getInstance()
57 ->translate()
58 ->noRequiredCheckbox()
59 ->noSeparator()
60 ->fetch();
61
62 $this->params = $params;
63
64 // display the template
65 parent::display($tpl);
66 }
67
68 /**
69 * Setting the toolbar.
70 *
71 * @return void
72 */
73 protected function addToolBar()
74 {
75 // add menu title and some buttons to the page
76 JToolBarHelper::title(JText::translate('VAPMAINTITLECONFIG'), 'vikappointments');
77
78 if (JFactory::getUser()->authorise('core.edit', 'com_vikappointments'))
79 {
80 JToolBarHelper::apply('configuration.save', JText::translate('VAPSAVE'));
81 }
82
83 JToolBarHelper::cancel('dashboard.cancel', 'JTOOLBAR_CLOSE');
84 }
85 }
86