| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage com_vikbooking |
| 5 |
* @author Alessio Gaggii - e4j - Extensionsforjoomla.com |
| 6 |
* @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved. |
| 7 |
* @license GNU General Public License version 2 or later; see LICENSE |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 12 |
|
| 13 |
// import Joomla view library |
| 14 |
jimport('joomla.application.component.view'); |
| 15 |
|
| 16 |
class VikBookingViewTranslations extends JViewVikBooking |
| 17 |
{ |
| 18 |
public function display($tpl = null) |
| 19 |
{ |
| 20 |
// Set the toolbar |
| 21 |
$this->addToolBar(); |
| 22 |
|
| 23 |
$app = JFactory::getApplication(); |
| 24 |
$vbo_tn = VikBooking::getTranslator(); |
| 25 |
|
| 26 |
if ($app->input->getInt('normalize')) { |
| 27 |
// fixer can also be executed manually |
| 28 |
if ($vbo_tn->normalizeTnTableNames()) { |
| 29 |
$app->enqueueMessage('OK'); |
| 30 |
} else { |
| 31 |
$app->enqueueMessage('NOK', 'error'); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
$this->vbo_tn = $vbo_tn; |
| 36 |
|
| 37 |
// Display the template |
| 38 |
parent::display($tpl); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Sets the toolbar |
| 43 |
*/ |
| 44 |
protected function addToolBar() |
| 45 |
{ |
| 46 |
JToolBarHelper::title(JText::translate('VBMAINTRANSLATIONSTITLE'), 'vikbooking'); |
| 47 |
if (JFactory::getUser()->authorise('core.create', 'com_vikbooking') || JFactory::getUser()->authorise('core.edit', 'com_vikbooking')) { |
| 48 |
JToolBarHelper::apply( 'savetranslationstay', JText::translate('VBSAVE')); |
| 49 |
JToolBarHelper::spacer(); |
| 50 |
JToolBarHelper::save( 'savetranslation', JText::translate('VBSAVECLOSE')); |
| 51 |
JToolBarHelper::spacer(); |
| 52 |
} |
| 53 |
JToolBarHelper::cancel( 'cancel', JText::translate('VBBACK')); |
| 54 |
JToolBarHelper::spacer(); |
| 55 |
} |
| 56 |
} |
| 57 |
|