Skip to content

Commit

Permalink
Merge pull request #43469 from pe7er/5.2/upmerge/2024-05-14
Browse files Browse the repository at this point in the history
[5.2] Upmerge 2024-05-14
  • Loading branch information
pe7er authored May 14, 2024
2 parents 076864d + aa3374b commit 5580224
Show file tree
Hide file tree
Showing 80 changed files with 523 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_BANNERS',
'formURL' => 'index.php?option=com_banners&view=banners',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Banners',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Banners',
'icon' => 'icon-bookmark banners',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_BANNERS_CLIENT',
'formURL' => 'index.php?option=com_banners&view=clients',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Banners:_Clients',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Banners:_Clients',
'icon' => 'icon-bookmark banners',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

$displayData = [
'textPrefix' => 'COM_BANNERS_TRACKS',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Banners:_Tracks',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Banners:_Tracks',
'icon' => 'icon-bookmark banners',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

$displayData = [
'textPrefix' => 'COM_CHECKIN',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Maintenance:_Global_Check-in',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Maintenance:_Global_Check-in',
'icon' => 'icon-check-square',
'title' => Text::_('COM_CHECKIN_GLOBAL_CHECK_IN'),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_CONTACT',
'formURL' => 'index.php?option=com_contact',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Contacts',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Contacts',
'icon' => 'icon-address-book contact',
];

Expand Down
18 changes: 11 additions & 7 deletions administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,17 @@ public function save($data)
$field = $this->getItem($data['id']);
}

if (
isset($data['params']['searchindex'])
&& ((\is_null($field) && $data['params']['searchindex'] > 0)
|| ($field->params['searchindex'] != $data['params']['searchindex'])
|| ($data['params']['searchindex'] > 0 && ($field->state != $data['state'] || $field->access != $data['access'])))
) {
Factory::getApplication()->enqueueMessage(Text::_('COM_FIELDS_SEARCHINDEX_MIGHT_REQUIRE_REINDEXING'), 'notice');
if (isset($data['params']['searchindex'])) {
if (\is_null($field)) {
if ($data['params']['searchindex'] > 0) {
Factory::getApplication()->enqueueMessage(Text::_('COM_FIELDS_SEARCHINDEX_MIGHT_REQUIRE_REINDEXING'), 'notice');
}
} elseif (
$field->params['searchindex'] != $data['params']['searchindex']
|| ($data['params']['searchindex'] > 0 && ($field->state != $data['state'] || $field->access != $data['access']))
) {
Factory::getApplication()->enqueueMessage(Text::_('COM_FIELDS_SEARCHINDEX_MIGHT_REQUIRE_REINDEXING'), 'notice');
}
}

if (!isset($data['label']) && isset($data['params']['label'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$displayData = [
'textPrefix' => 'COM_FINDER',
'formURL' => 'index.php?option=com_finder&view=maps',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Smart_Search:_Content_Maps',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Smart_Search:_Content_Maps',
'icon' => 'icon-search-plus finder',
'title' => Text::_('COM_FINDER_MAPS_TOOLBAR_TITLE')
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$displayData = [
'textPrefix' => 'COM_FINDER',
'formURL' => 'index.php?option=com_finder&view=searches',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Smart_Search:_Search_Term_Analysis',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Smart_Search:_Search_Term_Analysis',
'icon' => 'icon-search',
'title' => Text::_('COM_FINDER_MANAGER_SEARCHES'),
'content' => Text::_('COM_FINDER_EMPTYSTATE_SEARCHES_CONTENT'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_GUIDEDTOURS_STEPS',
'formURL' => 'index.php?option=com_guidedtours&view=steps',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Guided_Tours:_Steps',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Guided_Tours:_Steps',
'icon' => 'icon-map-signs',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_GUIDEDTOURS_TOURS_LIST',
'formURL' => 'index.php?option=com_guidedtours&view=tours',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Guided_Tours',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Guided_Tours',
'icon' => 'icon-map-signs',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$displayData = [
'textPrefix' => 'COM_INSTALLER',
'formURL' => 'index.php?option=com_installer&task=discover.refresh',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Extensions:_Discover',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Extensions:_Discover',
'icon' => 'icon-puzzle-piece install',
'createURL' => 'index.php?option=com_installer&task=discover.refresh&' . Session::getFormToken() . '=1',
'content' => Text::_('COM_INSTALLER_MSG_DISCOVER_DESCRIPTION'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$displayData = [
'textPrefix' => 'COM_INSTALLER',
'formURL' => 'index.php?option=com_installer&view=update',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Extensions:_Update',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Extensions:_Update',
'icon' => 'icon-puzzle-piece install',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Joomla\CMS\Layout\LayoutHelper;

$displayData = [
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Information:_Warnings',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Information:_Warnings',
'icon' => 'icon-puzzle-piece install',
'title' => Text::_('COM_INSTALLER_MSG_WARNINGS_NONE'),
'content' => '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export default {
return api.canDelete && (typeof this.item.canDelete !== 'undefined' ? this.item.canDelete : true);
},
canOpenEditView() {
// @TODO pass the array of allowed to edit files from PHP
return ['jpg', 'jpeg', 'png'].includes(this.item.extension.toLowerCase());
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
}
// @todo remove the hardcoded extensions here
const extensionWithPreview = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'mp4', 'mp3', 'pdf'];
const extensionWithPreview = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'mp4', 'mp3', 'pdf'];
// Show preview
if (this.item.extension
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function ($mediaType) use (&$types) {
',',
ComponentHelper::getParams('com_media')->get(
'image_extensions',
'bmp,gif,jpg,jpeg,png,webp'
'bmp,gif,jpg,jpeg,png,webp,avif'
)
)
);
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_media/tmpl/file/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'csrfToken' => Session::getFormToken(),
'uploadPath' => $this->file->path,
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : '') . '&mediatypes=' . $mediaTypes,
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp'))),
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp,avif'))),
'audioExtensions' => array_map('trim', explode(',', $params->get('audio_extensions', 'mp3,m4a,mp4a,ogg'))),
'videoExtensions' => array_map('trim', explode(',', $params->get('video_extensions', 'mp4,mp4v,mpeg,mov,webm'))),
'documentExtensions' => array_map('trim', explode(',', $params->get('doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'))),
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_media/tmpl/media/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'fileBaseUrl' => Uri::root() . $params->get('file_path', 'images'),
'fileBaseRelativeUrl' => $params->get('file_path', 'images'),
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : '') . $mediaTypes,
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp'))),
'imagesExtensions' => array_map('trim', explode(',', $params->get('image_extensions', 'bmp,gif,jpg,jpeg,png,webp,avif'))),
'audioExtensions' => array_map('trim', explode(',', $params->get('audio_extensions', 'mp3,m4a,mp4a,ogg'))),
'videoExtensions' => array_map('trim', explode(',', $params->get('video_extensions', 'mp4,mp4v,mpeg,mov,webm'))),
'documentExtensions' => array_map('trim', explode(',', $params->get('doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv'))),
Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_menus/src/Helper/MenusHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,14 @@ protected static function parseXmlNode($node, $replace = [])
$params->set('menu-quicktask-permission', (string) $node['quicktask-permission']);
}

if ($item->ajaxbadge) {
$params->set('ajax-badge', $item->ajaxbadge);
}

if ($item->dashboard) {
$params->set('dashboard', $item->dashboard);
}

// Translate attributes for iterator values
foreach ($replace as $var => $val) {
$item->title = str_replace("{sql:$var}", $val, $item->title);
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_menus/src/View/Menu/XmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function display($tpl = null)
return;
}

$this->items = $root->getChildren(true);
$this->items = $root->getChildren();

$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><menu ' .
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' .
Expand Down Expand Up @@ -147,8 +147,8 @@ protected function addXmlChild($xml, $item)
$node->addChild('params', htmlentities((string) $item->getParams(), ENT_XML1));
}

if (isset($item->submenu)) {
foreach ($item->submenu as $sub) {
if ($item->hasChildren()) {
foreach ($item->getChildren() as $sub) {
$this->addXmlChild($node, $sub);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_MESSAGES',
'formURL' => 'index.php?option=com_messages&view=messages',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Private_Messages',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Private_Messages',
'icon' => 'icon-envelope inbox',
];

Expand Down
13 changes: 13 additions & 0 deletions administrator/components/com_modules/tmpl/module/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
defined('_JEXEC') or die;

/** @var \Joomla\Component\Modules\Administrator\View\Module\HtmlView $this */

// A backward compatibility for bootstrap modals: hide toolbar
// @TODO: Remove in 6.0
$this->getDocument()->getWebAssetManager()->addInlineScript('
if (window.parent.Joomla.Modal) {
const modal = window.parent.Joomla.Modal.getCurrent();
const toolbar = document.querySelector(".component .subhead")
if (modal && modal.nodeName !== "JOOMLA-DIALOG" && toolbar) {
toolbar.style.display = "none";
console.warn("Update your modal for Module editing to use Joomla Dialog");
}
}
', ['name' => 'inline.module-modal-fix'], ['type' => 'module']);
?>
<div class="subhead noshadow mb-3">
<?php echo $this->getDocument()->getToolbar('toolbar')->render(); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$displayData = [
'textPrefix' => 'COM_NEWSFEEDS',
'formURL' => 'index.php?option=com_newsfeeds&view=newsfeeds',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:News_Feeds',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:News_Feeds',
'icon' => 'icon-rss newsfeeds',
];

Expand Down
14 changes: 14 additions & 0 deletions administrator/components/com_plugins/tmpl/plugin/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
defined('_JEXEC') or die;

/** @var \Joomla\Component\Plugins\Administrator\View\Plugin\HtmlView $this */

// A backward compatibility for bootstrap modals: hide toolbar
// @TODO: Remove in 6.0
$this->getDocument()->getWebAssetManager()->addInlineScript('
if (window.parent.Joomla.Modal) {
const modal = window.parent.Joomla.Modal.getCurrent();
const toolbar = document.querySelector(".component .subhead")
if (modal && modal.nodeName !== "JOOMLA-DIALOG" && toolbar) {
toolbar.style.display = "none";
console.warn("Update your modal for Plugin editing to use Joomla Dialog");
}
}
', ['name' => 'inline.plugin-modal-fix'], ['type' => 'module']);

?>
<div class="subhead noshadow mb-3">
<?php echo $this->getDocument()->getToolbar('toolbar')->render(); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$displayData = [
'textPrefix' => 'COM_PRIVACY_CONSENTS',
'formURL' => 'index.php?option=com_privacy&view=consents',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Privacy:_Consents',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Privacy:_Consents',
'icon' => 'icon-lock',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$displayData = [
'textPrefix' => 'COM_PRIVACY_REQUESTS',
'formURL' => 'index.php?option=com_privacy&view=requests',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:Privacy:_Information_Requests',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Privacy:_Information_Requests',
'icon' => 'icon-lock',
];

Expand Down
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
12 changes: 7 additions & 5 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 All @@ -22,7 +23,7 @@
$displayData = [
'textPrefix' => 'COM_REDIRECT',
'formURL' => 'index.php?option=com_redirect&view=links',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help4.x:Redirects:_Links',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:Redirects:_Links',
'icon' => 'icon-map-signs redirect',
];

Expand All @@ -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->getDocument()->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
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public function nextExec(bool $string = true, bool $basisNow = false)
case 'cron-expression':
// @todo: testing
$cExp = new CronExpression((string) $this->rule->exp);
$nextExec = $cExp->getNextRunDate('now', 0, false, 'UTC');
$nextExec = $cExp->getNextRunDate('now', 0, false, Factory::getApplication()->get('offset', 'UTC'));
$nextExec->setTimezone(new \DateTimeZone('UTC'));
$nextExec = $string ? $this->dateTimeToSql($nextExec) : $nextExec;
break;
default:
Expand Down
Loading

0 comments on commit 5580224

Please sign in to comment.