CoreFiles by mySites.guru
HtmlView.php124 lines, 2,677 bytes, from Joomla_4.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta1
md5
2a6f83093cf572e1e8a11ff0057349dc
sha1
64f5f9ddaba2ded51415dfcf8cf6e98a21207441
sha256
a8698e96d5a10809352b34e6f1854ffc64dd3c2ede4dcb25791e5be46856f2e2
<?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;

\defined('_JEXEC') or die;

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;

/**
 * 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('toolbar');
		$canDo   = ContentHelper::getActions('com_installer');

		if ($canDo->get('core.edit.state'))
		{
			$toolbar->publish('manage.publish')
				->text('JTOOLBAR_ENABLE')
				->listCheck(true);
			$toolbar->unpublish('manage.unpublish')
				->text('JTOOLBAR_DISABLE')
				->listCheck(true);
			$toolbar->divider();
		}

		$toolbar->standardButton('refresh')
			->text('JTOOLBAR_REFRESH_CACHE')
			->task('manage.refresh')
			->listCheck(true);
		$toolbar->divider();

		if ($canDo->get('core.delete'))
		{
			$toolbar->delete('manage.remove')
				->text('JTOOLBAR_UNINSTALL')
				->message('COM_INSTALLER_CONFIRM_UNINSTALL')
				->listCheck(true);
			$toolbar->divider();
		}

		if ($canDo->get('core.manage'))
		{
			ToolbarHelper::link('index.php?option=com_installer&view=install', 'COM_INSTALLER_TOOLBAR_INSTALL_EXTENSIONS', 'upload');
			$toolbar->divider();
		}

		parent::addToolbar();
		$toolbar->help('Extensions:_Manage');
	}
}

The same content is in 22 releases, Joomla 4.1.0-beta3 to 4.2.0-beta2. See them all, or every version of this file.