CoreFiles by mySites.guru
HtmlView.php87 lines, 2,120 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
ee17b19ad78922614caaa9ab861f1a81
sha1
76931410c56a541a6d149ebda51f73935d0ac4e6
sha256
496d8d6fd95df7bd12748faf4593ba4b727cef9dba27c965bf843468b28707e3
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_banners
 *
 * @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\Banners\Administrator\View\Banners;

use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\MVC\View\ListView;
use Joomla\Component\Banners\Administrator\Model\BannersModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * View class for a list of banners.
 *
 * @since  1.6
 */
class HtmlView extends ListView
{
    /**
     * Category data
     *
     * @var    array
     * @since  1.6
     */
    protected $categories = [];

    /**
     * The help link for the view
     *
     * @var string
     */
    protected $helpLink = 'Banners';

    /**
     * Constructor
     *
     * @param   array  $config  An optional associative array of configuration settings.
     *
     * @since 6.0.0
     */
    public function __construct(array $config)
    {
        if (empty($config['option'])) {
            $config['option'] = 'com_banners';
        }

        $config['toolbar_icon']   = 'bookmark banners';
        $config['supports_batch'] = true;
        $config['category']       = 'com_banners';

        parent::__construct($config);
    }

    /**
     * Prepare view data
     *
     * @return  void
     *
     * @since 6.0.0
     */
    protected function initializeView()
    {
        parent::initializeView();

        /** @var BannersModel $model */
        $model            = $this->getModel();

        $this->categories = $model->getCategoryOrders();
        $this->canDo      = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id'));

        // We do not need to filter by language when multilingual is disabled
        if (!Multilanguage::isEnabled()) {
            unset($this->activeFilters['language']);
            $this->filterForm->removeField('language', 'filter');
        }
    }
}

The same content is in 44 releases, Joomla 6.0.0-rc1 to 6.2.1-rc1. See them all, or every version of this file.