API15

JPagination/getLimitBox: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Creates a dropdown box for selecting how many records to show per page <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JPagination/...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JPagination/getLimitBox|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JPagination/getLimitBox}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 50: Line 50:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JPagination/getLimitBox|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JPagination/getLimitBox}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getLimitBox
  category=getLimitBox
  category=JPagination
  category=JPagination
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 01:00, 25 March 2017

Description

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

[<! removed edit link to red link >]

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

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;
}

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

Examples

Code Examples