- md5
- f847ba7c7e98cc727c0357bb9f578903
- sha1
- 40ed4a8b6830c0c954b10d9578a0d0bdedde0001
- sha256
- d356d9e1ae3170a1877bba57bf69cd5d345b7371a103c2ce00ea8cefa1844027
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
<?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\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 34 releases, Joomla 5.0.0-rc to 5.2.0-alpha3. See them all, or every version of this file.