public static string
ordering
(mixed $name, mixed $query, mixed $attribs = null, mixed $selected = null, mixed $neworder = null, ?string $id = null)
public static function ordering($name, $query, $attribs = null, $selected = null, $neworder = null, ?string $id = null)
{
if (empty($attribs)) {
$attribs = 'size="1"';
}
if (empty($neworder)) {
$orders = HTMLHelper::_('list.genericordering', $query);
$html = HTMLHelper::_('select.genericlist', $orders, $name, ['list.attr' => $attribs, 'list.select' => (int) $selected, 'id' => $id ?? false]);
} else {
if ($neworder > 0) {
$text = Text::_('JGLOBAL_NEWITEMSLAST_DESC');
} elseif ($neworder <= 0) {
$text = Text::_('JGLOBAL_NEWITEMSFIRST_DESC');
}
$html = '<input type="hidden" name="' . $name . '" value="' . (int) $selected . '"><span class="readonly">' . $text . '</span>';
}
return $html;
}