Actions

API16

JHtmlMenu/ordering

From Joomla! Documentation

< API16:JHtmlMenu
Revision as of 21:58, 13 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

static 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

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

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

Examples

<CodeExamplesForm />