{* 
//////
//    @version [ Wainuiomata ]
//    @package hwdVideoShare
//    @copyright (C) 2007 - 2009 Highwood Design
//    @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
//////
//    hwdVideoShare Template System:::This template system uses the Smarty Template Engine. 
//    For full documentation, including syntax usage please refer to http://www.smarty.net 
//    or our website at http://www.hwdmediashare.co.uk   
//////
//    This file generates the display when a user views a category. It lists all the videos in that category
//    and if any subcategories exist it can also display these
//////
//    VARIABLES AVAILBLE IN THIS TEMPLATE FILE:                                        
//    -- $print_videolist...Only set if any video exist in the category
//    -- $print_subcats.....Only set if any subcategories exist in the category                            
//    -- $link_home.........Your website URL (to your Joomla root)                   
//////
*}

{include file='header.tpl'}

  {if $print_orderselect}
  <div style="float:right;text-align:right;padding:0 0 10px 0;">
    {literal}
    <script language="javaScript">
      function goto_sort(form) { 
        var index=form.select_order.selectedIndex
        if (form.select_order.options[index].value != "0") {
          location=form.select_order.options[index].value;
        }
      }
    </script>
    {/literal}
    <form name="redirect">
      <select name="select_order" onchange="goto_sort(this.form)" size="1">
        <option value="" selected="selected">{$smarty.const._HWDVIDS_TITLE_ORDERING}</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderASC">{$smarty.const._HWDVIDS_SELECT_ORDERING} ASC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderDESC">{$smarty.const._HWDVIDS_SELECT_ORDERING} DESC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateASC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} ASC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateDESC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} DESC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameASC">{$smarty.const._HWDVIDS_SELECT_NAME} ASC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameDESC">{$smarty.const._HWDVIDS_SELECT_NAME} DESC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsASC">{$smarty.const._HWDVIDS_SELECT_HITS} ASC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsDESC">{$smarty.const._HWDVIDS_SELECT_HITS} DESC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteASC">{$smarty.const._HWDVIDS_SELECT_RATING} ASC</option>
        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteDESC">{$smarty.const._HWDVIDS_SELECT_RATING} DESC</option>
      </select>
    </form>
  </div>
  {/if}
  <div style="clear:both;"></div>
  
{if $print_subcats}

   <div class="rightColContainer">
        {if $print_search}
	<!-- Search -->
	<div class="cModule searchbox">
		<form name="search" id="cFormSearch" method="post" action="{$form_search}">

			<fieldset class="fieldset">

			<div class="input_wrap clrfix">
				<a href="javascript:void(0);" onclick="jQuery('#cFormSearch').submit();" class="search_button"><span>{$smarty.const._HWDVIDS_SEARCHBAR}</span></a>
				{$searchinput}
			</div>

			<!--<div class="small">Try our <a href="{$mosConfig_live_site}/index.php?option=com_community&view=search&task=advancesearch">{$smarty.const._HWDVIDS_ADSEARCH}</a></div>-->

			</fieldset>

		</form>
	</div>
	<!-- Search -->
	<div class="clr"></div>
        
          {if $print_orderselect}
	  <div style="float:right;text-align:right;padding:5px;">
	    {literal}
	    <script language="javaScript">
	      function goto_sort(form) { 
	        var index=form.select_order.selectedIndex
	        if (form.select_order.options[index].value != "0") {
	          location=form.select_order.options[index].value;
	        }
	      }
	    </script>
	    {/literal}
	    <form name="redirect">
	      <select name="select_order" onchange="goto_sort(this.form)" size="1">
	        <option value="" selected="selected">{$smarty.const._HWDVIDS_TITLE_ORDERING}</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderASC">{$smarty.const._HWDVIDS_SELECT_ORDERING} ASC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderDESC">{$smarty.const._HWDVIDS_SELECT_ORDERING} DESC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateASC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} ASC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateDESC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} DESC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameASC">{$smarty.const._HWDVIDS_SELECT_NAME} ASC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameDESC">{$smarty.const._HWDVIDS_SELECT_NAME} DESC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsASC">{$smarty.const._HWDVIDS_SELECT_HITS} ASC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsDESC">{$smarty.const._HWDVIDS_SELECT_HITS} DESC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteASC">{$smarty.const._HWDVIDS_SELECT_RATING} ASC</option>
	        <option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteDESC">{$smarty.const._HWDVIDS_SELECT_RATING} DESC</option>
	      </select>
	    </form>
	  </div>
	  {/if}
  <div style="clear:both;"></div>
        
        {/if}			

	    <div class="cModule" style="overflow: hidden;">
	      <h3 class="frontTitle">Subcategories</h3>
		<div class="box">
		  {foreach name=outer item=data from=$subcatlist}
		  {include file='category_list.tpl'}
		  {/foreach}
		</div>
	    </div>

    </div>

    <div class="leftColContainer">

	<div id="recent-activities">
	<div class="app-box-header">
	<div class="app-box-header">
			<h2 class="expand app-box-title">{$smarty.const._HWDVIDS_TITLE_CATEGORYVIDS} ({$category_name})</h2>
	</div>
	</div>

		{if $print_videolist}
		<div class="box">
          {foreach name=outer item=data from=$list}
          <div class="videoBox">
	  {include file="video_list.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:left;"></div>
	  {elseif $smarty.foreach.outer.index % $vpr-($vpr-1) == 0}
	     <div style="clear:left;"></div>
	  {/if}
          {/foreach}
		</div>
		{$pageNavigation}
		{else}
		  <div class="standard"><div class="padding">{$smarty.const._HWDVIDS_INFO_NFEATV}</div></div>
		{/if}
	</div>

	
    </div>

    <div style="clear:both;"></div>

{else}
	
	<div id="recent-activities">
	<div class="app-box-header">
	<div class="app-box-header">
			<h2 class="expand app-box-title">{$smarty.const._HWDVIDS_TITLE_CATEGORYVIDS} ({$category_name})</h2>
	</div>
	</div>
		{if $print_videolist}
		<div class="box">
          {foreach name=outer item=data from=$list}
          <div class="videoBox">
	  {include file="video_list.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:left;"></div>
	  {elseif $smarty.foreach.outer.index % $vpr-($vpr-1) == 0}
	     <div style="clear:left;"></div>
	  {/if}
          {/foreach}
		</div>
		{$pageNavigation}
		{else}
		  <div class="standard"><div class="padding">{$smarty.const._HWDVIDS_INFO_NFEATV}</div></div>
		{/if}
	</div>
	
{/if}

{include file='footer.tpl'}
