- md5
- 0774e62b3681fdec8a65f25cfb221da1
- sha1
- 206bf94c3ad192fae7acd8c5014d1201ee64caf6
- sha256
- 22dc6e008701e8fea1cab4023a7507a4c6c3820f8becc505faaa850b11f5eba4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
<?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\Manage;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\Pagination\Pagination;
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 Manage View
*
* @since 1.6
*/
class HtmlView extends InstallerViewDefault
{
/**
* List of updatesites
*
* @var \stdClass[]
*/
protected $items;
/**
* Pagination object
*
* @var Pagination
*/
protected $pagination;
/**
* Form object
*
* @var Form
*/
protected $form;
/**
* Display the view.
*
* @param string $tpl Template
*
* @return mixed|void
*
* @since 1.6
*/
public function display($tpl = null)
{
// 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');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new GenericDataException(implode("\n", $errors), 500);
}
// Display the view.
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$toolbar = Toolbar::getInstance();
$canDo = ContentHelper::getActions('com_installer');
if ($canDo->get('core.edit.state')) {
$toolbar->publish('manage.publish', 'JTOOLBAR_ENABLE')
->listCheck(true);
$toolbar->unpublish('manage.unpublish', 'JTOOLBAR_DISABLE')
->listCheck(true);
$toolbar->divider();
}
$toolbar->standardButton('refresh', 'JTOOLBAR_REFRESH_CACHE', 'manage.refresh')
->listCheck(true);
$toolbar->divider();
if ($canDo->get('core.delete')) {
$toolbar->delete('manage.remove', 'JTOOLBAR_UNINSTALL')
->message('COM_INSTALLER_CONFIRM_UNINSTALL')
->listCheck(true);
$toolbar->divider();
}
if ($canDo->get('core.manage')) {
$toolbar->linkButton('upload', 'COM_INSTALLER_TOOLBAR_INSTALL_EXTENSIONS')
->url('index.php?option=com_installer&view=install');
$toolbar->divider();
}
parent::addToolbar();
$toolbar->help('Extensions:_Manage');
}
}
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.