Skip to content

Commit

Permalink
Merge branch '5.1-dev' into fix-contacts-category-levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzo1987 committed Dec 28, 2023
2 parents 068251e + 9b943e3 commit 0d1b5f1
Show file tree
Hide file tree
Showing 55 changed files with 667 additions and 445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
/**
* Field to load a list of all users that have logged actions
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
class UserlogtypeField extends ListField
{
/**
* The form field type.
*
* @var string
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
protected $type = 'UserLogType';

Expand All @@ -39,7 +39,7 @@ class UserlogtypeField extends ListField
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public function getOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
$messageData['type'] = Text::_($messageData['type']);
}

// Remove links from the message template, if we should not generate links.
if (!$generateLinks) {
$message = preg_replace('/<a href=["\'].+?["\']>/', '', $message);
$message = str_replace('</a>', '', $message);
}

$linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE;

foreach ($messageData as $key => $value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ protected function sendNotificationEmails($messages, $username, $context)
$lang->load('com_actionlogs', JPATH_ADMINISTRATOR);
ActionlogsHelper::loadTranslationFiles($extension);
$temp = [];
$tempPlain = [];

foreach ($messages as $message) {
$m = [];
Expand All @@ -159,14 +160,23 @@ protected function sendNotificationEmails($messages, $username, $context)
$m['date'] = HTMLHelper::_('date', $message->log_date, 'Y-m-d H:i:s T', 'UTC');
$m['username'] = $username;
$temp[] = $m;

// copy replacement tags array and set non-HTML message.
$mPlain = array_merge([], $m);
$mPlain['message'] = ActionlogsHelper::getHumanReadableLogMessage($message, false);
$tempPlain[] = $mPlain;
}

$templateData = [
'messages' => $temp,
];
$templateDataPlain = [
'messages' => $tempPlain,
];

$mailer = new MailTemplate('com_actionlogs.notification', $app->getLanguage()->getTag());
$mailer->addTemplateData($templateData);
$mailer->addTemplateData($templateDataPlain, true);

foreach ($recipients as $recipient) {
$mailer->addRecipient($recipient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
return $result;
}

if ($this->element['extension']) {
$extension = (string) $this->element['extension'];
} else {
$extension = (string) Factory::getApplication()->getInput()->get('extension', 'com_content');
}

Factory::getApplication()->getLanguage()->load('com_categories', JPATH_ADMINISTRATOR);

$languages = LanguageHelper::getContentLanguages([0, 1], false);
Expand All @@ -79,6 +85,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
'view' => 'categories',
'layout' => 'modal',
'tmpl' => 'component',
'extension' => $extension,
Session::getFormToken() => 1,
]);
$linkItem = clone $linkItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<?php endif; ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo htmlspecialchars($item->editor); ?>
<?php echo empty($item->editor) ? $item->editor_user_id : htmlspecialchars($item->editor); ?>
</td>
<td class="text-end">
<?php echo number_format((int) $item->character_count, 0, Text::_('DECIMALS_SEPARATOR'), Text::_('THOUSANDS_SEPARATOR')); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ class HtmlView extends BaseHtmlView
*/
protected $reasonNoDownload = '';

/**
* Details on failed PHP or DB version requirements to be shown in the emptystate layout when there is no download
*
* @var \stdClass PHP and database requirements from the update manifest
*
* @since 4.4.2
*/
protected $detailsNoDownload;

/**
* List of non core critical plugins
*
Expand Down Expand Up @@ -199,8 +208,9 @@ public function display($tpl = null)
} else {
// No download available
if ($hasUpdate) {
$this->messagePrefix = '_NODOWNLOAD';
$this->reasonNoDownload = 'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON';
$this->messagePrefix = '_NODOWNLOAD';
$this->reasonNoDownload = 'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON';
$this->detailsNoDownload = $this->updateInfo['object']->get('otherUpdateInfo');
}

$this->setLayout('noupdate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,35 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Session\Session;

$uploadLink = 'index.php?option=com_joomlaupdate&view=upload';
$uploadLink = 'index.php?option=com_joomlaupdate&view=upload';
$reasonNoDownload = '';

if (!empty($this->reasonNoDownload)) {
$reasonNoDownload = Text::_($this->reasonNoDownload);

if (isset($this->detailsNoDownload->php)) {
$reasonNoDownload .= Text::sprintf(
'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_PHP',
$this->detailsNoDownload->php->used,
$this->detailsNoDownload->php->required
);
}

if (isset($this->detailsNoDownload->db)) {
$reasonNoDownload .= Text::sprintf(
'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_DATABASE',
Text::_('JLIB_DB_SERVER_TYPE_' . $this->detailsNoDownload->db->type),
$this->detailsNoDownload->db->used,
$this->detailsNoDownload->db->required
);
}

$reasonNoDownload .= Text::_('COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_ACTION');
}

$displayData = [
'textPrefix' => 'COM_JOOMLAUPDATE' . $this->messagePrefix,
'content' => Text::_($this->reasonNoDownload) . Text::sprintf($this->langKey, $this->updateSourceKey),
'content' => $reasonNoDownload . Text::sprintf($this->langKey, $this->updateSourceKey),
'formURL' => 'index.php?option=com_joomlaupdate&view=joomlaupdate',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Updating_from_an_existing_version',
'icon' => 'icon-loop joomlaupdate',
Expand Down
14 changes: 8 additions & 6 deletions administrator/components/com_users/tmpl/users/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,17 @@
<?php endif; ?>
</td>
<td class="text-center d-md-table-cell">
<?php
$activated = empty($item->activation) ? 0 : 1;
echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.activateStates'), $activated, $i, 'users.', (bool) $activated);
?>
<?php if (empty($item->activation)) : ?>
<span class="icon-check" aria-hidden="true" aria-describedby="tip-activated<?php echo $i; ?>"></span>
<div role="tooltip" id="tip-activated<?php echo $i; ?>">
<?php echo Text::_('COM_USERS_ACTIVATED'); ?>
</div>
<?php else : ?>
<?php echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.activateStates'), 1, $i, 'users.', true); ?>
<?php endif; ?>
</td>
<?php if ($mfa) : ?>
<td class="text-center d-none d-md-table-cell">
<span class="tbody-icon">
<?php if ($item->mfaRecords > 0 || !empty($item->otpKey)) : ?>
<span class="icon-check" aria-hidden="true" aria-describedby="tip-mfa<?php echo $i; ?>"></span>
<div role="tooltip" id="tip-mfa<?php echo $i; ?>">
Expand All @@ -165,7 +168,6 @@
<?php echo Text::_('COM_USERS_MFA_NOTACTIVE'); ?>
</div>
<?php endif; ?>
</span>
</td>
<?php endif; ?>
<td class="d-none d-md-table-cell">
Expand Down
5 changes: 4 additions & 1 deletion administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ COM_JOOMLAUPDATE_MINIMUM_STABILITY_STABLE="Stable"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_APPEND="Upload and Update"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_BUTTON_ADD="Retry check for update"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_CONTENT="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. Either the update to Joomla %1$s is not available for your stability level or there is a problem with the Joomla Update Server.<br>Please try to download the update package from <a href=\"https://downloads.joomla.org/latest\">the official Joomla download page</a> and use the Upload and Update function."
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON="An update to Joomla %1$s was found but your web server doesn't meet the <a href=\"https://downloads.joomla.org/technical-requirements\" target=\"_blank\" rel=\"noopener noreferrer\">minimum requirements</a>. Please contact your web host to update your server.<br>"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON="An update to Joomla %1$s was found but your web server doesn't meet the <a href=\"https://manual.joomla.org/docs/next/get-started/technical-requirements/\" target=\"_blank\" rel=\"noopener noreferrer\">minimum requirements</a>.<br>"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_ACTION="Please contact your web host to update your server.<br>"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_DATABASE="Your %1$s version \"%2$s\" is lower than \"%3$s\".<br>"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON_PHP="Your PHP version \"%1$s\" is lower than \"%2$s\".<br>"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_TITLE="This site can't be updated to Joomla %1$s"
COM_JOOMLAUPDATE_OVERVIEW="Joomla Update"
COM_JOOMLAUPDATE_PREUPDATE_CHECK_CAPTION="Server settings to check before update."
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>English (en-GB)</name>
<tag>en-GB</tag>
<version>5.1.0</version>
<creationDate>2023-11</creationDate>
<creationDate>2023-12</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/langmetadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<metafile client="administrator">
<name>English (en-GB)</name>
<version>5.1.0</version>
<creationDate>2023-11</creationDate>
<creationDate>2023-12</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/mod_menu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ MOD_MENU_HELP_SECURITY="Security Centre"
MOD_MENU_HELP_SHOP="Joomla! Shop"
MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum" ; Will be used if the localised sample data has a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module has a URL
MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM="Official Support Forum"
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM="Official Language Forums" ; If you have displayed the specific language forum, use something like "Official French Forum" in your language.
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM="Official Language Forums" ; If you have displayed the specific language forum, use something like 'Official French Forum' in your language.
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE="511" ; The # of the specific language forum in https://forum.joomla.org/ (example: 19 for French). Default is '511' which is the section for all languages forums.
MOD_MENU_HELP_TRANSLATIONS="Joomla! Translations"
MOD_MENU_HELP_USER_GROUPS="Joomla User Groups"
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_fields_imagelist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

PLG_FIELDS_IMAGELIST="Fields - Imagelist"
PLG_FIELDS_IMAGELIST_LABEL="List of Images (%s)"
PLG_FIELDS_IMAGELIST_PARAMS_DIRECTORY_DESC="This directory is relative to \"images\" directory in Joomla! root." ; Don't translate "images"
PLG_FIELDS_IMAGELIST_PARAMS_DIRECTORY_DESC="This directory is relative to \"images\" directory in Joomla! root." ; Don't translate 'images'
PLG_FIELDS_IMAGELIST_PARAMS_DIRECTORY_LABEL="Directory"
PLG_FIELDS_IMAGELIST_PARAMS_IMAGE_CLASS_LABEL="Image Class"
PLG_FIELDS_IMAGELIST_PARAMS_MULTIPLE_LABEL="Multiple"
Expand Down
4 changes: 2 additions & 2 deletions administrator/manifests/files/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>5.1.0-alpha2-dev</version>
<creationDate>2023-11</creationDate>
<version>5.1.0-alpha3-dev</version>
<creationDate>2023-12</creationDate>
<description>FILES_JOOMLA_XML_DESCRIPTION</description>

<scriptfile>administrator/components/com_admin/script.php</scriptfile>
Expand Down
2 changes: 1 addition & 1 deletion administrator/manifests/packages/pkg_en-GB.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>English (en-GB) Language Pack</name>
<packagename>en-GB</packagename>
<version>5.1.0.1</version>
<creationDate>2023-11</creationDate>
<creationDate>2023-12</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
31 changes: 11 additions & 20 deletions administrator/modules/mod_multilangstatus/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

Expand All @@ -20,29 +19,21 @@
return;
}

$modalHTML = HTMLHelper::_(
'bootstrap.renderModal',
'multiLangModal',
[
'title' => Text::_('MOD_MULTILANGSTATUS'),
'url' => Route::_('index.php?option=com_languages&view=multilangstatus&tmpl=component'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">' . Text::_('JTOOLBAR_CLOSE') . '</button>',
]
);

$app->getDocument()->getWebAssetManager()
->registerAndUseScript('mod_multilangstatus.admin', 'mod_multilangstatus/admin-multilangstatus.min.js', [], ['type' => 'module', 'defer' => true]);
$app->getDocument()->getWebAssetManager()->useScript('joomla.dialog-autocreate');

$popupOptions = [
'popupType' => 'iframe',
'src' => Route::_('index.php?option=com_languages&view=multilangstatus&tmpl=component', false),
'textHeader' => Text::_('MOD_MULTILANGSTATUS'),
];

?>
<a data-bs-target="#multiLangModal" class="header-item-content multilanguage" title="<?php echo Text::_('MOD_MULTILANGSTATUS'); ?>" data-bs-toggle="modal" role="button">
<button type="button" class="header-item-content multilanguage" title="<?php echo htmlspecialchars(Text::_('MOD_MULTILANGSTATUS')); ?>"
data-joomla-dialog="<?php echo htmlspecialchars(json_encode($popupOptions, JSON_UNESCAPED_SLASHES)) ?>">
<div class="header-item-icon">
<span class="icon-language" aria-hidden="true"></span>
</div>
<div class="header-item-text">
<?php echo Text::_('MOD_MULTILANGSTATUS'); ?>
</div>
</a>
<?php echo $modalHTML; ?>
</button>
2 changes: 1 addition & 1 deletion api/language/en-GB/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>English (en-GB)</name>
<tag>en-GB</tag>
<version>5.1.0</version>
<creationDate>2023-11</creationDate>
<creationDate>2023-12</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
2 changes: 1 addition & 1 deletion api/language/en-GB/langmetadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<metafile client="api">
<name>English (en-GB)</name>
<version>5.1.0</version>
<creationDate>2023-11</creationDate>
<creationDate>2023-12</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
8 changes: 6 additions & 2 deletions build/media_source/com_finder/js/finder.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@
try {
response = JSON.parse(xhr.responseText);
} catch (e) {
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr, 'parsererror'));
// Something went wrong, but we are not going to bother the enduser with this
// eslint-disable-next-line no-console
console.error(e);
return;
}

if (Object.prototype.toString.call(response.suggestions) === '[object Array]') {
target.awesomplete.list = response.suggestions;
}
}).catch((xhr) => {
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr));
// Something went wrong, but we are not going to bother the enduser with this
// eslint-disable-next-line no-console
console.error(xhr);
});
}
};
Expand Down

This file was deleted.

0 comments on commit 0d1b5f1

Please sign in to comment.