Skip to content

Commit 8c67273

Browse files
authored
[5.3][com_finder] check if finder content plugin is enabled (#44632)
1 parent 01fdc70 commit 8c67273

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ class HtmlView extends BaseHtmlView
112112
*/
113113
private $isEmptyState = false;
114114

115+
/**
116+
* The finder plugins status
117+
*
118+
* @var boolean
119+
*
120+
* @since __DEPLOY_VERSION__
121+
*/
122+
protected $finderPlugins = true;
123+
115124
/**
116125
* Method to display the view.
117126
*
@@ -157,6 +166,11 @@ public function display($tpl = null)
157166
$this->finderPluginId = FinderHelper::getFinderPluginId();
158167
}
159168

169+
// Check that the finder plugins are enabled
170+
if (!PluginHelper::getPlugin('finder')) {
171+
$this->finderPlugins = false;
172+
}
173+
160174
// Configure the toolbar.
161175
$this->addToolbar();
162176

administrator/components/com_finder/tmpl/index/default.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
5353
}
5454

55+
// Show warning that the finder plugins are disabled
56+
if (!$this->finderPlugins) {
57+
$url = 'index.php?option=com_plugins&filter[folder]=finder';
58+
$link = HTMLHelper::_('link', Route::_($url), Text::_('COM_FINDER_FINDER_PLUGINS'), 'class="alert-link"');
59+
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_FINDER_NOT_ENABLED_LINK', $link), 'warning');
60+
}
61+
5562
?>
5663
<form action="<?php echo Route::_('index.php?option=com_finder&view=index'); ?>" method="post" name="adminForm" id="adminForm">
5764
<div class="row">

administrator/components/com_finder/tmpl/index/emptystate.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,10 @@
5555
);
5656
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
5757
}
58+
59+
// Show warning that the finder plugins are disabled
60+
if (!$this->finderPlugins) {
61+
$url = 'index.php?option=com_plugins&filter[folder]=finder';
62+
$link = HTMLHelper::_('link', Route::_($url), Text::_('COM_FINDER_FINDER_PLUGINS'), 'class="alert-link"');
63+
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_FINDER_NOT_ENABLED_LINK', $link), 'warning');
64+
}

administrator/language/en-GB/com_finder.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ COM_FINDER_FILTERS_N_ITEMS_UNPUBLISHED="%d filters unpublished."
111111
COM_FINDER_FILTERS_N_ITEMS_UNPUBLISHED_1="Filter unpublished."
112112
COM_FINDER_FILTERS_TABLE_CAPTION="Filters"
113113
COM_FINDER_FILTERS_TOOLBAR_TITLE="Smart Search: Search Filters"
114+
COM_FINDER_FINDER_PLUGINS="Smart Search Finder Plugins"
114115
COM_FINDER_HEADING_CHILDREN="Maps"
115116
COM_FINDER_HEADING_CREATED_BY="Created By"
116117
COM_FINDER_HEADING_CREATED_BY_ASC="Created By ascending"
@@ -148,6 +149,7 @@ COM_FINDER_INDEX_NO_DATA="No content has been indexed."
148149
COM_FINDER_INDEX_OPTIMISE_FINISHED="Optimisation finished."
149150
COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index until the Plugin is enabled."
150151
COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK="The %s is disabled. Changes to content will not update the Smart Search index if you do not enable this plugin."
152+
COM_FINDER_INDEX_PLUGIN_FINDER_NOT_ENABLED_LINK="The %s are disabled. Changes to content will not update the Smart Search index if you do not enable these plugins."
151153
COM_FINDER_INDEX_PURGE_FAILED="Failed to delete selected items."
152154
COM_FINDER_INDEX_PURGE_SUCCESS="All items have been deleted."
153155
COM_FINDER_INDEX_SEARCH_DESC="Search in title, URL and last updated date."

0 commit comments

Comments
 (0)