API15

JHTMLList/specificordering

From Joomla! Documentation

< API15:JHTMLList
Revision as of 17:21, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Build the select list for Ordering of a specified Table <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JHTMLList/specificordering...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API15" 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.

Description[edit]

Build the select list for Ordering of a specified Table

[Edit Descripton]

Template:Description:JHTMLList/specificordering

Syntax[edit]

specificordering(&$row, $id, $query, $neworder=0)
Parameter Name Default Value Description
$id
$query
$neworder 0

Defined in[edit]

libraries/joomla/html/html/list.php

Importing[edit]

jimport( 'joomla.html.html.list' );

Source Body[edit]

function specificordering( &$row, $id, $query, $neworder = 0 )
{
        $db =& JFactory::getDBO();

        if ( $id ) {
                $order = JHTML::_('list.genericordering',  $query );
                $ordering = JHTML::_('select.genericlist',   $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) );
        } else {
                if ( $neworder ) {
                        $text = JText::_( 'descNewItemsFirst' );
                } else {
                        $text = JText::_( 'descNewItemsLast' );
                }
                $ordering = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. $text;
        }
        return $ordering;
}

[Edit See Also] Template:SeeAlso:JHTMLList/specificordering

Examples[edit]

<CodeExamplesForm />