API15

Difference between revisions of "JHTMLList/specificordering"

From Joomla! Documentation

< API15:JHTMLList
m (removing red link to edit, no existant pages)
m (preparing for archive only)
 
Line 66: Line 66:
  
 
===Examples===
 
===Examples===
<CodeExamplesForm />
+
=== Code Examples ===
 
<dpl>
 
<dpl>
 
  noresultsheader=\n
 
  noresultsheader=\n
 
  category=specificordering
 
  category=specificordering
 
  category=JHTMLList
 
  category=JHTMLList
  category=CodeExample
+
  namespace=CodeExample
 
  category=MethodExample
 
  category=MethodExample
 
  include=*
 
  include=*

Latest revision as of 19:52, 24 March 2017

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

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

specificordering(&$row, $id, $query, $neworder=0)
Parameter Name Default Value Description
&$row
$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;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]