PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / trunk
VikAppointments Services Booking Calendar vtrunk
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / editconfigsmsapi / view.html.php
vikappointments / admin / views / editconfigsmsapi Last commit date
tmpl 2 years ago index.html 7 years ago view.html.php 2 years ago
view.html.php
77 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 sms api configuration view.
16 *
17 * @since 1.3
18 */
19 class VikAppointmentsVieweditconfigsmsapi 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 $r)
47 {
48 $params[$r->param] = $r->setting;
49 }
50 }
51
52 $this->params = $params;
53
54 // display the template
55 parent::display($tpl);
56 }
57
58 /**
59 * Setting the toolbar.
60 *
61 * @return void
62 */
63 protected function addToolBar()
64 {
65 // add menu title and some buttons to the page
66 JToolBarHelper::title(JText::translate('VAPMAINTITLECONFIG'), 'vikappointments');
67
68 if (JFactory::getUser()->authorise('core.edit', 'com_vikappointments'))
69 {
70 JToolBarHelper::apply('configsmsapi.save', JText::translate('VAPSAVE'));
71 JToolBarHelper::divider();
72 }
73
74 JToolBarHelper::cancel('dashboard.cancel', 'JTOOLBAR_CLOSE');
75 }
76 }
77