productModule Class Reference

Traitement des modules associé. More...

Inherits AbstractAcaModule, and InterfaceAcaGene.

List of all members.

Public Member Functions

  • get_option_data ($product_array)
    Get data modified/add by module.
  • adjust_price (&$product_array)
    Get price modified by module Unqiuement pour les module qui definissent le flag price.
  • display_view ($pID, $class='', $exclude=array())
    Affiche module elemennt html Block principal d'affichage, liste ou vue des élément.
  • display_view_min ($cID, $class='')
    Affiche module display_view mini.
  • display_titre ($cID, $format='$s')
    Affiche bock titre client notifié.

Static Public Member Functions

Public Attributes

Static Public Attributes

Protected Member Functions

Static Protected Attributes

Private Member Functions


Detailed Description

Traitement des modules associé.

Traitement des modules type products.

Definition at line 605 of file driver.product.php.


Constructor & Destructor Documentation

productModule::__construct (  )  [protected]

Reimplemented from page.

Definition at line 626 of file driver.product.php.

00626                                    {
00627     global $language, $page;
00628     $this-> name=__CLASS__;
00629     $this->type_flag=1;
00630     $this-> products_id='';
00631     $this-> image_handler='';
00632 
00633     $this->modules=array();
00634     $this->pile_img=array();
00635     $list_mod=array();
00636 
00637     foreach(parent::initialise_type('MODULE_ACAPRO_INSTALLED','products') as $class){
00638       $cl[$class]=new $class ();
00639       $list_mod[$class] = $cl[$class]->sort_order;
00640       // test flag type module, si aucun, produist base
00641       if(!isset($cl[$class]->flag_type_virtual)) $cl[$class]->flag_type_virtual=0;
00642       // incremente tableau module unqiuement si flag ok
00643       if($this->control_type_mod($cl[$class]->flag_type_virtual)) $list_mod[$class] = $cl[$class]->sort_order;
00644     }
00645 
00646     asort($list_mod);
00647     foreach($list_mod as $class=>$s){
00648       $this->modules[$class] =$cl[$class];
00649     }
00650     unset($cl);unset($list_mod);
00651 
00652     return $this->modules;
00653   }


Member Function Documentation

productModule::adjust_price ( &$  product_array  ) 

Get price modified by module Unqiuement pour les module qui definissent le flag price.

Definition at line 683 of file driver.product.php.

00683                                                {
00684 //     $product_array = $product_array_master;
00685     if(isset($this->modules) && is_array($this->modules))
00686     foreach ($this->modules as $key=>$module) {
00687       if ( $module->enabled && isset($module->price)   && (method_exists($module, 'adjust_price' ))) {
00688         $product_array=$this->modules[$key]->adjust_price($product_array);
00689       }
00690     }
00691     return $product_array;
00692   }

productModule::control_type_mod ( flag  )  [private]

Specifique Module.

Activation/ descative les modules en focntion du type de produits

Parameters:
$flag string le type falg de modules
Returns:
boolean

Definition at line 775 of file driver.product.php.

Referenced by __construct().

00775                                           {
00776     if(!isset($this->type_flag) ) $this->load_type_product();
00777     if(in_array($flag,explode(',',$this->type_flag) )|| $flag==0) return true;
00778     else return false;
00779   }

productModule::display_titre ( cID,
format = '$s' 
)

Affiche bock titre client notifié.

Parameters:
$cID 
$format string format for sprintf

Definition at line 753 of file driver.product.php.

00753                                                   {
00754       $c='';
00755       foreach ($this->modules as $key=>$module) {
00756         if (($module->enabled)  and (method_exists($module, 'display_view_min' ))) {
00757           $this->modules[$key]->load_db_values($cID);
00758           $c .=$this->modules[$key]->display_titre($format);
00759         }
00760       }
00761       return $c;
00762   }

productModule::display_view ( pID,
class = '',
exclude = array() 
)

Affiche module elemennt html Block principal d'affichage, liste ou vue des élément.

Block principal de page

Parameters:
$pID int le Id du produits
$class string le nom de la class appelé, ou vide pour toutes les class enfants
$exclude array

Definition at line 703 of file driver.product.php.

00703                                                                 {
00704     global  $page;
00705     if (!empty($class)) {
00706       if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($class, 'display_view' ))){
00707         $this->modules[$class]->load_db_values($pID);
00708         return $this->modules[$class]->display_view($pID);
00709       }
00710     } else {
00711       $c=array();
00712       if(isset($this->modules) && is_array($this->modules))
00713       foreach ($this->modules as $key=>$module) {
00714         if ( !in_array($key,$exclude) && ($module->enabled)  and (method_exists($module, 'display_view' ))) {
00715           $this->modules[$key]->load_db_values($pID);
00716           $c[$key]=$this->modules[$key]->display_view($pID);
00717         }
00718       }
00719       return $c;
00720     }
00721   }

productModule::display_view_min ( cID,
class = '' 
)

Affiche module display_view mini.

Parameters:
cID int le Id du customers
class string le nom de la class appelé, ou vide pour toutes les class enfants

Definition at line 728 of file driver.product.php.

00728                                                   {
00729     global  $page;
00730     if (!empty($class)) {
00731       if (isset($this->modules[$class]) && $this->modules[$class]->enabled and (method_exists($module, 'display_view_min' ))){
00732         $this->modules[$class]->load_db_values($cID);
00733         return $this->modules[$class]->display_view_min($cID);
00734       }
00735     } else {
00736        $c='';
00737       foreach ($this->modules as $key=>$module) {
00738         if (($module->enabled)  and (method_exists($module, 'display_view_min' ))) {
00739           $this->modules[$key]->load_db_values($cID);
00740           $c .=$this->modules[$key]->display_view_min($cID);
00741         }
00742       }
00743       return $c;
00744     }
00745   }

productModule::get_option_data ( product_array  ) 

Get data modified/add by module.

Definition at line 669 of file driver.product.php.

00669                                                  {
00670     if(isset($this->modules) && is_array($this->modules))
00671     foreach ($this->modules as $key=>$module) {
00672       if ( $module->enabled && (method_exists($module, 'get_option_data' ))) {
00673         $product_array=$this->modules[$key]->get_option_data($product_array);
00674       }
00675     }
00676     return $product_array;
00677   }

static productModule::getInstance (  )  [static]

Reimplemented from page.

Definition at line 656 of file driver.product.php.

Referenced by resetInstance().

00656                                        {
00657     if(self::$_instance == null) self::$_instance = new self();
00658     return self::$_instance;
00659   }

productModule::load_type_product (  )  [private]

Recup db type flag.

Returns:
int, Id du type ou 1

Definition at line 785 of file driver.product.php.

Referenced by control_type_mod().

00785                                       {
00786     if(!isset($_GET['products_id'])) return ;
00787 
00788     if(isset(productData::$array_data[(int)$_GET['products_id']]) )  return productData::$array_data[(int)$_GET['products_id']];
00789 
00790     $sql = "select * from ".TABLE_PRODUCTS_VIRTUAL." where productsID=".(int)$_GET['products_id'];
00791     $result = tep_db_query($sql);
00792     if (tep_db_num_rows($result) > 0) { // this product is in the virtual table
00793       $virtual = tep_db_fetch_array($result);
00794       $this->type_flag= $virtual['typeID'];
00795     }
00796     else $this->type_flag=1;
00797     productData::$array_data[(int)$_GET['products_id']] = $this->type_flag;
00798     tep_db_free_result($result);
00799   }

static productModule::resetInstance (  )  [static]

Definition at line 661 of file driver.product.php.

00661                                         {
00662     self::$_instance = null;
00663     return self::getInstance();
00664   }


Member Data Documentation

productModule::$_instance [static, protected]

Reimplemented from page.

Definition at line 622 of file driver.product.php.

productModule::$_pidVirtual_c = array() [static]

Definition at line 620 of file driver.product.php.

productModule::$modules

Les modules actif.

Parameters:
string 

Definition at line 618 of file driver.product.php.

productModule::$name

flag de la class

Parameters:
string 

Definition at line 613 of file driver.product.php.


The documentation for this class was generated from the following file: