CoreFiles by mySites.guru
HtmlView.php84 lines, 1,971 bytes, from Joomla_5.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha1
md5
a6eeb1b2648307933b791dde1838535e
sha1
268329774f39e8d3fa1eb333f22c9f7d49ffd10e
sha256
43709a930ad32062489ce3a53f889077b38121ba277061d46464b3f5b929d16f
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 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\Indexer;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
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;

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

/**
 * Indexer view class for Finder.
 *
 * @since  2.5
 */
class HtmlView extends BaseHtmlView
{
    /**
     * @var   Form  $form
     *
     * @since  5.0.0
     */
    public $form;

    /**
     * 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)
    {
        if ($this->getLayout() == 'debug') {
            $this->form = $this->get('Form');
            $this->addToolbar();
        }

        parent::display($tpl);
    }

    /**
     * Method to configure the toolbar for this view.
     *
     * @return  void
     *
     * @since   5.0.0
     */
    protected function addToolbar()
    {
        $toolbar = Toolbar::getInstance('toolbar');

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

        $arrow  = Factory::getLanguage()->isRtl() ? 'arrow-right' : 'arrow-left';

        ToolbarHelper::link(
            Route::_('index.php?option=com_finder&view=index'),
            'JTOOLBAR_BACK',
            $arrow
        );

        $toolbar->standardButton('index', 'COM_FINDER_INDEX')
            ->icon('icon-play')
            ->onclick('Joomla.debugIndexing();');
    }
}

The same content is in 2 releases, Joomla 5.0.0-alpha1 to 5.0.0-alpha2. See them all, or every version of this file.