Skip to content

Commit

Permalink
Merge branch '5.1-dev' into mod_latestactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Feb 29, 2024
2 parents 7da60c4 + e3000bb commit 25ce97b
Show file tree
Hide file tree
Showing 58 changed files with 253 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class BannersHelper extends ContentHelper
*/
public static function updateReset()
{
$db = Factory::getDbo();
$date = Factory::getDate();
$app = Factory::getApplication();
$user = $app->getIdentity();
$db = Factory::getDbo();
$nowDate = Factory::getDate()->toSql();
$app = Factory::getApplication();
$user = $app->getIdentity();

$query = $db->getQuery(true)
->select('*')
Expand All @@ -52,7 +52,7 @@ public static function updateReset()
$db->quoteName('reset') . ' IS NOT NULL',
]
)
->bind(':date', $date)
->bind(':date', $nowDate)
->extendWhere(
'AND',
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_CACHE_SETTINGS');
$this->description = '';
$this->fieldsname = 'cache';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_COOKIE_SETTINGS');
$this->description = '';
$this->fieldsname = 'cookie';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_DATABASE_SETTINGS');
$this->description = '';
$this->fieldsname = 'database';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_DEBUG_SETTINGS');
$this->description = '';
$this->fieldsname = 'debug';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_TEXT_FILTER_SETTINGS');
$this->description = '';
$this->fieldsname = 'filters';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_LOCATION_SETTINGS');
$this->description = '';
$this->fieldsname = 'locale';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_LOGGING_SETTINGS');
$this->description = '';
$this->fieldsname = 'logging';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_LOGGING_CUSTOM_SETTINGS');
$this->description = '';
$this->fieldsname = 'logging_custom';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$ajaxUri = Route::_('index.php?option=com_config&task=application.sendtestmail&format=json');

$this->name = Text::_('COM_CONFIG_MAIL_SETTINGS');
$this->description = '';
$this->fieldsname = 'mail';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_METADATA_SETTINGS');
$this->description = '';
$this->fieldsname = 'metadata';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_PROXY_SETTINGS');
$this->description = '';
$this->fieldsname = 'proxy';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_SEO_SETTINGS');
$this->description = Text::_('COM_CONFIG_SEO_SETTINGS_DESC');
$this->fieldsname = 'seo';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_SERVER_SETTINGS');
$this->description = '';
$this->fieldsname = 'server';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_SESSION_SETTINGS');
$this->description = '';
$this->fieldsname = 'session';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_SITE_SETTINGS');
$this->description = '';
$this->fieldsname = 'site';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die;

$this->name = Text::_('COM_CONFIG_WEBSERVICES_SETTINGS');
$this->description = '';
$this->fieldsname = 'webservices';
$this->formclass = 'options-form';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

// phpcs:disable PSR1.Files.SideEffects
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_users/src/Helper/Mfa.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Users\Administrator\Helper;

use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Document\HtmlDocument;
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ COM_CONFIG_SENDMAIL_METHOD_SMTP="SMTP"
COM_CONFIG_SENDMAIL_SUBJECT="Test mail from {SITENAME}"
COM_CONFIG_SENDMAIL_SUCCESS="The email was sent to <strong>%s</strong> using <strong>%s</strong>. You should check that you've received the test email."
COM_CONFIG_SENDMAIL_SUCCESS_FALLBACK="The email was sent to <strong>%s</strong> but using <strong>%s</strong> as fallback. You should check that you've received the test email."
COM_CONFIG_SEO_SETTINGS_DESC="Additional settings can be found in the \"System - SEF\" plugin."
COM_CONFIG_SEO_SETTINGS="SEO"
COM_CONFIG_SERVER="Server"
COM_CONFIG_SERVER_SETTINGS="Server"
Expand Down
5 changes: 5 additions & 0 deletions administrator/language/en-GB/plg_system_sef.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@

PLG_SEF_DOMAIN_DESCRIPTION="If your site can be accessed through more than one domain enter the preferred (sometimes referred to as canonical) domain here. <br><strong>Note:</strong> https://example.com and https://www.example.com are different domains."
PLG_SEF_DOMAIN_LABEL="Site Domain"
PLG_SEF_TRAILINGSLASH_DESCRIPTION="Force Joomla to only use URLs with or without trailing slash. When set, this will force the right URL with redirects and is only applied when 'Add suffix to URL' is disabled."
PLG_SEF_TRAILINGSLASH_LABEL="Trailing slash for URLs"
PLG_SEF_TRAILINGSLASH_OPTION_NONE="No change"
PLG_SEF_TRAILINGSLASH_OPTION_NO_SLASH="Enforce URLs without trailing slash"
PLG_SEF_TRAILINGSLASH_OPTION_SLASH="Enforce URLs with trailing slash"
PLG_SEF_XML_DESCRIPTION="Adds SEF support to links in the document. It operates directly on the HTML and does not require a special tag."
PLG_SYSTEM_SEF="System - SEF"
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function getUnreadMessagesCount(Registry $params, AdministratorApplicatio

return \count($messages);
} catch (\RuntimeException $e) {
$messages = [];

// Still render the error message from the Exception object
$app->enqueueMessage($e->getMessage(), 'error');

return 0;
}
}
}
2 changes: 0 additions & 2 deletions components/com_contact/tmpl/contact/default_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

?>
<div class="com-contact__links contact-links">
<ul class="list-unstyled">
Expand Down
4 changes: 4 additions & 0 deletions components/com_content/tmpl/category/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?> </div>
<?php endif; ?>
<?php // Code to add a link to submit an article. ?>
<?php if ($this->category->getParams()->get('access-create')) : ?>
<?php echo HTMLHelper::_('contenticon.create', $this->category, $this->category->params); ?>
<?php endif; ?>
<?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="com-content-category-blog__navigation w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
Expand Down
6 changes: 5 additions & 1 deletion layouts/joomla/content/options_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Text;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
Expand All @@ -21,7 +22,10 @@
<fieldset class="<?php echo !empty($displayData->formclass) ? $displayData->formclass : ''; ?>">
<legend><?php echo $displayData->name; ?></legend>
<?php if (!empty($displayData->description)) : ?>
<p><?php echo $displayData->description; ?></p>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo $displayData->description; ?>
</div>
<?php endif; ?>
<?php $fieldsnames = explode(',', $displayData->fieldsname); ?>
<div class="form-grid">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\Access\Exception\AuthenticationFailed;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\MVC\Controller\Exception\CheckinCheckout;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;

// phpcs:disable PSR1.Files.SideEffects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\Router\Exception\RouteNotFoundException;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\Application\Exception\NotAcceptable;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Error/JsonApi/NotAllowedExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\MVC\Controller\Exception\ResourceNotFound;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Error/JsonApi/SaveExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\MVC\Controller\Exception\Save;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Error/JsonApi/SendEmailExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Error\JsonApi;

use Exception;
use Joomla\CMS\MVC\Controller\Exception\SendEmail;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Event/Result/ResultAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Event\Result;

use BadMethodCallException;
use Joomla\Event\Event as BaseEvent;

// phpcs:disable PSR1.Files.SideEffects
Expand Down
2 changes: 0 additions & 2 deletions libraries/src/Event/Table/AfterMoveEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace Joomla\CMS\Event\Table;

use stdClass;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Form/Field/CalendarField.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace Joomla\CMS\Form\Field;

use DateTime;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;
Expand Down
55 changes: 55 additions & 0 deletions libraries/src/Form/Rule/RegexRule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/**
* Joomla! Content Management System
*
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Form\Rule;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Form Rule class for the Joomla Platform.
*
* @since __DEPLOY_VERSION__
*/
class RegexRule extends FormRule
{
/**
* Method to test the value.
*
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
* @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form.
* @param ?Form $form The form object for which the field is being tested.
*
* @return boolean True if the value is valid, false otherwise.
*
* @since __DEPLOY_VERSION__
* @throws \UnexpectedValueException if rule is invalid.
*/
public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null)
{
if ((string) $element['validate_regex']) {
$this->regex = (string) $element['validate_regex'];
}

if ((string) $element['validate_modifier']) {
$this->modifiers = (string) $element['validate_modifier'];
}

return parent::test($element, $value, $group, $input, $form);
}
}

0 comments on commit 25ce97b

Please sign in to comment.