- md5
- 9fa0df55d79abe3168ee009fdc99665c
- sha1
- 9d8be9ff036589f543b47e8f5edc7019a51d65b5
- sha256
- 7bce8d4695b4e90674e3d66ae2cb989d3a80e1f4f117cf43588bb3bef12d49bb
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
<?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\Component\Installer\Administrator\Model\DiscoverModel;
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
{
/**
* An array of items
*
* @var array
*
* @since 5.2.0
*/
protected $items;
/**
* The pagination object
*
* @var \Joomla\CMS\Pagination\Pagination
*
* @since 5.2.0
*/
protected $pagination;
/**
* Is this view an Empty State
*
* @var boolean
* @since 4.0.0
*/
private $isEmptyState = false;
/**
* Form object for search filters
*
* @var \Joomla\CMS\Form\Form
*/
public $filterForm;
/**
* The active search filters
*
* @var array
*/
public $activeFilters;
/**
* Display the view.
*
* @param string $tpl Template
*
* @return void
*
* @since 1.6
*/
public function display($tpl = null)
{
/** @var DiscoverModel $model */
$model = $this->getModel();
$model->setUseExceptions(true);
// Run discover from the model.
if (!$model->checkExtensions()) {
$model->discover();
}
// Get data from the model.
$this->items = $model->getItems();
$this->pagination = $model->getPagination();
$this->filterForm = $model->getFilterForm();
$this->activeFilters = $model->getActiveFilters();
if (!\count($this->items) && $this->isEmptyState = $model->getIsEmptyState()) {
$this->setLayout('emptystate');
}
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 3.1
*/
protected function addToolbar()
{
$toolbar = $this->getDocument()->getToolbar();
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 25 releases, Joomla 5.4.0-beta2 to 5.4.10. See them all, or every version of this file.