Back to PhocacartPagination class

Method getLimitBox

public
getLimitBox
()

Method getLimitBox - Source code

function getLimitBox()
{
    $app = Factory::getApplication();
    $paramsC = PhocacartUtils::getComponentParameters();
    $pos = PhocacartPos::isPos();
    if ($pos == 1) {
        $pagination = $paramsC->get('pos_pagination', '6,12,24,36,48,60');
    } else {
        $pagination = $paramsC->get('item_pagination', '5,10,15,20,50');
    }
    $paginationArray = explode(',', $pagination);
    // Initialize variables
    $limits = array();
    foreach ($paginationArray as $paginationValue) {
        $limits[] = HTMLHelper::_('select.option', $paginationValue);
    }
    $limits[] = HTMLHelper::_('select.option', '0', Text::_('COM_PHOCACART_ALL'));
    $selected = $this->viewall ? 0 : $this->limit;
    // Build the select list
    if ($app->isClient('administrator')) {
        $html = HTMLHelper::_('select.genericlist', $limits, 'limit', 'class="form-control" size="1" onchange="submitform();"', 'value', 'text', $selected);
    } else {
        $html = HTMLHelper::_('select.genericlist', $limits, 'limit', 'class="form-control" size="1" onchange="phEventChangeFormPagination(this.form, this)"', 'value', 'text', $selected);
    }
    return $html;
}