Skip to content

Commit 25bc4ab

Browse files
authored
[4.0] Smart Search - Search Terms (#32251)
* [4.0] Smart Search Gather statistics There are a few components that will give a warning message if a required plugin is not enabled AND the message includes a link directly to the plugin. Smart Search -> Gather Statistics has a requirement for a specific option in the component to be enabled. This PR updates the message to provide a link to the options. * lang
1 parent bb7c751 commit 25bc4ab

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

administrator/components/com_finder/src/View/Searches/HtmlView.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313

1414
use Joomla\CMS\Factory;
1515
use Joomla\CMS\Helper\ContentHelper;
16+
use Joomla\CMS\HTML\HTMLHelper;
1617
use Joomla\CMS\Language\Text;
1718
use Joomla\CMS\MVC\View\GenericDataException;
1819
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
20+
use Joomla\CMS\Router\Route;
1921
use Joomla\CMS\Toolbar\ToolbarHelper;
22+
use Joomla\CMS\Uri\Uri;
23+
2024

2125
/**
2226
* View class for a list of search terms.
@@ -94,17 +98,20 @@ public function display($tpl = null)
9498
$this->activeFilters = $this->get('ActiveFilters');
9599
$this->enabled = $this->state->params->get('gather_search_statistics', 0);
96100
$this->canDo = ContentHelper::getActions('com_finder');
101+
$uri = Uri::getInstance();
102+
$link = 'index.php?option=com_config&view=component&component=com_finder&return=' . base64_encode($uri);
103+
$output = HTMLHelper::_('link', Route::_($link), Text::_('JOPTIONS'));
97104

98105
// Check for errors.
99106
if (count($errors = $this->get('Errors')))
100107
{
101108
throw new GenericDataException(implode("\n", $errors), 500);
102109
}
103110

104-
// Check if plugin is enabled
111+
// Check if component is enabled
105112
if (!$this->enabled)
106113
{
107-
$app->enqueueMessage(Text::_('COM_FINDER_LOGGING_DISABLED'), 'warning');
114+
$app->enqueueMessage(Text::sprintf('COM_FINDER_LOGGING_DISABLED', $output), 'warning');
108115
}
109116

110117
// Prepare the view.

administrator/language/en-GB/com_finder.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ COM_FINDER_INDEXER_MESSAGE_OPTIMIZE="The index tables are being optimised for th
151151
COM_FINDER_INDEXER_MESSAGE_RUNNING="Your content is being indexed. Do not close this window."
152152
COM_FINDER_ITEM_X_ONLY="%s Only"
153153
COM_FINDER_ITEMS="Content"
154-
COM_FINDER_LOGGING_DISABLED="Gathering of statistics is disabled. Enable it in the Options."
154+
COM_FINDER_LOGGING_DISABLED="Gathering of statistics is disabled. Enable it in the %s."
155155
COM_FINDER_MANAGER_SEARCHES="Smart Search: Search Term Analysis"
156156
COM_FINDER_MAPS="Maps"
157157
COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT="Are you sure you want to delete the selected map(s)?"

0 commit comments

Comments
 (0)