API16

Difference between revisions of "JHtmlList/ordering"

From Joomla! Documentation

< API16:JHtmlList
(New page: ===Description=== Build the select list for Ordering derived from a query <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JHtmlList/ordering|Edit Des...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHtmlList/ordering|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JHtmlList/ordering}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 83: Line 83:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JHtmlList/ordering|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JHtmlList/ordering}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 98: Line 98:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Revision as of 21:57, 13 May 2013

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.

Description[edit]

Build the select list for Ordering derived from a query

[<! removed edit link to red link >]

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

Syntax[edit]

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[edit]

string

Defined in[edit]

libraries/joomla/html/html/list.php

Importing[edit]

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

Source Body[edit]

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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />