29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-17 17:44:57 +00:00

Merge branch '5.2-dev' into customcss-radiolist

This commit is contained in:
Quy 2024-05-22 13:51:14 -07:00 committed by GitHub
commit dec09746e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
155 changed files with 885 additions and 557 deletions

9
.github/CODEOWNERS vendored
View File

@ -12,9 +12,9 @@ build/bump.php @rdeutz
build/deleted_file_check.php @rdeutz
# Core/Extension Install/Update Tools
administrator/components/com_joomlaupdate/* @rdeutz @zero-24
libraries/src/Installer/* @rdeutz @zero-24
libraries/src/Updater/* @rdeutz @zero-24
administrator/components/com_joomlaupdate/* @rdeutz
libraries/src/Installer/* @rdeutz
libraries/src/Updater/* @rdeutz
# Automated Testing
tests/* @hackwar @fancyFranci
@ -24,9 +24,6 @@ tests/Unit/* @rdeutz @fancyFranci
phpunit.xml.dist @rdeutz @hackwar @fancyFranci
phpunit-pgsql.xml.dist @rdeutz @hackwar @fancyFranci
# HttpHeaders Plugin
plugins/system/httpheaders/* @zero-24
# Workflow
administrator/components/com_workflow/* @bembelimen @hleithner
administrator/language/en-GB/com_workflow.ini @bembelimen @hleithner

View File

@ -7,19 +7,22 @@ You are welcome to submit a contribution for review and possible inclusion in th
2) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
3) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible.
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
4) Report security issues to the Joomla! Security Strike Team (JSST) at security@joomla.org or use the [JSST contact form](https://developer.joomla.org/contact-security-team.html). Please do not use the public tracker for security issues.
5) If you have a feature request, then please open a discussion to define the feature request and discuss possible solutions. Discussions can be converted into issues when the request is defined sufficiently that a developer can start coding the feature. In this process you will get feedback from the maintainers, if the feature is something for the Joomla core distribution or not.
Please be patient as not all items will be tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code.
#### Branches
PRs should usually be made to the `4.3-dev` branch as this contains the most recent version of the code.
There are other branches available which serve specific purposes.
While 4.4 is in maintenance mode, ie we are still fixing bugs, PRs should be made to the `4.4-dev` branch. Merged bugfixes will be upmerged into the current 5.x branch. If a bug is only in the 5.x series the PR should be made to the current 5.x branch (currently 5.1).
| Branch | Purpose |
| ------ | ------- |
| 3.10-dev | Branch for the Joomla 3.x series. The 3.10 series release will now only include security patches. |
| 4.3-dev | Branch for the current minor Joomla version.|
| 4.4-dev | Branch for the next minor Joomla version. Commits to 4.3-dev will be applied to this branch as well. |
| 5.0-dev | Branch for the next major Joomla version. New features go into this branch. |
| 4.4-dev | Branch for the current 4.x Joomla version. Currently in maintenance mode |
| 5.1-dev | Branch for the current 5.x Joomla version. Bugfix only for 5.x go into this branch. |
| 5.2-dev | Branch for the next minor 5.x Joomla version. New features go into this branch. |
| 6.0-dev | Branch for the next major Joomla version. New features that include a b/c break have to go into this branch. |

View File

@ -20,7 +20,7 @@ Overview
What is Joomla?
---------------------
* [Joomla!](https://www.joomla.org/about-joomla.html) is a **Content Management System** (CMS) which enables you to build websites and powerful online applications.
* It is a simple and powerful web server application which requires a server with PHP and either MySQL or PostgreSQL to run. You can find [full technical requirements here](https://downloads.joomla.org/technical-requirements).
* It is a simple and powerful web server application which requires a server with PHP and either MySQL, MariaDB or PostgreSQL to run. You can find [full technical requirements here](https://downloads.joomla.org/technical-requirements).
* Joomla! is **free and Open Source software** distributed under the GNU General Public License version 2 or later.
Looking for an installable package?

View File

@ -12,7 +12,7 @@ The Joomla! 5.2 branch is under heavy development and not all links in this docu
2- What is Joomla?
* Joomla! is a Content Management System (CMS) which enables you to build websites and powerful online applications.
* It's a free and Open Source software, distributed under the GNU General Public License version 2 or later.
* This is a simple and powerful web server application and it requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run.
* This is a simple and powerful web server application and it requires a server with PHP and either MySQL, MariaDB or PostgreSQL to run.
You can find full technical requirements here: https://downloads.joomla.org/technical-requirements.
3- Is Joomla! for you?

View File

@ -177,10 +177,10 @@ class ActionlogsHelper
*/
public static function getHumanReadableLogMessage($log, $generateLinks = true)
{
static::loadActionLogPluginsLanguage();
static $links = [];
$message = Text::_($log->message_language_key);
$messageData = json_decode($log->message, true);
$message = Text::_($log->message_language_key);
$messageData = json_decode($log->message, true);
// Special handling for translation extension name
if (isset($messageData['extension_name'])) {

View File

@ -2326,6 +2326,13 @@ class JoomlaInstallerScript
'/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql',
'/administrator/modules/mod_post_installation_messages/mod_post_installation_messages.php',
'/media/vendor/punycode/LICENSE-MIT.txt',
// From 5.1.0 to 5.1.1
'/libraries/vendor/cweagans/composer-patches/LICENSE.md',
'/libraries/vendor/cweagans/composer-patches/src/PatchEvent.php',
'/libraries/vendor/cweagans/composer-patches/src/PatchEvents.php',
'/libraries/vendor/cweagans/composer-patches/src/Patches.php',
'/libraries/vendor/cweagans/composer-patches/tests/PatchEventTest.php',
'/libraries/vendor/laminas/laminas-diactoros/PATCHES.txt',
];
$folders = [
@ -2585,6 +2592,11 @@ class JoomlaInstallerScript
'/libraries/src/Event/Router',
// From 5.1.0-beta2 to 5.1.0-rc1
'/media/vendor/punycode',
// From 5.1.0 to 5.1.1
'/libraries/vendor/cweagans/composer-patches/tests',
'/libraries/vendor/cweagans/composer-patches/src',
'/libraries/vendor/cweagans/composer-patches',
'/libraries/vendor/cweagans',
];
$status['files_checked'] = $files;

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -14,7 +14,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -15,7 +15,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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'),
];

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -117,13 +117,17 @@ class FieldModel extends AdminModel
$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'])) {

View File

@ -16,7 +16,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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')
];

View File

@ -16,7 +16,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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'),

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -19,7 +19,7 @@ use Joomla\CMS\Session\Session;
$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'),

View File

@ -18,7 +18,7 @@ use Joomla\CMS\Session\Session;
$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',
];

View File

@ -14,7 +14,7 @@ use Joomla\CMS\Language\Text;
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' => '',

View File

@ -1400,6 +1400,9 @@ class ZIPExtraction
if ($this->dataReadLength == 0) {
// Before processing file data, ensure permissions are adequate
$this->setCorrectPermissions($this->fileHeader->file);
// This file is changed during the script's operation so we clear the status cache.
clearstatcache($this->fileHeader->file);
}
// Open the output file
@ -1491,6 +1494,9 @@ class ZIPExtraction
// Before processing file data, ensure permissions are adequate
$this->setCorrectPermissions($this->fileHeader->file);
// This file is changed during the script's operation so we clear the status cache.
clearstatcache($this->fileHeader->file);
// Open the output file
$outfp = @fopen($this->fileHeader->realFile, 'wb');

View File

@ -1632,7 +1632,7 @@ ENDDATA;
$minimumStability = ComponentHelper::getParams('com_installer')->get('minimum_stability', Updater::STABILITY_STABLE);
$update = new Update();
$update->set('jversion.full', $joomlaTargetVersion);
$update->setTargetVersion($joomlaTargetVersion);
$update->loadFromXml($updateFileUrl, $minimumStability);
$compatibleVersions = $update->get('compatibleVersions');

View File

@ -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());
},
},

View File

@ -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

View File

@ -489,7 +489,7 @@ class ApiModel extends BaseDatabaseModel
',',
ComponentHelper::getParams('com_media')->get(
'image_extensions',
'bmp,gif,jpg,jpeg,png,webp'
'bmp,gif,jpg,jpeg,png,webp,avif'
)
)
);

View File

@ -45,7 +45,7 @@ $config = [
'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'))),

View File

@ -43,7 +43,7 @@ $config = [
'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'))),

View File

@ -891,6 +891,14 @@ class MenusHelper extends ContentHelper
$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);

View File

@ -69,7 +69,7 @@ class XmlView extends BaseHtmlView
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" ' .
@ -147,8 +147,8 @@ class XmlView extends BaseHtmlView
$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);
}
}

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -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(); ?>

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -150,5 +150,7 @@ class HtmlView extends BaseHtmlView
}
$toolbar->cancel('plugin.cancel');
$toolbar->inlinehelp();
}
}

View File

@ -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(); ?>

View File

@ -15,7 +15,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -16,7 +16,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$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',
];

View File

@ -10,6 +10,7 @@
name="mode"
type="radio"
label="COM_REDIRECT_MODE_LABEL"
description="COM_REDIRECT_MODE_DESC"
layout="joomla.form.field.radio.switcher"
default="0"
>

View File

@ -136,7 +136,7 @@ class HtmlView extends BaseHtmlView
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();
}

View File

@ -14,6 +14,7 @@ use Joomla\CMS\Factory;
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;
@ -32,11 +33,12 @@ $listOrder = $this->escape($this->state->get('list.ordering'));
$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',
@ -56,10 +58,10 @@ if (!$redirectPluginId && $collectUrlsEnabled) {
],
);
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');

View File

@ -14,6 +14,7 @@ use Joomla\CMS\Factory;
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;
@ -22,7 +23,7 @@ use Joomla\Component\Redirect\Administrator\Helper\RedirectHelper;
$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',
];
@ -42,11 +43,12 @@ if (
}
$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();
@ -70,10 +72,10 @@ if (!$redirectPluginId && $collectUrlsEnabled) {
],
);
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');

View File

@ -104,7 +104,8 @@ class ExecRuleHelper
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:

View File

@ -283,6 +283,18 @@ class TaskModel extends AdminModel
$data->execution_rules['exec-day'] = gmdate('d');
$data->execution_rules['exec-time'] = gmdate('H:i');
}
if ($data->next_execution) {
$data->next_execution = Factory::getDate($data->next_execution);
$data->next_execution->setTimezone(new \DateTimeZone($this->app->get('offset', 'UTC')));
$data->next_execution = $data->next_execution->toSql(true);
}
if ($data->last_execution) {
$data->last_execution = Factory::getDate($data->last_execution);
$data->last_execution->setTimezone(new \DateTimeZone($this->app->get('offset', 'UTC')));
$data->last_execution = $data->last_execution->toSql(true);
}
}
// Let plugins manipulate the data

View File

@ -409,27 +409,53 @@ class TemplateModel extends FormModel
{
$result = [];
$prefix = JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $this->template->element;
$mediaPrefix = JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . $this->template->element;
if ($this->template->client_id === 0) {
$prefix = JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $this->template->element;
$mediaPrefix = JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'site' . DIRECTORY_SEPARATOR . $this->template->element;
}
$dirFiles = scandir($dir);
foreach ($dirFiles as $key => $value) {
if (!\in_array($value, ['.', '..', 'node_modules'])) {
if (is_dir($dir . $value)) {
$relativePath = str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . ($this->template->client_id === 0 ? 'site' : 'administrator') . DIRECTORY_SEPARATOR . $this->template->element, '', $dir . $value);
$relativePath = str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR . ($this->template->client_id === 0 ? '' : 'administrator' . DIRECTORY_SEPARATOR) . 'templates' . DIRECTORY_SEPARATOR . $this->template->element, '', $relativePath);
$result[str_replace('\\', '//', $relativePath)] = $this->getDirectoryTree($dir . $value . '/');
} else {
$ext = pathinfo($dir . $value, PATHINFO_EXTENSION);
$allowedFormat = $this->checkFormat($ext);
foreach ($dirFiles as $value) {
if (\in_array($value, ['.', '..', 'node_modules'])) {
continue;
}
if ($allowedFormat == true) {
$relativePath = str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . ($this->template->client_id === 0 ? 'site' : 'administrator') . DIRECTORY_SEPARATOR . $this->template->element, '', $dir . $value);
$relativePath = str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR . ($this->template->client_id === 0 ? '' : 'administrator' . DIRECTORY_SEPARATOR) . 'templates' . DIRECTORY_SEPARATOR . $this->template->element, '', $relativePath);
$result[] = $this->getFile($relativePath, $value);
}
}
$relativePath = str_replace([$prefix, $mediaPrefix], '', $dir . $value);
if (is_dir($dir . $value)) {
$result[str_replace('\\', '//', $relativePath)] = $this->getDirectoryTree($dir . $value . '/');
continue;
}
$ext = pathinfo($dir . $value, PATHINFO_EXTENSION);
if ($this->checkFormat($ext)) {
$result[] = $this->getFile($relativePath, $value);
}
}
// Sort directories first, then files alphabetically.
uksort($result, function ($a, $b) use ($result) {
if (\is_string($a)) {
if (\is_string($b)) {
return strnatcmp($a, $b);
}
return -1;
}
if (\is_string($b)) {
return 1;
}
return strnatcmp($result[$a]->name, $result[$b]->name);
});
return !empty($result) ? $result : ['.'];
}

View File

@ -13,8 +13,6 @@ defined('_JEXEC') or die;
use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\Templates\Administrator\View\Template\HtmlView $this */
ksort($this->files, SORT_NATURAL);
?>
<ul class="directory-tree treeselect">

View File

@ -19,7 +19,6 @@ if (!count($this->mediaFiles)) {
return;
}
ksort($this->mediaFiles, SORT_STRING);
?>
<ul class="directory-tree treeselect">

View File

@ -69,12 +69,10 @@ $canDelete = MfaHelper::canDeleteMethod($this->user);
<?php foreach ($method['active'] as $record) : ?>
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
<?php if ($methodName === 'backupcodes') : ?>
<?php if ($canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)) ?>
</div>
<?php endif ?>
<?php if ($methodName === 'backupcodes' && $canAddEdit) : ?>
<div class="alert alert-info mt-1 w-100">
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id), 'text-decoration-underline') ?>
</div>
<?php else : ?>
<h4 class="com-users-methods-list-method-record-title-container mb-1 fs-3">
<?php if ($record->default) : ?>

View File

@ -17,7 +17,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$displayData = [
'textPrefix' => 'COM_USERS_NOTES',
'formURL' => 'index.php?option=com_users&view=notes',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help40:User_Notes',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Help5.x:User_Notes',
'icon' => 'icon-users user',
];

File diff suppressed because one or more lines are too long

View File

@ -24,27 +24,56 @@ COM_ADMIN_EXTENSIONS="Extensions"
COM_ADMIN_FILE_UPLOADS="File Uploads"
COM_ADMIN_GLOSSARY="Glossary"
COM_ADMIN_HELP="Joomla! Help"
COM_ADMIN_HELP_ADMIN_MODULES:_ACTION_LOGS_-_LATEST="Admin Modules: Action Logs - Latest"
COM_ADMIN_HELP_ADMIN_MODULES:_ADMINISTRATOR_DASHBOARD_MENU="Admin Modules: Administrator Dashboard Menu"
COM_ADMIN_HELP_ADMIN_MODULES:_ADMINISTRATOR_MENU="Admin Modules: Administrator Menu"
COM_ADMIN_HELP_ADMIN_MODULES:_ARTICLES_-_LATEST="Admin Modules: Articles - Latest"
COM_ADMIN_HELP_ADMIN_MODULES:_CUSTOM="Admin Modules: Custom"
COM_ADMIN_HELP_ADMIN_MODULES:_FEED_DISPLAY="Admin Modules: Feed Display"
COM_ADMIN_HELP_ADMIN_MODULES:_FRONTEND_LINK="Admin Modules: Frontend Link"
COM_ADMIN_HELP_ADMIN_MODULES:_GUIDED_TOURS="Admin Modules: Guided Tours"
COM_ADMIN_HELP_ADMIN_MODULES:_JOOMLA_VERSION_INFORMATION="Admin Modules: Joomla Version Information"
COM_ADMIN_HELP_ADMIN_MODULES:_LOGIN_FORM="Admin Modules: Login Form"
COM_ADMIN_HELP_ADMIN_MODULES:_LOGIN_SUPPORT_INFORMATION="Admin Modules: Login Support Information"
COM_ADMIN_HELP_ADMIN_MODULES:_MESSAGES="Admin Modules: Messages"
COM_ADMIN_HELP_ADMIN_MODULES:_MULTILINGUAL_STATUS="Admin Modules: Multilingual Status"
COM_ADMIN_HELP_ADMIN_MODULES:_POPULAR_ARTICLES="Admin Modules: Popular Articles"
COM_ADMIN_HELP_ADMIN_MODULES:_POST_INSTALLATION_MESSAGES="Admin Modules: Post Installation Messages"
COM_ADMIN_HELP_ADMIN_MODULES:_PRIVACY_DASHBOARD="Admin Modules: Privacy Dashboard"
COM_ADMIN_HELP_ADMIN_MODULES:_PRIVACY_STATUS_CHECK="Admin Modules: Privacy Status Check"
COM_ADMIN_HELP_ADMIN_MODULES:_QUICK_ICONS="Admin Modules: Quick Icons"
COM_ADMIN_HELP_ADMIN_MODULES:_SAMPLE_DATA="Admin Modules: Sample Data"
COM_ADMIN_HELP_ADMIN_MODULES:_TITLE="Admin Modules: Title"
COM_ADMIN_HELP_ADMIN_MODULES:_TOOLBAR="Admin Modules: Toolbar"
COM_ADMIN_HELP_ARTICLES:_CATEGORIES="Articles: Categories"
COM_ADMIN_HELP_ARTICLES:_EDIT_CATEGORY="Articles: Categories - New/Edit"
COM_ADMIN_HELP_ARTICLES:_EDIT="Articles: New/Edit"
COM_ADMIN_HELP_ARTICLES:_FEATURED="Articles: Featured"
COM_ADMIN_HELP_ARTICLES:_OPTIONS="Articles: Options"
COM_ADMIN_HELP_ARTICLES="Articles"
COM_ADMIN_HELP_BANNERS:_CATEGORIES="Banners: Categories"
COM_ADMIN_HELP_BANNERS:_CLIENTS="Banners: Clients"
COM_ADMIN_HELP_BANNERS:_EDIT="Banners: New/Edit"
COM_ADMIN_HELP_BANNERS:_NEW_OR_EDIT_CATEGORY="Banners: Categories - New/Edit"
COM_ADMIN_HELP_BANNERS:_NEW_OR_EDIT_CLIENT="Banners: Clients - New/Edit"
COM_ADMIN_HELP_BANNERS:_OPTIONS="Banners: Options"
COM_ADMIN_HELP_BANNERS:_TRACKS="Banners: Tracks"
COM_ADMIN_HELP_BANNERS="Banners"
COM_ADMIN_HELP_CACHE:_OPTIONS="Cache: Options"
COM_ADMIN_HELP_CHECK-IN:_OPTIONS="Check-in: Options"
COM_ADMIN_HELP_CONTACTS:_CATEGORIES="Contacts: Categories"
COM_ADMIN_HELP_CONTACTS:_EDIT_CATEGORY="Contacts: Categories - New/Edit"
COM_ADMIN_HELP_CONTACTS:_EDIT="Contacts: New/Edit"
COM_ADMIN_HELP_CONTACTS:_OPTIONS="Contacts: Options"
COM_ADMIN_HELP_CONTACTS="Contacts"
COM_ADMIN_HELP_EDIT_UPDATE_SITE="Edit Update Site"
COM_ADMIN_HELP_EDITORS="Editors"
COM_ADMIN_HELP_EXTENSIONS:_DISCOVER="Extensions: Discover"
COM_ADMIN_HELP_EXTENSIONS:_INSTALL="Extensions: Install"
COM_ADMIN_HELP_EXTENSIONS:_LANGUAGES="Extensions: Install Languages"
COM_ADMIN_HELP_EXTENSIONS:_MANAGE="Extensions: Manage"
COM_ADMIN_HELP_EXTENSIONS:_UPDATE="Extensions: Update"
COM_ADMIN_HELP_EXTENSIONS:_UPDATE_SITES="Extensions: Update Sites"
COM_ADMIN_HELP_FIELD_GROUPS:_EDIT="Field Groups: New/Edit"
COM_ADMIN_HELP_FIELD_GROUPS="Field Groups"
COM_ADMIN_HELP_FIELDS:_EDIT="Fields: New/Edit"
@ -52,41 +81,85 @@ COM_ADMIN_HELP_FIELDS="Fields"
COM_ADMIN_HELP_GLOSSARY="Glossary"
COM_ADMIN_HELP_GUIDED_TOURS:_NEW_OR_EDIT_STEP="Guided Tours: New/Edit Step"
COM_ADMIN_HELP_GUIDED_TOURS:_NEW_OR_EDIT_TOUR="Guided Tours: New/Edit Tour"
COM_ADMIN_HELP_GUIDED_TOURS:_OPTIONS="Guided Tours: Options"
COM_ADMIN_HELP_GUIDED_TOURS:_STEPS="Guided Tours: Steps"
COM_ADMIN_HELP_GUIDED_TOURS="Guided Tours"
COM_ADMIN_HELP_HOME_DASHBOARD="Home Dashboard"
COM_ADMIN_HELP_INFORMATION:_DATABASE="Extensions: Check Database"
COM_ADMIN_HELP_INFORMATION:_WARNINGS="Extensions: Warnings"
COM_ADMIN_HELP_INSTALLER:_OPTIONS="Installer: Options"
COM_ADMIN_HELP_JOOMLA_UPDATE:_OPTIONS="Joomla Update: Options"
COM_ADMIN_HELP_JOOMLA_UPDATE="Joomla Update"
COM_ADMIN_HELP_LANGUAGES:_CONTENT="Languages: Content"
COM_ADMIN_HELP_LANGUAGES:_EDIT_CONTENT_LANGUAGE="Languages: New/Edit"
COM_ADMIN_HELP_LANGUAGES:_EDIT_OVERRIDE="Languages: Overrides - New/Edit"
COM_ADMIN_HELP_LANGUAGES:_INSTALLED="Languages: Installed"
COM_ADMIN_HELP_LANGUAGES:_OPTIONS="Languages: Options"
COM_ADMIN_HELP_LANGUAGES:_OVERRIDES="Languages: Overrides"
COM_ADMIN_HELP_MAIL_TEMPLATE:_EDIT="Mail Templates: Edit"
COM_ADMIN_HELP_MAIL_TEMPLATES:_OPTIONS="Mail Templates: Options"
COM_ADMIN_HELP_MAIL_TEMPLATES="Mail Templates"
COM_ADMIN_HELP_MAINTENANCE:_CLEAR_CACHE="Cache: Clear Cache"
COM_ADMIN_HELP_MAINTENANCE:_GLOBAL_CHECK-IN="Global Check-in"
COM_ADMIN_HELP_MASS_MAIL_USERS="Mass Mail Users"
COM_ADMIN_HELP_MEDIA:_OPTIONS="Media: Options"
COM_ADMIN_HELP_MEDIA="Media"
COM_ADMIN_HELP_MENU_ITEM:_ALIAS="Menu Item: Alias"
COM_ADMIN_HELP_MENU_ITEM:_ARTICLE_ARCHIVED="Menu Item: Article Archived"
COM_ADMIN_HELP_MENU_ITEM:_COMPACT_LIST_OF_TAGGED_ITEMS="Menu Item: Compact List of Tagged Items"
COM_ADMIN_HELP_MENU_ITEM:_COMPONENTS_MENU_CONTAINER="Menu Item: Components Menu Container"
COM_ADMIN_HELP_MENU_ITEM:_CONFIRM_REQUEST="Menu Item: Confirm Request"
COM_ADMIN_HELP_MENU_ITEM:_CREATE_ARTICLE="Menu Item: Create Article"
COM_ADMIN_HELP_MENU_ITEM:_CREATE_CONTACT="Menu Item: Create Contact"
COM_ADMIN_HELP_MENU_ITEM:_CREATE_REQUEST="Menu Item: Create Request"
COM_ADMIN_HELP_MENU_ITEM:_DISPLAY_TEMPLATE_OPTIONS="Menu Item: Display Template Options"
COM_ADMIN_HELP_MENU_ITEM:_EXTEND_CONSENT="Menu Item: Extend Consent"
COM_ADMIN_HELP_MENU_ITEM:_FEATURED_ARTICLES="Menu Item: Featured Articles"
COM_ADMIN_HELP_MENU_ITEM:_FEATURED_CONTACTS="Menu Item: Featured Contacts"
COM_ADMIN_HELP_MENU_ITEM:_HEADING="Menu Item: Heading"
COM_ADMIN_HELP_MENU_ITEM:_IFRAME_WRAPPER="Menu Item: Iframe Wrapper"
COM_ADMIN_HELP_MENU_ITEM:_LIST_ALL_TAGS="Menu Item: List All Tags"
COM_ADMIN_HELP_MENU_ITEM:_LOGIN_FORM="Menu Item: Login Form"
COM_ADMIN_HELP_MENU_ITEM:_LOGOUT="Menu Item: Logout"
COM_ADMIN_HELP_MENU_ITEM:_NEW_ITEM="Menu: Items New/Edit"
COM_ADMIN_HELP_MENU_ITEM:_PASSWORD_RESET="Menu Item: Password Reset"
COM_ADMIN_HELP_MENU_ITEM:_REGISTRATION_FORM="Menu Item: Registration Form"
COM_ADMIN_HELP_MENU_ITEM:_SEARCH="Menu Item: Search"
COM_ADMIN_HELP_MENU_ITEM:_SEPARATOR="Menu Item: Separator"
COM_ADMIN_HELP_MENU_ITEM:_SINGLE_ARTICLE="Menu Item: Single Article"
COM_ADMIN_HELP_MENU_ITEM:_SINGLE_CONTACT="Menu Item: Single Contact"
COM_ADMIN_HELP_MENU_ITEM:_SINGLE_NEWS_FEED="Menu Item: Single News Feed"
COM_ADMIN_HELP_MENU_ITEM:_SITE_CONFIGURATION_OPTIONS="Menu Item: Site Configuration Options"
COM_ADMIN_HELP_MENU_ITEM:_TAGGED_ITEMS="Menu Item: Tagged Items"
COM_ADMIN_HELP_MENU_ITEM:_URL="Menu Item: URL"
COM_ADMIN_HELP_MENUS:_EDIT="Menus: New/Edit"
COM_ADMIN_HELP_MENUS:_ITEMS="Menu: Items"
COM_ADMIN_HELP_MENUS:_OPTIONS="Menus: Options"
COM_ADMIN_HELP_MENUS="Menus"
COM_ADMIN_HELP_MESSAGES:_OPTIONS="Messages: Options"
COM_ADMIN_HELP_MODULES:_OPTIONS="Modules: Options"
COM_ADMIN_HELP_MODULES="Modules"
COM_ADMIN_HELP_MULTILINGUAL_ASSOCIATIONS:_EDIT="Multilingual Associations: Select"
COM_ADMIN_HELP_MULTILINGUAL_ASSOCIATIONS:_OPTIONS="Multilingual Associations: Options"
COM_ADMIN_HELP_MULTILINGUAL_ASSOCIATIONS="Multilingual Associations"
COM_ADMIN_HELP_MY_PROFILE="My Profile"
COM_ADMIN_HELP_NEWS_FEEDS:_CATEGORIES="News Feeds: Categories"
COM_ADMIN_HELP_NEWS_FEEDS:_EDIT_CATEGORY="News Feeds: Categories - New/Edit"
COM_ADMIN_HELP_NEWS_FEEDS:_EDIT="News Feeds: New/Edit"
COM_ADMIN_HELP_NEWS_FEED:_OPTIONS="News Feed: Options"
COM_ADMIN_HELP_NEWS_FEEDS="News Feeds"
COM_ADMIN_HELP_PERMISSIONS_FOR_GROUP="Permissions for Group"
COM_ADMIN_HELP_PERMISSIONS_FOR_USER="Users: Debug Users Permissions"
COM_ADMIN_HELP_PLUGINS:_NAME_OF_PLUGIN="Plugins: New/Edit"
COM_ADMIN_HELP_PLUGIN:_OPTIONS="Plugin: Options"
COM_ADMIN_HELP_PLUGINS="Plugins"
COM_ADMIN_HELP_POST-INSTALLATION_MESSAGES:_OPTIONS="Post-installation Messages: Options"
COM_ADMIN_HELP_POST-INSTALLATION_MESSAGES_FOR_JOOMLA_CMS="Post-Installation Messages"
COM_ADMIN_HELP_PRIVACY:_CONSENTS="Privacy: Consents"
COM_ADMIN_HELP_PRIVACY:_EXTENSION_CAPABILITIES="Privacy: Extension Capabilities"
COM_ADMIN_HELP_PRIVACY:_INFORMATION_REQUESTS="Privacy: Information Requests"
COM_ADMIN_HELP_PRIVACY:_NEW_INFORMATION_REQUEST="Privacy: New Information Request"
COM_ADMIN_HELP_PRIVACY:_OPTIONS="Privacy: Options"
COM_ADMIN_HELP_PRIVACY:_REVIEW_INFORMATION_REQUEST="Privacy: Review Information Request"
COM_ADMIN_HELP_PRIVACY_DASHBOARD="Privacy: Dashboard"
COM_ADMIN_HELP_PRIVATE_MESSAGES:_READ="Private Messages: Read"
@ -94,22 +167,52 @@ COM_ADMIN_HELP_PRIVATE_MESSAGES:_WRITE="Private Messages: Write"
COM_ADMIN_HELP_PRIVATE_MESSAGES="Private Messages: Inbox"
COM_ADMIN_HELP_REDIRECTS:_LINKS="Redirect: Links"
COM_ADMIN_HELP_REDIRECTS:_NEW_OR_EDIT="Redirect: Links - New/Edit"
COM_ADMIN_HELP_REDIRECT:_OPTIONS="Redirect: Options"
COM_ADMIN_HELP_SCHEDULED_TASKS="Scheduled Tasks"
COM_ADMIN_HELP_SCHEDULED_TASKS:_EDIT="Scheduled Tasks: New/Edit"
COM_ADMIN_HELP_SCHEDULED_TASKS:_OPTIONS="Scheduled Tasks: Options"
COM_ADMIN_HELP_SITE_GLOBAL_CONFIGURATION="Global Configuration"
COM_ADMIN_HELP_SITE_MODULES:_ARTICLES_-_ARCHIVED="Site Modules: Articles - Archived"
COM_ADMIN_HELP_SITE_MODULES:_ARTICLES_-_LATEST="Site Modules: Articles - Latest"
COM_ADMIN_HELP_SITE_MODULES:_ARTICLES_-_MOST_READ="Site Modules: Articles - Most Read"
COM_ADMIN_HELP_SITE_MODULES:_ARTICLES_-_NEWSFLASH="Site Modules: Articles - Newsflash"
COM_ADMIN_HELP_SITE_MODULES:_ARTICLES_-_RELATED="Site Modules: Articles - Related"
COM_ADMIN_HELP_SITE_MODULES:_BANNERS="Site Modules: Banners"
COM_ADMIN_HELP_SITE_MODULES:_BREADCRUMBS="Site Modules: Breadcrumbs"
COM_ADMIN_HELP_SITE_MODULES:_CUSTOM="Site Modules: Custom"
COM_ADMIN_HELP_SITE_MODULES:_FEED_DISPLAY="Site Modules: Feed Display"
COM_ADMIN_HELP_SITE_MODULES:_FOOTER="Site Modules: Footer"
COM_ADMIN_HELP_SITE_MODULES:_LANGUAGE_SWITCHER="Site Modules: Language Switcher"
COM_ADMIN_HELP_SITE_MODULES:_LOGIN="Site Modules: Login"
COM_ADMIN_HELP_SITE_MODULES:_MENU="Site Modules: Menu"
COM_ADMIN_HELP_SITE_MODULES:_RANDOM_IMAGE="Site Modules: Random Image"
COM_ADMIN_HELP_SITE_MODULES:_SMART_SEARCH="Site Modules: Smart Search"
COM_ADMIN_HELP_SITE_MODULES:_STATISTICS="Site Modules: Statistics"
COM_ADMIN_HELP_SITE_MODULES:_SYNDICATION_FEEDS="Site Modules: Syndication Feeds"
COM_ADMIN_HELP_SITE_MODULES:_TAGS_-_POPULAR="Site Modules: Tags - Popular"
COM_ADMIN_HELP_SITE_MODULES:_TAGS_-_SIMILAR="Site Modules: Tags - Similar"
COM_ADMIN_HELP_SITE_MODULES:_WHO_IS_ONLINE="Site Modules: Who's Online"
COM_ADMIN_HELP_SITE_MODULES:_WRAPPER="Site Modules: Wrapper"
COM_ADMIN_HELP_SITE_SYSTEM_INFORMATION="System Information"
COM_ADMIN_HELP_SMART_SEARCH:_CONTENT_MAPS="Smart Search: Content Maps"
COM_ADMIN_HELP_SMART_SEARCH:_INDEXED_CONTENT="Smart Search: Indexed Content"
COM_ADMIN_HELP_SMART_SEARCH:_NEW_OR_EDIT_FILTER="Smart Search: Filters - New/Edit"
COM_ADMIN_HELP_SMART_SEARCH:_SEARCH_FILTERS="Smart Search: Search Filters"
COM_ADMIN_HELP_SMART_SEARCH:_OPTIONS="Smart Search: Options"
COM_ADMIN_HELP_SMART_SEARCH:_SEARCH_TERM_ANALYSIS="Smart Search: Search Term Analysis"
COM_ADMIN_HELP_STAGES_LIST:_BASIC_WORKFLOW="Stages List: Basic Workflow"
COM_ADMIN_HELP_START_HERE="Start Here"
COM_ADMIN_HELP_TAGS:_NEW_OR_EDIT="Tags: New/Edit"
COM_ADMIN_HELP_TAGS:_OPTIONS="Tags: Options"
COM_ADMIN_HELP_TAGS="Tags"
COM_ADMIN_HELP_TEMPLATE:_OPTIONS="Template: Options"
COM_ADMIN_HELP_TEMPLATES:_CUSTOMISE_SOURCE="Templates: Source - Edit"
COM_ADMIN_HELP_TEMPLATES:_CUSTOMISE="Templates: Edit"
COM_ADMIN_HELP_TEMPLATES:_EDIT_STYLE="Templates: Styles - Edit"
COM_ADMIN_HELP_TEMPLATES:_STYLES="Templates: Styles"
COM_ADMIN_HELP_TEMPLATES:_TEMPLATES="Templates"
COM_ADMIN_HELP_TRANSITIONS_LIST:_BASIC_WORKFLOW="Transitions List: Basic Workflow"
COM_ADMIN_HELP_USER_ACTIONS_LOG:_OPTIONS="User Actions Log: Options"
COM_ADMIN_HELP_USER_ACTIONS_LOG="Action Logs"
COM_ADMIN_HELP_USER_NOTES:_NEW_OR_EDIT="Users: User Notes - New/Edit"
COM_ADMIN_HELP_USER_NOTES="Users: User Notes"
@ -117,8 +220,10 @@ COM_ADMIN_HELP_USERS:_EDIT_PROFILE="Users: New/Edit"
COM_ADMIN_HELP_USERS:_EDIT_VIEWING_ACCESS_LEVEL="Users: Access Levels - New/Edit"
COM_ADMIN_HELP_USERS:_GROUPS="Users: Groups"
COM_ADMIN_HELP_USERS:_NEW_OR_EDIT_GROUP="Users: Groups - New/Edit"
COM_ADMIN_HELP_USERS:_OPTIONS="Users: Options"
COM_ADMIN_HELP_USERS:_VIEWING_ACCESS_LEVELS="Users: Access Levels"
COM_ADMIN_HELP_USERS="Users"
COM_ADMIN_HELP_WORKFLOWS_LIST="Workflows List"
COM_ADMIN_JOOMLA_COMPAT_PLUGIN="Joomla Backward Compatibility Plugin"
COM_ADMIN_JOOMLA_VERSION="Joomla! Version"
COM_ADMIN_LICENSE="License"

View File

@ -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"

View File

@ -66,6 +66,7 @@ COM_REDIRECT_HEADING_STATUS_CODE_DESC="Status Code descending"
COM_REDIRECT_MANAGER_LINK_EDIT="Redirects: Edit"
COM_REDIRECT_MANAGER_LINK_NEW="Redirects: New"
COM_REDIRECT_MANAGER_LINKS="Redirects: Links"
COM_REDIRECT_MODE_DESC="The Advanced Mode allows the use of HTTP 1.1 status codes other than the default '301 Permanently Moved'."
COM_REDIRECT_MODE_LABEL="Activate Advanced Mode"
COM_REDIRECT_N_ITEMS_ARCHIVED="%d links archived."
COM_REDIRECT_N_ITEMS_ARCHIVED_1="Link archived."

View File

@ -253,7 +253,7 @@ COM_USERS_MFA_ACTIVE="Uses Multi-factor Authentication"
COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE="Add a new %s"
COM_USERS_MFA_ADD_PAGE_HEAD="Add a Multi-factor Authentication Method"
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT="Backup Codes let you log into the site if your regular Multi-factor Authentication method does not work or you no longer have access to it. Each code can be used <em>only once</em>."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD="<a href=\"%1s\" class=\"%2s\">Print these codes</a> and keep them in your wallet."
COM_USERS_MFA_BACKUPCODES_RESET="Regenerate Backup Codes"
COM_USERS_MFA_BACKUPCODES_RESET_INFO="Use the \"Regenerate Backup Codes\" button on the toolbar to generate a new set of Backup Codes. We recommend that you do this if you think your Backup Codes are compromised, e.g. someone got hold of a printout with them, or if you are running low on available Backup Codes."
COM_USERS_MFA_EDIT_FIELD_DEFAULT="Make this the default Multi-factor Authentication method"

View File

@ -3,7 +3,7 @@
<name>English (en-GB)</name>
<tag>en-GB</tag>
<version>5.2.0</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>

View File

@ -2,7 +2,7 @@
<metafile client="administrator">
<name>English (en-GB)</name>
<version>5.2.0</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>

View File

@ -663,6 +663,7 @@ JLIB_INSTALLER_SQL_END="End of SQL updates."
JLIB_INSTALLER_SQL_END_NOT_COMPLETE="End of SQL updates - INCOMPLETE."
JLIB_INSTALLER_TUF_DEBUG_MESSAGE="TUF Debug Message: %s"
JLIB_INSTALLER_TUF_DOWNLOAD_SIZE="The size of the update downloaded did not match the expected size."
JLIB_INSTALLER_TUF_ERROR_GENERIC="Could not fetch update information, enable system debug mode for further information."
JLIB_INSTALLER_TUF_FREEZE_ATTACK="Update not possible because the offered update has expired."
JLIB_INSTALLER_TUF_INVALID_METADATA="The saved TUF update information is invalid."
JLIB_INSTALLER_TUF_NOT_AVAILABLE="TUF is not available for extensions yet."

View File

@ -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"

View File

@ -7,7 +7,7 @@
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>5.2.0-alpha1-dev</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<description>FILES_JOOMLA_XML_DESCRIPTION</description>
<scriptfile>administrator/components/com_admin/script.php</scriptfile>

View File

@ -3,7 +3,7 @@
<name>English (en-GB) Language Pack</name>
<packagename>en-GB</packagename>
<version>5.2.0.1</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>

View File

@ -54,10 +54,10 @@ HTMLHelper::_('bootstrap.dropdown', '.dropdown-toggle');
<?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; ?>

View File

@ -3,7 +3,7 @@
<name>English (en-GB)</name>
<tag>en-GB</tag>
<version>5.2.0</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>

View File

@ -2,7 +2,7 @@
<metafile client="api">
<name>English (en-GB)</name>
<version>5.2.0</version>
<creationDate>2024-04</creationDate>
<creationDate>2024-05</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>

View File

@ -843,7 +843,7 @@
"title": "Joomla: Environment Setup Incomplete",
"header": "Environment Setup Incomplete",
"text": "It looks like you are trying to run Joomla! from our git repository. To do so requires you complete a couple of extra steps first.",
"link": "J4.x:Setting_Up_Your_Local_Environment",
"link": "J5.x:Setting_Up_Your_Local_Environment",
"linkText": "More Details",
"destFile": [
"/templates/system/build_incomplete.html"

View File

@ -87,49 +87,59 @@ $command = new class () extends AbstractCommand {
$io->comment('Fetching data from docs wiki');
// Get the category members (local hack)
$categoryMembers = $mediawiki->categories->getCategoryMembers(
sprintf('Category:Help_screen_%s.%s', Version::MAJOR_VERSION, Version::MINOR_VERSION),
null,
'max'
);
$members = [];
// Loop through the result objects to get every document
foreach ($categoryMembers->query->categorymembers as $catmembers) {
foreach ($catmembers as $member) {
$members[] = (string) $member['title'];
}
}
// Get the language object
$language = Factory::getLanguage();
/*
* Now we start fancy processing so we can get the language key for the titles
*/
$cleanMembers = [];
// Strip the namespace prefix off the titles and replace spaces with underscores
$namespace = sprintf('Help%d.x:', Version::MAJOR_VERSION);
$io->comment(sprintf('Loop through docs wiki categories since Joomla Version %d.0 - Takes a while ...', Version::MAJOR_VERSION));
foreach ($members as $member) {
$cleanMembers[] = str_replace([$namespace, ' '], ['', '_'], $member);
// Loop through the Versions since 5.0 to get all HelpTocs - Temporary fix
for ($helpScreenMinor=Version::MINOR_VERSION; $helpScreenMinor >= 0; $helpScreenMinor--) {
// Get the category members (local hack)
$categoryMembers = $mediawiki->categories->getCategoryMembers(
sprintf('Category:Help_screen_%s.%s', Version::MAJOR_VERSION, $helpScreenMinor),
null,
'max'
);
$members = [];
// Loop through the result objects to get every document
foreach ($categoryMembers->query->categorymembers as $catmembers) {
foreach ($catmembers as $member) {
$members[] = (string) $member['title'];
}
}
/*
* Now we start fancy processing so we can get the language key for the titles
*/
// Strip the namespace prefix off the titles and replace spaces with underscores
$namespace = sprintf('Help%d.x:', Version::MAJOR_VERSION);
foreach ($members as $member) {
$cleanMembers[str_replace([$namespace, ' '], ['', '_'], $member)] = trim(str_replace($namespace, ' ', $member));
}
}
// Make sure we only have an array of unique values before continuing
$cleanMembers = array_unique($cleanMembers);
// Get the language object
$language = Factory::getLanguage();
// Load the admin com_admin language file
$language->load('com_admin', JPATH_ADMINISTRATOR);
$toc = [];
$toc = [];
$missing = [];
// filter for translated Media-Wiki articles
$translationLanguages = ['/de', '/en', '/fr', '/nl', '/pt-br', '/es', '/pt', '/it'];
foreach ($cleanMembers as $key => $value) {
$string = strtoupper($value);
$string = strtoupper($key);
// Validate the key exists
$io->comment(sprintf('Validating key COM_ADMIN_HELP_%s', $string));
@ -137,11 +147,13 @@ $command = new class () extends AbstractCommand {
if ($language->hasKey('COM_ADMIN_HELP_' . $string)) {
$io->comment(sprintf('Adding %s', $string));
$toc[$value] = $string;
$toc[$key] = $string;
} else {
// We check the string for words in singular/plural form and check again
$io->comment(sprintf('Inflecting %s', $string));
$inflected = '';
if (strpos($string, '_CATEGORIES') !== false) {
$inflected = str_replace('_CATEGORIES', '_CATEGORY', $string);
} elseif (strpos($string, '_USERS') !== false) {
@ -150,8 +162,10 @@ $command = new class () extends AbstractCommand {
$inflected = str_replace('_CATEGORY', '_CATEGORIES', $string);
} elseif (strpos($string, '_USER') !== false) {
$inflected = str_replace('_USER', '_USERS', $string);
} else {
$inflected = '';
}
if ($inflected === '' && !\in_array(substr($value, strrpos($value, '/')), $translationLanguages)) {
$missing[$string] = $value;
}
// Now try to validate the key
@ -161,7 +175,7 @@ $command = new class () extends AbstractCommand {
if ($language->hasKey('COM_ADMIN_HELP_' . $inflected)) {
$io->comment(sprintf('Adding %s', $inflected));
$toc[$value] = $inflected;
$toc[$key] = $inflected;
}
}
}
@ -172,6 +186,25 @@ $command = new class () extends AbstractCommand {
// JSON encode the file and write it to JPATH_ADMINISTRATOR/help/en-GB/toc.json
file_put_contents(JPATH_ADMINISTRATOR . '/help/en-GB/toc.json', json_encode($toc));
if (\count($missing)) {
$str_missing = '';
foreach ($missing as $string => $value) {
$str_missing .= 'COM_ADMIN_HELP_' . $string . '="' . $value . '"'. PHP_EOL;
}
// write missing strings to JPATH_BASE/tmp/missing-helptoc.txt
file_put_contents(JPATH_BASE . '/tmp/missing-helptoc.txt', $str_missing);
$io->caution(sprintf('Number of media-wiki articles without string: %d', \count($missing)));
$io->note(sprintf('Missing strings are saved in: %s and should be revised and added to %s', 'tmp/missing-helptoc.txt', 'administrator/language/en-GB/com_admin.ini'));
$io->caution('TODO: For a complete TOC, please run this script again after adding the missing language strings!');
}
$io->success('Help Screen TOC written');
return 0;

View File

@ -172,7 +172,7 @@ class Edit {
* Public
*/
upload(url, stateChangeCallback) {
let format = Joomla.MediaManager.Edit.original.extension === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension;
let format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase();
if (!format) {
// eslint-disable-next-line prefer-destructuring

View File

@ -112,13 +112,13 @@ if (sidebar && !sidebar.getAttribute('data-hidden')) {
}));
};
mainNav.querySelectorAll('li.parent > a').forEach((parent) => {
document.querySelectorAll('ul.main-nav li.parent > a').forEach((parent) => {
parent.addEventListener('click', openToggle);
parent.addEventListener('keyup', openToggle);
});
// Menu close
mainNav.querySelectorAll('li.parent .close').forEach((subMenu) => {
document.querySelectorAll('ul.main-nav li.parent .close').forEach((subMenu) => {
subMenu.addEventListener('click', () => {
mainNav.querySelectorAll('.open').forEach((menuChild) => menuChild.classList.remove('open'));
mainNav.classList.remove('child-open');

View File

@ -8,10 +8,9 @@
'use strict';
window.JoomlainitReCaptcha2 = () => {
const elements = [].slice.call(document.getElementsByClassName('g-recaptcha'));
const optionKeys = ['sitekey', 'theme', 'size', 'tabindex', 'callback', 'expired-callback', 'error-callback'];
elements.forEach((element) => {
document.querySelectorAll('.g-recaptcha').forEach((element) => {
let options = {};
if (element.dataset) {

View File

@ -8,10 +8,9 @@
'use strict';
window.JoomlainitReCaptchaInvisible = () => {
const elements = [].slice.call(document.getElementsByClassName('g-recaptcha'));
const optionKeys = ['sitekey', 'badge', 'size', 'tabindex', 'callback', 'expired-callback', 'error-callback'];
elements.forEach((element) => {
document.getElementsByClassName('g-recaptcha').forEach((element) => {
let options = {};
if (element.dataset) {

View File

@ -125,9 +125,7 @@ const optionsToExtensions = async (options) => {
const [module, methods] = extInfo;
q.push(import(module).then((modObject) => {
// Call each method
methods.forEach((method) => {
extensions.push(modObject[method]());
});
methods.forEach((method) => extensions.push(modObject[method]()));
}));
});
}

View File

@ -103,9 +103,7 @@ class CodemirrorEditor extends HTMLElement {
// Relocate BS modals, to resolve z-index issue in full screen
this.bsModals = this.querySelectorAll('.joomla-modal.modal');
this.bsModals.forEach((modal) => {
document.body.appendChild(modal);
});
this.bsModals.forEach((modal) => document.body.appendChild(modal));
}
// Create and register the Editor
@ -129,9 +127,7 @@ class CodemirrorEditor extends HTMLElement {
// Restore modals
if (this.bsModals && this.bsModals.length) {
this.bsModals.forEach((modal) => {
this.appendChild(modal);
});
this.bsModals.forEach((modal) => this.appendChild(modal));
}
}
}

View File

@ -464,8 +464,4 @@ const toggleAvailableOption = () => {
window.addEventListener('load', () => toggleAvailableOption());
// Allow to select the group only once per the set
selects.forEach((select) => {
select.addEventListener('change', () => {
toggleAvailableOption();
});
});
selects.forEach((select) => select.addEventListener('change', () => toggleAvailableOption()));

View File

@ -63,9 +63,7 @@ Joomla = window.Joomla || {};
uploadUrl += `&return=${returnUrl}`;
}
button.addEventListener('click', () => {
fileInput.click();
});
button.addEventListener('click', () => fileInput.click());
fileInput.addEventListener('change', () => {
if (uploading) {

View File

@ -184,7 +184,7 @@ class WebInstaller {
WebInstaller.clicker();
if (webInstallerOptions.view !== 'extension') {
[].slice.call(document.querySelectorAll('div.load-extension')).forEach((element) => {
document.querySelectorAll('div.load-extension').forEach((element) => {
element.addEventListener('click', (event) => {
event.preventDefault();
this.processLinkClick(element.getAttribute('data-url'));
@ -237,7 +237,7 @@ class WebInstaller {
}
clickforlinks() {
[].slice.call(document.querySelectorAll('a.transcode')).forEach((element) => {
document.querySelectorAll('a.transcode').forEach((element) => {
const ajaxurl = element.getAttribute('href');
element.addEventListener('click', (event) => {

View File

@ -51,7 +51,7 @@ const init = (image) => {
formElements.cropY.value = Math.round(e.detail.y);
formElements.cropWidth.value = Math.round(e.detail.width);
formElements.cropHeight.value = Math.round(e.detail.height);
const format = Joomla.MediaManager.Edit.original.extension === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension;
const format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase();
const quality = formElements.cropQuality.value;
// Update the store

View File

@ -14,7 +14,7 @@ const resize = (width, height, image) => {
canvas.getContext('2d').drawImage(image, 0, 0, width, height);
// The format
const format = Joomla.MediaManager.Edit.original.extension === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension;
const format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase();
// The quality
const quality = formElements.resizeQuality.value;

View File

@ -28,7 +28,7 @@ const rotate = (angle, image) => {
ctx.drawImage(image, -image.naturalWidth / 2, -image.naturalHeight / 2);
// The format
const format = Joomla.MediaManager.Edit.original.extension === 'jpg' ? 'jpeg' : 'jpg';
const format = Joomla.MediaManager.Edit.original.extension.toLowerCase() === 'jpg' ? 'jpeg' : Joomla.MediaManager.Edit.original.extension.toLowerCase();
// The quality
const quality = document.getElementById('jform_rotate_quality').value;
@ -62,27 +62,18 @@ const initRotate = (image) => {
target.value = 0;
// Deselect all buttons
[].slice.call(document.querySelectorAll('#jform_rotate_distinct label'))
.forEach((element) => {
element.classList.remove('active');
element.classList.remove('focus');
});
document.querySelectorAll('#jform_rotate_distinct label').forEach((element) => element.classList.remove('active', 'focus'));
});
// The 90 degree rotate buttons listeners
[].slice.call(document.querySelectorAll('#jform_rotate_distinct [type=radio]'))
.forEach((element) => {
element.addEventListener('click', ({ target }) => {
rotate(parseInt(target.value, 10), image);
document.querySelectorAll('#jform_rotate_distinct [type=radio]').forEach((element) => {
element.addEventListener('click', ({ target }) => {
rotate(parseInt(target.value, 10), image);
// Deselect all buttons
[].slice.call(document.querySelectorAll('#jform_rotate_distinct label'))
.forEach((el) => {
el.classList.remove('active');
el.classList.remove('focus');
});
});
// Deselect all buttons
document.querySelectorAll('#jform_rotate_distinct label').forEach((el) => el.classList.remove('active', 'focus'));
});
});
activated = true;
}

View File

@ -188,9 +188,7 @@
document.getElementById('users-mfa-captive-button-submit')
.addEventListener('click', onValidateClick);
} else {
document.querySelectorAll('.multifactorauth_webauthn_setup').forEach((btn) => {
btn.addEventListener('click', setUp);
});
document.querySelectorAll('.multifactorauth_webauthn_setup').forEach((btn) => btn.addEventListener('click', setUp));
}
});
})(Joomla, document);

View File

@ -13,16 +13,13 @@
const update = (type, text) => {
const link = document.getElementById('plg_quickicon_extensionupdate');
const linkSpans = [].slice.call(link.querySelectorAll('span.j-links-link'));
if (link) {
link.classList.add(type);
}
if (linkSpans.length) {
linkSpans.forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
}
link.querySelectorAll('span.j-links-link').forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
};
/**
@ -57,7 +54,5 @@
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(fetchUpdate, 330);
});
window.addEventListener('load', () => setTimeout(fetchUpdate, 330));
})();

View File

@ -6,16 +6,13 @@
if (Joomla && Joomla.getOptions('js-extensions-update')) {
const update = (type, text) => {
const link = document.getElementById('plg_quickicon_joomlaupdate');
const linkSpans = [].slice.call(link.querySelectorAll('span.j-links-link'));
if (link) {
link.classList.add(type);
}
if (linkSpans.length) {
linkSpans.forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
}
link.querySelectorAll('span.j-links-link').forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
};
const fetchUpdate = () => {
@ -58,7 +55,5 @@ if (Joomla && Joomla.getOptions('js-extensions-update')) {
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(fetchUpdate, 300);
});
window.addEventListener('load', () => setTimeout(fetchUpdate, 300));
}

View File

@ -12,7 +12,6 @@
const options = Joomla.getOptions('js-override-check');
const update = (type, text, linkHref) => {
const link = document.getElementById('plg_quickicon_overridecheck');
const linkSpans = link.querySelectorAll('span.j-links-link');
if (link) {
link.classList.add(type);
@ -21,11 +20,9 @@
}
}
if (linkSpans.length) {
linkSpans.forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
}
link.querySelectorAll('span.j-links-link').forEach((span) => {
span.innerHTML = Joomla.sanitizeHtml(text);
});
};
/**
@ -66,7 +63,5 @@
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(checkOverride, 390);
});
window.addEventListener('load', () => setTimeout(checkOverride, 390));
})();

View File

@ -68,7 +68,5 @@
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(checkPrivacy, 360);
});
window.addEventListener('load', () => setTimeout(checkPrivacy, 360));
})(document);

View File

@ -22,8 +22,7 @@
* Register events
*/
const registerEvents = () => {
const sectionTogglers = [].slice.call(document.querySelectorAll(debugSectionTogglerSelector));
sectionTogglers.forEach((toggler) => {
document.querySelectorAll(debugSectionTogglerSelector).forEach((toggler) => {
toggler.addEventListener('click', (event) => {
event.preventDefault();
toggle(toggler.getAttribute(toggleTargetAttribute));
@ -31,7 +30,5 @@
});
};
document.addEventListener('DOMContentLoaded', () => {
registerEvents();
});
document.addEventListener('DOMContentLoaded', registerEvents);
})(document);

View File

@ -577,23 +577,23 @@ function loadTour(tourId) {
}
// Opt-in Start buttons
document.querySelector('body').addEventListener('click', (event) => {
document.querySelector('body').addEventListener('click', ({ target }) => {
// Click somewhere else
if (!event.target || !event.target.classList.contains('button-start-guidedtour')) {
if (!target || !target.classList.contains('button-start-guidedtour')) {
return;
}
// Click button but missing data-id
if (
(!event.target.hasAttribute('data-id') || event.target.getAttribute('data-id') <= 0)
&& (!event.target.hasAttribute('data-gt-uid') || event.target.getAttribute('data-gt-uid') === '')
(!target.hasAttribute('data-id') || target.getAttribute('data-id') <= 0)
&& (!target.hasAttribute('data-gt-uid') || target.getAttribute('data-gt-uid') === '')
) {
Joomla.renderMessages({ error: [Joomla.Text._('PLG_SYSTEM_GUIDEDTOURS_COULD_NOT_LOAD_THE_TOUR')] });
return;
}
sessionStorage.setItem('tourToken', String(Joomla.getOptions('com_guidedtours.token')));
loadTour(event.target.getAttribute('data-id') || event.target.getAttribute('data-gt-uid'));
loadTour(target.getAttribute('data-id') || target.getAttribute('data-gt-uid'));
});
// Start a given tour

View File

@ -30,7 +30,5 @@ const initScheduler = () => {
};
((document) => {
document.addEventListener('DOMContentLoaded', () => {
initScheduler();
});
document.addEventListener('DOMContentLoaded', initScheduler);
})(document);

View File

@ -256,12 +256,7 @@ window.Joomla = window.Joomla || {};
};
// Initialization. Runs on DOM content loaded since this script is always loaded deferred.
const loginButtons = [].slice.call(document.querySelectorAll('.plg_system_webauthn_login_button'));
if (loginButtons.length) {
loginButtons.forEach((button) => {
button.addEventListener('click', ({ currentTarget }) => {
Joomla.plgSystemWebauthnLogin(currentTarget.getAttribute('data-webauthn-form'));
});
});
}
document.querySelectorAll('.plg_system_webauthn_login_button').forEach((button) => {
button.addEventListener('click', ({ currentTarget }) => Joomla.plgSystemWebauthnLogin(currentTarget.getAttribute('data-webauthn-form')));
});
})(Joomla, document);

View File

@ -469,19 +469,8 @@ window.Joomla = window.Joomla || {};
addButton.addEventListener('click', Joomla.plgSystemWebauthnAddOnClick);
}
const editLabelButtons = [].slice.call(document.querySelectorAll('.plg_system_webauthn-manage-edit'));
if (editLabelButtons.length) {
editLabelButtons.forEach((button) => {
button.addEventListener('click', Joomla.plgSystemWebauthnEditOnClick);
});
}
const deleteButtons = [].slice.call(document.querySelectorAll('.plg_system_webauthn-manage-delete'));
if (deleteButtons.length) {
deleteButtons.forEach((button) => {
button.addEventListener('click', Joomla.plgSystemWebauthnDeleteOnClick);
});
}
document.querySelectorAll('.plg_system_webauthn-manage-edit').forEach((button) => button.addEventListener('click', Joomla.plgSystemWebauthnEditOnClick));
document.querySelectorAll('.plg_system_webauthn-manage-delete').forEach((button) => button.addEventListener('click', Joomla.plgSystemWebauthnDeleteOnClick));
};
// Initialization. Runs on DOM content loaded since this script is always loaded deferred.

View File

@ -109,7 +109,7 @@ window.Joomla.Modal = window.Joomla.Modal || {
newDestination = {};
}
[].slice.call(Object.keys(source)).forEach((key) => {
Object.keys(source).forEach((key) => {
newDestination[key] = source[key];
});
@ -155,10 +155,9 @@ window.Joomla.Modal = window.Joomla.Modal || {
Joomla.loadOptions = (options) => {
// Load form the script container
if (!options) {
const elements = [].slice.call(document.querySelectorAll('.joomla-script-options.new'));
let counter = 0;
elements.forEach((element) => {
document.querySelectorAll('.joomla-script-options.new').forEach((element) => {
const str = element.text || element.textContent;
const option = JSON.parse(str);
@ -180,7 +179,7 @@ window.Joomla.Modal = window.Joomla.Modal || {
Joomla.optionsStorage = options || {};
} else if (options) {
// Merge with existing
[].slice.call(Object.keys(options)).forEach((key) => {
Object.keys(options).forEach((key) => {
/**
* If both existing and new options are objects, merge them with Joomla.extend().
* But test for new option being null, as null is an object, but we want to allow
@ -241,7 +240,7 @@ window.Joomla.Modal = window.Joomla.Modal || {
* @returns {Joomla.Text}
*/
load: (object) => {
[].slice.call(Object.keys(object)).forEach((key) => {
Object.keys(object).forEach((key) => {
Joomla.Text.strings[key.toUpperCase()] = object[key];
});
@ -513,10 +512,8 @@ window.Joomla.Modal = window.Joomla.Modal || {
return;
}
const elements = [].slice.call(document.getElementsByTagName('input'));
elements.forEach((element) => {
if (element.type === 'hidden' && element.value === '1' && element.name.length === 32) {
document.querySelectorAll('input[type="hidden"]').forEach((element) => {
if (element.value === '1' && element.name.length === 32) {
element.name = newToken;
}
});
@ -596,7 +593,7 @@ window.Joomla.Modal = window.Joomla.Modal || {
// Custom headers
if (newOptions.headers) {
[].slice.call(Object.keys(newOptions.headers)).forEach((key) => {
Object.keys(newOptions.headers).forEach((key) => {
// Allow request without Content-Type
// eslint-disable-next-line no-empty
if (key === 'Content-Type' && newOptions.headers['Content-Type'] === 'false') {

View File

@ -32,7 +32,7 @@ window.customElements.define('joomla-field-permissions', class extends HTMLEleme
* Lifecycle
*/
connectedCallback() {
this.buttons = [].slice.call(document.querySelectorAll(`[${this.buttonDataSelector}]`));
this.buttons = document.querySelectorAll(`[${this.buttonDataSelector}]`);
if (this.buttons) {
this.buttons.forEach((button) => {
button.addEventListener('change', this.onDropdownChange);

View File

@ -215,7 +215,7 @@
throw new Error('Simple color field requires a select element');
}
this.options = [].slice.call(this.select.querySelectorAll('option'));
this.options = this.select.querySelectorAll('option');
this.select.classList.add('hidden');

View File

@ -240,8 +240,8 @@ const insertAsOther = (media, editor, fieldClass, type) => {
<source src="${Joomla.selectedMediaFile.url}" type="${Joomla.selectedMediaFile.fileType}">
</video>`;
}
} else if (Joomla.editors.instances[editor].getSelection() !== '') {
outputText = `<a download href="${Joomla.selectedMediaFile.url}">${Joomla.editors.instances[editor].getSelection()}</a>`;
} else if (editorInst.getSelection() !== '') {
outputText = `<a download href="${Joomla.selectedMediaFile.url}">${editorInst.getSelection()}</a>`;
} else {
const name = /([\w-]+)\./.exec(Joomla.selectedMediaFile.url);
outputText = `<a download href="${Joomla.selectedMediaFile.url}">${Joomla.Text._('JFIELD_MEDIA_DOWNLOAD_FILE').replace('{file}', name[1])}</a>`;

View File

@ -7,6 +7,8 @@
*
* Copyright (c) 2014 Thomas Kjærgaard
*
* ADAPTED BY: Joomla for use in the Joomla! CMS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@ -50,7 +52,7 @@ class PasswordStrength {
// eslint-disable-next-line no-useless-escape
score += this.constructor.calc(
value,
/[@$!#?=;:*\-_€%&()`´]/g,
/[@$!#?=;:*\-_€%&()`´+[\]{}'"\\|,.<>/~^]/g,
this.special,
mods,
);
@ -121,7 +123,7 @@ class PasswordStrength {
};
document.addEventListener('DOMContentLoaded', () => {
const fields = [].slice.call(document.querySelectorAll('.js-password-strength'));
const fields = document.querySelectorAll('.js-password-strength');
// Loop through the fields
fields.forEach((field, index) => {
@ -155,9 +157,7 @@ class PasswordStrength {
}
// Add a listener for input data change
field.addEventListener('keyup', ({ target }) => {
getMeter(target);
});
field.addEventListener('keyup', ({ target }) => getMeter(target));
});
// Set a handler for the validation script

View File

@ -19,9 +19,7 @@
};
const updateSelectboxColour = () => {
const colourSelects = [].slice.call(document.querySelectorAll('.form-select-color-state'));
colourSelects.forEach((colourSelect) => {
document.querySelectorAll('.form-select-color-state').forEach((colourSelect) => {
const value = parseInt(colourSelect.value, 10);
// Add class on page load

View File

@ -37,9 +37,7 @@ class JFormValidator {
});
// Attach all forms with a class 'form-validate'
const forms = [].slice.call(document.querySelectorAll('form'));
forms.forEach((form) => {
document.querySelectorAll('form').forEach((form) => {
if (form.classList.contains('form-validate')) {
this.attachToForm(form);
}
@ -74,8 +72,7 @@ class JFormValidator {
}
}
element.classList.remove('form-control-danger');
element.classList.remove('invalid');
element.classList.remove('form-control-danger', 'invalid');
element.classList.add('form-control-success');
element.parentNode.classList.remove('has-danger');
element.parentNode.classList.add('has-success');
@ -97,10 +94,8 @@ class JFormValidator {
// Get a label
const label = element.form.querySelector(`label[for="${element.id}"]`);
element.classList.remove('form-control-success');
element.classList.remove('valid');
element.classList.add('form-control-danger');
element.classList.add('invalid');
element.classList.remove('form-control-success', 'valid');
element.classList.add('form-control-danger', 'invalid');
element.parentNode.classList.remove('has-success');
element.parentNode.classList.add('has-danger');
element.setAttribute('aria-invalid', 'true');
@ -145,18 +140,13 @@ class JFormValidator {
message = label.querySelector('span.form-control-feedback');
}
element.classList.remove('form-control-danger');
element.classList.remove('form-control-success');
element.classList.remove('invalid');
element.classList.remove('form-control-danger', 'form-control-success', 'remove');
element.classList.add('valid');
element.parentNode.classList.remove('has-danger');
element.parentNode.classList.remove('has-success');
element.parentNode.classList.remove('has-danger', 'has-success');
// Remove message
if (message) {
if (label) {
label.removeChild(message);
}
if (message && label) {
label.removeChild(message);
}
// Restore Label
@ -256,7 +246,7 @@ class JFormValidator {
if (form.nodeName === 'FORM') {
fields = [].slice.call(form.elements);
} else {
fields = [].slice.call(form.querySelectorAll('input, textarea, select, button, fieldset'));
fields = form.querySelectorAll('input, textarea, select, button, fieldset');
}
fields.forEach((field) => {
if (this.validate(field) === false) {
@ -294,7 +284,7 @@ class JFormValidator {
if (form.nodeName === 'FORM') {
elements = [].slice.call(form.elements);
} else {
elements = [].slice.call(form.querySelectorAll('input, textarea, select, button, fieldset'));
elements = form.querySelectorAll('input, textarea, select, button, fieldset');
}
// Iterate through the form object and attach the validate method to all input fields.

View File

@ -29,9 +29,7 @@ if (Joomla.getOptions && typeof Joomla.getOptions === 'function' && Joomla.getOp
const instance = new Mark(element);
// Loop through the terms
options.highLight.forEach((term) => {
instance.mark(term, options);
});
options.highLight.forEach((term) => instance.mark(term, options));
}
} else {
const start = document.querySelector(`#${options.start}`);

View File

@ -9,49 +9,47 @@
* @param {String} toggleClass The class name of the DIVs to toggle display for
*/
Joomla.toggleInlineHelp = (toggleClass) => {
[].slice.call(document.querySelectorAll(`div.${toggleClass}`))
.forEach((elDiv) => {
// Toggle the visibility of the node by toggling the 'd-none' Bootstrap class.
elDiv.classList.toggle('d-none');
// The ID of the description whose visibility is toggled.
const myId = elDiv.id;
// The ID of the control described by this node (same ID, minus the '-desc' suffix).
const controlId = myId ? myId.substring(0, myId.length - 5) : null;
// Get the control described by this node.
const elControl = controlId ? document.getElementById(controlId) : null;
// Is this node hidden?
const isHidden = elDiv.classList.contains('d-none');
document.querySelectorAll(`div.${toggleClass}`).forEach((elDiv) => {
// Toggle the visibility of the node by toggling the 'd-none' Bootstrap class.
elDiv.classList.toggle('d-none');
// The ID of the description whose visibility is toggled.
const myId = elDiv.id;
// The ID of the control described by this node (same ID, minus the '-desc' suffix).
const controlId = myId ? myId.substring(0, myId.length - 5) : null;
// Get the control described by this node.
const elControl = controlId ? document.getElementById(controlId) : null;
// Is this node hidden?
const isHidden = elDiv.classList.contains('d-none');
// If we do not have a control we will exit early
if (!controlId || !elControl) {
return;
}
// Unset the aria-describedby attribute in the control when the description is hidden and viceversa.
if (isHidden && elControl.hasAttribute('aria-describedby')) {
elControl.removeAttribute('aria-describedby');
} else if (!isHidden) {
elControl.setAttribute('aria-describedby', myId);
}
});
};
// Initialisation. Clicking on anything with the button-inlinehelp class will toggle the inline help.
[].slice.call(document.querySelectorAll('.button-inlinehelp'))
.forEach((elToggler) => {
// The class of the DIVs to toggle visibility on is defined by the data-class attribute of the click target.
const toggleClass = elToggler.dataset.class ?? 'hide-aware-inline-help';
const collection = document.getElementsByClassName(toggleClass);
// no description => hide inlinehelp button
if (collection.length === 0) {
elToggler.classList.add('d-none');
// If we do not have a control we will exit early
if (!controlId || !elControl) {
return;
}
// Add the click handler.
elToggler.addEventListener('click', (event) => {
event.preventDefault();
Joomla.toggleInlineHelp(toggleClass);
});
// Unset the aria-describedby attribute in the control when the description is hidden and viceversa.
if (isHidden && elControl.hasAttribute('aria-describedby')) {
elControl.removeAttribute('aria-describedby');
} else if (!isHidden) {
elControl.setAttribute('aria-describedby', myId);
}
});
};
// Initialisation. Clicking on anything with the button-inlinehelp class will toggle the inline help.
document.querySelectorAll('.button-inlinehelp').forEach((elToggler) => {
// The class of the DIVs to toggle visibility on is defined by the data-class attribute of the click target.
const toggleClass = elToggler.dataset.class ?? 'hide-aware-inline-help';
const collection = document.getElementsByClassName(toggleClass);
// no description => hide inlinehelp button
if (collection.length === 0) {
elToggler.classList.add('d-none');
return;
}
// Add the click handler.
elToggler.addEventListener('click', (event) => {
event.preventDefault();
Joomla.toggleInlineHelp(toggleClass);
});
});

View File

@ -53,7 +53,7 @@ Joomla.renderMessages = (messages, selector, keepOld, timeout) => {
Joomla.removeMessages(messageContainer);
}
[].slice.call(Object.keys(messages)).forEach((type) => {
Object.keys(messages).forEach((type) => {
let alertClass = type;
// Array of messages of this type
@ -107,12 +107,7 @@ Joomla.renderMessages = (messages, selector, keepOld, timeout) => {
*/
Joomla.removeMessages = (container) => {
const messageContainer = getMessageContainer(container);
const alerts = [].slice.call(messageContainer.querySelectorAll('joomla-alert'));
if (alerts.length) {
alerts.forEach((alert) => {
alert.close();
});
}
messageContainer.querySelectorAll('joomla-alert').forEach((alert) => alert.close());
};
document.addEventListener('DOMContentLoaded', () => {

View File

@ -110,7 +110,7 @@ Joomla = window.Joomla || {};
this.clearButton = document.querySelector(this.options.clearBtnSelector);
// Ordering
this.orderCols = Array.prototype.slice.call(document.querySelectorAll(`${this.options.formSelector} ${this.options.orderColumnSelector}`));
this.orderCols = document.querySelectorAll(`${this.options.formSelector} ${this.options.orderColumnSelector}`);
this.orderField = document.querySelector(`${this.options.formSelector} ${this.options.orderFieldSelector}`);
// Limit
@ -375,17 +375,17 @@ Joomla = window.Joomla || {};
// eslint-disable-next-line consistent-return
getFilterFields() {
if (this.mainContainer) {
return Array.prototype.slice.call(this.mainContainer.querySelectorAll('select,input'));
return this.mainContainer.querySelectorAll('select,input');
}
if (this.filterContainer) {
return Array.prototype.slice.call(this.filterContainer.querySelectorAll('select,input'));
return this.filterContainer.querySelectorAll('select,input');
}
return [];
}
getListFields() {
return Array.prototype.slice.call(this.listContainer.querySelectorAll('select'));
return this.listContainer.querySelectorAll('select');
}
// Common container functions

View File

@ -22,7 +22,7 @@ class Showon {
// }
};
this.showonFields = [].slice.call(this.container.querySelectorAll('[data-showon]'));
this.showonFields = this.container.querySelectorAll('[data-showon]');
// Populate the fields data
if (this.showonFields.length) {
// @todo refactor this, dry
@ -38,7 +38,7 @@ class Showon {
let localFields;
if (showonData.length) {
localFields = [].slice.call(self.container.querySelectorAll(`[name="${showonData[0].field}"], [name="${showonData[0].field}[]"]`));
localFields = self.container.querySelectorAll(`[name="${showonData[0].field}"], [name="${showonData[0].field}[]"]`);
if (!this.fields[showonData[0].field]) {
this.fields[showonData[0].field] = {
@ -64,7 +64,7 @@ class Showon {
return;
}
localFields = [].slice.call(self.container.querySelectorAll(`[name="${value.field}"], [name="${value.field}[]"]`));
localFields = self.container.querySelectorAll(`[name="${value.field}"], [name="${value.field}[]"]`);
if (!this.fields[showonData[0].field]) {
this.fields[showonData[0].field] = {
@ -260,7 +260,7 @@ const getMatchedParents = ($child, selector) => {
document.addEventListener('joomla:updated', ({ target }) => {
// Check is it subform, then wee need to fix some "showon" config
if (target.classList.contains('subform-repeatable-group')) {
const elements = [].slice.call(target.querySelectorAll('[data-showon]'));
const elements = target.querySelectorAll('[data-showon]');
if (elements.length) {
const search = [];

View File

@ -8,7 +8,7 @@ class TableColumns {
this.storageKey = `joomla-tablecolumns-${this.tableName}`;
this.$headers = [].slice.call($table.querySelector('thead tr').children);
this.$rows = [].slice.call($table.querySelectorAll('tbody tr'));
this.$rows = $table.querySelectorAll('tbody tr');
this.listOfHidden = [];
// Load previous state

View File

@ -7,9 +7,7 @@
*/
document.addEventListener('DOMContentLoaded', () => {
const allMenus = document.querySelectorAll('ul.mod-menu_dropdown-metismenu');
allMenus.forEach((menu) => {
document.querySelectorAll('ul.mod-menu_dropdown-metismenu').forEach((menu) => {
// eslint-disable-next-line no-new, no-undef
const mm = new MetisMenu(menu, {
triggerElement: 'button.mm-toggler',

View File

@ -1,74 +0,0 @@
/**
* @package Joomla.Site
* @subpackage Templates.Cassiopeia
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 4.0.0
*/
Joomla = window.Joomla || {};
(function(Joomla, document) {
'use strict';
function initTemplate(event) {
var target = event && event.target ? event.target : document;
/**
* Prevent clicks on buttons within a disabled fieldset
*/
var fieldsets = target.querySelectorAll('fieldset.btn-group');
for (var i = 0; i < fieldsets.length; i++) {
var self = fieldsets[i];
if (self.getAttribute('disabled') === true) {
self.style.pointerEvents = 'none';
var btns = self.querySelectorAll('.btn');
for (var ib = 0; ib < btns.length; ib++) {
btns[ib].classList.add('disabled');
}
}
}
}
document.addEventListener('DOMContentLoaded', function (event) {
initTemplate(event);
/**
* Back to top
*/
var backToTop = document.getElementById('back-top');
if (backToTop) {
function checkScrollPos() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
backToTop.classList.add('visible');
} else {
backToTop.classList.remove('visible')
}
}
checkScrollPos();
window.onscroll = function() {
checkScrollPos();
};
backToTop.addEventListener('click', function(event) {
event.preventDefault();
window.scrollTo(0, 0);
});
}
[].slice.call(document.head.querySelectorAll('link[rel="lazy-stylesheet"]'))
.forEach(function($link){
$link.rel = "stylesheet";
});
});
/**
* Initialize when a part of the page was updated
*/
document.addEventListener('joomla:updated', initTemplate);
})(Joomla, document);

View File

@ -0,0 +1,64 @@
/**
* @package Joomla.Site
* @subpackage Templates.Cassiopeia
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 4.0.0
*/
Joomla = window.Joomla || {};
((Joomla, document) => {
'use strict';
function initTemplate(event) {
const target = event && event.target ? event.target : document;
/**
* Prevent clicks on buttons within a disabled fieldset
*/
target.querySelectorAll('fieldset.btn-group').forEach((fieldset) => {
if (fieldset.getAttribute('disabled') === true) {
fieldset.style.pointerEvents = 'none';
fieldset.querySelectorAll('.btn').forEach((btn) => btn.classList.add('disabled'));
}
});
}
document.addEventListener('DOMContentLoaded', (event) => {
initTemplate(event);
/**
* Back to top
*/
const backToTop = document.getElementById('back-top');
function checkScrollPos() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
backToTop.classList.add('visible');
} else {
backToTop.classList.remove('visible');
}
}
if (backToTop) {
checkScrollPos();
window.addEventListener('scroll', checkScrollPos);
backToTop.addEventListener('click', (ev) => {
ev.preventDefault();
window.scrollTo(0, 0);
});
}
document.head.querySelectorAll('link[rel="lazy-stylesheet"]').forEach(($link) => {
$link.rel = 'stylesheet';
});
});
/**
* Initialize when a part of the page was updated
*/
document.addEventListener('joomla:updated', initTemplate);
})(Joomla, document);

Some files were not shown because too many files have changed in this diff Show More