Skip to content
Permalink
Browse files

Merge branch '4.0-dev' into drop_server_config_files

  • Loading branch information...
zero-24 committed Aug 5, 2019
2 parents 1f62209 + dfeae11 commit f2407258ba9081a0fe0346e7cf7f74542c80f6e8
Showing with 257 additions and 193 deletions.
  1. +4 −5 administrator/components/com_contact/Service/HTML/AdministratorService.php
  2. +0 −36 administrator/components/com_content/Service/HTML/AdministratorService.php
  3. +28 −0 administrator/components/com_csp/Helper/ReporterHelper.php
  4. +8 −0 administrator/components/com_csp/View/Reports/HtmlView.php
  5. +3 −0 administrator/components/com_csp/tmpl/reports/default.php
  6. +3 −3 administrator/components/com_messages/Service/HTML/Messages.php
  7. +9 −2 administrator/components/com_privacy/Model/ConsentsModel.php
  8. +1 −1 administrator/components/com_privacy/View/Request/HtmlView.php
  9. +2 −0 administrator/components/com_privacy/forms/filter_consents.xml
  10. +1 −3 administrator/components/com_privacy/forms/request.xml
  11. +30 −29 administrator/components/com_privacy/tmpl/consents/default.php
  12. +5 −20 administrator/components/com_privacy/tmpl/request/edit.php
  13. +3 −3 administrator/components/com_redirect/Service/HTML/Redirect.php
  14. +5 −1 administrator/components/com_users/tmpl/users/default.php
  15. +1 −0 administrator/language/en-GB/en-GB.com_csp.ini
  16. +9 −6 administrator/language/en-GB/en-GB.com_privacy.ini
  17. +1 −1 administrator/language/en-GB/en-GB.com_users.ini
  18. +1 −1 administrator/modules/mod_menu/Menu/CssMenu.php
  19. +1 −1 build/media_source/system/js/fields/joomla-field-module-order.w-c.es6.js
  20. +11 −5 components/com_content/Model/ArticleModel.php
  21. +4 −1 components/com_tags/tmpl/tag/default_items.php
  22. +5 −5 composer.lock
  23. +9 −0 installation/forms/setup.xml
  24. +2 −1 installation/language/en-GB/en-GB.ini
  25. +2 −1 installation/language/en-US/en-US.ini
  26. +5 −4 installation/src/Model/ConfigurationModel.php
  27. +4 −0 installation/tmpl/setup/default.php
  28. +1 −1 layouts/joomla/form/field/moduleorder.php
  29. +1 −1 layouts/joomla/form/field/tag.php
  30. +12 −12 libraries/src/Document/Document.php
  31. +29 −20 libraries/src/Document/Renderer/Html/ScriptsRenderer.php
  32. +29 −20 libraries/src/Document/Renderer/Html/StylesRenderer.php
  33. +2 −2 plugins/content/pagenavigation/pagenavigation.php
  34. +1 −1 plugins/editors/tinymce/tinymce.php
  35. +1 −0 plugins/sampledata/testing/language/en-GB/en-GB.plg_sampledata_testing.ini
  36. +23 −7 plugins/sampledata/testing/testing.php
  37. +1 −0 tests/Codeception/acceptance.suite.yml
@@ -12,7 +12,6 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
@@ -116,14 +115,14 @@ public function featured($value, $i, $canChange = true)
if ($canChange)
{
$html = '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="tbody-icon hasTooltip'
. ($value == 1 ? ' active' : '') . '" title="' . HTMLHelper::_('tooltipText', $state[3])
$html = '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="tbody-icon'
. ($value == 1 ? ' active' : '') . '" title="' . Text::_($state[3])
. '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>';
}
else
{
$html = '<a class="tbody-icon hasTooltip disabled' . ($value == 1 ? ' active' : '')
. '" title="' . HTMLHelper::_('tooltipText', $state[2]) . '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>';
$html = '<a class="tbody-icon disabled' . ($value == 1 ? ' active' : '')
. '" title="' . Text::_($state[2]) . '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>';
}
return $html;
@@ -12,12 +12,10 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Utilities\ArrayHelper;
/**
* Content HTML helper
@@ -94,38 +92,4 @@ public function association($articleid)
return $html;
}
/**
* Show the feature/unfeature links
*
* @param integer $value The state value
* @param integer $i Row number
* @param boolean $canChange Is user allowed to change?
*
* @return string HTML code
*/
public function featured($value, $i, $canChange = true)
{
// Array of image, task, title, action
$states = array(
0 => array('unfeatured', 'articles.featured', 'COM_CONTENT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
1 => array('featured', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
);
$state = ArrayHelper::getValue($states, (int) $value, $states[1]);
$icon = $state[0];
if ($canChange)
{
$html = '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="tbody-icon hasTooltip'
. ($value == 1 ? ' active' : '') . '" title="' . HTMLHelper::_('tooltipText', $state[3])
. '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>';
}
else
{
$html = '<a class="tbody-icon hasTooltip disabled' . ($value == 1 ? ' active' : '') . '" title="'
. HTMLHelper::_('tooltipText', $state[2]) . '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>';
}
return $html;
}
}
@@ -48,4 +48,32 @@ public static function getHttpHeadersPluginId()
return $result;
}
/**
* Check the com_csp trash to show a warning in this case
*
* @return boolean The status of the trash; Do items exists in the trash
*
* @since 4.0.0
*/
public static function getCspTrashStatus()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('COUNT(*)')
->from($db->quoteName('#__csp'))
->where($db->quoteName('published') . ' = ' . $db->quote('-2'));
$db->setQuery($query);
try
{
$result = (int) $db->loadResult();
}
catch (\RuntimeException $e)
{
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
return boolval($result);
}
}
@@ -11,6 +11,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
@@ -102,6 +103,13 @@ public function display($tpl = null)
$this->httpHeadersId = ReporterHelper::getHttpHeadersPluginId();
}
if (ComponentHelper::getParams('com_csp')->get('contentsecuritypolicy_mode', 'custom') === 'detect'
&& ComponentHelper::getParams('com_csp')->get('contentsecuritypolicy', 0)
&& ReporterHelper::getCspTrashStatus())
{
$this->trashWarningMessage = Text::_('COM_CSP_COLLECTING_TRASH_WARNING');
}
$this->addToolbar();
return parent::display($tpl);
@@ -55,6 +55,9 @@
)
); ?>
<?php endif; ?>
<?php if (isset($this->trashWarningMessage)) : ?>
<?php Factory::getApplication()->enqueueMessage($this->trashWarningMessage, 'warning'); ?>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
@@ -11,7 +11,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
/**
@@ -46,8 +46,8 @@ public function status($i, $value = 0, $canChange = false)
if ($canChange)
{
$html = '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-sm hasTooltip'
. ($value == 1 ? ' active' : '') . '" title="' . HTMLHelper::_('tooltipText', $state[3]) . '"><span class="icon-'
$html = '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="tbody-icon'
. ($value == 1 ? ' active' : '') . '" title="' . Text::_($state[3]) . '"><span class="icon-'
. $icon . '" aria-hidden="true"></span></a>';
}
@@ -39,6 +39,7 @@ public function __construct($config = [])
'id', 'a.id', 'a.user_id',
'created', 'a.created',
'username', 'u.username',
'name', 'u.name',
'state', 'a.state',
];
}
@@ -63,8 +64,9 @@ protected function getListQuery()
$query->select($this->getState('list.select', 'a.*'));
$query->from($db->quoteName('#__privacy_consents', 'a'));
// Join over the users for the username.
$query->select($db->quoteName('u.username', 'username'));
// Join over the users for the username and name.
$query->select($db->quoteName('u.username', 'username'))
->select($db->quoteName('u.name', 'name'));
$query->join('LEFT', $db->quoteName('#__users', 'u') . ' ON u.id = a.user_id');
// Filter by search in email
@@ -80,6 +82,11 @@ protected function getListQuery()
{
$query->where($db->quoteName('a.user_id') . ' = ' . (int) substr($search, 4));
}
elseif (stripos($search, 'name:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 5), true) . '%');
$query->where($db->quoteName('u.name') . ' LIKE ' . $search);
}
else
{
$search = $db->quote('%' . $db->escape($search, true) . '%');
@@ -125,7 +125,7 @@ protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_PRIVACY_VIEW_REQUEST_ADD_REQUEST'), 'lock');
ToolbarHelper::apply('request.save');
ToolbarHelper::save('request.save');
ToolbarHelper::cancel('request.cancel');
ToolbarHelper::help('JHELP_COMPONENTS_PRIVACY_REQUEST_EDIT');
}
@@ -50,6 +50,8 @@
>
<option value="u.username ASC">COM_PRIVACY_HEADING_USERNAME_ASC</option>
<option value="u.username DESC">COM_PRIVACY_HEADING_USERNAME_DESC</option>
<option value="u.name ASC">COM_PRIVACY_HEADING_NAME_ASC</option>
<option value="u.name DESC">COM_PRIVACY_HEADING_NAME_DESC</option>
<option value="a.state ASC">COM_PRIVACY_HEADING_STATUS_ASC</option>
<option value="a.state DESC">COM_PRIVACY_HEADING_STATUS_DESC</option>
<option value="u.user_id ASC">COM_PRIVACY_HEADING_USERID_ASC</option>
@@ -14,8 +14,7 @@
<field
name="status"
type="list"
label="JSTATUS"
description="COM_PRIVACY_FIELD_STATUS_DESC"
label="COM_PRIVACY_FIELD_STATUS_LABEL"
filter="int"
default="0"
validate="options"
@@ -31,7 +30,6 @@
name="request_type"
type="list"
label="COM_PRIVACY_FIELD_REQUEST_TYPE_LABEL"
description="COM_PRIVACY_FIELD_REQUEST_TYPE_DESC"
filter="string"
default="export"
validate="options"
@@ -18,15 +18,13 @@
/** @var PrivacyViewConsent $this */
// Load the tooltip behavior.
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('behavior.multiselect');
$user = Factory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$now = Factory::getDate();
$stateIcons = array(-1 => 'trash', 0 => 'archive', 1 => 'publish');
$stateIcons = array(-1 => 'delete', 0 => 'archive', 1 => 'publish');
$stateMsgs = array(
-1 => Text::_('COM_PRIVACY_CONSENTS_STATE_INVALIDATED'),
0 => Text::_('COM_PRIVACY_CONSENTS_STATE_OBSOLETE'),
@@ -37,60 +35,62 @@
<form action="<?php echo Route::_('index.php?option=com_privacy&view=consents'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<div class="clearfix"> </div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="consentList">
<table class="table" id="consentList">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_PRIVACY_TABLE_CONSENTS_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<th width="1%" class="center">
<td style="width:1%" class="text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap center">
</td>
<th scope="col" style="width:5%" class="text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap">
<th scope="col" width="10%">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_USERNAME', 'u.username', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap">
<th scope="col" width="10%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_NAME', 'u.name', $listDirn, $listOrder); ?>
</th>
<th scope="col" width="1%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_USERID', 'a.user_id', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap">
<th scope="col" width="10%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_SUBJECT', 'a.subject', $listDirn, $listOrder); ?>
</th>
<th class="nowrap">
<th scope="col">
<?php echo Text::_('COM_PRIVACY_HEADING_CONSENTS_BODY'); ?>
</th>
<th width="15%" class="nowrap">
<th scope="col" width="15%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PRIVACY_HEADING_CONSENTS_CREATED', 'a.created', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<th scope="col" width="1%">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="9">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<tr>
<td class="center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id); ?>
</td>
<td>
<span class="icon icon-<?php echo $stateIcons[$item->state]; ?>" title="<?php echo $stateMsgs[$item->state]; ?>"></span>
<td class="tbody-icon">
<span class="icon-<?php echo $stateIcons[$item->state]; ?>" aria-hidden="true" title="<?php echo $stateMsgs[$item->state]; ?>"></span>
<span class="sr-only"><?php echo $stateMsgs[$item->state]; ?>"></span>
</td>
<td>
<th scope="row">
<?php echo $item->username; ?>
</th>
<td>
<?php echo $item->name; ?>
</td>
<td>
<?php echo $item->user_id; ?>
@@ -102,11 +102,12 @@
<?php echo $item->body; ?>
</td>
<td class="break-word">
<span class="hasTooltip" title="<?php echo HTMLHelper::_('date', $item->created, Text::_('DATE_FORMAT_LC6')); ?>">
<?php echo HTMLHelper::_('date.relative', new Date($item->created), null, $now); ?>
</span>
<?php echo HTMLHelper::_('date.relative', new Date($item->created), null, $now); ?>
<div class="small">
<?php echo HTMLHelper::_('date', $item->created, Text::_('DATE_FORMAT_LC6')); ?>
</div>
</td>
<td class="hidden-phone">
<td>
<?php echo (int) $item->id; ?>
</td>
</tr>
@@ -9,7 +9,6 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
@@ -18,29 +17,15 @@
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
$js = <<< JS
Joomla.submitbutton = function(task) {
if (task === 'request.cancel' || document.formvalidator.isValid(document.getElementById('item-form'))) {
Joomla.submitform(task, document.getElementById('item-form'));
}
};
JS;
Factory::getDocument()->addScriptDeclaration($js);
?>

<form action="<?php echo Route::_('index.php?option=com_privacy&view=request&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
<div class="form-horizontal">
<div class="row-fluid">
<div class="span9">
<fieldset class="adminform">
<?php echo $this->form->renderField('email'); ?>
<?php echo $this->form->renderField('status'); ?>
<?php echo $this->form->renderField('request_type'); ?>
</fieldset>
</div>
</div>

<fieldset class="adminform">
<?php echo $this->form->renderField('email'); ?>
<?php echo $this->form->renderField('status'); ?>
<?php echo $this->form->renderField('request_type'); ?>
</fieldset>
<input type="hidden" name="task" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
</div>

0 comments on commit f240725

Please sign in to comment.
You can’t perform that action at this time.