<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  16/09/10, 21:55
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8

  Prend en charge les appels vers les listes, type listing: produits, articles, rubriques
*/
$cPath=$page->the_var('cPath');
$categories=$page->the_var('categories');
$category_depth=$page->the_var('category_depth');
?>
<div id="index">

  <h2 class="content title <?php echo $language ;?>"><?php echo (isset($categories->categories_name))? $categories->categories_name : (isset($manuf['manufacturers_name'])?$manuf['manufacturers_name'] : '' ); ?></h2>

  <?php /** Image cat or manufacturer */ if (!empty($image)) : ?>
    <div id="headingCatImg">
      <?php echo tep_image(DIR_WS_IMAGES . $image, isset($categories->categories_name)? $categories->categories_name : $manuf['manufacturers_name'],  $page->_conf_value('HEADING_IMAGE_WIDTH'),  $page->_conf_value('HEADING_IMAGE_HEIGHT')); ?>
    </div>
  <?php endif; ?>
  <?php /** Image cat */ if(isset($categories->categories_description)) : ?>
    <div id="headingCatTxt">
      <?php  echo $categories->categories_description; ?>
    </div>
  <?php endif; ?>

  <?php /** Type de ressource */ if (!isset($_GET['manufacturers_id']) && isset($categories) ) : ?>
    <?php echo tep_draw_form('Type_filter', FILENAME_DEFAULT, 'get') ?>
      <fieldset class="ListFilterType">
          <p><label for="type_object"><?php echo TEXT_SHOW_TYPE ?></label>
          <?php echo tep_draw_hidden_field('cPath', $cPath).tep_draw_pull_down_menu('type_object', 'type_object',array(array('id' => 'products', 'text' => 'produits'), array('id' => 'pages', 'text' => 'pages') ), (isset($_GET['type_object']) ? $_GET['type_object'] : ''), 'onchange="this.form.submit()"'); ?>
          </p>
      </fieldset>
    </form>
  <?php endif;  ?>

  <?php /** liste des categories   */ if(!isset($_GET['manufacturers_id']) && $category_depth=='products')  echo tep_manufacturers_list($page->the_var('current_category_id')); ?>

</div>

<?php /** L'appel du module sera prise en charge par le template */

      /** init module liste image des categories enfant.  */
        if ($category_depth == 'nested') $page->oscss_modules->_add('listing_cat.php','center');
      /** init module liste des produit ou page de la categories concerné */
        if (isset($listing_split) && (isset($listing_query) && tep_db_num_rows($listing_query)>0) ) {
	  if($category_depth=='products'||$category_depth == 'nested') $page->oscss_modules->_add(FILENAME_PRODUCT_LISTING,'center', array('listing_split'=>$listing_split,'listing_query'=>@$listing_query) );
	  elseif($category_depth=='pages') $page->oscss_modules->_add('listing_pages.php','center', array('title'=>TEXT_HEADING_CHILD_PRODUCT, 'listing_split'=>$listing_split, 'listing_query'=>@$listing_query) );
      /** init d'un module de remplacement ...; */
        } else $page->oscss_modules->_add(FILENAME_NEW_PRODUCTS,'center');
?>