- md5
- 6b30d747505392bf8aeb6a93d50ceb97
- sha1
- 3c1c013e02d589d7ee16a5727bfb24c0f66670dd
- sha256
- 4f609d02b6f36de7e418012d0ecfad02240f1eb893eed485f93b556d2f23cbd0
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
<?php
/**
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright (C) 2008 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\Discover;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Installer\Administrator\View\Installer\HtmlView as InstallerViewDefault;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Extension Manager Discover View
*
* @since 1.6
*/
class HtmlView extends InstallerViewDefault
{
/**
* Is this view an Empty State
*
* @var boolean
* @since 4.0.0
*/
private $isEmptyState = false;
/**
* Display the view.
*
* @param string $tpl Template
*
* @return void
*
* @since 1.6
*/
public function display($tpl = null)
{
// Run discover from the model.
if (!$this->getModel()->checkExtensions()) {
$this->getModel()->discover();
}
// Get data from the model.
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
if (!count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
}
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new GenericDataException(implode("\n", $errors), 500);
}
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 3.1
*/
protected function addToolbar()
{
$toolbar = Toolbar::getInstance();
if (!$this->isEmptyState) {
$toolbar->standardButton('upload', 'JTOOLBAR_INSTALL', 'discover.install')
->listCheck(true)
->icon('icon-upload');
}
$toolbar->standardButton('discover', 'COM_INSTALLER_TOOLBAR_DISCOVER', 'discover.refresh')
->icon('icon-refresh');
$toolbar->divider();
parent::addToolbar();
$toolbar->help('Extensions:_Discover');
}
}
The same content is in 5 releases, Joomla 4.3.0-alpha3 to 4.3.0-beta4. See them all, or every version of this file.