view.html.php
73 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 closing days configuration view. |
| 16 | * |
| 17 | * @since 1.2 |
| 18 | */ |
| 19 | class VikAppointmentsVieweditconfigcldays 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 | $this->services = array(); |
| 34 | |
| 35 | $q = $dbo->getQuery(true) |
| 36 | ->select($dbo->qn(array('id', 'name'))) |
| 37 | ->from($dbo->qn('#__vikappointments_service')); |
| 38 | |
| 39 | $dbo->setQuery($q); |
| 40 | $dbo->execute(); |
| 41 | |
| 42 | if ($dbo->getNumRows()) |
| 43 | { |
| 44 | foreach ($dbo->loadObjectList() as $service) |
| 45 | { |
| 46 | $this->services[$service->id] = $service->name; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // display the template |
| 51 | parent::display($tpl); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Setting the toolbar. |
| 56 | * |
| 57 | * @return void |
| 58 | */ |
| 59 | protected function addToolBar() |
| 60 | { |
| 61 | // add menu title and some buttons to the page |
| 62 | JToolBarHelper::title(JText::translate('VAPMAINTITLECONFIG'), 'vikappointments'); |
| 63 | |
| 64 | if (JFactory::getUser()->authorise('core.edit', 'com_vikappointments')) |
| 65 | { |
| 66 | JToolBarHelper::apply('configcldays.save', JText::translate('VAPSAVE')); |
| 67 | JToolBarHelper::divider(); |
| 68 | } |
| 69 | |
| 70 | JToolBarHelper::cancel('dashboard.cancel', 'JTOOLBAR_CLOSE'); |
| 71 | } |
| 72 | } |
| 73 |