CoreFiles by mySites.guru
HtmlView.php96 lines, 2,141 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
d6b23e33992c373b4702cef207e0b582
sha1
5dad3e40f4004f619d9cd854990497fa1a6d638c
sha256
690487c2bc8623a17aaf1148e4a6aecd88f6a4b4676fd469ad407d6dd7a76adb
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Finder\Administrator\View\Item;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Finder\Administrator\Model\ItemModel;

/**
 * Index view class for Finder.
 *
 * @since  5.0.0
 */
class HtmlView extends BaseHtmlView
{
    /**
     * The indexed item
     *
     * @var  object
     *
     * @since  5.0.0
     */
    protected $item;

    /**
     * The associated terms
     *
     * @var  object[]
     *
     * @since  5.0.0
     */
    protected $terms;

    /**
     * The associated taxonomies
     *
     * @var  object[]
     *
     * @since  5.0.0
     */
    protected $taxonomies;

    /**
     * Method to display the view.
     *
     * @param   string  $tpl  A template file to load. [optional]
     *
     * @return  void
     *
     * @since   5.0.0
     */
    public function display($tpl = null)
    {
        /** @var ItemModel $model */
        $model = $this->getModel();

        $this->item       = $model->getItem();
        $this->terms      = $model->getTerms();
        $this->taxonomies = $model->getTaxonomies();

        // Configure the toolbar.
        $this->addToolbar();

        parent::display($tpl);
    }

    /**
     * Method to configure the toolbar for this view.
     *
     * @return  void
     *
     * @since   5.0.0
     */
    protected function addToolbar()
    {
        /** @var Toolbar $toolbar */
        $toolbar = $this->getDocument()->getToolbar();

        ToolbarHelper::title(Text::_('COM_FINDER_INDEX_TOOLBAR_TITLE'), 'search-plus finder');

        $toolbar->linkButton('back', 'JTOOLBAR_BACK')
            ->icon('icon-arrow-' . ($this->getLanguage()->isRtl() ? 'right' : 'left'))
            ->url(Route::_('index.php?option=com_finder&view=index'));
    }
}

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