<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.0.9
  @date  07/06/10, 14:43
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
  @class desc_base
*/
class desc_base implements InterfaceModule {

  function __construct($page=''){
    global $page;
    $this->code = 'desc_base';
    $this->title = __('description base listing');
    $this->description = __('description (chapeaux) produits dans les listing');
    $this->sort_order = (defined('MODULE_ACAPRO_DESC_BASE_SORT_ORDER')) ? MODULE_ACAPRO_DESC_BASE_SORT_ORDER : 0 ;
    $this->enabled = true;

    if(!is_object($page))  return null;
    $this->languages_id=$page->the_var('languages_id');
  }


/*
  Function ACA
*/
  /**
    Chargement des db
  */
  public function load_db_values($pID){
      $product_query = tep_db_query($sql="select pd.products_id, pd.language_id, pd.products_name , pd.products_description, pd.products_chapo, pd.products_url from  " . TABLE_PRODUCTS_DESCRIPTION . " pd where  pd.products_id= '" . $pID . "' and language_id='".$this->languages_id."' ");
      $this->content=$product = tep_db_fetch_array($product_query);
      tep_db_free_result($product_query);
  }

  /**
    return des db
  */
  public function return_db_min($pID){
      if(isset($this->content['products_chapo']) )$this->load_db_values((int)$pID);
      return tep_output_string_protected($this->content['products_chapo'],false,true);
  }

  /**
    Return min
  */

  public function display_view_min($pID){
    global $page;
    $m=array();
    $this->load_db_values((int)$pID);
    echo $this->content['products_chapo'];
  }

/** implements InterfaceModule depend */
  public function check() {}
  public function install() {}
  public function remove() {}
  public function keys() {}
}
?>