CoreFiles by mySites.guru
HtmlView.php92 lines, 2,011 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
1b32da570b9006e2db1204dd4e329df4
sha1
595b1c0e15325bad3288671e563630551e9b6024
sha256
2bb9c3fa57239b5f50c72dd623202f87b1394d6a6b7a78f36342331af45afdc0
<?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;

/**
 * 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)
    {
        $this->item       = $this->get('Item');
        $this->terms      = $this->get('Terms');
        $this->taxonomies = $this->get('Taxonomies');

        // 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 55 releases, Joomla 5.0.0-alpha4 to 5.2.6. See them all, or every version of this file.