Skip to content

Commit

Permalink
Merge branch '4.3-dev' into CAPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Mar 27, 2023
2 parents c734339 + 52660a6 commit 2cc74c2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ libraries/src/Installer/* @rdeutz @zero-24
libraries/src/Updater/* @rdeutz @zero-24

# Automated Testing
tests/* @hackwar
tests/* @hackwar @fancyFranci
tests/Codeception/* @rdeutz
tests/javascript/* @rdeutz
tests/Unit/* @rdeutz
.appveyor.yml @rdeutz @hackwar
.drone.yml @rdeutz @hackwar
codeception.yml @rdeutz @hackwar
phpunit.xml.dist @rdeutz @hackwar
phpunit-pgsql.xml.dist @rdeutz @hackwar
.appveyor.yml @rdeutz @hackwar @fancyFranci
.drone.yml @rdeutz @hackwar @fancyFranci
codeception.yml @rdeutz @hackwar @fancyFranci
phpunit.xml.dist @rdeutz @hackwar @fancyFranci
phpunit-pgsql.xml.dist @rdeutz @hackwar @fancyFranci

# HttpHeaders Plugin
plugins/system/httpheaders/* @zero-24
Expand Down
1 change: 0 additions & 1 deletion libraries/src/Form/Field/ImagelistField.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class ImagelistField extends FilelistField
protected function getOptions()
{
// Define the image file type filter.
$this->fileFilter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$';
$this->fileFilter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$|\.avif$|\.webp$|\.heic$|\.wp2$';

// Get the field options.
Expand Down
38 changes: 17 additions & 21 deletions libraries/src/HTML/Helpers/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ abstract class Grid
*/
public static function sort($title, $order, $direction = 'asc', $selected = '', $task = null, $newDirection = 'asc', $tip = '', $form = null)
{
Factory::getDocument()->getWebAssetManager()->useScript('list-view');
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip');

$direction = strtolower($direction);
Expand All @@ -56,12 +55,12 @@ public static function sort($title, $order, $direction = 'asc', $selected = '',
$direction = $direction === 'desc' ? 'asc' : 'desc';
}

$html = '<a href="#" class="hasTooltip" title="' . htmlspecialchars(Text::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '"'
. ' data-ordering-order="' . $order . '"'
. ' data-ordering-direction="' . $direction . '"'
. ' data-ordering-task="' . $task . '"'
. ' data-ordering-form="' . (isset($form) ? $form : '') . '"'
. ' data-bs-placement="top">';
if ($form) {
$form = ', document.getElementById(\'' . $form . '\')';
}

$html = '<a href="#" onclick="Joomla.tableOrdering(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\'' . $form . ');return false;"'
. ' class="hasTooltip" title="' . htmlspecialchars(Text::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '" data-bs-placement="top">';

if (isset($title['0']) && $title['0'] === '<') {
$html .= $title;
Expand Down Expand Up @@ -90,15 +89,9 @@ public static function sort($title, $order, $direction = 'asc', $selected = '',
*/
public static function checkall($name = 'checkall-toggle', $action = 'Joomla.checkAll(this)')
{
Factory::getDocument()->getWebAssetManager()->useScript('list-view');
HTMLHelper::_('behavior.core');

if ($action !== 'Joomla.checkAll(this)') {
$action = ' onclick="' . $action . '"';
} else {
$action = '';
}

return '<input class="js-grid-item-check-all form-check-input" autocomplete="off" type="checkbox" name="' . $name . '" value="" title="' . Text::_('JGLOBAL_CHECK_ALL') . '"' . $action . '>';
return '<input class="form-check-input" autocomplete="off" type="checkbox" name="' . $name . '" value="" title="' . Text::_('JGLOBAL_CHECK_ALL') . '" onclick="' . $action . '">';
}

/**
Expand All @@ -118,12 +111,17 @@ public static function checkall($name = 'checkall-toggle', $action = 'Joomla.che
*/
public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $stub = 'cb', $title = '', $formId = null)
{
Factory::getDocument()->getWebAssetManager()->useScript('list-view');
if ($formId !== null) {
return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
. ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
. '<input class="form-check-input" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
. '" onclick="Joomla.isChecked(this.checked, \'' . $formId . '\');">';
}

return $checkedOut ? '' : '<label for="' . $stub . $rowNum . '"><span class="visually-hidden">' . Text::_('JSELECT')
. ' ' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '</span></label>'
. '<input class="js-grid-item-is-checked form-check-input" autocomplete="off" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
. '"' . ($formId !== null ? ' data-form-id="' . $formId . '"' : '') . '>';
. '<input class="form-check-input" autocomplete="off" type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId
. '" onclick="Joomla.isChecked(this.checked);">';
}

/**
Expand Down Expand Up @@ -174,8 +172,6 @@ public static function checkedOut(&$row, $i, $identifier = 'id')
*/
public static function published($value, $i, $img1 = 'tick.png', $img0 = 'publish_x.png', $prefix = '')
{
Factory::getDocument()->getWebAssetManager()->useScript('list-view');

if (is_object($value)) {
$value = $value->published;
}
Expand All @@ -185,7 +181,7 @@ public static function published($value, $i, $img1 = 'tick.png', $img0 = 'publis
$alt = $value ? Text::_('JPUBLISHED') : Text::_('JUNPUBLISHED');
$action = $value ? Text::_('JLIB_HTML_UNPUBLISH_ITEM') : Text::_('JLIB_HTML_PUBLISH_ITEM');

return '<a href="#" class="js-grid-item-action" data-item-id="cb' . $i . '" data-item-task="' . $prefix . $task . '" title="' . $action . '">'
return '<a href="#" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $prefix . $task . '\')" title="' . $action . '">'
. HTMLHelper::_('image', 'admin/' . $img, $alt, null, true) . '</a>';
}

Expand Down

0 comments on commit 2cc74c2

Please sign in to comment.