29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-29 16:43:42 +00:00

Merge remote-tracking branch 'Joomla/4.0-dev' into icon-

This commit is contained in:
Troy T. Hall 2020-06-01 11:03:57 -05:00
commit 3c7b0bd57b
121 changed files with 1201 additions and 1107 deletions

View File

@ -37,35 +37,6 @@ steps:
commands:
- npm ci --unsafe-perm
- name: publish-diff
image: joomlaprojects/docker-images:patchtester
failure: ignore
depends_on: [ npm ]
environment:
CMP_ARCHIVE_NAME: "build"
CMP_MASTER_FOLDER: "/reference"
CMP_SLAVE_FOLDER: "." # The directory the current repo is in
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
BRANCH_NAME: "4.0-dev" # Current branch to check against (from repo joomla/joomla-cms)
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
commands:
- export PULL_ID=$DRONE_PULL_REQUEST
- /bin/compare.sh
volumes:
- name: reference
path: /reference
when:
branch:
- 4.0-dev
- name: rebuild-cache
image: drillster/drone-volume-cache
depends_on: [ npm ]
@ -339,6 +310,6 @@ steps:
---
kind: signature
hmac: 96e2fc482e327ef648d7632eb06048ece16cf3a04e27c30dd4ff4a1dc2236a8d
hmac: 9bb74c784835b3ef017189b6f407cf7750d3f38464d42006da76999b62b41277
...

View File

@ -42,27 +42,27 @@ HTMLHelper::_('script', 'com_actionlogs/admin-actionlogs-default.js', ['relative
</caption>
<thead>
<tr>
<td width="1%" class="text-center">
<td class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<th scope="col" class="d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ACTIONLOGS_ACTION', 'a.message', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="15%" class="d-none d-md-table-cell">
<th scope="col" class="w-15 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ACTIONLOGS_EXTENSION', 'a.extension', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="15%" class="d-none d-md-table-cell">
<th scope="col" class="w-15 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ACTIONLOGS_DATE', 'a.log_date', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="10%" class="d-md-table-cell">
<th scope="col" class="w-10 d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ACTIONLOGS_NAME', 'a.user_id', $listDirn, $listOrder); ?>
</th>
<?php if ($this->showIpColumn) : ?>
<th scope="col" width="10%" class="d-none d-md-table-cell">
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ACTIONLOGS_IP_ADDRESS', 'a.ip_address', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th scope="col" width="1%" class="d-none d-md-table-cell">
<th scope="col" class="w-1 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>

View File

@ -0,0 +1,8 @@
INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_users.massmail.mail', '', 'COM_USERS_MASSMAIL_MAIL_SUBJECT', 'COM_USERS_MASSMAIL_MAIL_BODY', '', '', '{"tags":["subject","body","subjectprefix","bodysuffix"]}'),
('com_users.password_reset', '', 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', '', '', '{"tags":["name","email","sitename","link_text","link_html","token"]}'),
('com_users.reminder', '', 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', '', '', '{"tags":["name","username","sitename","email","link_text","link_html"]}'),
('plg_system_updatenotification.mail', '', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}'),
('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}');

View File

@ -0,0 +1,8 @@
INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_users.massmail.mail', '', 'COM_USERS_MASSMAIL_MAIL_SUBJECT', 'COM_USERS_MASSMAIL_MAIL_BODY', '', '', '{"tags":["subject","body","subjectprefix","bodysuffix"]}'),
('com_users.password_reset', '', 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', '', '', '{"tags":["name","email","sitename","link_text","link_html","token"]}'),
('com_users.reminder', '', 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', '', '', '{"tags":["name","username","sitename","email","link_text","link_html"]}'),
('plg_system_updatenotification.mail', '', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}'),
('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}');

View File

@ -1,13 +1,13 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
* @subpackage com_categories
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Administrator\Field;
namespace Joomla\Component\Categories\Administrator\Field;
defined('_JEXEC') or die;

View File

@ -196,13 +196,13 @@ if ($saveOrder && !empty($this->items))
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<span class="small" title="<?php echo $this->escape($item->path); ?>">
<div class="small" title="<?php echo $this->escape($item->path); ?>">
<?php if (empty($item->note)) : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
</th>
<?php if (isset($this->items[0]) && property_exists($this->items[0], 'count_published')) : ?>
<td class="text-center btns d-none d-md-table-cell itemnumber">

View File

@ -12,7 +12,8 @@
type="ComponentsCategory"
label="COM_CATEGORIES_CHOOSE_COMPONENT_LABEL"
required="true"
>
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
>
<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
</field>
</fieldset>

View File

@ -108,13 +108,13 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php echo LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
<a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->title)); ?>', null, '<?php echo $this->escape(RouteHelper::getCategoryRoute($item->id, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);">
<?php echo $this->escape($item->title); ?></a>
<span class="small" title="<?php echo $this->escape($item->path); ?>">
<div class="small" title="<?php echo $this->escape($item->path); ?>">
<?php if (empty($item->note)) : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
</th>
<td class="small d-none d-md-table-cell">
<?php echo $this->escape($item->access_level); ?>

View File

@ -12,6 +12,7 @@
type="ComponentsCategory"
label="COM_CATEGORIES_CHOOSE_COMPONENT_LABEL"
required="true"
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
>
<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
</field>

View File

@ -270,13 +270,13 @@ HTMLHelper::_('script', 'com_content/admin-articles-workflow-buttons.js', ['rela
<?php else : ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>"><?php echo $this->escape($item->title); ?></span>
<?php endif; ?>
<span class="small break-word">
<div class="small break-word">
<?php if (empty($item->note)) : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
<div class="small">
<?php
$ParentCatUrl = Route::_('index.php?option=com_categories&task=category.edit&id=' . $item->parent_category_id . '&extension=com_content');

View File

@ -256,13 +256,13 @@ HTMLHelper::_('script', 'com_content/admin-articles-workflow-buttons.js', ['rela
<?php else : ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>"><?php echo $this->escape($item->title); ?></span>
<?php endif; ?>
<span class="small break-word">
<div class="small break-word">
<?php if (empty($item->note)) : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
</div>
<div class="small">
<?php
$ParentCatUrl = Route::_('index.php?option=com_categories&task=category.edit&id=' . $item->parent_category_id . '&extension=com_content');

View File

@ -1,31 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
* @subpackage com_fields
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Administrator\Field;
namespace Joomla\Component\Fields\Administrator\Field;
defined('_JEXEC') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
FormHelper::loadFieldClass('list');
/**
* Components Fieldgroup field.
*
* @since 1.6
*/
class ComponentsFieldgroupField extends \JFormFieldList
class ComponentsFieldgroupField extends ListField
{
/**
* The form field type.

View File

@ -1,31 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
* @subpackage com_fields
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Administrator\Field;
namespace Joomla\Component\Fields\Administrator\Field;
defined('_JEXEC') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
FormHelper::loadFieldClass('list');
/**
* Components Fields field.
*
* @since 1.6
*/
class ComponentsFieldsField extends \JFormFieldList
class ComponentsFieldsField extends ListField
{
/**
* The form field type.

View File

@ -218,12 +218,8 @@ class FieldModel extends AdminModel
if (is_object($oldParams) && is_object($newParams) && $oldParams != $newParams)
{
$names = array();
foreach ($newParams as $param)
{
$names[] = $db->quote($param['value']);
}
// Get new values.
$names = array_column((array) $newParams, 'value');
$fieldId = (int) $field->id;
$query = $db->getQuery(true);

View File

@ -9,9 +9,10 @@
<fields name="request">
<field
name="extension"
type="componentsfields"
type="ComponentsFields"
label="COM_FIELDS_CHOOSE_CONTEXT_LABEL"
required="true"
addfieldprefix="Joomla\Component\Fields\Administrator\Field"
>
<option value="">COM_MENUS_OPTION_SELECT_CONTEXT</option>
</field>

View File

@ -9,9 +9,10 @@
<fields name="request">
<field
name="extension"
type="componentsfieldgroup"
type="ComponentsFieldgroup"
label="COM_FIELDS_CHOOSE_CONTEXT_LABEL"
required="true"
addfieldprefix="Joomla\Component\Fields\Administrator\Field"
>
<option value="">COM_MENUS_OPTION_SELECT_CONTEXT</option>
</field>

View File

@ -60,7 +60,7 @@
</field>
<field
name="logging_enabled"
name="gather_search_statistics"
type="radio"
label="COM_FINDER_CONFIG_GATHER_SEARCH_STATISTICS_LABEL"
layout="joomla.form.field.radio.switcher"

View File

@ -92,7 +92,7 @@ class HtmlView extends BaseHtmlView
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->enabled = $this->state->params->get('logging_enabled');
$this->enabled = $this->state->params->get('gather_search_statistics', 0);
$this->canDo = ContentHelper::getActions('com_finder');
// Check for errors.

View File

@ -89,6 +89,6 @@ class DiscoverController extends BaseController
$model = $this->getModel('Discover');
echo new JsonResponse(count($model->getItems()));
echo new JsonResponse($model->getTotal());
}
}

View File

@ -220,6 +220,6 @@ class UpdateController extends BaseController
$model = $this->getModel('Update');
echo new JsonResponse(count($model->getItems()));
echo new JsonResponse($model->getTotal());
}
}

View File

@ -135,7 +135,7 @@ class InstallerHelper
?string $folder = null
): ?SimpleXMLElement
{
$path = $clientId ? JPATH_ADMINISTRATOR : JPATH_ROOT;
$path = [0 => JPATH_SITE, 1 => JPATH_ADMINISTRATOR, 3 => JPATH_API][$clientId] ?? JPATH_SITE;
switch ($type)
{
@ -159,6 +159,9 @@ class InstallerHelper
break;
case 'package':
$path = JPATH_ADMINISTRATOR . '/manifests/packages/' . $element . '.xml';
break;
case 'language':
$path .= '/language/' . $element . '/install.xml';
}
if (file_exists($path) === false)

View File

@ -169,7 +169,7 @@ class InstallerModel extends ListModel
}
$item->author_info = @$item->authorEmail . '<br>' . @$item->authorUrl;
$item->client = Text::_([0 => 'JSITE', 1 => 'JADMINISTRATOR', 3 => 'JAPI'][$item->client_id]);
$item->client = Text::_([0 => 'JSITE', 1 => 'JADMINISTRATOR', 3 => 'JAPI'][$item->client_id] ?? 'JSITE');
$item->client_translated = $item->client;
$item->type_translated = Text::_('COM_INSTALLER_TYPE_' . strtoupper($item->type));
$item->folder_translated = @$item->folder ? $item->folder : Text::_('COM_INSTALLER_TYPE_NONAPPLICABLE');

View File

@ -199,7 +199,7 @@ class UpdateModel extends ListModel
{
foreach ($items as &$item)
{
$item->client_translated = $item->client_id ? Text::_('JADMINISTRATOR') : Text::_('JSITE');
$item->client_translated = Text::_([0 => 'JSITE', 1 => 'JADMINISTRATOR', 3 => 'JAPI'][$item->client_id] ?? 'JSITE');
$manifest = json_decode($item->manifest_cache);
$item->current_version = $manifest->version ?? Text::_('JLIB_UNKNOWN');
$item->description = $manifest->description ?? Text::_('COM_INSTALLER_MSG_UPDATE_NODESC');

View File

@ -87,6 +87,7 @@ class HtmlView extends BaseHtmlView
$fields = array('subject', 'body', 'htmlbody');
$this->templateData = array();
$language = Factory::getLanguage();
$language->load($component, JPATH_SITE, $this->item->language, true);
$language->load($component, JPATH_ADMINISTRATOR, $this->item->language, true);
foreach ($fields as $field)

View File

@ -28,6 +28,7 @@ $this->useCoreUI = true;
$input = $app->input;
list($component, $sub_id) = explode('.', $this->master->template_id, 2);
$sub_id = str_replace('.', '_', $sub_id);
$doc->addScriptOptions('com_mails', ['templateData' => $this->templateData]);
@ -52,6 +53,7 @@ $doc->addScriptOptions('com_mails', ['templateData' => $this->templateData]);
<?php echo $this->form->renderField('subject'); ?>
</div>
<div class="col-md-3">
<?php echo $this->form->getField('subject_switcher')->label; ?>
<?php echo $this->form->getField('subject_switcher')->input; ?>
</div>
</div>
@ -62,6 +64,7 @@ $doc->addScriptOptions('com_mails', ['templateData' => $this->templateData]);
<?php echo $this->form->renderField('body'); ?>
</div>
<div class="col-md-3">
<?php echo $this->form->getField('body_switcher')->label; ?>
<?php echo $this->form->getField('body_switcher')->input; ?>
<div class="tags-container-body <?php echo $fieldBody->disabled ? 'hidden' : ''; ?>">
<h2><?php echo Text::_('COM_MAILS_FIELDSET_TAGS_LABEL'); ?></h2>
@ -77,6 +80,7 @@ $doc->addScriptOptions('com_mails', ['templateData' => $this->templateData]);
<?php echo $this->form->renderField('htmlbody'); ?>
</div>
<div class="col-md-3">
<?php echo $this->form->getField('htmlbody_switcher')->label; ?>
<?php echo $this->form->getField('htmlbody_switcher')->input; ?>
<div class="tags-container-htmlbody <?php echo $fieldHtmlBody->disabled ? 'hidden' : ''; ?>">
<h2><?php echo Text::_('COM_MAILS_FIELDSET_TAGS_LABEL'); ?></h2>

View File

@ -59,6 +59,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<tbody>
<?php foreach ($this->items as $i => $item) :
list($component, $sub_id) = explode('.', $item->template_id, 2);
$sub_id = str_replace('.', '_', $sub_id);
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="break-word">

View File

@ -8,7 +8,9 @@
<div :class="{'input-group': extension.length}">
<input id="name" class="form-control" type="text" :placeholder="translate('COM_MEDIA_NAME')"
:value="name" required autocomplete="off" ref="nameField">
<span class="input-group-addon" v-if="extension.length">{{extension }}</span>
<span class="input-group-append" v-if="extension.length">
<span class="input-group-text">{{extension }}</span>
</span>
</div>
</div>
</form>

View File

@ -95,6 +95,7 @@
height: calc(#{$grid-item-icon-size} * 1.3);
font-family: "Font Awesome 5 Free";
font-size: $grid-item-icon-size;
font-weight: 900;
line-height: calc(#{$grid-item-icon-size} * 1.3);
text-align: center;
content: "\f00c";

View File

@ -228,16 +228,24 @@ class ApiModel extends BaseDatabaseModel
throw new FileExistsException;
}
$object = $this->triggerEvent(
$adapter,
$name,
$path,
0,
function ($object)
{
$object->name = $this->getAdapter($object->adapter)->createFolder($object->name, $object->path);
}
);
$app = Factory::getApplication();
$object = new CMSObject;
$object->adapter = $adapter;
$object->name = $name;
$object->path = $path;
PluginHelper::importPlugin('content');
$result = $app->triggerEvent('onContentBeforeSave', ['com_media.folder', $object, true, $object]);
if (in_array(false, $result, true))
{
throw new \Exception($object->getError());
}
$object->name = $this->getAdapter($object->adapter)->createFolder($object->name, $object->path);
$app->triggerEvent('onContentAfterSave', ['com_media.folder', $object, true, $object]);
return $object->name;
}
@ -281,16 +289,29 @@ class ApiModel extends BaseDatabaseModel
throw new InvalidPathException;
}
$object = $this->triggerEvent(
$adapter,
$name,
$path,
$data,
function ($object)
{
$object->name = $this->getAdapter($object->adapter)->createFile($object->name, $object->path, $object->data);
}
);
$app = Factory::getApplication();
$object = new CMSObject;
$object->adapter = $adapter;
$object->name = $name;
$object->path = $path;
$object->data = $data;
$object->extension = strtolower(File::getExt($name));
PluginHelper::importPlugin('content');
// Also include the filesystem plugins, perhaps they support batch processing too
PluginHelper::importPlugin('media-action');
$result = $app->triggerEvent('onContentBeforeSave', ['com_media.file', $object, true, $object]);
if (in_array(false, $result, true))
{
throw new \Exception($object->getError());
}
$object->name = $this->getAdapter($object->adapter)->createFile($object->name, $object->path, $object->data);
$app->triggerEvent('onContentAfterSave', ['com_media.file', $object, true, $object]);
return $object->name;
}
@ -318,16 +339,29 @@ class ApiModel extends BaseDatabaseModel
throw new InvalidPathException;
}
$this->triggerEvent(
$adapter,
$name,
$path,
$data,
function ($object)
{
$this->getAdapter($object->adapter)->updateFile($object->name, $object->path, $object->data);
}
);
$app = Factory::getApplication();
$object = new CMSObject;
$object->adapter = $adapter;
$object->name = $name;
$object->path = $path;
$object->data = $data;
$object->extension = strtolower(File::getExt($name));
PluginHelper::importPlugin('content');
// Also include the filesystem plugins, perhaps they support batch processing too
PluginHelper::importPlugin('media-action');
$result = $app->triggerEvent('onContentBeforeSave', ['com_media.file', $object, false, $object]);
if (in_array(false, $result, true))
{
throw new \Exception($object->getError());
}
$this->getAdapter($object->adapter)->updateFile($object->name, $object->path, $object->data);
$app->triggerEvent('onContentAfterSave', ['com_media.file', $object, false, $object]);
}
/**
@ -353,7 +387,24 @@ class ApiModel extends BaseDatabaseModel
throw new InvalidPathException;
}
$this->getAdapter($adapter)->delete($path);
$type = $file->type === 'file' ? 'file' : 'folder';
$app = Factory::getApplication();
$object = new CMSObject;
$object->adapter = $adapter;
$object->path = $path;
PluginHelper::importPlugin('content');
$result = $app->triggerEvent('onContentBeforeDelete', ['com_media.' . $type, $object]);
if (in_array(false, $result, true))
{
throw new \Exception($object->getError());
}
$this->getAdapter($object->adapter)->delete($object->path);
$app->triggerEvent('onContentAfterDelete', ['com_media.' . $type, $object]);
}
/**
@ -494,52 +545,4 @@ class ApiModel extends BaseDatabaseModel
// Check if the extension exists in the allowed extensions
return in_array($extension, $this->allowedExtensions);
}
/**
* Triggers the onContentBeforeSave and onContentAfterSave event when calling the
* given callable.
*
* If the onContentBeforeSave contains false, the operation will be aborted and an exception thrown.
*
* The object will be returned which got sent as part of the event.
*
* @param string $adapter The adapter
* @param string $name The name
* @param string $path The path
* @param binary $data The binary data
* @param callable $callback The callback
*
* @return CMSObject
*
* @throws \Exception
* @since 4.0.0
*/
private function triggerEvent(string $adapter, string $name, string $path, $data, callable $callback)
{
$app = Factory::getApplication();
$object = new CMSObject;
$object->adapter = $adapter;
$object->name = $name;
$object->path = $path;
$object->data = $data;
$object->extension = strtolower(File::getExt($name));
$object->type = $object->extension ? 'file' : 'dir';
// Also include the filesystem plugins, perhaps they support batch processing too
PluginHelper::importPlugin('media-action');
$result = $app->triggerEvent('onContentBeforeSave', ['com_media.' . $object->type, $object, true]);
if (in_array(false, $result, true))
{
throw new \Exception($object->getError());
}
$callback($object);
$app->triggerEvent('onContentAfterSave', ['com_media.' . $object->type, $object, true]);
return $object;
}
}

View File

@ -142,7 +142,7 @@ if (!empty($editor))
<td class="text-center d-none d-md-table-cell">
<?php if ($item->type == 'component') : ?>
<?php if ($item->language == '*' || $item->home == '0') : ?>
<?php echo HTMLHelper::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && 0); ?>
<?php echo HTMLHelper::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && false && !$item->protected, 'cb', null, 'home', 'circle'); ?>
<?php else : ?>
<?php if ($item->language_image) : ?>
<?php echo HTMLHelper::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?>

View File

@ -35,8 +35,9 @@
<field
name="header_class"
type="text"
type="textarea"
label="COM_MODULES_FIELD_HEADER_CLASS_LABEL"
rows="3"
/>
</fieldset>
</fields>

View File

@ -75,7 +75,7 @@ if ($saveOrder && !empty($this->items))
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'l.title', $listDirn, $listOrder); ?>
</th>
<?php elseif ($clientId === 1 && ModuleHelper::isAdminMultilang()) : ?>
<th scope="col" width="10%" class="d-none d-md-table-cell">
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>

View File

@ -18,6 +18,7 @@ use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\Component\Postinstall\Administrator\Helper\PostinstallHelper;
use Joomla\Database\ParameterType;
/**
* Model class to manage postinstall messages
@ -38,27 +39,30 @@ class MessagesModel extends BaseDatabaseModel
public function getItem($id)
{
$db = $this->getDbo();
$id = (int) $id;
$query = $db->getQuery(true);
$query->select(
$db->quoteName(
array
('postinstall_message_id',
'extension_id',
'title_key',
'description_key',
'action_key',
'language_extension',
'language_client_id',
'type',
'action_file',
'action',
'condition_file',
'condition_method',
'version_introduced',
'enabled')
)
)->from($db->quoteName('#__postinstall_messages'))->where($db->quoteName('postinstall_message_id') . ' = ' . $db->quote($id));
[
$db->quoteName('postinstall_message_id'),
$db->quoteName('extension_id'),
$db->quoteName('title_key'),
$db->quoteName('description_key'),
$db->quoteName('action_key'),
$db->quoteName('language_extension'),
$db->quoteName('language_client_id'),
$db->quoteName('type'),
$db->quoteName('action_file'),
$db->quoteName('action'),
$db->quoteName('condition_file'),
$db->quoteName('condition_method'),
$db->quoteName('version_introduced'),
$db->quoteName('enabled'),
]
)
->from($db->quoteName('#__postinstall_messages'))
->where($db->quoteName('postinstall_message_id') . ' = :id')
->bind(':id', $id, ParameterType::INTEGER);
$db->setQuery($query);
@ -77,10 +81,14 @@ class MessagesModel extends BaseDatabaseModel
public function unpublishMessage($id)
{
$db = $this->getDbo();
$id = (int) $id;
$query = $db->getQuery(true);
$query->update($db->quoteName('#__postinstall_messages'))
->set($db->quoteName('enabled') . ' = ' . $db->quote(0))->where($db->quoteName('postinstall_message_id') . ' = ' . $db->quote($id));
$query
->update($db->quoteName('#__postinstall_messages'))
->set($db->quoteName('enabled') . ' = 0')
->where($db->quoteName('postinstall_message_id') . ' = :id')
->bind(':id', $id, ParameterType::INTEGER);
$db->setQuery($query);
$db->execute();
}
@ -99,34 +107,34 @@ class MessagesModel extends BaseDatabaseModel
$query = $db->getQuery(true);
$query->select(
$db->quoteName(
array
('postinstall_message_id',
'extension_id',
'title_key',
'description_key',
'action_key',
'language_extension',
'language_client_id',
'type',
'action_file',
'action',
'condition_file',
'condition_method',
'version_introduced',
'enabled')
)
);
[
$db->quoteName('postinstall_message_id'),
$db->quoteName('extension_id'),
$db->quoteName('title_key'),
$db->quoteName('description_key'),
$db->quoteName('action_key'),
$db->quoteName('language_extension'),
$db->quoteName('language_client_id'),
$db->quoteName('type'),
$db->quoteName('action_file'),
$db->quoteName('action'),
$db->quoteName('condition_file'),
$db->quoteName('condition_method'),
$db->quoteName('version_introduced'),
$db->quoteName('enabled'),
]
)
->from($db->quoteName('#__postinstall_messages'));
// Add a forced extension filtering to the list
$eid = $this->getState('eid', $this->getJoomlaFilesExtensionId());
$query->where($db->quoteName('extension_id') . ' = ' . $db->quote($eid));
$eid = (int) $this->getState('eid', $this->getJoomlaFilesExtensionId());
$query->where($db->quoteName('extension_id') . ' = :eid')
->bind(':eid', $eid, ParameterType::INTEGER);
// Force filter only enabled messages
$published = $this->getState('published', 1);
$query->where($db->quoteName('enabled') . ' = ' . (int) $published);
$query->from($db->quoteName('#__postinstall_messages'));
$published = (int) $this->getState('published', 1);
$query->where($db->quoteName('enabled') . ' = :published')
->bind(':published', $published, ParameterType::INTEGER);
$db->setQuery($query);
@ -149,14 +157,22 @@ class MessagesModel extends BaseDatabaseModel
public function getExtensionName($eid)
{
// Load the extension's information from the database
$db = $this->getDbo();
$db = $this->getDbo();
$eid = (int) $eid;
$query = $db->getQuery(true)
->select(array('name', 'element', 'client_id'))
->select(
[
$db->quoteName('name'),
$db->quoteName('element'),
$db->quoteName('client_id'),
]
)
->from($db->quoteName('#__extensions'))
->where($db->quoteName('extension_id') . ' = ' . (int) $eid);
->where($db->quoteName('extension_id') . ' = :eid')
->bind(':eid', $eid, ParameterType::INTEGER)
->setLimit(1);
$query->setLimit(1);
$db->setQuery($query);
$extension = $db->loadObject();
@ -192,12 +208,14 @@ class MessagesModel extends BaseDatabaseModel
*/
public function resetMessages($eid)
{
$db = $this->getDbo();
$db = $this->getDbo();
$eid = (int) $eid;
$query = $db->getQuery(true)
->update($db->quoteName('#__postinstall_messages'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('extension_id') . ' = ' . (int) $eid);
->where($db->quoteName('extension_id') . ' = :eid')
->bind(':eid', $eid, ParameterType::INTEGER);
$db->setQuery($query);
return $db->execute();
@ -214,12 +232,14 @@ class MessagesModel extends BaseDatabaseModel
*/
public function hideMessages($eid)
{
$db = $this->getDbo();
$db = $this->getDbo();
$eid = (int) $eid;
$query = $db->getQuery(true)
->update($db->quoteName('#__postinstall_messages'))
->set($db->quoteName('enabled') . ' = 0')
->where($db->quoteName('extension_id') . ' = ' . (int) $eid);
->where($db->quoteName('extension_id') . ' = :eid')
->bind(':eid', $eid, ParameterType::INTEGER);
$db->setQuery($query);
return $db->execute();
@ -302,9 +322,9 @@ class MessagesModel extends BaseDatabaseModel
$db = $this->getDbo();
$query = $db->getQuery(true)
->select('extension_id')
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__postinstall_messages'))
->group(array($db->quoteName('extension_id')));
->group($db->quoteName('extension_id'));
$db->setQuery($query);
$extension_ids = $db->loadColumn();
@ -532,16 +552,24 @@ class MessagesModel extends BaseDatabaseModel
}
// Check if the definition exists
$table = $this->getTable();
$tableName = $table->getTableName();
$table = $this->getTable();
$tableName = $table->getTableName();
$extensionId = (int) $options['extension_id'];
$db = $this->getDbo();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName($tableName))
->where($db->quoteName('extension_id') . ' = ' . (int) $options['extension_id'])
->where($db->quoteName('type') . ' = ' . $db->quote($options['type']))
->where($db->quoteName('title_key') . ' = ' . $db->quote($options['title_key']));
->where(
[
$db->quoteName('extension_id') . ' = :extensionId',
$db->quoteName('type') . ' = :type',
$db->quoteName('title_key') . ' = :titleKey',
]
)
->bind(':extensionId', $extensionId, ParameterType::INTEGER)
->bind(':type', $options['type'])
->bind(':titleKey', $options['title_key']);
$existingRow = $db->setQuery($query)->loadAssoc();
@ -568,9 +596,16 @@ class MessagesModel extends BaseDatabaseModel
// Otherwise it's not the same row. Remove the old row before insert a new one.
$query = $db->getQuery(true)
->delete($db->quoteName($tableName))
->where($db->quote('extension_id') . ' = ' . (int) $options['extension_id'])
->where($db->quote('type') . ' = ' . $db->quote($options['type']))
->where($db->quote('title_key') . ' = ' . $db->quote($options['title_key']));
->where(
[
$db->quoteName('extension_id') . ' = :extensionId',
$db->quoteName('type') . ' = :type',
$db->quoteName('title_key') . ' = :titleKey',
]
)
->bind(':extensionId', $extensionId, ParameterType::INTEGER)
->bind(':type', $options['type'])
->bind(':titleKey', $options['title_key']);
$db->setQuery($query)->execute();
}

View File

@ -55,25 +55,25 @@ $stateMsgs = array(
<th scope="col" class="w-5 text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="10%">
<th scope="col" class="w-10">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_USERNAME', 'u.username', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="10%">
<th scope="col" class="w-10">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_NAME', 'u.name', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="1%">
<th scope="col" class="w-1">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_USERID', 'a.user_id', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="10%">
<th scope="col" class="w-10">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_SUBJECT', 'a.subject', $listDirn, $listOrder); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_PRIVACY_HEADING_CONSENTS_BODY'); ?>
</th>
<th scope="col" width="15%">
<th scope="col" class="w-15">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_CREATED', 'a.created', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="1%">
<th scope="col" class="w-1">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>

View File

@ -19,6 +19,7 @@ use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Mail\Exception\MailDisabledException;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\Database\ParameterType;
use PHPMailer\PHPMailer\Exception as phpMailerException;
@ -97,11 +98,12 @@ class MailModel extends AdminModel
*/
public function send()
{
$app = Factory::getApplication();
$data = $app->input->post->get('jform', array(), 'array');
$user = Factory::getUser();
$access = new Access;
$db = $this->getDbo();
$app = Factory::getApplication();
$data = $app->input->post->get('jform', array(), 'array');
$user = Factory::getUser();
$access = new Access;
$db = $this->getDbo();
$language = Factory::getLanguage();
$mode = array_key_exists('mode', $data) ? (int) $data['mode'] : 0;
$subject = array_key_exists('subject', $data) ? $data['subject'] : '';
@ -176,30 +178,40 @@ class MailModel extends AdminModel
}
// Get the Mailer
$mailer = Factory::getMailer();
$mailer = new MailTemplate('com_users.massmail.mail', $language->getTag());
$params = ComponentHelper::getParams('com_users');
try
{
// Build email message format.
$mailer->setSender(array($app->get('mailfrom'), $app->get('fromname')));
$mailer->setSubject($params->get('mailSubjectPrefix') . stripslashes($subject));
$mailer->setBody($message_body . $params->get('mailBodySuffix'));
$mailer->IsHtml($mode);
$data = [
'subject' => stripslashes($subject),
'body' => $message_body,
'subjectprefix' => $params->get('mailSubjectPrefix', ''),
'bodysuffix' => $params->get('mailBodySuffix', '')
];
$mailer->addTemplateData($data);
// Add recipients
if ($bcc)
{
$mailer->addBcc($rows);
foreach ($rows as $row)
{
$mailer->addRecipient($row, null, 'bcc');
}
$mailer->addRecipient($app->get('mailfrom'));
}
else
{
$mailer->addRecipient($rows);
foreach ($rows as $row)
{
$mailer->addRecipient($row);
}
}
// Send the Mail
$rs = $mailer->Send();
$rs = $mailer->send();
}
catch (MailDisabledException | phpMailerException $exception)
{

View File

@ -1,31 +1,29 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_menus
* @subpackage com_workflow
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Menus\Administrator\Field;
namespace Joomla\Component\Workflow\Administrator\Field;
defined('_JEXEC') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\Workflow\WorkflowServiceInterface;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
FormHelper::loadFieldClass('list');
/**
* Components Workflow field.
*
* @since 1.6
*/
class ComponentsWorkflowField extends \JFormFieldList
class ComponentsWorkflowField extends ListField
{
/**
* The form field type.

View File

@ -9,9 +9,10 @@
<fields name="request">
<field
name="extension"
type="componentsworkflow"
type="ComponentsWorkflow"
label="COM_WORKFLOW_CHOOSE_CONTEXT_LABEL"
required="true"
addfieldprefix="Joomla\Component\Workflow\Administrator\Field"
>
<option value="">COM_MENUS_OPTION_SELECT_CONTEXT</option>
</field>

View File

@ -188,4 +188,4 @@ COM_BANNERS_UNLIMITED="Unlimited"
COM_BANNERS_XML_DESCRIPTION="This component manages banners and banner clients."
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_BANNERS="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_COM_BANNERS="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."

View File

@ -36,4 +36,4 @@ COM_CACHE_TABLE_CAPTION="Table of Cached Files"
COM_CACHE_XML_DESCRIPTION="Component for cache management."
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_CACHE="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_COM_CACHE="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."

View File

@ -47,15 +47,15 @@ COM_CATEGORIES_N_ITEMS_TRASHED="%d categories trashed."
COM_CATEGORIES_N_ITEMS_TRASHED_1="Category trashed."
COM_CATEGORIES_N_ITEMS_UNPUBLISHED="%d categories unpublished."
COM_CATEGORIES_N_ITEMS_UNPUBLISHED_1="Category unpublished."
COM_CATEGORIES_NEW_CATEGORY="New Category"
COM_CATEGORIES_NO_ITEM_SELECTED="Please first make a selection from the list."
COM_CATEGORIES_PATH_LABEL="Category Path"
COM_CATEGORIES_N_QUICKICON="Article Categories"
COM_CATEGORIES_N_QUICKICON_0="Article Categories"
COM_CATEGORIES_N_QUICKICON_1="Article Category"
COM_CATEGORIES_N_QUICKICON_SRONLY="Categories: %s article categories are published."
COM_CATEGORIES_N_QUICKICON_SRONLY_0="Categories: No article category is published."
COM_CATEGORIES_N_QUICKICON_SRONLY_1="Categories: One article category is published."
COM_CATEGORIES_NEW_CATEGORY="New Category"
COM_CATEGORIES_NO_ITEM_SELECTED="Please first make a selection from the list."
COM_CATEGORIES_PATH_LABEL="Category Path"
COM_CATEGORIES_REBUILD_FAILURE="Failed rebuilding Categories tree data."
COM_CATEGORIES_REBUILD_SUCCESS="Categories tree data rebuilt."
COM_CATEGORIES_SAVE_SUCCESS="Category saved."

View File

@ -203,4 +203,4 @@ COM_CONFIG_TEXT_FILTERS_SUMMARY="Expand for notes about the text filters"
COM_CONFIG_XML_DESCRIPTION="Configuration Manager"
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_CONFIG="If you change the setting, it will apply to this and all child groups, components and content. Note that:<br><em><strong>Inherited</strong></em> means that the permissions from the parent group will be used.<br><em><strong>Denied</strong></em> means that no matter what the parent group's setting is, the group being edited can't take this action.<br><em><strong>Allowed</strong></em> means that the group being edited will be able to take this action (but if this is in conflict with the parent group it will have no impact; a conflict will be indicated by <em><strong>Not Allowed (Locked)</strong></em> under Calculated Settings).<br><em><strong>Not Set</strong></em> is used only for the Public group in global configuration. The Public group is the parent of all other groups. If a permission is not set, it is treated as deny but can be changed for child groups, components, categories and items."
JLIB_RULES_SETTING_NOTES_COM_CONFIG="If you change the setting, it will apply to this and all child groups, components and content. Note that:<br><em><strong>Inherited</strong></em> means that the permissions from the parent group will be used.<br><em><strong>Denied</strong></em> means that no matter what the parent group's setting is, the group being edited can't take this action.<br><em><strong>Allowed</strong></em> means that the group being edited will be able to take this action (but if this is in conflict with the parent group it will have no impact; a conflict will be indicated by <em><strong>Not Allowed (Locked)</strong></em> under Calculated Settings).<br><em><strong>Not Set</strong></em> is used only for the Public group in global configuration. The Public group is the parent of all other groups. If a permission is not set, it is treated as deny but can be changed for child groups, components, categories and items."

View File

@ -141,6 +141,10 @@ COM_CONTACT_HEADING_ASSOCIATION="Association"
COM_CONTACT_ICONS_SETTINGS="Icons"
COM_CONTACT_ID_LABEL="ID"
COM_CONTACT_MAIL_FIELDSET_LABEL="Mail Options"
COM_CONTACT_MAIL_MAIL_COPY_DESC="This mail is sent to the submitter of a mail with the contact form if option \"Send Copy to Submitter\" is switched on in the form settings."
COM_CONTACT_MAIL_MAIL_COPY_TITLE="Contacts: Contact Form Mail Copy"
COM_CONTACT_MAIL_MAIL_DESC="This mail is sent with the contact form."
COM_CONTACT_MAIL_MAIL_TITLE="Contacts: Contact Form Mail"
COM_CONTACT_MANAGER_CONTACTS="Contacts"
COM_CONTACT_MANAGER_CONTACT_EDIT="Contacts: Edit"
COM_CONTACT_MANAGER_CONTACT_NEW="Contacts: New"
@ -183,4 +187,4 @@ JGLOBAL_NEWITEMSLAST_DESC="New Contacts default to the last position. Ordering c
JLIB_HTML_BATCH_USER_LABEL="Set Linked User"
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_CONTACT="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_COM_CONTACT="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."

View File

@ -70,4 +70,4 @@ COM_MESSAGES_XML_DESCRIPTION="Component for private messaging support in Backend
JLIB_APPLICATION_SAVE_SUCCESS="Message sent."
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_MESSAGES="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_COM_MESSAGES="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."

View File

@ -187,4 +187,4 @@ COM_MODULES_TYPE_OR_SELECT_POSITION="Type or Select a Position"
COM_MODULES_XML_DESCRIPTION="Component for module management in Backend"
; Alternate language strings for the rules form field
JLIB_RULES_SETTING_NOTES_COM_MODULES="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."
JLIB_RULES_SETTING_NOTES_COM_MODULES="Changes apply to this component only.<br><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br><em><strong>Allowed</strong></em> will enable the action for this component unless overruled by a Global Configuration setting."

View File

@ -178,15 +178,23 @@ COM_USERS_MAIL_FIELD_SEND_AS_BLIND_CARBON_COPY_LABEL="Recipients as BCC"
COM_USERS_MAIL_FIELD_SEND_IN_HTML_MODE_LABEL="Send in HTML Mode"
COM_USERS_MAIL_FIELD_SUBJECT_LABEL="Subject"
COM_USERS_MAIL_FIELD_VALUE_ALL_USERS_GROUPS="All Users Groups"
COM_USERS_MAIL_MASSMAIL_MAIL_DESC="This mail is sent with the \"Mass Mail Users\" form in backend."
COM_USERS_MAIL_MASSMAIL_MAIL_TITLE="Users: Mass Mail Users"
COM_USERS_MAIL_NO_USERS_COULD_BE_FOUND_IN_THIS_GROUP="No users could be found in this group."
COM_USERS_MAIL_ONLY_YOU_COULD_BE_FOUND_IN_THIS_GROUP="You are the only user in this group."
COM_USERS_MAIL_PASSWORD_RESET_DESC="This mail is sent to a user by using the \"Forgot your password?\" link e.g. in a login form."
COM_USERS_MAIL_PASSWORD_RESET_TITLE="Users: Password Reset"
COM_USERS_MAIL_PLEASE_FILL_IN_THE_FORM_CORRECTLY="Please fill in the form correctly."
COM_USERS_MAIL_PLEASE_FILL_IN_THE_MESSAGE="Please enter a message"
COM_USERS_MAIL_PLEASE_FILL_IN_THE_SUBJECT="Please enter a subject"
COM_USERS_MAIL_PLEASE_SELECT_A_GROUP="Please select a Group"
COM_USERS_MAIL_REMINDER_DESC="This mail is sent to a user by using the \"Forgot your username?\" link e.g. in a login form."
COM_USERS_MAIL_REMINDER_TITLE="Users: Username Reminder"
COM_USERS_MAIL_THE_MAIL_COULD_NOT_BE_SENT="The mail could not be sent."
COM_USERS_MASS_MAIL="Mass Mail Users"
COM_USERS_MASS_MAIL_DESC="Mass Mail options."
COM_USERS_MASSMAIL_MAIL_BODY="{BODY} {BODYSUFFIX}"
COM_USERS_MASSMAIL_MAIL_SUBJECT="{SUBJECTPREFIX} {SUBJECT}"
COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N="Password does not have enough digits. At least %s digits are required."
COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N_1="Password does not have enough digits. At least 1 digit is required."
COM_USERS_MSG_NOT_ENOUGH_LOWERCASE_LETTERS_N="Password does not have enough lower case characters. At least %s lower case characters are required."

View File

@ -41,12 +41,14 @@ MOD_QUICKICON_SHOW_MODULES_LABEL="Modules Icon"
MOD_QUICKICON_SHOW_OVERRIDEUPDATE_LABEL="Override Update Check"
MOD_QUICKICON_SHOW_PLUGINS_LABEL="Plugins Icon"
MOD_QUICKICON_SHOW_PRIVACYREQUEST_LABEL="Privacy Requests"
MOD_QUICKICON_SHOW_TEMPLATES_LABEL="Templates Icon"
MOD_QUICKICON_SHOW_TEMPLATE_CODE_LABEL="Template Code Icon"
MOD_QUICKICON_SHOW_TEMPLATE_STYLES_LABEL="Template Styles Icon"
MOD_QUICKICON_SHOW_USERS_LABEL="User Icon"
MOD_QUICKICON_SITE="Icons Site"
MOD_QUICKICON_STRUCTURE="Structure"
MOD_QUICKICON_SYSTEM="Icons System"
MOD_QUICKICON_TEMPLATES="Template Styles"
MOD_QUICKICON_TEMPLATE_CODE="Template Code"
MOD_QUICKICON_TEMPLATE_STYLES="Template Styles"
MOD_QUICKICON_TYPE="Icon Type"
MOD_QUICKICON_UPDATE="Icons Update"
MOD_QUICKICON_USER_MANAGER="Users"

View File

@ -9,6 +9,8 @@ PLG_SYSTEM_HTTPHEADERS_ADDITIONAL_HEADER="Force HTTP Headers"
; Please do not translate the word 'HTTP Header' in the following two language strings
PLG_SYSTEM_HTTPHEADERS_ADDITIONAL_HEADER_KEY="HTTP Header"
PLG_SYSTEM_HTTPHEADERS_ADDITIONAL_HEADER_VALUE="HTTP Header Value"
; Please do not translate the following language string
PLG_SYSTEM_HTTPHEADERS_COOP="Cross-Origin-Opener-Policy"
PLG_SYSTEM_HTTPHEADERS_HEADER_CLIENT="Client"
PLG_SYSTEM_HTTPHEADERS_HEADER_CLIENT_BOTH="Both"
; Please do not translate the following language string

View File

@ -6,19 +6,13 @@
PLG_SYSTEM_UPDATENOTIFICATION="System - Joomla! Update Notification"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_LBL="Super User Emails"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_DESC="A comma separated list of the email addresses which will receive the update notification emails. The addresses in the list MUST belong to existing users of your site who have the Super User privilege. If none of the listed emails belongs to Super Users, or if it's left blank, all Super Users of this site will receive the update notification email."
; You can use the following merge codes:
; [NEWVERSION] New Joomla! version, e.g. 1.2.3
; [CURVERSION] Currently installed Joomla! version, e.g. 1.2.0
; [SITENAME] Site name, as set in Global Configuration.
; [URL] URL of the site's frontend page.
; [LINK] Update URL (link to com_joomlaupdate, will request login if the Super User isn't already logged in).
; [RELEASENEWS] URL to the release news on joomla.org
; \n Newline character. Use it to start a new line in the email.
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT="Joomla! Update available for [SITENAME] [URL]"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by Joomla.org. It is sent automatically by your own site,\n[SITENAME] - [URL] \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: [CURVERSION]\nJoomla! version available for installation: [NEWVERSION]\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on [SITENAME] please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: [LINK]\n\nRelease News can be found here: [RELEASENEWS]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT="Joomla! Update available for {SITENAME} {URL}"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by Joomla.org. It is sent automatically by your own site,\n{SITENAME} - {URL} \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: {CURVERSION}\nJoomla! version available for installation: {NEWVERSION}\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on {SITENAME} please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: {LINK}\n\nRelease News can be found here: {RELEASENEWS}\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, {SITENAME}"
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL="Email Language"
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC="Select a language for the update notification emails. Set to Auto to send them in the site language at the time."
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE="Auto"
PLG_SYSTEM_UPDATENOTIFICATION_MAIL_MAIL_DESC="This mail is sent to the site administrator when the \"Joomla! Update Notification\" system plugin has detected an available update."
PLG_SYSTEM_UPDATENOTIFICATION_MAIL_MAIL_TITLE="Joomla: Update Notification"
PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME="The Joomla! Update Notification will not run in this configuration"
PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY="In your Installer Configuration you have set the Option Update Cache (in Hours) to 0 this means that Joomla is not caching the Update. This means an email should be sent on every page visit but this is not possible. Please increase the value (6 is default) or confirm that the Joomla! Update Notification will never send you mails."
PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION="Set it back to the default setting (6 Hours)"

View File

@ -8,7 +8,9 @@ PLG_USER_JOOMLA_FIELD_AUTOREGISTER_LABEL="Auto-create Users"
PLG_USER_JOOMLA_FIELD_FORCELOGOUT_LABEL="Force Logout for all Sessions?"
PLG_USER_JOOMLA_FIELD_MAILTOUSER_LABEL="Notification Mail to User"
PLG_USER_JOOMLA_FIELD_STRONG_PASSWORDS_LABEL="Strong Passwords"
PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY="Hello %s,\n\n\nYou have been added as a User to %s by an Administrator.\n\nThis email has your username and password to log in to %s\n\nUsername: %s\nPassword: %s\n\n\nPlease do not respond to this message as it is automatically generated and is for information purposes only."
PLG_USER_JOOMLA_MAIL_MAIL_DESC="This mail is sent to a new user who has just been created in backend."
PLG_USER_JOOMLA_MAIL_MAIL_TITLE="Users: New User"
PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY="Hello {NAME},\n\n\nYou have been added as a User to {SITENAME} by an Administrator.\n\nThis email has your username and password to log in to {URL}\n\nUsername: {USERNAME}\nPassword: {PASSWORD}\n\n\nPlease do not respond to this message as it is automatically generated and is for information purposes only."
PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT="New User Details"
PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_BTN="Enable Strong Password Encryption"
PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_TEXT="As a security feature, Joomla allows you to switch to strong password encryption.<br>To turn strong passwords on select the button below. Alternatively you can edit the User - Joomla plugin and change the strong password setting to On.<br>Before enabling you should verify that all third party registration/login, user management or bridge extensions installed on your site support this strong password encryption."

View File

@ -9,47 +9,24 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
// Load Bootstrap JS for dropdowns.
HTMLHelper::_('bootstrap.framework');
$hideLinks = $app->input->getBool('hidemainmenu');
?>
<?php if ($app->getIdentity()->authorise('core.manage', 'com_postinstall')) : ?>
<div class="header-item-content dropdown d-flex">
<button class="dropdown-toggle d-flex flex-column align-items-stretch <?php echo ($hideLinks ? 'disabled' : ''); ?>" data-toggle="dropdown" type="button" <?php echo ($hideLinks ? 'disabled' : ''); ?>
title="<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>">
<div class="header-item-content">
<a class="d-flex flex-column <?php echo ($hideLinks ? 'disabled' : ''); ?>"
href="<?php echo Route::_('index.php?option=com_postinstall&eid=' . $joomlaFilesExtensionId); ?>" title="<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>">
<div class="d-flex align-items-end mx-auto">
<span class="fas fa-bell" aria-hidden="true"></span>
<?php if (count($messages) > 0) : ?>
<span class="badge badge-danger"><?php echo count($messages); ?></span>
<?php endif; ?>
</div>
<div class="tiny">
<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>
</div>
<span class="fas fa-angle-down" aria-hidden="true"></span>
<?php if (count($messages) > 0) : ?>
<span class="badge badge-danger"><?php echo count($messages); ?></span>
<?php endif; ?>
</button>
<?php if (!$hideLinks) : ?>
<div class="dropdown-menu dropdown-menu-right dropdown-notifications border-0">
<div class="dropdown-header">
<?php echo Text::_('MOD_POST_INSTALLATION_MESSAGES'); ?>
</div>
<?php if (empty($messages)) : ?>
<a class="dropdown-item" href="<?php echo Route::_('index.php?option=com_postinstall&eid=' . $joomlaFilesExtensionId); ?>">
<?php echo Text::_('COM_POSTINSTALL_LBL_NOMESSAGES_TITLE'); ?>
</a>
<?php endif; ?>
<?php foreach ($messages as $message) : ?>
<?php $route = 'index.php?option=com_postinstall&amp;eid=' . $joomlaFilesExtensionId; ?>
<a class="dropdown-item" href="<?php echo Route::_($route); ?>">
<?php echo Text::_($message->title_key); ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</a>
</div>
<?php endif; ?>

View File

@ -147,9 +147,19 @@
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_templates"
name="show_template_styles"
type="radio"
label="MOD_QUICKICON_SHOW_TEMPLATES_LABEL"
label="MOD_QUICKICON_SHOW_TEMPLATE_STYLES_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_template_code"
type="radio"
label="MOD_QUICKICON_SHOW_TEMPLATE_CODE_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>

View File

@ -187,12 +187,23 @@ abstract class QuickIconHelper
self::$buttons[$key][] = $tmp;
}
if ($params->get('show_templates'))
if ($params->get('show_template_styles'))
{
self::$buttons[$key][] = [
'image' => 'fas fa-paint-brush',
'link' => Route::_('index.php?option=com_templates&view=styles&client_id=0'),
'name' => 'MOD_QUICKICON_TEMPLATES',
'name' => 'MOD_QUICKICON_TEMPLATE_STYLES',
'access' => array('core.admin', 'com_templates'),
'group' => 'MOD_QUICKICON_SITE'
];
}
if ($params->get('show_template_code'))
{
self::$buttons[$key][] = [
'image' => 'fas fa-code',
'link' => Route::_('index.php?option=com_templates&view=templates&client_id=0'),
'name' => 'MOD_QUICKICON_TEMPLATE_CODE',
'access' => array('core.admin', 'com_templates'),
'group' => 'MOD_QUICKICON_SITE'
];

View File

@ -125,7 +125,6 @@ body .container-main {
.content {
padding: 2vw;
border-radius: $border-radius;
> .row {
@ -222,3 +221,8 @@ details {
summary {
color: var(--atum-link-color);
}
// meter element
meter {
width: 100%;
}

View File

@ -246,7 +246,7 @@
}
.navbar-toggler-icon::before {
font: normal normal normal 30px/1 "Font Awesome 5 Free";
font: normal normal 900 30px/1 "Font Awesome 5 Free";
color: var(--toggle-color);
content: "\f00d";
}

View File

@ -147,7 +147,7 @@
}
.toggler-toolbar-icon::before {
font: normal normal normal 30px/1 'Font Awesome 5 Free';
font: normal normal 900 30px/1 'Font Awesome 5 Free';
color: var(--toggle-color);
content: "\f00d";
}

View File

@ -72,7 +72,7 @@
.com_cpanel {
.content {
margin-top: 0;
margin-top: 1rem;
}
.card {

View File

@ -17,6 +17,7 @@ use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Mail\Exception\MailDisabledException;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Controller\Exception\SendEmail;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Uri\Uri;
@ -204,69 +205,60 @@ class ContactController extends ApiController
{
$app = $this->app;
Factory::getLanguage()->load('com_contact', JPATH_SITE, $app->getLanguage()->getTag(), true);
if ($contact->email_to == '' && $contact->user_id != 0)
{
$contact_user = User::getInstance($contact->user_id);
$contact->email_to = $contact_user->get('email');
}
$mailfrom = $app->get('mailfrom');
$fromname = $app->get('fromname');
$sitename = $app->get('sitename');
$name = $data['contact_name'];
$email = PunycodeHelper::emailToPunycode($data['contact_email']);
$subject = $data['contact_subject'];
$body = $data['contact_message'];
// Prepare email body
$prefix = Text::sprintf('COM_CONTACT_ENQUIRY_TEXT', Uri::base());
$body = $prefix . "\n" . $name . ' <' . $email . '>' . "\r\n\r\n" . stripslashes($body);
$templateData = [
'sitename' => $app->get('sitename'),
'name' => $data['contact_name'],
'contactname' => $contact->name,
'email' => PunycodeHelper::emailToPunycode($data['contact_email']),
'subject' => $data['contact_subject'],
'body' => stripslashes($data['contact_message']),
'url' => Uri::base(),
'customfields' => ''
];
// Load the custom fields
if (!empty($data['com_fields']) && $fields = FieldsHelper::getFields('com_contact.mail', $contact, true, $data['com_fields']))
{
$output = FieldsHelper::render(
'com_contact.mail',
'fields.render', [
'fields.render',
array(
'context' => 'com_contact.mail',
'item' => $contact,
'fields' => $fields,
]
)
);
if ($output)
{
$body .= "\r\n\r\n" . $output;
$templateData['customfields'] = $output;
}
}
try
{
$mail = Factory::getMailer();
$mail->addRecipient($contact->email_to);
$mail->addReplyTo($email, $name);
$mail->setSender([$mailfrom, $fromname]);
$mail->setSubject($sitename . ': ' . $subject);
$mail->setBody($body);
$sent = $mail->Send();
$mailer = new MailTemplate('com_contact.mail', $app->getLanguage()->getTag());
$mailer->addRecipient($contact->email_to);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$sent = $mailer->send();
// If we are supposed to copy the sender, do so.
// Check whether email copy function activated
if ($copy_email_activated == true && !empty($data['contact_email_copy']))
{
$copytext = Text::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename);
$copytext .= "\r\n\r\n" . $body;
$copysubject = Text::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject);
$mail = Factory::getMailer();
$mail->addRecipient($email);
$mail->addReplyTo($email, $name);
$mail->setSender([$mailfrom, $fromname]);
$mail->setSubject($copysubject);
$mail->setBody($copytext);
$sent = $mail->Send();
$mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag());
$mailer->addRecipient($templateData['email']);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$sent = $mailer->send();
}
}
catch (MailDisabledException | phpMailerException $exception)

View File

@ -27,8 +27,8 @@
buttons.forEach((button) => {
button.addEventListener('click', (e) => {
e.preventDefault();
const task = e.target.getAttribute(buttonDataSelector);
submitTask(task, e.target.form);
const task = e.currentTarget.getAttribute(buttonDataSelector);
submitTask(task, e.currentTarget.form);
});
});
};

View File

@ -16,9 +16,9 @@ Joomla = window.Joomla || {};
// do field validation
if (form.install_package.value === '') {
alert(Joomla.JText._('PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE')] });
} else if (form.install_package.files[0].size > form.max_upload_size.value) {
alert(Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG')] });
} else {
Joomla.displayLoader();
@ -32,7 +32,7 @@ Joomla = window.Joomla || {};
// do field validation
if (form.install_directory.value === '') {
alert(Joomla.JText._('PLG_INSTALLER_FOLDERINSTALLER_NO_INSTALL_PATH'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('PLG_INSTALLER_FOLDERINSTALLER_NO_INSTALL_PATH')] });
} else {
Joomla.displayLoader();
@ -46,7 +46,7 @@ Joomla = window.Joomla || {};
// do field validation
if (form.install_url.value === '' || form.install_url.value === 'http://' || form.install_url.value === 'https://') {
alert(Joomla.JText._('PLG_INSTALLER_URLINSTALLER_NO_URL'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('PLG_INSTALLER_URLINSTALLER_NO_URL')] });
} else {
Joomla.displayLoader();
@ -60,7 +60,7 @@ Joomla = window.Joomla || {};
// do field validation
if (form.install_url.value === '' || form.install_url.value === 'http://' || form.install_url.value === 'https://') {
alert(Joomla.JText._('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL')] });
} else {
Joomla.displayLoader();
@ -69,14 +69,29 @@ Joomla = window.Joomla || {};
}
};
Joomla.submitbutton5 = () => {
const form = document.getElementById('adminForm');
// do field validation
if (form.install_url.value !== '' || form.install_url.value !== 'http://' || form.install_url.value !== 'https://') {
Joomla.submitbutton4();
} else if (form.install_url.value === '') {
Joomla.renderMessages({ warning: [Joomla.apps.options.btntxt] });
} else {
document.querySelector('#appsloading').classList.remove('hidden');
form.installtype.value = 'web';
form.submit();
}
};
Joomla.submitbuttonUpload = () => {
const form = document.getElementById('uploadForm');
// do field validation
if (form.install_package.value === '') {
alert(Joomla.JText._('COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE')] });
} else if (form.install_package.files[0].size > form.max_upload_size.value) {
alert(Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG')] });
} else {
Joomla.displayLoader();
@ -204,7 +219,7 @@ document.addEventListener('DOMContentLoaded', () => {
const data = new FormData();
if (file.size > fileSizeMax) {
alert(Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG'), true);
Joomla.renderMessages({ warning: [Joomla.JText._('COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG')] });
return;
}

View File

@ -121,10 +121,13 @@
if (target.value === '0') {
this.setHtmlBodyValue(this.templateData.htmlbody ? this.templateData.htmlbody.master : '');
this.inputHtmlBody.disabled = true;
Joomla.editors.instances[this.inputHtmlBody.id].disable(true);
tagsContainer.classList.add('hidden');
} else if (target.value === '1') {
Joomla.editors.instances[this.inputHtmlBody.id].disable(false);
this.inputHtmlBody.disabled = false;
this.inputHtmlBody.readOnly = false;
this.setHtmlBodyValue(this.templateData.htmlbody ? this.templateData.htmlbody.translated : '');
tagsContainer.classList.remove('hidden');
} else {

View File

@ -26,7 +26,7 @@
folder.addEventListener('click', (event) => {
event.preventDefault();
const list = folder.parentNode.querySelector('ul');
const list = event.currentTarget.parentNode.querySelector('ul');
if (!list.classList.contains('hidden')) {
list.classList.add('hidden');
@ -45,12 +45,12 @@
fileModalFold.classList.remove('selected');
});
fileModalFolder.classList.add('selected');
event.currentTarget.classList.add('selected');
const listElsAddressToAdd = [].slice.call(document.querySelectorAll('#fileModal input.address'));
listElsAddressToAdd.forEach((element) => {
element.value = fileModalFolder.getAttribute('data-id');
element.value = event.currentTarget.getAttribute('data-id');
});
});
});
@ -64,11 +64,11 @@
folderModalFldr.classList.remove('selected');
});
folderModalFolder.classList.add('selected');
event.currentTarget.classList.add('selected');
const listElsAddressToAdd = [].slice.call(document.querySelectorAll('#folderModal input.address'));
listElsAddressToAdd.forEach((element) => {
element.value = folderModalFolder.getAttribute('data-id');
element.value = event.currentTarget.getAttribute('data-id');
});
});
});

View File

@ -1,5 +1,5 @@
/* eslint-disable no-undef */
tinymce.PluginManager.add('jdragdrop', (editor) => {
tinymce.PluginManager.add('jdragndrop', (editor) => {
// Reset the drop area border
tinyMCE.DOM.bind(document, 'dragleave', (e) => {
e.stopPropagation();
@ -9,108 +9,98 @@ tinymce.PluginManager.add('jdragdrop', (editor) => {
return false;
});
// The upload logic
const UploadFile = (file) => {
const fd = new FormData();
fd.append('Filedata', file);
fd.append('folder', tinyMCE.activeEditor.settings.mediaUploadPath);
// Fix for Chrome
editor.on('dragenter', (e) => {
e.stopPropagation();
const xhr = new XMLHttpRequest();
return false;
});
xhr.upload.onprogress = (e) => {
const percentComplete = (e.loaded / e.total) * 100;
document.querySelector('.bar').style.width = `${percentComplete}%`;
// Notify user when file is over the drop area
editor.on('dragover', (e) => {
e.preventDefault();
editor.contentAreaContainer.style.borderStyle = 'dashed';
editor.contentAreaContainer.style.borderWidth = '5px';
return false;
});
function uploadFile(name, content) {
const url = `${tinyMCE.activeEditor.settings.uploadUri}&path=${tinyMCE.activeEditor.settings.comMediaAdapter}`;
const data = {
[tinyMCE.activeEditor.settings.csrfToken]: '1',
name,
content,
parent: tinyMCE.activeEditor.settings.parentUploadFolder,
};
const removeProgessBar = () => {
// @todo Promisify
setTimeout(() => {
const loader = document.querySelector('#jloader');
loader.parentNode.removeChild(loader);
editor.contentAreaContainer.style.borderWidth = '1px 0 0 0';
}, 200);
};
Joomla.request({
url,
method: 'POST',
data: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' },
onSuccess: (resp) => {
let response;
xhr.onload = () => {
const resp = JSON.parse(xhr.responseText);
if (xhr.status === 200) {
if (resp.status === '0') {
removeProgessBar();
editor.windowManager.alert(`${resp.message}: ${tinyMCE.activeEditor.settings.setCustomDir}${resp.location}`);
try {
response = JSON.parse(resp);
} catch (e) {
editor.windowManager.alert(`${Joomla.Text._('JERROR')}: {e}`);
}
if (resp.status === '1') {
removeProgessBar();
if (response.data && response.data.path) {
let urlPath;
// For local adapters use relative paths
if (/local-/.test(response.data.adapter)) {
const { rootFull } = Joomla.getOptions('system.paths');
// Create the image tag
const newNode = tinyMCE.activeEditor.getDoc().createElement('img');
newNode.src = tinyMCE.activeEditor.settings.setCustomDir + resp.location;
tinyMCE.activeEditor.execCommand('mceInsertContent', false, newNode.outerHTML);
urlPath = `${response.data.thumb_path.split(rootFull)[1]}`;
} else if (response.data.thumb_path) {
// Absolute path for different domain
urlPath = response.data.thumb_path;
}
tinyMCE.activeEditor.execCommand('mceInsertContent', false, `<img loading="lazy" src="${urlPath}" alt=""/>`);
}
} else {
removeProgessBar();
}
},
onError: (xhr) => {
editor.windowManager.alert(`Error: ${xhr.statusText}`);
},
});
}
function readFile(file) {
// Create a new file reader instance
const reader = new FileReader();
// Add the on load callback
reader.onload = (progressEvent) => {
const { result } = progressEvent.target;
const splitIndex = result.indexOf('base64') + 7;
const content = result.slice(splitIndex, result.length);
// Upload the file
uploadFile(file.name, content);
};
xhr.onerror = () => {
removeProgessBar();
};
xhr.open('POST', tinyMCE.activeEditor.settings.uploadUri, true);
xhr.send(fd);
};
reader.readAsDataURL(file);
}
// Listers for drag and drop
if (typeof FormData !== 'undefined') {
// Fix for Chrome
editor.on('dragenter', (e) => {
e.stopPropagation();
return false;
});
// Notify user when file is over the drop area
editor.on('dragover', (e) => {
e.preventDefault();
editor.contentAreaContainer.style.borderStyle = 'dashed';
editor.contentAreaContainer.style.borderWidth = '5px';
return false;
});
// Logic for the dropped file
editor.on('drop', (e) => {
e.preventDefault();
// We override only for files
if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length > 0) {
const files = [].slice.call(e.dataTransfer.files);
files.forEach((file) => {
// Only images allowed
if (file.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
// Create and display the progress bar
const container = document.createElement('div');
container.id = 'jloader';
const innerDiv = document.createElement('div');
innerDiv.classList.add('progress');
innerDiv.classList.add('progress-success');
innerDiv.classList.add('progress-striped');
innerDiv.classList.add('active');
innerDiv.style.width = '100%';
innerDiv.style.height = '30px';
const progressBar = document.createElement('div');
progressBar.classList.add('bar');
progressBar.style.width = '0';
innerDiv.appendChild(progressBar);
container.appendChild(innerDiv);
document.querySelector('.mce-toolbar-grp').appendChild(container);
// Upload the file(s)
UploadFile(file);
readFile(file);
}
e.preventDefault();
});
}
editor.contentAreaContainer.style.borderWidth = '1px 0 0';

View File

@ -25,7 +25,6 @@ if (!Joomla) {
webInstallerOptions.loaded = 1;
const cancelButton = document.getElementById('uploadform-web-cancel');
cancelButton.addEventListener('click', () => {
document.getElementById('uploadform-web').classList.add('hidden');
@ -34,6 +33,15 @@ if (!Joomla) {
}
});
const installButton = document.getElementById('uploadform-web-install');
installButton.addEventListener('click', () => {
if (webInstallerOptions.options.installFrom === 4) {
Joomla.submitbutton4();
} else {
Joomla.submitbutton5();
}
});
this.loadweb(`${webInstallerOptions.options.base_url}index.php?format=json&option=com_apps&view=dashboard`);
this.clickforlinks();
@ -160,11 +168,11 @@ if (!Joomla) {
if (installExtensionButton) {
installExtensionButton.addEventListener('click', () => {
WebInstaller.installfromweb(installExtensionButton.getAttribute('data-downloadurl'), installExtensionButton.getAttribute('data-name'));
document.getElementById('uploadform-web-install').scrollIntoView({ behavior: 'smooth', block: 'start' });
});
}
if (installExtensionFromExternalButton) {
// @todo Migrate this handler's confirm to a CE dialog
installExtensionFromExternalButton.addEventListener('click', () => {
const redirectUrl = installExtensionFromExternalButton.getAttribute('data-downloadurl');
const redirectConfirm = window.confirm(Joomla.JText._('PLG_INSTALLER_WEBINSTALLER_REDIRECT_TO_EXTERNAL_SITE_TO_INSTALL').replace('[SITEURL]', redirectUrl));
@ -290,11 +298,10 @@ if (!Joomla) {
* @param {string} installUrl
* @param {string} name
* @returns {boolean}
* @todo Migrate this function's alert to a CE dialog
*/
static installfromweb(installUrl, name = null) {
if (!installUrl) {
alert(Joomla.JText._('PLG_INSTALLER_WEBINSTALLER_CANNOT_INSTALL_EXTENSION_IN_PLUGIN'));
Joomla.renderMessages({ warning: [Joomla.JText._('PLG_INSTALLER_WEBINSTALLER_CANNOT_INSTALL_EXTENSION_IN_PLUGIN')] });
return false;
}

View File

@ -1,209 +0,0 @@
"use strict";
/**
* PasswordStrength script by Thomas Kjaergaard
* License: MIT
* Repo: https://github.com/tkjaergaard/Password-Strength
*
* The MIT License (MIT)
*
* Copyright (c) 2014 Thomas Kjærgaard
*
* 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
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var PasswordStrength;
PasswordStrength = (function() {
function PasswordStrength(settings) {
this.lowercase = settings.lowercase || 0;
this.uppercase = settings.uppercase || 0;
this.numbers = settings.numbers || 0;
this.special = settings.special || 0;
this.length = settings.length || 4;
}
PasswordStrength.prototype.getScore = function(value) {
var score = 0, mods = 0;
var sets = ['lowercase', 'uppercase', 'numbers', 'special', 'length'];
for (var i = 0, l = sets.length; l>i; i++) {
if (this.hasOwnProperty(sets[i]) && this[sets[i]] > 0) {
mods = mods + 1;
}
}
score += this.calc(value, /[a-z]/g, this.lowercase, mods);
score += this.calc(value, /[A-Z]/g, this.uppercase, mods);
score += this.calc(value, /[0-9]/g, this.numbers, mods);
score += this.calc(value, /[\$\!\#\?\=\;\:\*\-\_\€\%\&\(\)\`\´]/g, this.special, mods);
if (mods == 1) {
score += value.length > this.length ? 100 : 100 / this.length * value.length;
} else {
score += value.length > this.length ? (100 / mods) : (100 / mods) / this.length * value.length;
}
return score;
};
PasswordStrength.prototype.calc = function(value, pattern, length, mods) {
var count;
count = value.match(pattern);
if (count && count.length > length && length != 0) {
return 100 / mods;
}
if (count && length > 0) {
return (100 / mods) / length * count.length;
} else {
return 0;
}
};
return PasswordStrength;
})();
/**
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
document.addEventListener('DOMContentLoaded', function(){
"use strict";
/** Method to check the input and set the meter **/
var getMeter = function(element) {
var $minLength = element.getAttribute('data-min-length'),
$minIntegers = element.getAttribute('data-min-integers'),
$minSymbols = element.getAttribute('data-min-symbols'),
$minUppercase = element.getAttribute('data-min-uppercase'),
$minLowercase = element.getAttribute('data-min-lowercase'),
meter = document.querySelector('.progress-bar');
var strength = new PasswordStrength({
lowercase: $minLowercase ? $minLowercase : 0,
uppercase: $minUppercase ? $minUppercase : 0,
numbers: $minIntegers ? $minIntegers : 0,
special: $minSymbols ? $minSymbols : 0,
length: $minLength ? $minLength : 4
});
var score = strength.getScore(element.value),
i = meter.getAttribute('id').replace( /^\D+/g, ''),
label = element.parentNode.parentNode.querySelector('#password-' + i);
if (score > 79){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-warning');
label.innerHTML = Joomla.JText._('JFIELD_PASSWORD_INDICATE_COMPLETE');
}
if (score > 64 && score < 80){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-warning');
label.innerHTML = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score > 50 && score < 65){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-warning');
label.innerHTML = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score > 40 && score < 51){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-warning');
label.innerHTML = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score < 41){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-danger');
label.innerHTML = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score === 100){
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
}
meter.style.width = score + '%';
if (!element.value.length) {
meter.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated');
label.innerHTML = '';
element.setAttribute('required', '');
}
};
var fields = document.querySelectorAll('.js-password-strength');
/** Loop through the fields **/
for (var i = 0, l = fields.length; i<l; i++) {
var startClass = '',
initialVal = '';
if (!fields[i].value.length) {
startClass =' bg-danger';
initialVal = 0;
}
/** Create a progress meter and the label **/
var meter = document.createElement('div');
meter.setAttribute('class', 'progress');
var meter2 = document.createElement('div');
meter2.setAttribute('class', 'progress-bar progress-bar-striped progress-bar-animated' + startClass);
meter2.style.width = 0 + initialVal;
meter2.max = 100;
meter2.setAttribute('id', 'progress-' + i);
meter.appendChild(meter2);
var label = document.createElement('div');
label.setAttribute('class', 'text-xs-center');
label.setAttribute('id', 'password-' + i);
label.setAttribute('aria-live', 'polite');
fields[i].parentNode.insertAdjacentElement('afterEnd', label);
fields[i].parentNode.insertAdjacentElement('afterEnd', meter);
/** Add a data attribute for the required **/
if (fields[i].value.length > 0) {
fields[i].setAttribute('required', true);
}
/** Add a listener for input data change **/
fields[i].addEventListener('keyup', function(event) {
getMeter(event.target);
});
}
/** Set a handler for the validation script **/
if (fields[0]) {
document.formvalidator.setHandler('password-strength', function(value) {
var returnedValue = false,
fields = document.querySelectorAll('.js-password-strength'),
$minLength = fields[0].getAttribute('data-min-length'),
$minIntegers = fields[0].getAttribute('data-min-integers'),
$minSymbols = fields[0].getAttribute('data-min-symbols'),
$minUppercase = fields[0].getAttribute('data-min-uppercase'),
$minLowercase = fields[0].getAttribute('data-min-lowercase');
var strength = new PasswordStrength({
lowercase: $minLowercase ? $minLowercase : 0,
uppercase: $minUppercase ? $minUppercase : 0,
numbers: $minIntegers ? $minIntegers : 0,
special: $minSymbols ? $minSymbols : 0,
length: $minLength ? $minLength : 4
});
var score = strength.getScore(value);
if (score === 100 ) returnedValue = true;
return returnedValue;
});
}
});

View File

@ -0,0 +1,196 @@
/**
* PasswordStrength script by Thomas Kjaergaard
* License: MIT
* Repo: https://github.com/tkjaergaard/Password-Strength
*
* The MIT License (MIT)
*
* Copyright (c) 2014 Thomas Kjærgaard
*
* 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
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
class PasswordStrength {
constructor(settings) {
this.lowercase = parseInt(settings.lowercase, 10) || 0;
this.uppercase = parseInt(settings.uppercase, 10) || 0;
this.numbers = parseInt(settings.numbers, 10) || 0;
this.special = parseInt(settings.special, 10) || 0;
this.length = parseInt(settings.length, 10) || 4;
}
getScore(value) {
let score = 0;
let mods = 0;
const sets = ['lowercase', 'uppercase', 'numbers', 'special', 'length'];
sets.forEach((set) => {
if (this[set] > 0) {
mods += 1;
}
});
score += this.constructor.calc(value, /[a-z]/g, this.lowercase, mods);
score += this.constructor.calc(value, /[A-Z]/g, this.uppercase, mods);
score += this.constructor.calc(value, /[0-9]/g, this.numbers, mods);
// eslint-disable-next-line no-useless-escape
score += this.constructor.calc(value, /[\$\!\#\?\=\;\:\*\-\_\€\%\&\(\)\`\´]/g,
this.special, mods);
if (mods === 1) {
score += value.length > this.length
? 100
: (100 / this.length) * value.length;
} else {
score += value.length > this.length
? (100 / mods)
: ((100 / mods) / this.length) * value.length;
}
return score;
}
static calc(value, pattern, length, mods) {
const count = value.match(pattern);
if (count && count.length > length && length !== 0) {
return 100 / mods;
}
if (count && length > 0) {
return ((100 / mods) / length) * count.length;
}
return 0;
}
}
/**
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((Joomla, document) => {
// Method to check the input and set the meter
const getMeter = (element) => {
const meter = document.querySelector('meter');
const minLength = element.getAttribute('data-min-length');
const minIntegers = element.getAttribute('data-min-integers');
const minSymbols = element.getAttribute('data-min-symbols');
const minUppercase = element.getAttribute('data-min-uppercase');
const minLowercase = element.getAttribute('data-min-lowercase');
const strength = new PasswordStrength({
lowercase: minLowercase || 0,
uppercase: minUppercase || 0,
numbers: minIntegers || 0,
special: minSymbols || 0,
length: minLength || 4,
});
const score = strength.getScore(element.value);
const i = meter.getAttribute('id').replace(/^\D+/g, '');
const label = element.parentNode.parentNode.querySelector(`#password-${i}`);
if (score > 79) {
label.innerText = Joomla.JText._('JFIELD_PASSWORD_INDICATE_COMPLETE');
}
if (score > 64 && score < 80) {
label.innerText = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score > 50 && score < 65) {
label.innerText = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score > 40 && score < 51) {
label.innerText = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
if (score < 41) {
label.innerText = Joomla.JText._('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
}
meter.value = score;
if (!element.value.length) {
label.innerText = '';
element.setAttribute('required', '');
}
};
document.addEventListener('DOMContentLoaded', () => {
const fields = [].slice.call(document.querySelectorAll('.js-password-strength'));
// Loop through the fields
fields.forEach((field, index) => {
let initialVal = '';
if (!field.value.length) {
initialVal = 0;
}
// Create a progress meter and the label
const meter = document.createElement('meter');
meter.setAttribute('id', `progress-${index}`);
meter.setAttribute('min', 0);
meter.setAttribute('max', 100);
meter.setAttribute('low', 40);
meter.setAttribute('high', 60);
meter.setAttribute('optimum', 80);
meter.value = initialVal;
const label = document.createElement('div');
label.setAttribute('class', 'text-center');
label.setAttribute('id', `password-${index}`);
label.setAttribute('aria-live', 'polite');
field.parentNode.insertAdjacentElement('afterEnd', label);
field.parentNode.insertAdjacentElement('afterEnd', meter);
// Add a data attribute for the required
if (field.value.length > 0) {
field.setAttribute('required', true);
}
// Add a listener for input data change
field.addEventListener('keyup', ({ target }) => {
getMeter(target);
});
});
// Set a handler for the validation script
if (fields[0]) {
document.formvalidator.setHandler('password-strength', (value) => {
const strengthElements = document.querySelectorAll('.js-password-strength');
const minLength = strengthElements[0].getAttribute('data-min-length');
const minIntegers = strengthElements[0].getAttribute('data-min-integers');
const minSymbols = strengthElements[0].getAttribute('data-min-symbols');
const minUppercase = strengthElements[0].getAttribute('data-min-uppercase');
const minLowercase = strengthElements[0].getAttribute('data-min-lowercase');
const strength = new PasswordStrength({
lowercase: minLowercase || 0,
uppercase: minUppercase || 0,
numbers: minIntegers || 0,
special: minSymbols || 0,
length: minLength || 4,
});
const score = strength.getScore(value);
if (score === 100) {
return true;
}
return false;
});
}
});
})(Joomla, document);

View File

@ -79,24 +79,17 @@ window.customElements.define('joomla-toolbar-button', class extends HTMLElement
// Make sure we have a boolean value
this.disabled = !!disabled;
// Switch attribute for current element
if (this.disabled) {
this.setAttribute('disabled', true);
} else {
this.removeAttribute('disabled');
}
// Switch attribute for native element
// An anchor does not support "disabled" attribute, so use class
if (this.buttonElement) {
if (this.disabled) {
if (this.buttonElement.nodeName === 'BUTTON') {
this.buttonElement.setAttribute('disabled', true);
this.buttonElement.disabled = true;
} else {
this.buttonElement.classList.add('disabled');
}
} else if (this.buttonElement.nodeName === 'BUTTON') {
this.buttonElement.removeAttribute('disabled');
this.buttonElement.disabled = false;
} else {
this.buttonElement.classList.remove('disabled');
}

View File

@ -46,25 +46,19 @@ if (Multilanguage::isEnabled())
<div class="row">
<div class="col-md-12">
<div class="btn-toolbar" role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<div class="btn-group">
<button type="button" class="btn btn-primary" data-submit-task="modules.apply">
<span class="fas fa-check" aria-hidden="true"></span>
<?php echo Text::_('JAPPLY') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-secondary" data-submit-task="modules.save">
<span class="fas fa-check" aria-hidden="true"></span>
<?php echo Text::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger" data-submit-task="modules.cancel">
<span class="fas fa-times" aria-hidden="true"></span>
<?php echo Text::_('JCANCEL') ?>
</button>
</div>
<div role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<button type="button" class="btn btn-primary" data-submit-task="modules.apply">
<span class="fas fa-check" aria-hidden="true"></span>
<?php echo Text::_('JAPPLY'); ?>
</button>
<button type="button" class="btn btn-secondary" data-submit-task="modules.save">
<span class="fas fa-check" aria-hidden="true"></span>
<?php echo Text::_('JSAVE'); ?>
</button>
<button type="button" class="btn btn-danger" data-submit-task="modules.cancel">
<span class="fas fa-times" aria-hidden="true"></span>
<?php echo Text::_('JCANCEL'); ?>
</button>
</div>
<hr>

View File

@ -15,6 +15,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Mail\Exception\MailDisabledException;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
@ -241,18 +242,16 @@ class ContactController extends FormController
$contact->email_to = $contact_user->get('email');
}
$mailfrom = $app->get('mailfrom');
$fromname = $app->get('fromname');
$sitename = $app->get('sitename');
$name = $data['contact_name'];
$email = PunycodeHelper::emailToPunycode($data['contact_email']);
$subject = $data['contact_subject'];
$body = $data['contact_message'];
// Prepare email body
$prefix = Text::sprintf('COM_CONTACT_ENQUIRY_TEXT', Uri::base());
$body = $prefix . "\n" . $name . ' <' . $email . '>' . "\r\n\r\n" . stripslashes($body);
$templateData = [
'sitename' => $app->get('sitename'),
'name' => $data['contact_name'],
'contactname' => $contact->name,
'email' => PunycodeHelper::emailToPunycode($data['contact_email']),
'subject' => $data['contact_subject'],
'body' => stripslashes($data['contact_message']),
'url' => Uri::base(),
'customfields' => ''
];
// Load the custom fields
if (!empty($data['com_fields']) && $fields = FieldsHelper::getFields('com_contact.mail', $contact, true, $data['com_fields']))
@ -269,34 +268,26 @@ class ContactController extends FormController
if ($output)
{
$body .= "\r\n\r\n" . $output;
$templateData['customfields'] = $output;
}
}
try
{
$mail = Factory::getMailer();
$mail->addRecipient($contact->email_to);
$mail->addReplyTo($email, $name);
$mail->setSender(array($mailfrom, $fromname));
$mail->setSubject($sitename . ': ' . $subject);
$mail->setBody($body);
$sent = $mail->Send();
$mailer = new MailTemplate('com_contact.mail', $app->getLanguage()->getTag());
$mailer->addRecipient($contact->email_to);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$sent = $mailer->send();
// If we are supposed to copy the sender, do so.
if ($copy_email_activated == true && !empty($data['contact_email_copy']))
{
$copytext = Text::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename);
$copytext .= "\r\n\r\n" . $body;
$copysubject = Text::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject);
$mail = Factory::getMailer();
$mail->addRecipient($email);
$mail->addReplyTo($email, $name);
$mail->setSender(array($mailfrom, $fromname));
$mail->setSubject($copysubject);
$mail->setBody($copytext);
$sent = $mail->Send();
$mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag());
$mailer->addRecipient($templateData['email']);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$sent = $mailer->send();
}
}
catch (MailDisabledException | phpMailerException $exception)

View File

@ -511,26 +511,11 @@ class ArticlesModel extends ListModel
$authorAliasWhere = $db->quoteName('a.created_by_alias') . $type . ':authorAlias';
$query->bind(':authorAlias', $authorAlias);
}
elseif (is_array($authorAlias))
elseif (\is_array($authorAlias) && !empty($authorAlias))
{
$first = current($authorAlias);
if (!empty($first))
{
foreach ($authorAlias as $key => $alias)
{
$authorAlias[$key] = $db->quote($alias);
}
$authorAlias = implode(',', $authorAlias);
if ($authorAlias)
{
$type = $this->getState('filter.author_alias.include', true) ? ' IN' : ' NOT IN';
$authorAliasWhere = $db->quoteName('a.created_by_alias') . $type
. ' (' . implode(',', $query->bindArray($authorAlias, ParameterType::STRING)) . ')';
}
}
$type = $this->getState('filter.author_alias.include', true) ? ' IN' : ' NOT IN';
$authorAliasWhere = $db->quoteName('a.created_by_alias') . $type
. ' (' . implode(',', $query->bindArray($authorAlias, ParameterType::STRING)) . ')';
}
if (!empty($authorWhere) && !empty($authorAliasWhere))

View File

@ -158,10 +158,12 @@ class Router extends RouterView
{
if (!strpos($id, ':'))
{
$id = (int) $id;
$dbquery = $this->db->getQuery(true);
$dbquery->select($this->db->quoteName('alias'))
->from($this->db->quoteName('#__content'))
->where('id = ' . $this->db->quote($id));
->where($this->db->quoteName('id') . ' = :id')
->bind(':id', $id, ParameterType::INTEGER);
$this->db->setQuery($dbquery);
$id .= ':' . $this->db->loadResult();

View File

@ -34,9 +34,7 @@ class FinderHelper
*/
public static function logSearch(Query $searchquery, $resultCount = 0)
{
$enable_log_searches = ComponentHelper::getParams('com_finder')->get('logging_enabled', 1);
if (!$enable_log_searches)
if (!ComponentHelper::getParams('com_finder')->get('gather_search_statistics', 0))
{
return;
}

View File

@ -15,6 +15,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Model\FormModel;
use Joomla\CMS\Router\Route;
use Joomla\CMS\String\PunycodeHelper;
@ -176,27 +177,18 @@ class RemindModel extends FormModel
// Put together the email template data.
$data = ArrayHelper::fromObject($user);
$data['fromname'] = $app->get('fromname');
$data['mailfrom'] = $app->get('mailfrom');
$data['sitename'] = $app->get('sitename');
$data['link_text'] = Route::_($link, false, $mode);
$data['link_html'] = Route::_($link, true, $mode);
$subject = Text::sprintf(
'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT',
$data['sitename']
);
$body = Text::sprintf(
'COM_USERS_EMAIL_USERNAME_REMINDER_BODY',
$data['sitename'],
$data['username'],
$data['link_text']
);
$mailer = new MailTemplate('com_users.reminder', $app->getLanguage()->getTag());
$mailer->addTemplateData($data);
$mailer->addRecipient($user->email, $user->name);
// Try to send the password reset request email.
try
{
$return = Factory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $user->email, $subject, $body);
$return = $mailer->send();
}
catch (\Exception $exception)
{

View File

@ -16,6 +16,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Model\FormModel;
use Joomla\CMS\Router\Route;
use Joomla\CMS\String\PunycodeHelper;
@ -472,29 +473,19 @@ class ResetModel extends FormModel
// Put together the email template data.
$data = $user->getProperties();
$data['fromname'] = $app->get('fromname');
$data['mailfrom'] = $app->get('mailfrom');
$data['sitename'] = $app->get('sitename');
$data['link_text'] = Route::_($link, false, $mode);
$data['link_html'] = Route::_($link, true, $mode);
$data['token'] = $token;
$subject = Text::sprintf(
'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT',
$data['sitename']
);
$body = Text::sprintf(
'COM_USERS_EMAIL_PASSWORD_RESET_BODY',
$data['sitename'],
$data['token'],
$data['link_text']
);
$mailer = new MailTemplate('com_users.password_reset', $app->getLanguage()->getTag());
$mailer->addTemplateData($data);
$mailer->addRecipient($user->email, $user->name);
// Try to send the password reset request email.
try
{
$return = Factory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $user->email, $subject, $body);
$return = $mailer->send();
}
catch (\Exception $exception)
{

View File

@ -427,4 +427,11 @@ CREATE TABLE IF NOT EXISTS `#__mail_templates` (
--
INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}');
('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}'),
('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_users.massmail.mail', '', 'COM_USERS_MASSMAIL_MAIL_SUBJECT', 'COM_USERS_MASSMAIL_MAIL_BODY', '', '', '{"tags":["subject","body","subjectprefix","bodysuffix"]}'),
('com_users.password_reset', '', 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', '', '', '{"tags":["name","email","sitename","link_text","link_html","token"]}'),
('com_users.reminder', '', 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', '', '', '{"tags":["name","username","sitename","email","link_text","link_html"]}'),
('plg_system_updatenotification.mail', '', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}'),
('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}');

View File

@ -438,4 +438,11 @@ CREATE INDEX "#__mail_templates_idx_language" ON "#__mail_templates" ("language"
--
INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}');
('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}'),
('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'),
('com_users.massmail.mail', '', 'COM_USERS_MASSMAIL_MAIL_SUBJECT', 'COM_USERS_MASSMAIL_MAIL_BODY', '', '', '{"tags":["subject","body","subjectprefix","bodysuffix"]}'),
('com_users.password_reset', '', 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', '', '', '{"tags":["name","email","sitename","link_text","link_html","token"]}'),
('com_users.reminder', '', 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', '', '', '{"tags":["name","username","sitename","email","link_text","link_html"]}'),
('plg_system_updatenotification.mail', '', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}'),
('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}');

View File

@ -220,16 +220,16 @@ HTMLHelper::_('behavior.formvalidator');
<caption id="install_languages_desc"><?php echo Text::_('INSTL_LANGUAGES_DESC'); ?></caption>
<thead>
<tr>
<td width="1%" class="text-center">
<td>
&nbsp;
</td>
<th scope="col">
<?php echo Text::_('INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE'); ?>
</th>
<th scope="col" width="15%">
<th scope="col">
<?php echo Text::_('INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG'); ?>
</th>
<th scope="col" width="5%" class="text-center">
<th scope="col" class="text-center">
<?php echo Text::_('INSTL_LANGUAGES_COLUMN_HEADER_VERSION'); ?>
</th>
</tr>

View File

@ -18,8 +18,8 @@ COM_CONTACT_FILTER_SEARCH_DESC="Contact Filter Search"
COM_CONTACT_CHECKED_OUT_BY="Checked out by %s"
COM_CONTACT_CONTACT_MESSAGE_SUBJECT_LABEL="Subject"
COM_CONTACT_CONTACT_SEND="Send Email"
COM_CONTACT_COPYSUBJECT_OF="Copy of: %s"
COM_CONTACT_COPYTEXT_OF="This is a copy of the following message you sent to %s via %s"
COM_CONTACT_COPYSUBJECT_OF="Copy of: {SUBJECT}"
COM_CONTACT_COPYTEXT_OF="This is a copy of the following message you sent to {CONTACTNAME} via {SITENAME}\n\n{BODY}"
COM_CONTACT_COUNT="Contact count:"
COM_CONTACT_COUNTRY="Country"
COM_CONTACT_DEFAULT_PAGE_TITLE="Contacts"
@ -29,7 +29,8 @@ COM_CONTACT_EDIT_CONTACT="Edit Contact"
COM_CONTACT_EMAIL_FORM="Contact Form"
COM_CONTACT_EMAIL_LABEL="Email"
COM_CONTACT_EMAIL_THANKS="Thank you for your email."
COM_CONTACT_ENQUIRY_TEXT="This is an enquiry email via %s from:"
COM_CONTACT_ENQUIRY_SUBJECT="{SITENAME}: {SUBJECT}"
COM_CONTACT_ENQUIRY_TEXT="This is an enquiry email via {URL} from:\n{NAME} <{EMAIL}>\n\n{BODY}\n\n{CUSTOMFIELDS}"
COM_CONTACT_ERROR_CONTACT_NOT_FOUND="Contact not found"
COM_CONTACT_FAX="Fax"
COM_CONTACT_FAX_NUMBER="Fax: %s"

View File

@ -74,8 +74,8 @@ COM_CONTENT_PUBLISHED_DATE_ON="Published: %s"
COM_CONTENT_PUBLISHING="Publishing"
COM_CONTENT_RATINGS="Rating"
COM_CONTENT_RATINGS_COUNT="Rating: %s"
COM_CONTENT_READ_MORE="Read more: "
COM_CONTENT_READ_MORE_TITLE="Read more ..."
COM_CONTENT_READ_MORE="Read more ..."
COM_CONTENT_READ_MORE_TITLE="Read more: %s"
COM_CONTENT_REGISTER_TO_READ_MORE="Register to read more ..."
COM_CONTENT_RIGHT="Right"
COM_CONTENT_SAVE_SUCCESS="Article saved."

View File

@ -14,8 +14,8 @@ COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA n
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of %s at %s"
COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering."
COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for %s at %s"
COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your %s account password. To reset your password, you will need to submit this verification code to verify that the request was legitimate.\n\nThe verification code is %s\n\nSelect the URL below and proceed with resetting your password.\n\n %s \n\nThank you."
COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your %s password reset request"
COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your {SITENAME} account password. To reset your password, you will need to submit this verification code to verify that the request was legitimate.\n\nThe verification code is {TOKEN}\n\nSelect the URL below and proceed with resetting your password.\n\n {LINK_TEXT} \n\nThank you."
COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your {SITENAME} password reset request"
COM_USERS_EMAIL_REGISTERED_BODY="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
COM_USERS_EMAIL_REGISTERED_BODY_NOPW="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the username and password you registered with."
COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator, \n\nA new user '%s', username '%s', has registered at %s."
@ -23,8 +23,8 @@ COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for regi
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s"
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s"
COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your %s account.\n\nYour username is %s.\n\nTo login to your account, select the link below.\n\n%s \n\nThank you."
COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your %s username"
COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your {SITENAME} account.\n\nYour username is {USERNAME}.\n\nTo login to your account, select the link below.\n\n{LINK_TEXT} \n\nThank you."
COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your {SITENAME} username"
COM_USERS_ERROR_SECRET_CODE_WITHOUT_TFA="You have entered a Secret Code but two factor authentication is not enabled in your user account. If you want to use a secret code to secure your login please edit your user profile and enable two factor authentication."
COM_USERS_FIELD_PASSWORD_RESET_DESC="Please enter the email address associated with your User account.<br>A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account."
COM_USERS_FIELD_PASSWORD_RESET_LABEL="Email Address"

View File

@ -20,13 +20,12 @@ $direction = Factory::getLanguage()->isRtl() ? 'left' : 'right';
<p class="readmore">
<?php if (!$params->get('access-view')) : ?>
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?>
<?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>">
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::_('COM_CONTENT_REGISTER_TO_READ_MORE') . ' ' . $this->escape($item->title); ?>">
<?php echo '<span class="fas fa-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php echo Text::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?>
</a>
<?php elseif ($readmore = $item->alternative_readmore) : ?>
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo $readmore; ?> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>">
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo $this->escape($readmore . ' ' . $item->title); ?>">
<?php echo '<span class="fas fa-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php echo $readmore; ?>
<?php if ($params->get('show_readmore_title', 0) != 0) : ?>
@ -34,15 +33,14 @@ $direction = Factory::getLanguage()->isRtl() ? 'left' : 'right';
<?php endif; ?>
</a>
<?php elseif ($params->get('show_readmore_title', 0) == 0) : ?>
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::_('COM_CONTENT_READ_MORE'); ?> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>">
<?php echo '<span class="fas fa-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php echo Text::sprintf('COM_CONTENT_READ_MORE_TITLE'); ?>
</a>
<?php else : ?>
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::_('COM_CONTENT_READ_MORE'); ?> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>">
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::sprintf('COM_CONTENT_READ_MORE_TITLE', $this->escape($item->title)); ?>">
<?php echo '<span class="fas fa-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php echo Text::_('COM_CONTENT_READ_MORE'); ?>
<?php echo HTMLHelper::_('string.truncate', $item->title, $params->get('readmore_limit')); ?>
</a>
<?php else : ?>
<a class="btn btn-secondary" href="<?php echo $displayData['link']; ?>" itemprop="url" aria-label="<?php echo Text::sprintf('COM_CONTENT_READ_MORE_TITLE', $this->escape($item->title)); ?>">
<?php echo '<span class="fas fa-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php echo Text::sprintf('COM_CONTENT_READ_MORE_TITLE', HTMLHelper::_('string.truncate', $item->title, $params->get('readmore_limit'))); ?>
</a>
<?php endif; ?>
</p>

View File

@ -72,7 +72,7 @@ if (isset($params['url']))
}
?>
<div id="<?php echo $selector; ?>" role="dialog" <?php echo ArrayHelper::toString($modalAttributes); ?> <?php echo $url ?? ''; ?> <?php echo isset($url) ? 'data-iframe="'.trim($iframeHtml).'"' : ''; ?>>
<div class="modal-dialog modal-lg<?php echo $modalDialogClass; ?>" role="document">
<div class="modal-dialog modal-lg<?php echo $modalDialogClass; ?>">
<div class="modal-content">
<?php
// Header

View File

@ -18,6 +18,7 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Utility\Utility;
use Joomla\CMS\WebAsset\WebAssetManager;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;
@ -160,6 +161,30 @@ class HtmlDocument extends Document
$data['scriptOptions'] = $this->scriptOptions;
// Get Asset manager state
$wa = $this->getWebAssetManager();
$waState = $wa->getManagerState();
// Get asset objects and filter only manually added/enabled assets,
// Dependencies will be picked up from registry files
$waState['assets'] = [];
foreach ($waState['activeAssets'] as $assetType => $assetNames)
{
foreach ($assetNames as $assetName => $assetState)
{
if ($assetState === WebAssetManager::ASSET_STATE_ACTIVE)
{
$waState['assets'][$assetType][] = $wa->getAsset($assetType, $assetName);
}
}
}
// We have loaded asset objects, now can remove unused stuff
unset($waState['activeAssets']);
$data['assetManager'] = $waState;
return $data;
}
@ -269,6 +294,30 @@ class HtmlDocument extends Document
$this->_custom = $data['custom'] ?? $this->_custom;
$this->scriptOptions = (isset($data['scriptOptions']) && !empty($data['scriptOptions'])) ? $data['scriptOptions'] : $this->scriptOptions;
// Restore asset manager state
$wa = $this->getWebAssetManager();
if (!empty($data['assetManager']['registryFiles']))
{
$waRegistry = $wa->getRegistry();
foreach ($data['assetManager']['registryFiles'] as $registryFile)
{
$waRegistry->addRegistryFile($registryFile);
}
}
if (!empty($data['assetManager']['assets']))
{
foreach ($data['assetManager']['assets'] as $assetType => $assets)
{
foreach ($assets as $asset)
{
$wa->registerAsset($assetType, $asset)->useAsset($assetType, $asset->getName());
}
}
}
return $this;
}
@ -360,6 +409,30 @@ class HtmlDocument extends Document
}
}
// Restore asset manager state
$wa = $this->getWebAssetManager();
if (!empty($data['assetManager']['registryFiles']))
{
$waRegistry = $wa->getRegistry();
foreach ($data['assetManager']['registryFiles'] as $registryFile)
{
$waRegistry->addRegistryFile($registryFile);
}
}
if (!empty($data['assetManager']['assets']))
{
foreach ($data['assetManager']['assets'] as $assetType => $assets)
{
foreach ($assets as $asset)
{
$wa->registerAsset($assetType, $asset)->useAsset($assetType, $asset->getName());
}
}
}
return $this;
}

View File

@ -65,6 +65,12 @@ abstract class JGrid
$title = $enabled ? $active_title : $inactive_title;
$title = $translate ? Text::_($title) : $title;
$ariaid = $checkbox . $task . $i . '-desc';
// Don't show empty tooltip.
if ($title === '')
{
$tip = false;
}
}
if ($enabled)
@ -123,7 +129,7 @@ abstract class JGrid
}
else
{
$html[] = '<a class="tbody-icon ' . $active_class . '-disabled disabled jgrid"';
$html[] = '<span class="tbody-icon ' . $active_class . '-disabled disabled jgrid"';
$html[] = $tip ? ' aria-labelledby="' . $ariaid . '"' : '';
$html[] = '>';
@ -169,7 +175,7 @@ abstract class JGrid
$html[] = '<span class="' . $inactive_class . '" aria-hidden="true"></span>';
}
$html[] = '</a>';
$html[] = '</span>';
$html[] = $tip ? '<div role="tooltip" id="' . $ariaid . '">' . $title . '</div>' : '';
}

View File

@ -602,6 +602,9 @@ class ModuleAdapter extends InstallerAdapter
// Update namespace
$this->extension->namespace = (string) $this->manifest->namespace;
// Update changelogurl
$this->extension->changelogurl = (string) $this->manifest->changelogurl;
// Update manifest
$this->extension->manifest_cache = $this->parent->generateManifestCache();

View File

@ -472,8 +472,19 @@ class PluginAdapter extends InstallerAdapter
);
}
// Load the entry and update the manifest_cache
$this->extension->load($this->currentExtensionId);
// Update name
$this->extension->name = $this->name;
// Update namespace
$this->extension->namespace = (string) $this->manifest->namespace;
// Update changelogurl
$this->extension->changelogurl = (string) $this->manifest->changelogurl;
// Update manifest
$this->extension->manifest_cache = $this->parent->generateManifestCache();
// Update the manifest cache and name

View File

@ -201,19 +201,6 @@ class Text
$args = \func_get_args();
$count = \count($args);
if ($count < 1)
{
return '';
}
if ($count == 1)
{
// Default to the normal sprintf handling.
$args[0] = $lang->_($string);
return \call_user_func_array('sprintf', $args);
}
// Try the key from the language plural potential suffixes
$found = false;
$suffixes = $lang->getPluralSuffixes((int) $n);
@ -285,11 +272,6 @@ class Text
$args = \func_get_args();
$count = \count($args);
if ($count < 1)
{
return '';
}
if (\is_array($args[$count - 1]))
{
$args[0] = $lang->_(
@ -332,11 +314,6 @@ class Text
$args = \func_get_args();
$count = \count($args);
if ($count < 1)
{
return '';
}
if (\is_array($args[$count - 1]))
{
$args[0] = $lang->_(

View File

@ -70,6 +70,14 @@ class MailTemplate
*/
protected $recipients = array();
/**
* Reply To of the email
*
* @var \stdClass
* @since 4.0.0
*/
protected $replyto;
/**
* Constructor for the mail templating class
*
@ -123,15 +131,33 @@ class MailTemplate
*
* @since 4.0.0
*/
public function addRecipient($mail, $name, $type = 'to')
public function addRecipient($mail, $name = null, $type = 'to')
{
$recipient = new \stdClass;
$recipient->mail = $mail;
$recipient->name = $name;
$recipient->name = $name ?? $mail;
$recipient->type = $type;
$this->recipients[] = $recipient;
}
/**
* Set reply to for this mail
*
* @param string $mail Mail address to reply to
* @param string $name Name
*
* @return void
*
* @since 4.0.0
*/
public function setReplyTo($mail, $name = '')
{
$reply = new \stdClass;
$reply->mail = $mail;
$reply->name = $name;
$this->replyto = $reply;
}
/**
* Add data to replace in the template
*
@ -240,6 +266,11 @@ class MailTemplate
}
}
if ($this->replyto)
{
$this->mailer->addReplyTo($this->replyto->mail, $this->replyto->name);
}
$path = JPATH_ROOT . '/' . $config->get('attachment_folder') . '/';
foreach ((array) json_decode($mail->attachments) as $attachment)
@ -282,21 +313,23 @@ class MailTemplate
if (is_array($value))
{
$matches = array();
preg_match_all('/{' . strtoupper($key) . '}(.*?){/' . strtoupper($key) . '}/s', $text, $matches);
foreach ($matches[0] as $i => $match)
if (preg_match_all('/{' . strtoupper($key) . '}(.*?){\/' . strtoupper($key) . '}/s', $text, $matches))
{
$replacement = '';
foreach ($value as $subvalue)
foreach ($matches[0] as $i => $match)
{
if (is_array($subvalue))
{
$replacement .= $this->replaceTags($matches[1][$i], $subvalue);
}
}
$replacement = '';
$text = str_replace($match, $replacement, $text);
foreach ($value as $subvalue)
{
if (is_array($subvalue))
{
$replacement .= $this->replaceTags($matches[1][$i], $subvalue);
}
}
$text = str_replace($match, $replacement, $text);
}
}
}
else

View File

@ -720,6 +720,21 @@ class WebAssetManager implements WebAssetManagerInterface
return $this;
}
/**
* Get the manager state. A collection of registry files and active asset names (per type).
*
* @return array
*
* @since __DEPLOY_VERSION__
*/
public function getManagerState(): array
{
return [
'registryFiles' => $this->getRegistry()->getRegistryFiles(),
'activeAssets' => $this->activeAssets,
];
}
/**
* Update Dependencies state for all active Assets or only for given
*

View File

@ -270,6 +270,18 @@ class WebAssetRegistry implements WebAssetRegistryInterface, DispatcherAwareInte
return $this;
}
/**
* Get a list of the registry files
*
* @return array
*
* @since __DEPLOY_VERSION__
*/
public function getRegistryFiles(): array
{
return array_values($this->dataFilesParsed + $this->dataFilesNew);
}
/**
* Helper method to register new file with Template Asset(s) info
*

View File

@ -89,7 +89,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onContentAfterSave($context, $article, $isNew)
public function onContentAfterSave($context, $article, $isNew): void
{
if (isset($this->contextAliases[$context]))
{
@ -155,7 +155,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onContentAfterDelete($context, $article)
public function onContentAfterDelete($context, $article): void
{
$option = $this->app->input->get('option');
@ -305,7 +305,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onApplicationAfterSave($config)
public function onApplicationAfterSave($config): void
{
$option = $this->app->input->getCmd('option');
@ -499,7 +499,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onExtensionAfterSave($context, $table, $isNew)
public function onExtensionAfterSave($context, $table, $isNew): void
{
$option = $this->app->input->getCmd('option');
@ -563,7 +563,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onExtensionAfterDelete($context, $table)
public function onExtensionAfterDelete($context, $table): void
{
if (!$this->checkLoggable($this->app->input->get('option')))
{
@ -604,7 +604,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onUserAfterSave($user, $isnew, $success, $msg)
public function onUserAfterSave($user, $isnew, $success, $msg): void
{
$context = $this->app->input->get('option');
$task = $this->app->input->post->get('task');
@ -676,7 +676,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onUserAfterDelete($user, $success, $msg)
public function onUserAfterDelete($user, $success, $msg): void
{
$context = $this->app->input->get('option');
@ -710,7 +710,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onUserAfterSaveGroup($context, $table, $isNew)
public function onUserAfterSaveGroup($context, $table, $isNew): void
{
$context = $this->app->input->get('option');
@ -754,7 +754,7 @@ class PlgActionlogJoomla extends ActionLogPlugin
*
* @since 3.9.0
*/
public function onUserAfterDeleteGroup($group, $success, $msg)
public function onUserAfterDeleteGroup($group, $success, $msg): void
{
$context = $this->app->input->get('option');

View File

@ -33,7 +33,7 @@ class PlgContentFinder extends CMSPlugin
*
* @since 2.5
*/
public function onContentAfterSave($context, $article, $isNew)
public function onContentAfterSave($context, $article, $isNew): void
{
PluginHelper::importPlugin('finder');
@ -72,7 +72,7 @@ class PlgContentFinder extends CMSPlugin
*
* @since 2.5
*/
public function onContentAfterDelete($context, $article)
public function onContentAfterDelete($context, $article): void
{
PluginHelper::importPlugin('finder');

View File

@ -102,29 +102,28 @@ class PlgContentJoomla extends CMSPlugin
* @param object $article A JTableContent object
* @param boolean $isNew If the content is just about to be created
*
* @return boolean true if function not enabled, is in frontend or is new. Else true or
* false depending on success of save function.
* @return void
*
* @since 1.6
*/
public function onContentAfterSave($context, $article, $isNew)
public function onContentAfterSave($context, $article, $isNew): void
{
// Check we are handling the frontend edit form.
if ($context !== 'com_content.form')
{
return true;
return;
}
// Check if this function is enabled.
if (!$this->params->def('email_new_fe', 1))
{
return true;
return;
}
// Check this is a new article.
if (!$isNew)
{
return true;
return;
}
$db = $this->db;
@ -138,7 +137,7 @@ class PlgContentJoomla extends CMSPlugin
if (empty($users))
{
return true;
return;
}
$user = $this->app->getIdentity();
@ -147,7 +146,6 @@ class PlgContentJoomla extends CMSPlugin
$default_language = ComponentHelper::getParams('com_languages')->get('administrator');
$debug = $this->app->get('debug_lang');
$result = true;
foreach ($users as $user_id)
{
@ -164,11 +162,9 @@ class PlgContentJoomla extends CMSPlugin
);
$model_message = $this->app->bootComponent('com_messages')->getMVCFactory()
->createModel('Message', 'Administrator');
$result = $model_message->save($message);
$model_message->save($message);
}
}
return $result;
}
/**
@ -615,12 +611,6 @@ class PlgContentJoomla extends CMSPlugin
return true;
}
// Check if this function is enabled.
if (!$this->params->def('email_new_stage', 0) || $context != 'com_content.article')
{
return true;
}
$db = $this->db;
$query = $db->getQuery(true)
->select($db->quoteName('core_content_id'))
@ -634,6 +624,12 @@ class PlgContentJoomla extends CMSPlugin
$cctable = new CoreContent($db);
$cctable->publish($ccIds, $value);
// Check if sending email on transition execution is enabled.
if (!$this->params->def('email_new_stage', 0) || $context !== 'com_content.article')
{
return true;
}
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__users'))

View File

@ -14,6 +14,7 @@ use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Log\Log;
@ -501,38 +502,29 @@ class PlgEditorTinymce extends CMSPlugin
}
}
// Drag and drop Images
// Drag and drop Images always FALSE, reverting this allows for inlining the images
$allowImgPaste = false;
$dragdrop = $levelParams->get('drag_drop', 1);
if ($dragdrop && $user->authorise('core.create', 'com_media'))
{
$externalPlugins['jdragndrop'] = Uri::root() . 'media/plg_editors_tinymce/js/plugins/dragdrop/plugin.min.js';
$allowImgPaste = true;
$isSubDir = '';
$session = $this->app->getSession();
$uploadUrl = Uri::base() . 'index.php?option=com_media&task=file.upload&tmpl=component&'
. $session->getName() . '=' . $session->getId()
. '&' . Session::getFormToken() . '=1'
. '&asset=image&format=json';
$externalPlugins['jdragndrop'] = HTMLHelper::_('script', 'plg_editors_tinymce/plugins/dragdrop/plugin.min.js', ['relative' => true, 'version' => 'auto', 'pathOnly' => true]);
$uploadUrl = Uri::base(false) . 'index.php?option=com_media&format=json&task=api.files';
if ($this->app->isClient('site'))
{
$uploadUrl = htmlentities($uploadUrl, null, 'UTF-8', null);
}
// Is Joomla installed in subdirectory
if (Uri::root(true) !== '/')
{
$isSubDir = Uri::root(true);
}
Text::script('PLG_TINY_ERR_UNSUPPORTEDBROWSER');
Text::script('JERROR');
$scriptOptions['setCustomDir'] = $isSubDir;
$scriptOptions['mediaUploadPath'] = $levelParams->get('path', '');
$scriptOptions['uploadUri'] = $uploadUrl;
$scriptOptions['parentUploadFolder'] = $levelParams->get('path', '');
$scriptOptions['csrfToken'] = Session::getFormToken();
$scriptOptions['uploadUri'] = $uploadUrl;
// @TODO have a way to select the adapter, similar to $levelParams->get('path', '');
$scriptOptions['comMediaAdapter'] = 'local-0:';
}
// Convert pt to px in dropdown

View File

@ -134,12 +134,12 @@ class PlgFinderCategories extends Adapter
* @param Table $row A Table object.
* @param boolean $isNew True if the category has just been created.
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterSave($context, $row, $isNew)
public function onFinderAfterSave($context, $row, $isNew): void
{
// We only want to handle categories here.
if ($context === 'com_categories.category')
@ -160,8 +160,6 @@ class PlgFinderCategories extends Adapter
$this->categoryAccessChange($row);
}
}
return true;
}
/**

View File

@ -113,12 +113,12 @@ class PlgFinderContacts extends Adapter
* @param string $context The context of the action being performed.
* @param Table $table A Table object containing the record to be deleted
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterDelete($context, $table)
public function onFinderAfterDelete($context, $table): void
{
if ($context === 'com_contact.contact')
{
@ -130,11 +130,11 @@ class PlgFinderContacts extends Adapter
}
else
{
return true;
return;
}
// Remove the items.
return $this->remove($id);
$this->remove($id);
}
/**
@ -144,12 +144,12 @@ class PlgFinderContacts extends Adapter
* @param Table $row A Table object
* @param boolean $isNew If the content has just been created
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterSave($context, $row, $isNew)
public function onFinderAfterSave($context, $row, $isNew): void
{
// We only want to handle contacts here
if ($context === 'com_contact.contact')
@ -174,8 +174,6 @@ class PlgFinderContacts extends Adapter
$this->categoryAccessChange($row);
}
}
return true;
}
/**

View File

@ -115,12 +115,12 @@ class PlgFinderContent extends Adapter
* @param string $context The context of the action being performed.
* @param Table $table A Table object containing the record to be deleted
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterDelete($context, $table)
public function onFinderAfterDelete($context, $table): void
{
if ($context === 'com_content.article')
{
@ -132,11 +132,11 @@ class PlgFinderContent extends Adapter
}
else
{
return true;
return;
}
// Remove item from the index.
return $this->remove($id);
$this->remove($id);
}
/**
@ -149,12 +149,12 @@ class PlgFinderContent extends Adapter
* @param Table $row A Table object.
* @param boolean $isNew True if the content has just been created.
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterSave($context, $row, $isNew)
public function onFinderAfterSave($context, $row, $isNew): void
{
// We only want to handle articles here.
if ($context === 'com_content.article' || $context === 'com_content.form')
@ -179,8 +179,6 @@ class PlgFinderContent extends Adapter
$this->categoryAccessChange($row);
}
}
return true;
}
/**

View File

@ -111,12 +111,12 @@ class PlgFinderNewsfeeds extends Adapter
* @param string $context The context of the action being performed.
* @param Table $table A Table object containing the record to be deleted.
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterDelete($context, $table)
public function onFinderAfterDelete($context, $table): void
{
if ($context === 'com_newsfeeds.newsfeed')
{
@ -128,11 +128,11 @@ class PlgFinderNewsfeeds extends Adapter
}
else
{
return true;
return;
}
// Remove the item from the index.
return $this->remove($id);
$this->remove($id);
}
/**
@ -145,12 +145,12 @@ class PlgFinderNewsfeeds extends Adapter
* @param Table $row A Table object.
* @param boolean $isNew True if the content has just been created.
*
* @return boolean True on success.
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterSave($context, $row, $isNew)
public function onFinderAfterSave($context, $row, $isNew): void
{
// We only want to handle newsfeeds here.
if ($context === 'com_newsfeeds.newsfeed')
@ -175,8 +175,6 @@ class PlgFinderNewsfeeds extends Adapter
$this->categoryAccessChange($row);
}
}
return true;
}
/**

View File

@ -88,12 +88,12 @@ class PlgFinderTags extends Adapter
* @param string $context The context of the action being performed.
* @param Table $table A Table object containing the record to be deleted
*
* @return boolean True on success.
* @return void
*
* @since 3.1
* @throws Exception on database error.
*/
public function onFinderAfterDelete($context, $table)
public function onFinderAfterDelete($context, $table): void
{
if ($context === 'com_tags.tag')
{
@ -105,11 +105,11 @@ class PlgFinderTags extends Adapter
}
else
{
return true;
return;
}
// Remove the items.
return $this->remove($id);
$this->remove($id);
}
/**
@ -119,12 +119,12 @@ class PlgFinderTags extends Adapter
* @param Table $row A Table object
* @param boolean $isNew If the content has just been created
*
* @return boolean True on success.
* @return void
*
* @since 3.1
* @throws Exception on database error.
*/
public function onFinderAfterSave($context, $row, $isNew)
public function onFinderAfterSave($context, $row, $isNew): void
{
// We only want to handle tags here.
if ($context === 'com_tags.tag')
@ -139,8 +139,6 @@ class PlgFinderTags extends Adapter
// Reindex the item
$this->reindex($row->id);
}
return true;
}
/**

View File

@ -39,8 +39,8 @@ $dir = $this->isRTL() ? ' dir="ltr"' : '';
<div class="card card-light">
<div class="card-body">
<div class="card-text">
<input type="button" class="btn btn-primary" value="<?php echo Text::_('COM_INSTALLER_INSTALL_BUTTON'); ?>" onclick="Joomla.submitbutton<?php echo $this->getInstallFrom() != '' ? 4 : 5; ?>()" />
<input type="button" class="btn btn-secondary" id="uploadform-web-cancel" value="<?php echo Text::_('JCANCEL'); ?>" />
<button type="button" class="btn btn-primary" id="uploadform-web-install"><?php echo Text::_('COM_INSTALLER_INSTALL_BUTTON'); ?></button>
<button type="button" class="btn btn-secondary" id="uploadform-web-cancel"><?php echo Text::_('JCANCEL'); ?></button>
</div>
</div>
</div>

View File

@ -114,6 +114,7 @@ class PlgInstallerWebinstaller extends CMSPlugin
'dev_level' => base64_encode($devLevel),
'installfromon' => $installfrom ? 1 : 0,
'language' => base64_encode($lang->getTag()),
'installFrom' => $installfrom != '' ? 4 : 5,
]
);

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