<?php
/* @package Joomla
 * @copyright Copyright (C) Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @extension Phoca Extension
 * @copyright Copyright (C) Jan Pavelka www.phoca.cz
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */
defined('_JEXEC') or die();
$d  = $displayData;


echo '<div class="ph-cb"></div>';

echo '<form id="phItemTopBoxForm" action="'.$d['t']['action'].'" method="post" name="phitemstopboxform">'. "\n";
echo '<div class="'.$d['s']['c']['row'].' ph-pagination-top">';

if ($d['t']['show_pagination_top']) {

    echo '<div class="'.$d['s']['c']['col.xs12.sm5.md5'].' ph-pag-top-row">';
	if ($d['t']['display_item_ordering_top']) {

		$ordering = str_replace( 'class="inputbox"', 'class="'.$d['s']['c']['inputbox.form-control'].' chosen-select" style="width: 16em;" aria-label="'.JText::_('COM_PHOCACART_ORDER_FRONT').'"', $d['t']['ordering']);
		$ordering = str_replace( 'id="itemordering"', 'id="itemorderingtop" aria-label="'.JText::_('COM_PHOCACART_ORDER_FRONT').'"', $ordering);// possible two the same ID
		echo $d['t']['display_pagination_labels'] == 1 ? JText::_('COM_PHOCACART_ORDER_FRONT') .':&nbsp;' : '';
		echo $ordering;

	}
    echo '</div>';

    echo '<div class="'.$d['s']['c']['col.xs12.sm3.md3'].' ph-pag-top-row">';
	if ($d['t']['show_pagination_limit_top']) {

		$limit = str_replace( 'class="inputbox"', 'class="'.$d['s']['c']['inputbox.form-control'].' chosen-select" aria-label="'.JText::_('COM_PHOCACART_DISPLAY_NUM').'"', $d['t']['pagination']->getLimitBox());
		$limit = str_replace( 'id="limit"', 'id="limittop" aria-label="'.JText::_('COM_PHOCACART_DISPLAY_NUM').'"', $limit);// possible two the same ID
		echo $d['t']['display_pagination_labels'] == 1 ? JText::_('COM_PHOCACART_DISPLAY_NUM') .':&nbsp;' : '';
		echo $limit;

	}
    echo '</div>';


    echo '<div class="'.$d['s']['c']['col.xs12.sm4.md4'].' ph-pag-top-row">';
	if ($d['t']['show_switch_layout_type']) {

		echo '<button type="button" aria-label="'.JText::_('COM_PHOCACART_GRID').'" class="'.$d['s']['c']['btn.btn-default'].' phItemSwitchLayoutType grid '.$d['t']['layouttypeactive'][0].'" data-layouttype="grid"><span class="'.$d['s']['i']['grid'].'"></span></button> ';
		echo '<button type="button" aria-label="'.JText::_('COM_PHOCACART_GRID_LIST').'" class="'.$d['s']['c']['btn.btn-default'].' phItemSwitchLayoutType gridlist '.$d['t']['layouttypeactive'][1].'" data-layouttype="gridlist"><span class="'.$d['s']['i']['gridlist'].'"></span></button> ';
		echo '<button type="button" aria-label="'.JText::_('COM_PHOCACART_LIST').'" class="'.$d['s']['c']['btn.btn-default'].' phItemSwitchLayoutType list '.$d['t']['layouttypeactive'][2].'" data-layouttype="list"><span class="'.$d['s']['i']['list'].'"></span></button>';

	}
    echo '</div>';

    echo '<div class="ph-cb"></div>';
}
echo '</div>';
echo '<input type="hidden" name="format" value="raw" />';
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
?>
