JHtmlList/ordering
From Joomla! Documentation
< API16:JHtmlList
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Contents
Description
Build the select list for Ordering derived from a query
<! removed transcluded page call, red link never existed >
Syntax
static ordering($name, $query, $attribs=null, $selected=null, $neworder=null, $chop=null)
Parameter Name | Default Value | Description |
---|---|---|
$name | $value The scalar value | |
$query | $query | |
$attribs | null | $attribs HTML tag attributes |
$selected | null | $neworder 1 if new and first, -1 if new and last, 0 or null if existing item |
$neworder | null | $prefix An optional prefix for the task |
$chop | null |
Returns
string
Defined in
libraries/joomla/html/html/list.php
Importing
jimport( 'joomla.html.html.list' );
Source Body
public static function ordering($name, $query, $attribs = null, $selected = null, $neworder = null, $chop = null)
{
if (empty($attribs)) {
$attribs = 'class="inputbox" size="1"';
}
if (empty($neworder))
{
$orders = JHtml::_('list.genericordering', $query);
$html = JHtml::_(
'select.genericlist',
$orders,
$name,
array('list.attr' => $attribs, 'list.select' => (int) $selected)
);
}
else
{
if ($neworder > 0) {
$text = JText::_('descNewItemsFirst');
}
else if ($neworder <= 0) {
$text = JText::_('JCOMMON_NEWITEMSLAST_DESC');
}
$html = '<input type="hidden" name="'.$name.'" value="'. (int) $selected .'" />'. $text;
}
return $html;
}
<! removed transcluded page call, red link never existed >