Back to PhocaGalleryPaginationCategory class

Method getLimitBox

public
getLimitBox
()

Method getLimitBox - Source code

public function getLimitBox()
{
    $app = Factory::getApplication();
    $paramsC = ComponentHelper::getParams('com_phocagallery');
    $pagination = $paramsC->get('pagination_category', '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_PHOCAGALLERY_ALL'));
    $selected = $this->viewall ? 0 : $this->limit;
    // Build the select list
    if ($app->isClient('administrator')) {
        $html = HTMLHelper::_('select.genericlist', $limits, 'limit', 'class="form-select" size="1" onchange="Joomla.submitform();"', 'value', 'text', $selected);
    } else {
        $html = HTMLHelper::_('select.genericlist', $limits, 'limit', 'class="form-select" size="1" onchange="this.form.submit()"', 'value', 'text', $selected);
    }
    return $html;
}