<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<?php
/**
 * Product list toolbar
 *
 * @see Mage_Catalog_Block_Product_List_Toolbar
 */
?>
<?php if($this->getCollection()->getSize()): ?>
	<div class="pager<?php if(Mage::getStoreConfigFlag('avalanche_config/avalanche_product_listings/avalanche_ajax_pager')): ?> pager-visible<?php endif; ?>">
		<?php echo $this->getPagerHtml() ?>
	</div>
	
	<?php if( $this->isExpanded() ): ?>
	<div class="sorter">
		<div class="catalog-mode">
	        <?php if($this->isEnabledViewSwitcher()): ?>
	            <?php $_modes = $this->getModes(); ?>
	            <?php if($_modes && count($_modes) > 1): ?>
	            <?php foreach($this->getModes() as $_code => $_label): ?>
	            <div class="view-mode">
	                <?php if($this->isModeActive($_code)): ?>
	                    <strong title="<?php echo $_label ?>" class="<?php echo strtolower($_code); ?>"><?php echo $_label ?></strong>&nbsp;
	                <?php else: ?>
	                    <a href="<?php echo $this->getModeUrl($_code) ?>" title="<?php echo $_label ?>" class="<?php echo strtolower($_code); ?>"><?php echo $_label ?></a>&nbsp;
	                <?php endif; ?>
	            </div>
	            <?php endforeach; ?>
	            <?php endif; ?>
	        <?php endif; ?>
		</div>
		<div class="results-sort sort-by">
			<label><span><?php echo $this->__('Sort by') ?></span></label>
			<select class="options_sort" onchange="setLocation(this.value)">
	           <option value="<?php echo $this->getOrderUrl('position', 'asc') ?>"<?php if($this->isOrderCurrent('position') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
	                <?php echo $this->__('Featured') ?>
	            </option>
	            <option value="<?php echo $this->getOrderUrl('price', 'asc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
	                <?php echo $this->__('Lowest Price') ?>
	            </option>
	            <option value="<?php echo $this->getOrderUrl('price', 'desc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
	                <?php echo $this->__('Highest Price') ?>
	            </option>
	            <option value="<?php echo $this->getOrderUrl('name', 'asc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
	                <?php echo $this->__('Name A-Z') ?>
	            </option>
	            <option value="<?php echo $this->getOrderUrl('name', 'desc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
	                <?php echo $this->__('Name Z-A') ?>
	            </option>
			</select>
		</div>
	</div>
	<?php endif; ?>
<?php endif ?>
