Actions

API15

JPagination/getLimitBox

From Joomla! Documentation

< API15:JPagination
Revision as of 17:21, 22 March 2010 by Doxiki (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

Creates a dropdown box for selecting how many records to show per page

[Edit Descripton]

Description:JPagination/getLimitBox

Syntax

getLimitBox()


Returns

string The html for the limit # input box

Defined in

libraries/joomla/html/pagination.php

Importing

jimport( 'joomla.html.pagination' );

Source Body

function getLimitBox()
{
        global $mainframe;
 
        // Initialize variables
        $limits = array ();
 
        // Make the option list
        for ($i = 5; $i <= 30; $i += 5) {
                $limits[] = JHTML::_('select.option', "$i");
        }
        $limits[] = JHTML::_('select.option', '50');
        $limits[] = JHTML::_('select.option', '100');
        $limits[] = JHTML::_('select.option', '0', JText::_('all'));
 
        $selected = $this->_viewall ? 0 : $this->limit;
 
        // Build the select list
        if ($mainframe->isAdmin()) {
                $html = JHTML::_('select.genericlist',  $limits, 'limit', 'class="inputbox" size="1" onchange="submitform();"', 'value', 'text', $selected);
        } else {
                $html = JHTML::_('select.genericlist',  $limits, 'limit', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $selected);
        }
        return $html;
}

[Edit See Also] SeeAlso:JPagination/getLimitBox

Examples

<CodeExamplesForm />