CoreFiles by mySites.guru
emptystate.php57 lines, 2,287 bytes, from Joomla_5.2.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 5.1.0-alpha4
md5
6e28abbe927b0cd28c215de4583a858b
sha1
edd08c984c4f2ad05edffcfb44719859d06ceff5
sha256
6fd1f014834a07a77945b3931d78b983a1fa022bd46bfe9cc1218948eb67f1b7
<?php

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

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

/** @var \Joomla\Component\Finder\Administrator\View\Index\HtmlView $this */

$displayData = [
    'textPrefix' => 'COM_FINDER',
    'formURL'    => 'index.php?option=com_finder&view=index',
    'helpURL'    => 'https://docs.joomla.org/Special:MyLanguage/Smart_Search_quickstart_guide',
    'icon'       => 'icon-search-plus finder',
    'content'    => Text::_('COM_FINDER_INDEX_NO_DATA') . '<br>' . Text::_('COM_FINDER_INDEX_TIP'),
    'title'      => Text::_('COM_FINDER_HEADING_INDEXER'),
    'createURL'  => "javascript:document.getElementsByClassName('button-index')[0].click();",
];

echo LayoutHelper::render('joomla.content.emptystate', $displayData);

// Show warning that the content - finder plugin is disabled
if ($this->finderPluginId) {
    /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
    $wa = $this->getDocument()->getWebAssetManager();
    $wa->useScript('joomla.dialog-autocreate');

    $popupOptions = [
        'popupType'  => 'iframe',
        'textHeader' => Text::_('COM_FINDER_EDIT_PLUGIN_SETTINGS'),
        'src'        => Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->finderPluginId . '&tmpl=component&layout=modal', false),
    ];
    $link = HTMLHelper::_(
        'link',
        '#',
        Text::_('COM_FINDER_CONTENT_PLUGIN'),
        [
            'class'                 => 'alert-link',
            'data-joomla-dialog'    => $this->escape(json_encode($popupOptions, JSON_UNESCAPED_SLASHES)),
            'data-checkin-url'      => Route::_('index.php?option=com_plugins&task=plugins.checkin&format=json&cid[]=' . $this->finderPluginId),
            'data-close-on-message' => '',
            'data-reload-on-close'  => '',
        ],
    );
    Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
}

The same content is in 3 releases, Joomla 5.2.0-alpha1 to 5.2.0-alpha3. See them all, or every version of this file.