Skip to content

Commit

Permalink
Merge branch '5.1-dev' into fix-43365
Browse files Browse the repository at this point in the history
  • Loading branch information
LadySolveig committed May 11, 2024
2 parents 99fb049 + 08316bb commit 737309e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 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"
7 changes: 5 additions & 2 deletions administrator/language/en-GB/mod_user.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

MOD_USER="User Menu"
MOD_USER_ACCESSIBILITY_SETTINGS="Accessibility Settings"
MOD_USER_DARK_MODE="Dark Mode"
MOD_USER_EDIT_ACCOUNT="Edit Account"
MOD_USER_LIGHT_MODE="Light Mode"
MOD_USER_LIGHTDARK_MODE="Light/Dark Mode"
MOD_USER_MENU="User Menu"
MOD_USER_TITLE="Signed in as %s"
MOD_USER_XML_DESCRIPTION="This module shows the User Menu and is intended to be displayed in the 'status' position."

; Deprecated, will be removed with 6.0
MOD_USER_LIGHT_MODE="Light Mode"
MOD_USER_DARK_MODE="Dark Mode"
4 changes: 2 additions & 2 deletions administrator/modules/mod_user/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
<?php if ($colorSchemeSwitch) : ?>
<button type="button" class="dropdown-item" data-color-scheme-switch>
<span class="d-dark-scheme-none">
<span class="fa fa-sun icon-fw me-1" aria-hidden="true"></span> <?php echo Text::_('MOD_USER_LIGHT_MODE'); ?>
<span class="fa fa-sun icon-fw me-1" aria-hidden="true"></span> <?php echo Text::_('MOD_USER_LIGHTDARK_MODE'); ?>
</span>
<span class="d-light-scheme-none">
<span class="fa fa-moon icon-fw me-1" aria-hidden="true"></span> <?php echo Text::_('MOD_USER_DARK_MODE'); ?>
<span class="fa fa-moon icon-fw me-1" aria-hidden="true"></span> <?php echo Text::_('MOD_USER_LIGHTDARK_MODE'); ?>
</span>
</button>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion plugins/editors-xtd/image/src/Extension/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public function onDisplay($name, $asset, $author)
'text' => Text::_('PLG_IMAGE_BUTTON_IMAGE'),
'name' => $this->_type . '_' . $this->_name,
'icon' => 'pictures',
'link' => $link,
'iconSVG' => '<svg width="24" height="24" viewBox="0 0 512 512"><path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48'
. ' 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6'
. ' 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40'
Expand All @@ -203,7 +204,6 @@ public function onDisplay($name, $asset, $author)
'popupType' => 'iframe',
'textHeader' => Text::_('PLG_IMAGE_BUTTON_IMAGE'),
'iconHeader' => 'icon-pictures',
'src' => $link,
]
);
}
Expand Down

0 comments on commit 737309e

Please sign in to comment.