oscss_modules Class Reference

load module not type More...

List of all members.

Public Member Functions

  • _draw ($mod, $parameter='')
    Return des contenu et resultat sql.
  • _in_obj ($mod, $parameter='')
    Return module in object.
  • _resultsql ($module)
    Return des contenu et resultat sql.
  • _replace ($module, $new_module)
  • _quick_call ($module, $filename='', $opt='')
    Rappel module en 2 tps L'appel des module est théroqiement chargée par un call_module si le module en cours de d'exec et desactivé, rappel un second module, appres l'appel a call.
  • _add ($file_to_display, $type='', $opt='')
    Alias de la function tep_call_modules.
  • _call ($modules=false, $type=false, $option='')
  • _return ($key)
    Alias de la function return.
  • _bloque ($module, $type)
    Alias de la function tep_call_modules.

Static Public Member Functions

Public Attributes

Protected Member Functions

Static Protected Attributes

Private Member Functions

  • modules ($file_to_display, $type='std', $opt)
    Scan template modules folders and display template boxes if exist, if not display default oscss boxes le type permet de classer les box par groupe Seul l'extentions .php est autoriser cherche dans plugins theme, puis, boxes theme, puis noyau.
  • tep_call_modules ($modules=false, $type=false)
    Appel des modules Charment des langues associés !!! Les variables de page ne sont pas accessible dans le fichiers de langues.
  • ret_modules ($key)
    Fournis les element enregsitré du module.
  • pile_commande ($module, $type, $action='', $value='')
  • test_value_content ($function, $parameter='')
    Verifie que le resultat du module appelé n'est pas null, ou vide.

Private Attributes

  • $temp
    private pile qui est appelé lors du _call d'un module et qui charge les commande en atente

Detailed Description

load module not type

Note:
: Gestion de l'appel des modules (rep modules, noyau them plugin ou them module)

Definition at line 14 of file page.oscss_modules.php.


Constructor & Destructor Documentation

oscss_modules::__construct (  )  [protected]

Definition at line 27 of file page.oscss_modules.php.

00027                                   {
00028     global $page;
00029     $this->ext=$page->ext;
00030     $this->lg=array();
00031     $page->page['modules']['sort']=array();
00032   }


Member Function Documentation

oscss_modules::_add ( file_to_display,
type = '',
opt = '' 
)

Alias de la function tep_call_modules.

Parameters:
$file_to_display 
$type 
$opt 

Definition at line 336 of file page.oscss_modules.php.

00336                                                          {
00337     global $page;
00338     return $this->modules($file_to_display,$type,$opt);
00339   }

oscss_modules::_bloque ( module,
type 
)

Alias de la function tep_call_modules.

Function qui chnage etat des modules.

Parameters:
$modules bool
$type bool
$option array
$module string nom du module
$type string la class du modules
Returns:
boolean false si module + type introuvable

Definition at line 371 of file page.oscss_modules.php.

00371                                         {
00372     global $page;
00373     $this->pile_commande($module,$type,'etat','false');
00374     return true;
00375   }

oscss_modules::_call ( modules = false,
type = false,
option = '' 
)

Definition at line 348 of file page.oscss_modules.php.

00348                                                               {
00349     global $page;
00350     if (!is_array($option))$option=array();
00351 
00352     return $this->tep_call_modules($modules,$type,$option);
00353   }

oscss_modules::_draw ( mod,
parameter = '' 
)

Return des contenu et resultat sql.

Parameters:
$mod array
$parameter 

Definition at line 263 of file page.oscss_modules.php.

00263                                            {
00264     global $page;
00265     if (function_exists('draw_'.$mod['name_clean'])) return call_user_func('draw_'.$mod['name_clean'], $parameter);
00266     else return false;
00267   }

oscss_modules::_in_obj ( mod,
parameter = '' 
)

Return module in object.

Parameters:
$mod array
$parameter 

Definition at line 275 of file page.oscss_modules.php.

00275                                              {
00276     global $page;
00277     if (function_exists('in_obj_'.$mod['name_clean'])) return call_user_func('in_obj_'.$mod['name_clean'], $parameter);
00278     else return false;
00279   }

oscss_modules::_quick_call ( module,
filename = '',
opt = '' 
)

Rappel module en 2 tps L'appel des module est théroqiement chargée par un call_module si le module en cours de d'exec et desactivé, rappel un second module, appres l'appel a call.

Parameters:
$module string la clef de module
$filename string la constante FILENAME, peut être hommis si elle est nommé sous la forme FILENAME_NOM_MODULE
$opt array
Returns:
path du file a include

Definition at line 318 of file page.oscss_modules.php.

00318                                                            {
00319     global $page;
00320     if (!is_array($opt))$opt=array();
00321     $filename=(tep_not_null($filename))? $filename : @constant(strtoupper('filename_'.$module))  ;
00322     $page->oscss_modules->modules($filename,'center',$opt);
00323     $page->oscss_modules->_call();
00324 //       $mod =$page->oscss_modules->_return($module);
00325       $page->oscss_modules->_draw($page->oscss_modules->_return($module));
00326 //       return $mod['path'];
00327   }

oscss_modules::_replace ( module,
new_module 
)
Parameters:
$module string : nom du module a remplacer
$new_module array : tableau des element du nouveau module

Definition at line 298 of file page.oscss_modules.php.

00298                                                 {
00299     global $page;
00300 //       if(isset($page->page['modules']['list'][$module])) {
00301 //         $page->page['modules']['list'][$module]=$new_module;
00302 //         return $page->page['modules']['list'][$module];
00303 //       }else return false;
00304       $name_clean=(strchr($module,'.')==$this->ext)? substr($module,0,strlen($module)-4) :$module ;
00305       $this->pile_commande($name_clean,$new_module);
00306   }

oscss_modules::_resultsql ( module  ) 

Return des contenu et resultat sql.

Parameters:
$module string

Definition at line 286 of file page.oscss_modules.php.

00286                                      {
00287     global $page;
00288     if(isset($page->page['modules']['list'][$module]['result_sql'])) return $page->page['modules']['list'][$module]['result_sql'];
00289     else return false;
00290   }

oscss_modules::_return ( key  ) 

Alias de la function return.

Parameters:
$key 

Definition at line 359 of file page.oscss_modules.php.

00359                                {
00360     global $page;
00361     return $this->ret_modules($key);
00362   }

static oscss_modules::getInstance (  )  [static]

Definition at line 34 of file page.oscss_modules.php.

Referenced by resetInstance().

00034                                        {
00035     if(self::$_instance == null) self::$_instance = new self();
00036     return self::$_instance;
00037   }

oscss_modules::modules ( file_to_display,
type = 'std',
opt 
) [private]

Scan template modules folders and display template boxes if exist, if not display default oscss boxes le type permet de classer les box par groupe Seul l'extentions .php est autoriser cherche dans plugins theme, puis, boxes theme, puis noyau.

Parameters:
$file_to_display string
$type string : class de boite, en pile
$opt array : option supplementaire
Returns:
boolean false Si l'index est deja utilise , true si ok

Definition at line 56 of file page.oscss_modules.php.

Referenced by _add().

00056                                                               {
00057     global $page;
00058     $name_clean=(strchr($file_to_display,'.')==$this->ext)? substr($file_to_display,0,strlen($file_to_display)-4) :$file_to_display ;
00059 
00060     if (isset($page->page['modules']['list'][$name_clean])) $this->pile_commande($name_clean,$opt);
00061 
00062     $filename = DIR_WS_TEMPLATES . $page->page['template'] .'/' . DIR_WS_INCLUDES. '%s';
00063 
00064     if (page::TestFile(sprintf($filename,'plugins/').$name_clean.$this->ext)) {
00065       $path =sprintf($filename,'plugins/');
00066       $path_lg=sprintf($filename,'plugins/').'languages/'.$page->page['language'].'.php';
00067     }
00068     elseif (page::TestFile(sprintf($filename,'modules/').$name_clean.$this->ext)){
00069       $path =sprintf($filename,'modules/');
00070       $path_lg=DIR_WS_TEMPLATES . $page->page['template'] .'/' . DIR_WS_INCLUDES.'languages/'.$page->page['language'].'/modules/';
00071     }
00072     else{
00073       $path = DIR_WS_MODULES;
00074       $path_lg= DIR_WS_LANGUAGES.$page->page['language'].'/modules/';
00075     }
00076 
00077 //     if(isset($page->page['modules']['list'][$name_clean]) ) return false;
00078     $array=(isset($page->page['modules']['list'][$name_clean])) ? $page->page['modules']['list'][$name_clean] : array();
00079     $array['name']=$file_to_display;
00080     $array['name_clean']=$name_clean;
00081     $array['path']=$path.$name_clean.$this->ext;
00082     $array['dir_lang']=$path_lg;
00083     $array=array_merge($array,(array)$opt);
00084 
00085 
00086     $page->page['modules']['list'][$name_clean]=$array;
00087     $page->page['modules']['sort'][$name_clean]=(isset($opt['sort']))? $opt['sort']: ((count($page->page['modules']['sort'])>0)?(count($page->page['modules']['sort'])+50):50);
00088     $page->page['modules'][$type][$name_clean]='true';
00089 
00090     return true;
00091   }

oscss_modules::pile_commande ( module,
type,
action = '',
value = '' 
) [private]

Definition at line 231 of file page.oscss_modules.php.

Referenced by _bloque(), _replace(), and modules().

00231                                                                        {
00232     if (is_array($type)){
00233       $this->temp['list'][$module]=$type;
00234     }else {
00235       $this->temp[$module]=array(
00236                                  'module'=>$module,
00237                                  'class'=>$type,
00238                                  'action'=>$action,
00239                                  'value'=>$value,
00240                                 );
00241     }
00242   }

static oscss_modules::resetInstance (  )  [static]

Definition at line 39 of file page.oscss_modules.php.

00039                                         {
00040     self::$_instance = null;
00041     return self::getInstance();
00042   }

oscss_modules::ret_modules ( key  )  [private]

Fournis les element enregsitré du module.

Parameters:
$key string la key du module

Definition at line 218 of file page.oscss_modules.php.

Referenced by _return(), and tep_call_modules().

00218                                     {
00219     global $page;
00220     if(isset($page->page['modules']['list'][$key]))return $page->page['modules']['list'][$key];
00221     else return false;
00222   }

oscss_modules::tep_call_modules ( modules = false,
type = false 
) [private]

Appel des modules Charment des langues associés !!! Les variables de page ne sont pas accessible dans le fichiers de langues.

Parameters:
$modules string, le nom du modules
$type string : la class de modules

Charment de la pile d'action en attente

Charment de la pile d'action en attente

Verif etat et exe

Charment de la pile d'action en attente

Definition at line 104 of file page.oscss_modules.php.

Referenced by _call().

00104                                                                {
00105     global $page;
00106 
00107     asort($page->page['modules']['sort']);
00108 
00109     if($type!=false && $modules!=false) {
00110       $key=(strchr($modules,'.')==$this->ext)? substr($modules,0,strlen($modules)-4) :$modules ;
00112       if (isset($this->temp[$key])  ){
00113         $page->page['modules'][$type][$key]=$this->temp[$key]['value'];
00114       }
00115 
00116       if (isset($page->page['modules'][$type]) && isset($page->page['modules'][$type][$key]) && $page->page['modules'][$type][$key] !='false') {
00117         $mod=$page->page['modules']['list'][$key];
00118         $function='sql_'.$mod['name_clean'];
00119 
00120         require_once($mod['path']);
00121 
00122         if ( ($res=$this->test_value_content($function)) !=false) $exe=true;
00123         elseif(function_exists($function)) $exe=false;
00124         else $exe=true;
00125 
00126         if ($exe) {
00127           $page->page['modules']['list'][$mod['name_clean']]['result_sql']=$res;
00128 //           if (page::TestFile($mod['dir_lang']. $mod['name'])) require_once($mod['dir_lang']. $mod['name'] );
00129           if(($path_lg=$page->fix_file($mod['dir_lang'] . $mod['name'],true)) !=false) $page->pile_file_lang($path_lg);
00130           return $mod['path'];
00131         }
00132         $this->modules_chargee[$key]=$page->page['modules'][$type][$key]='false';
00133       }else return false;
00134     }
00135 
00136     elseif($type !=false && !$modules){
00137       if (isset($page->page['modules']['sort'])) {
00138         foreach ($page->page['modules']['sort'] as $key=>$value){
00139 
00141           if (isset($this->temp[$key])  )
00142             $page->page['modules'][$type][$key]=$this->temp[$key]['value'];
00143           elseif (isset($this->temp['list']) && ( isset($this->temp['list'][$key]) && is_array($this->temp['list'][$key])) )
00144             $page->page['modules']['list'][$key]=array_merge( $page->page['modules']['list'][$key],$this->temp['list'][$key]);
00145 
00147           if($page->page['modules'][$type][$key] !='false'){
00148             $mod=$this->ret_modules($key);
00149 //             $file=$mod['dir_lang'] . $mod['name'] ;
00150             $function='sql_'.$mod['name_clean'];
00151 
00152             require_once($mod['path']);
00153 
00154             if ( ($res=$this->test_value_content($function)) !=false) $exe=true;
00155             elseif(function_exists($function)) $exe=false;
00156             else $exe=true;
00157 
00158             if($exe){
00159               if(page::TestFile($mod['dir_lang']. $mod['name']))require_once($mod['dir_lang']. $mod['name']);
00160               if(($path_lg=$page->fix_file($mod['dir_lang'] . $mod['name'],true)) !=false) $page->pile_file_lang($path_lg);
00161 
00162 // if (page::TestFile($file)) require_once($file);
00163               $this->modules_chargee[$key]=$page->page['modules'][$type][$key];
00164               $page->page['modules']['list'][$key]['result_sql']=$res;
00165             }
00166             else{
00167               $page->page['modules']['list'][$mod['name_clean']]['draw']='false';
00168               $this->modules_chargee[$key]=$page->page['modules'][$type][$key]='false';
00169             }
00170           }
00171         }
00172         return $this->modules_chargee;
00173       }else return false;
00174     }
00175 
00176     elseif(empty($type) && $modules!=false) {
00177       $key=(strchr($modules,'.')==$this->ext)? substr($modules,0,strlen($modules)-4) :$modules ;
00178 
00179       while($r=each($page->page['modules'])){
00181         if (isset($this->temp[$key])  )
00182           $page->page['modules'][$r['key']][$key]=$this->temp[$key]['value'];
00183 
00184         if (isset($page->page['modules'][$r['key']][$key]) && $page->page['modules'][$r['key']][$key] !='false'
00185             && ( ($mod=$page->page['modules']['list'][$key]) && is_array($mod) ) ) {
00186           $function='sql_'.$mod['name_clean'];
00187 
00188           require_once($mod['path']);
00189           if ( ($res=$this->test_value_content($function)) !=false) $exe=true;
00190           elseif(function_exists($function)) $exe=false;
00191           else $exe=true;
00192 
00193           if ($exe) {
00194             $page->page['modules']['list'][$mod['name_clean']]['draw']='true';
00195             $page->page['modules']['list'][$mod['name_clean']]['result_sql']=$res;
00196 //             if (page::TestFile($file)) require_once($mod['dir_lang']. $mod['name'] );
00197             if(($path_lg=$page->fix_file($mod['dir_lang'] . $mod['name'],true)) !=false) $page->pile_file_lang($path_lg);
00198             return $mod['path'];
00199           }
00200           else{
00201             $page->page['modules']['list'][$mod['name_clean']]['draw']='false';
00202             $this->modules_chargee[$key]=$page->page['modules'][$type][$key]='false';
00203           }
00204         }
00205       }
00206 
00207       return false;
00208     }
00209     else return $page->page['modules'];
00210   }

oscss_modules::test_value_content ( function,
parameter = '' 
) [private]

Verifie que le resultat du module appelé n'est pas null, ou vide.

Parameters:
$function 
$parameter 

Definition at line 251 of file page.oscss_modules.php.

Referenced by tep_call_modules().

00251                                                                {
00252     global $page;
00253     if (function_exists($function)) return call_user_func($function, $parameter);
00254     else return '';
00255   }


Member Data Documentation

oscss_modules::$_instance [static, protected]

Definition at line 23 of file page.oscss_modules.php.

oscss_modules::$modules_chargee

Definition at line 22 of file page.oscss_modules.php.

oscss_modules::$temp [private]

private pile qui est appelé lors du _call d'un module et qui charge les commande en atente

Definition at line 20 of file page.oscss_modules.php.


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