Difference between revisions of "JHtmlMenu/ordering"
From Joomla! Documentation
< API16:JHtmlMenu
m (preparing for archive only) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Build the select list for Menu Ordering | Build the select list for Menu Ordering | ||
− | |||
− | |||
− | |||
− | + | ||
+ | <! removed transcluded page call, red link never existed > | ||
===Syntax=== | ===Syntax=== | ||
Line 61: | Line 59: | ||
</source> | </source> | ||
− | + | ||
− | + | <! removed transcluded page call, red link never existed > | |
− | < | ||
− | |||
===Examples=== | ===Examples=== | ||
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=ordering | category=ordering | ||
category=JHtmlMenu | category=JHtmlMenu | ||
− | + | namespace=CodeExample | |
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API16]] |
Latest revision as of 20:46, 24 March 2017
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 Menu Ordering
<! removed transcluded page call, red link never existed >
Syntax[edit]
static ordering(&$row, $id)
Parameter Name | Default Value | Description |
---|---|---|
&$row | ||
$id |
Defined in[edit]
libraries/joomla/html/html/menu.php
Importing[edit]
jimport( 'joomla.html.html.menu' );
Source Body[edit]
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 transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]