- md5
- 50362379dc243a7dc3ff2be08cc11b59
- sha1
- e714f48f76ed967368c1690ee63680a546e4e75e
- sha256
- 53570ca27616b8596bc6a9e5dd21e5f3d1f8328b26b69fc07b8a08ea5e356428
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 56 releases, Joomla 4.3.0-rc1 to 5.0.0-beta3. See them all, or every version of this file.