- md5
- f91fb0bfa1d86273f06aacf5437a3e8a
- sha1
- d1c1ebed15aa8e9924694cb8f2cf28003b808021
- sha256
- 3e1f03dc0976ab5e85a1439784f5a888a39770d7ffb4cc53930dafd276471a09
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
<?php
/**
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Installer\Administrator\View\Database;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Installer\Administrator\Model\DatabaseModel;
use Joomla\Component\Installer\Administrator\View\Installer\HtmlView as InstallerViewDefault;
/**
* Extension Manager Database View
*
* @since 1.6
*/
class HtmlView extends InstallerViewDefault
{
/**
* List of change sets
*
* @var array
* @since 4.0.0
*/
protected $changeSet = array();
/**
* The number of errors found
*
* @var integer
* @since 4.0.0
*/
protected $errorCount = 0;
/**
* List pagination.
*
* @var Pagination
* @since 4.0.0
*/
protected $pagination;
/**
* The filter form
*
* @var Form
* @since 4.0.0
*/
public $filterForm;
/**
* A list of form filters
*
* @var array
* @since 4.0.0
*/
public $activeFilters = array();
/**
* Display the view.
*
* @param string $tpl Template
*
* @return void
*
* @throws \Exception
*
* @since 1.6
*/
public function display($tpl = null)
{
// Get the application
$app = Factory::getApplication();
// Get data from the model.
/** @var DatabaseModel $model */
$model = $this->getModel();
try {
$this->changeSet = $model->getItems();
} catch (\Exception $exception) {
$app->enqueueMessage($exception->getMessage(), 'error');
}
$this->errorCount = $model->getErrorCount();
$this->pagination = $model->getPagination();
$this->filterForm = $model->getFilterForm();
$this->activeFilters = $model->getActiveFilters();
if ($this->changeSet) {
($this->errorCount === 0)
? $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_OK'), 'info')
: $app->enqueueMessage(Text::_('COM_INSTALLER_MSG_DATABASE_CORE_ERRORS'), 'warning');
}
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
/*
* Set toolbar items for the page.
*/
ToolbarHelper::custom('database.fix', 'refresh', '', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', true);
ToolbarHelper::divider();
parent::addToolbar();
ToolbarHelper::help('Information:_Database');
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.