<?php
/**
 * [PHPFOX_HEADER]
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Miguel Espinoza
 * @package 		Phpfox
 * @version 		$Id: category.html.php 890 2009-12-14 13:54:49Z Miguel_Espinoza $
 */

defined('PHPFOX') or exit('NO DICE!');

?>
<div class="sub_section_menu">
	<ul {if isset($sUlClass)}class="{$sUlClass}"{else}class="action"{/if}>
	{foreach from=$aCategories item=aCategory key=iCategoryCount}
	<li class="{if isset($sModule)}{$sModule}_{/if}category" style="position:relative;">

		<a {if Phpfox::getParam('core.categories_to_show_at_first') >= 1 && count($aCategory.sub) > 0}class="no_ajax_link category_show_more_less_link"{/if} href="{$aCategory.url}{if Phpfox_Request::instance()->get('view') != ''}view_{request var='view'}/{/if}" id="{if isset($sModule)}{$sModule}_{/if}category_{$aCategory.category_id}">
        {softPhrase var=$aCategory.name}
		</a>

		{if Phpfox::getParam('core.categories_to_show_at_first') >= 1 && isset($aCategory.sub) && count($aCategory.sub)}
		<ul>
			{foreach from=$aCategory.sub item=aSubCategory key=iKey}
			<li {if $iKey >= Phpfox::getParam('core.categories_to_show_at_first')}style="display:none;" class="{if isset($sModule)}{$sModule}_{/if}subcategory_{$aCategory.category_id} special_subcategory"{/if}>
				<a href="{$aSubCategory.url}" id="{if isset($sModule)}{$sModule}_{/if}subcategory_{$aSubCategory.category_id}">
                    {softPhrase var=$aSubCategory.name}
				</a>
			</li>
			{/foreach}

			{if $iKey >= Phpfox::getParam('core.categories_to_show_at_first') && Phpfox::getParam('core.categories_to_show_at_first') > 0}
			<li onclick="$Core.toggleCategory('{if isset($sModule)}{$sModule}_{/if}subcategory_{$aCategory.category_id}',{$aCategory.category_id})">
				<div id="show_more_{$aCategory.category_id}" style="text-align:right;vertical-align:middle;"><a href="#" onclick="return false;">{img theme='misc/plus.gif' class='v_middle'}{_p var='view_more'}</a></div>
				<div id="show_less_{$aCategory.category_id}" style="display:none;text-align:right;vertical-align:middle;"><a href="#" onclick="return false;">{img theme='misc/minus.gif' class='v_middle'}{_p var='view_less'}</a></div>
			</li>
			{/if}
		</ul>
		{/if}
	</li>
	{/foreach}
	</ul>
</div>