29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-20 11:05:08 +00:00

Merge branch '4.3-dev' into 4.4-dev

This commit is contained in:
Allon Moritz 2023-05-13 17:53:15 +02:00
commit 41536a2f77
13 changed files with 106 additions and 57 deletions

View File

@ -126,11 +126,11 @@
// Evaluate the min year
if (btn.dataset.minYear) {
self.params.minYear = parseInt(btn.dataset.minYear, 10);
self.params.minYear = getBoundary(parseInt(btn.dataset.minYear, 10), self.params.dateType);
}
// Evaluate the max year
if (btn.dataset.maxYear) {
self.params.maxYear = parseInt(btn.dataset.maxYear, 10);
self.params.maxYear = getBoundary(parseInt(btn.dataset.maxYear, 10), self.params.dateType);
}
// Evaluate the weekend days
if (btn.dataset.weekend) {

View File

@ -4,12 +4,12 @@ import Mark from 'mark.js/src/vanilla';
const defaultOptions = {
exclude: [],
separateWordSearch: true,
accuracy: 'exactly',
accuracy: 'partially',
diacritics: true,
synonyms: {},
iframes: false,
iframesTimeout: 5000,
acrossElements: false,
acrossElements: true,
caseSensitive: false,
ignoreJoiners: false,
wildcards: 'disabled',

View File

@ -266,6 +266,7 @@ $state-danger-bg: $danger !default;
$state-danger-border: scale-color($danger, $lightness: -5%) !default;
// Mark element
$mark-padding: .1875em 0;
$mark-bg: #fbeea8 !default;
// scss-docs-start border-radius-variables

View File

@ -239,9 +239,9 @@ class HtmlView extends BaseHtmlView
// Add feed links
if ($this->params->get('show_feed_link', 1)) {
$link = '&format=feed&limitstart=';
$attribs = ['type' => 'application/rss+xml', 'title' => 'RSS 2.0'];
$attribs = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = ['type' => 'application/atom+xml', 'title' => 'Atom 1.0'];
$attribs = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}

View File

@ -321,12 +321,12 @@ class HtmlView extends BaseHtmlView implements SiteRouterAwareInterface
// Add feed link to the document head.
if ($this->params->get('show_feed_link', 1) == 1) {
// Add the RSS link.
$props = ['type' => 'application/rss+xml', 'title' => 'RSS 2.0'];
$props = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$route = Route::_($this->query->toUri() . '&format=feed&type=rss');
$this->document->addHeadLink($route, 'alternate', 'rel', $props);
// Add the ATOM link.
$props = ['type' => 'application/atom+xml', 'title' => 'Atom 1.0'];
$props = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$route = Route::_($this->query->toUri() . '&format=feed&type=atom');
$this->document->addHeadLink($route, 'alternate', 'rel', $props);
}

View File

@ -89,47 +89,59 @@ class Router extends RouterBase
}
// Get query language
$language = isset($query['lang']) ? $query['lang'] : '*';
$lang = isset($query['lang']) ? $query['lang'] : '*';
// Set the language to the current one when multilang is enabled and item is tagged to ALL
if (Multilanguage::isEnabled() && $language === '*') {
$language = $this->app->get('language');
if (Multilanguage::isEnabled() && $lang === '*') {
$lang = $this->app->get('language');
}
if (isset($query['view']) && $query['view'] == 'tags') {
if (isset($query['parent_id']) && isset($this->lookup[$language]['tags'][$query['parent_id']])) {
$query['Itemid'] = $this->lookup[$language]['tags'][$query['parent_id']];
} elseif (isset($this->lookup[$language]['tags'][0])) {
$query['Itemid'] = $this->lookup[$language]['tags'][0];
}
} elseif (isset($query['view']) && $query['view'] == 'tag') {
if (isset($query['id'])) {
if (!is_array($query['id'])) {
$query['id'] = [$query['id']];
}
$id = ArrayHelper::toInteger($query['id']);
sort($id);
if (isset($this->lookup[$language]['tag'][implode(',', $id)])) {
$query['Itemid'] = $this->lookup[$language]['tag'][implode(',', $id)];
foreach (array_unique([$lang, '*']) as $language) {
if (isset($query['view']) && $query['view'] == 'tags') {
if (isset($query['parent_id']) && isset($this->lookup[$language]['tags'][$query['parent_id']])) {
$query['Itemid'] = $this->lookup[$language]['tags'][$query['parent_id']];
break;
} elseif (isset($this->lookup[$language]['tags'][0])) {
$query['Itemid'] = $this->lookup[$language]['tags'][0];
break;
}
} elseif (isset($query['view']) && $query['view'] == 'tag') {
if (isset($query['id'])) {
if (!is_array($query['id'])) {
$query['id'] = [$query['id']];
}
$id = ArrayHelper::toInteger($query['id']);
sort($id);
if (isset($this->lookup[$language]['tag'][implode(',', $id)])) {
$query['Itemid'] = $this->lookup[$language]['tag'][implode(',', $id)];
break;
} else {
foreach ($id as $i) {
if (isset($this->lookup[$language]['tag'][$i])) {
$query['Itemid'] = $this->lookup[$language]['tag'][$i];
break 2;
}
}
}
if (isset($this->lookup[$language]['tags'][implode(',', $id)])) {
$query['Itemid'] = $this->lookup[$language]['tags'][implode(',', $id)];
break;
}
if (isset($this->lookup[$language]['tags'][0])) {
$query['Itemid'] = $this->lookup[$language]['tags'][0];
break;
}
}
}
}
// Check if the active menuitem matches the requested language
if (
!isset($query['Itemid']) && ($active && $active->component === 'com_tags'
&& ($language === '*' || \in_array($active->language, ['*', $language]) || !Multilanguage::isEnabled()))
) {
$query['Itemid'] = $active->id;
}
// If not found, return language specific home link
if (!isset($query['Itemid'])) {
$default = $this->menu->getDefault($language);
$default = $this->menu->getDefault($lang);
if (!empty($default->id)) {
$query['Itemid'] = $default->id;
@ -168,12 +180,18 @@ class Router extends RouterBase
unset($query['id']);
} elseif ($menuItem->query['view'] == 'tag') {
$ids = $query['id'];
$ids = ArrayHelper::toInteger($ids);
$ids = array_diff($ids, $menuItem->query['id']);
$ids = $query['id'];
$int_ids = ArrayHelper::toInteger($ids);
$mIds = (array) $menuItem->query['id'];
foreach ($ids as $id) {
$segments[] = $id;
/**
* We check if there is a difference between the tags of the menu item and the query.
* If they are identical, we exactly match the menu item. Otherwise we append all tags to the URL
*/
if (count(array_diff($int_ids, $mIds)) > 0 || count(array_diff($mIds, $int_ids)) > 0) {
foreach ($ids as $id) {
$segments[] = $id;
}
}
unset($query['id']);
@ -271,6 +289,10 @@ class Router extends RouterBase
$id = $item->query['id'];
sort($id);
$this->lookup[$item->language]['tag'][implode(',', $id)] = $item->id;
foreach ($id as $i) {
$this->lookup[$item->language]['tag'][$i] = $item->id;
}
}
if ($item->query['view'] == 'tags') {
@ -278,6 +300,37 @@ class Router extends RouterBase
$this->lookup[$item->language]['tags'][$id] = $item->id;
}
}
foreach ($this->lookup as $language => $items) {
// We have tags views with parent_id set and need to load child tags to be assigned to this menu item
if (
count($this->lookup[$language]['tags']) > 1
|| (count($this->lookup[$language]['tags']) == 1 && !isset($this->lookup[$language]['tags'][0]))
) {
foreach ($this->lookup[$language]['tags'] as $id => $menu) {
if ($id === 0) {
continue;
}
$query = $this->db->getQuery(true);
$query->select($this->db->quoteName('a.id'))
->from($this->db->quoteName('#__tags', 'a'))
->leftJoin(
$this->db->quoteName('#__tags', 'b')
. ' ON ' . $this->db->quoteName('b.lft') . ' < ' . $this->db->quoteName('a.lft')
. ' AND ' . $this->db->quoteName('a.rgt') . ' < ' . $this->db->quoteName('b.rgt')
)
->where($this->db->quoteName('b.id') . ' = :id')
->bind(':id', $id);
$this->db->setQuery($query);
$ids = (array) $this->db->loadColumn();
foreach ($ids as $i) {
$this->lookup[$language]['tags'][$i] = $menu;
}
}
}
}
}
/**

View File

@ -299,9 +299,9 @@ class HtmlView extends BaseHtmlView
if ($this->params->get('show_feed_link', 1) == 1) {
$link = '&format=feed&limitstart=';
$attribs = ['type' => 'application/rss+xml', 'title' => 'RSS 2.0'];
$attribs = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = ['type' => 'application/atom+xml', 'title' => 'Atom 1.0'];
$attribs = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}

View File

@ -164,9 +164,9 @@ class HtmlView extends BaseHtmlView
// Add alternative feed link
if ($this->params->get('show_feed_link', 1) == 1) {
$link = '&format=feed&limitstart=';
$attribs = ['type' => 'application/rss+xml', 'title' => 'RSS 2.0'];
$attribs = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = ['type' => 'application/atom+xml', 'title' => 'Atom 1.0'];
$attribs = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}

View File

@ -105,9 +105,6 @@ class UserController extends BaseController
$this->app->setUserState('users.login.form.data', []);
// Show a message when a user is logged in.
$this->app->enqueueMessage(Text::_('COM_USERS_FRONTEND_LOGIN_SUCCESS'), 'message');
$this->app->redirect(Route::_($this->app->getUserState('users.login.form.return'), false));
}

View File

@ -30,7 +30,6 @@ COM_USERS_FIELD_RESET_CONFIRM_USERNAME_LABEL="Username"
COM_USERS_FIELD_RESET_PASSWORD1_LABEL="Password"
COM_USERS_FIELD_RESET_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field."
COM_USERS_FIELD_RESET_PASSWORD2_LABEL="Confirm Password"
COM_USERS_FRONTEND_LOGIN_SUCCESS="You have been logged in."
COM_USERS_FRONTEND_LOGOUT_SUCCESS="You have been logged out."
COM_USERS_INVALID_EMAIL="Invalid email address"
COM_USERS_LBL_SELECT_INSTRUCTIONS="Please select how you would like to verify your login to this site."
@ -162,3 +161,6 @@ COM_USERS_PROFILE_OTEPS_WAIT_DESC="There are no emergency one time passwords gen
COM_USERS_PROFILE_TWOFACTOR_DESC="Select the two factor authentication method you want to use."
COM_USERS_PROFILE_TWOFACTOR_LABEL="Authentication Method"
COM_USERS_PROFILE_TWO_FACTOR_AUTH="Two Factor Authentication"
; Obsolete language strings since 4.3.0 -- Remove them in Joomla 5.0
COM_USERS_FRONTEND_LOGIN_SUCCESS="You have been logged in."

View File

@ -305,9 +305,9 @@ class CategoryView extends HtmlView
{
if ($this->params->get('show_feed_link', 1) == 1) {
$link = '&format=feed&limitstart=';
$attribs = ['type' => 'application/rss+xml', 'title' => 'RSS 2.0'];
$attribs = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
$attribs = ['type' => 'application/atom+xml', 'title' => 'Atom 1.0'];
$attribs = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->document->getTitle())];
$this->document->addHeadLink(Route::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
}

View File

@ -120,8 +120,6 @@
<exclude-pattern type="relative">libraries/src/Tree/ImmutableNodeTrait\.php</exclude-pattern>
<exclude-pattern type="relative">libraries/src/Updater/UpdateAdapter\.php</exclude-pattern>
<exclude-pattern type="relative">libraries/src/User/User\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/editors/tinymce/tinymce\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/system/cache/cache\.php</exclude-pattern>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
@ -236,11 +234,9 @@
<exclude-pattern type="relative">libraries/src/Updater/Update\.php</exclude-pattern>
<exclude-pattern type="relative">libraries/src/Updater/UpdateAdapter\.php</exclude-pattern>
<exclude-pattern type="relative">modules/mod_articles_category/src/Helper/ArticlesCategoryHelper\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/content/emailcloak/emailcloak\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/content/joomla/joomla\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/content/loadmodule/loadmodule\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/content/pagebreak/pagebreak\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/editors/none/none\.php</exclude-pattern>
<exclude-pattern type="relative">plugins/user/joomla/joomla\.php</exclude-pattern>
<exclude-pattern type="relative">tests/</exclude-pattern>
</rule>

View File

@ -16,7 +16,7 @@ use Joomla\CMS\Language\Text;
HTMLHelper::_('bootstrap.collapse');
?>
<nav class="navbar navbar-expand-md" aria-label="<?php echo htmlspecialchars($module->title, ENT_QUOTES, 'UTF-8'); ?>">
<nav class="navbar navbar-expand-lg" aria-label="<?php echo htmlspecialchars($module->title, ENT_QUOTES, 'UTF-8'); ?>">
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar<?php echo $module->id; ?>" aria-controls="navbar<?php echo $module->id; ?>" aria-expanded="false" aria-label="<?php echo Text::_('MOD_MENU_TOGGLE'); ?>">
<span class="icon-menu" aria-hidden="true"></span>
</button>