Actions

API15

JHTMLMenu/ordering

From Joomla! Documentation

< API15:JHTMLMenu
Revision as of 13:30, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Build the select list for Menu Ordering

[<! removed edit link to red link >]

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

Syntax

ordering(&$row, $id)
Parameter Name Default Value Description
&$row
$id

Defined in

libraries/joomla/html/html/menu.php

Importing

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

Source Body

function ordering( &$row, $id )
{
        $db =& JFactory::getDBO();
 
        if ( $id )
        {
                $query = 'SELECT ordering AS value, name AS text'
                . ' FROM #__menu'
                . ' WHERE menutype = '.$db->Quote($row->menutype)
                . ' AND parent = '.(int) $row->parent
                . ' AND published != -2'
                . ' ORDER BY ordering';
                $order = JHTML::_('list.genericordering',  $query );
                $ordering = JHTML::_('select.genericlist',   $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) );
        }
        else
        {
                $ordering = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. JText::_( 'DESCNEWITEMSLAST' );
        }
        return $ordering;
}

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

Examples

<CodeExamplesForm />