CoreFiles by mySites.guru
PluginsController.php64 lines, 1,557 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
8968bcd26c43ad569086b321e2a3158c
sha1
277e04ca67664cf59cb07bc2cad3b3fa90d90a90
sha256
4f8c04d61d547bc37edcfdb6599db9aed2054adb26e4335b3c2b88150dd9b5c4
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_plugins
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Plugins\Administrator\Controller;

\defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Response\JsonResponse;

/**
 * Plugins list controller class.
 *
 * @since  1.6
 */
class PluginsController extends AdminController
{
	/**
	 * Method to get a model object, loading it if required.
	 *
	 * @param   string  $name    The model name. Optional.
	 * @param   string  $prefix  The class prefix. Optional.
	 * @param   array   $config  Configuration array for model. Optional.
	 *
	 * @return  object  The model.
	 *
	 * @since   1.6
	 */
	public function getModel($name = 'Plugin', $prefix = 'Administrator', $config = array('ignore_request' => true))
	{
		return parent::getModel($name, $prefix, $config);
	}

	/**
	 * Method to get the number of activated plugins
	 *
	 * @return  void
	 *
	 * @since   4.0
	 */
	public function getQuickiconContent()
	{
		$model = $this->getModel('Plugins');

		$model->setState('filter.enabled', 1);

		$amount = (int) $model->getTotal();

		$result = [];

		$result['amount'] = $amount;
		$result['sronly'] = Text::plural('COM_PLUGINS_N_QUICKICON_SRONLY', $amount);
		$result['name'] = Text::plural('COM_PLUGINS_N_QUICKICON', $amount);

		echo new JsonResponse($result);
	}
}

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.