Skip to content

Commit

Permalink
Merge branch '5.1-dev' into fix-43344
Browse files Browse the repository at this point in the history
  • Loading branch information
LadySolveig committed May 11, 2024
2 parents 92a9ef1 + 9976a6e commit 50dcc6f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function display($tpl = null)
throw new GenericDataException(implode("\n", $errors), 500);
}

if (!(PluginHelper::isEnabled('system', 'redirect') && RedirectHelper::collectUrlsEnabled())) {
if (!PluginHelper::isEnabled('system', 'redirect') || !RedirectHelper::collectUrlsEnabled()) {
$this->redirectPluginId = RedirectHelper::getRedirectPluginId();
}

Expand Down
10 changes: 6 additions & 4 deletions administrator/components/com_redirect/tmpl/links/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Redirect\Administrator\Helper\RedirectHelper;
Expand All @@ -32,11 +33,12 @@
$listDirn = $this->escape($this->state->get('list.direction'));

$collectUrlsEnabled = RedirectHelper::collectUrlsEnabled();
$pluginEnabled = PluginHelper::isEnabled('system', 'redirect');
$redirectPluginId = $this->redirectPluginId;

// Show messages about the enabled plugin and if the plugin should collect URLs
if (!$redirectPluginId && $collectUrlsEnabled) {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED')), 'warning');
if ($pluginEnabled && $collectUrlsEnabled) {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED')), 'notice');
} else {
$popupOptions = [
'popupType' => 'iframe',
Expand All @@ -56,10 +58,10 @@
],
);

if (!$redirectPluginId && !$collectUrlsEnabled) {
if ($pluginEnabled && !$collectUrlsEnabled) {
$app->enqueueMessage(
Text::sprintf('COM_REDIRECT_COLLECT_MODAL_URLS_DISABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED'), $link),
'warning'
'notice'
);
} else {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_PLUGIN_MODAL_DISABLED', $link), 'error');
Expand Down
10 changes: 6 additions & 4 deletions administrator/components/com_redirect/tmpl/links/emptystate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Redirect\Administrator\Helper\RedirectHelper;

Expand Down Expand Up @@ -42,11 +43,12 @@
}

$collectUrlsEnabled = RedirectHelper::collectUrlsEnabled();
$pluginEnabled = PluginHelper::isEnabled('system', 'redirect');
$redirectPluginId = $this->redirectPluginId;

// Show messages about the enabled plugin and if the plugin should collect URLs
if (!$redirectPluginId && $collectUrlsEnabled) {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED')), 'warning');
if ($pluginEnabled && $collectUrlsEnabled) {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED')), 'notice');
} else {
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
Expand All @@ -70,10 +72,10 @@
],
);

if (!$redirectPluginId && !$collectUrlsEnabled) {
if ($pluginEnabled && !$collectUrlsEnabled) {
$app->enqueueMessage(
Text::sprintf('COM_REDIRECT_COLLECT_MODAL_URLS_DISABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED'), $link),
'warning'
'notice'
);
} else {
$app->enqueueMessage(Text::sprintf('COM_REDIRECT_PLUGIN_MODAL_DISABLED', $link), 'error');
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_cpanel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ COM_CPANEL_MSG_TEXTFILTER3919_TITLE="Updated Text Filter Recommendations"
COM_CPANEL_TITLE_SYSTEM_PANEL="System Panel"
COM_CPANEL_UNPUBLISH_MODULE_ERROR="Error unpublishing the module"
COM_CPANEL_UNPUBLISH_MODULE_SUCCESS="Module unpublished"
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users.</p><ul><li><a href=\"https://docs.joomla.org/Special:MyLanguage/Portal:Beginners\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla! Beginners Guide</a></li><li><a href=\"https://forum.joomla.org/viewforum.php?f=808\" target=\"_blank\" rel=\"noopener noreferrer\">New to Joomla! Forum</a></li></ul>"
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users.</p><ul><li><a href=\"https://docs.joomla.org/Special:MyLanguage/Portal:Beginners\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla! Beginners Guide</a></li><li><a href=\"https://forum.joomla.org/viewforum.php?f=834\" target=\"_blank\" rel=\"noopener noreferrer\">New to Joomla! Forum</a></li></ul>"
COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!"
COM_CPANEL_XML_DESCRIPTION="Home Dashboard component"

0 comments on commit 50dcc6f

Please sign in to comment.