oscss_boxes Class Reference

List of all members.

Public Member Functions

  • _in_obj ($box, $parameter='')
  • _add ($file_to_display, $type='', $opt='')
    Alias de la function boxes.
  • _addWidget ($name, $type='', $opt='')
    Alias de la function widget.
  • _call ($boxe='', $type='')
    Alias de la function tep_call_boxes.
  • _return ($key)

Static Public Member Functions

Protected Member Functions

Static Protected Attributes

Private Member Functions

  • boxes ($file_to_display, $type='std', $opt)
    Scan template boxes 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.
  • widget ($name_clean, $type='std', $opt)
    widget, appel de function chargée a l'identique des boxes.
  • tep_call_boxes ($boxe='', $type='')
    Chargement de la boxes.
  • ret_boxes ($key)
    Retrun les info de la boxe.

Static Private Member Functions


Detailed Description

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

Definition at line 13 of file page.oscss_boxes.php.


Constructor & Destructor Documentation

oscss_boxes::__construct (  )  [protected]

Definition at line 28 of file page.oscss_boxes.php.

00028                                    {
00029     global $page;
00030     $this->ext=$page->ext;
00031     $page->page['boxes']['list']=array();
00032     $page->page['boxes']['sort']=array();
00033   }


Member Function Documentation

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

Alias de la function boxes.

Parameters:
$file_to_display 
$type 
$opt 

Definition at line 213 of file page.oscss_boxes.php.

00213                                                          {
00214     global $page;
00215     return $this->boxes($file_to_display,$type,$opt);
00216   }

oscss_boxes::_addWidget ( name,
type = '',
opt = '' 
)

Alias de la function widget.

Parameters:
$name 
$type 
$opt 

Definition at line 225 of file page.oscss_boxes.php.

00225                                                     {
00226     global $page;
00227     return $this->widget($name,$type,$opt);
00228   }

oscss_boxes::_call ( boxe = '',
type = '' 
)

Alias de la function tep_call_boxes.

Parameters:
$boxe 
$type 

Definition at line 236 of file page.oscss_boxes.php.

00236                                           {
00237     global $page;
00238     return $this->tep_call_boxes($boxe,$type);
00239   }

oscss_boxes::_in_obj ( box,
parameter = '' 
)

Definition at line 201 of file page.oscss_boxes.php.

00201                                              {
00202     if(isset($box->content)) return true;
00203     else return false;
00204   }

oscss_boxes::_return ( key  ) 

Definition at line 246 of file page.oscss_boxes.php.

00246                                {
00247     global $page;
00248     return $this->ret_boxes($key);
00249   }

oscss_boxes::boxes ( file_to_display,
type = 'std',
opt 
) [private]

Scan template boxes 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

Definition at line 84 of file page.oscss_boxes.php.

Referenced by _add().

00084                                                             {
00085     global $page, $PHP_SELF, $request_type,$language, $lang;
00086     $name_clean=(strchr($file_to_display,'.')==$page->ext)? substr($file_to_display,0,strlen($file_to_display)-4) :$file_to_display ;
00087     if (!is_array($opt)) $opt=array();
00088 
00089     /* Force une taille d'image par defaut pour les images, si aucunne n'est pr�cis� */
00090     if (!isset($opt['img'])) $opt['img']=array('width'=>$page->the_var('SIDEBAR_IMG_WIDTH'),'height'=>$page->the_var('SIDEBAR_IMG_HEIGHT'));
00091     if (!isset($opt['img']['width'])) $opt['img']['width']=$page->the_var('SIDEBAR_IMG_WIDTH');
00092     if (!isset($opt['img']['height'])) $opt['img']['height']=$page->the_var('SIDEBAR_IMG_HEIGHT');
00093 
00094     /* Mise en cache */
00095     $cache=(isset($opt['cache']) && !_test_bool($opt['cache'])? false : true);
00096 
00097     $filename = DIR_WS_TEMPLATES . $page->page['template'] .'/' . DIR_WS_INCLUDES. '%s'. $name_clean.$page->ext;
00098 
00099     if (page::TestFile(sprintf($filename,'plugins/'))) $path =sprintf($filename,'plugins/');
00100     elseif (page::TestFile(sprintf($filename,'boxes/'))) $path =sprintf($filename,'boxes/');
00101     elseif (page::TestFile(DIR_WS_BOXES . $name_clean.$page->ext)) $path = (DIR_WS_BOXES . $name_clean.$page->ext);
00102     else return false;
00103 
00104     if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/boxes/' . $name_clean.$page->ext,true)) !=false) $page->pile_file_lang($path_lg);
00105 
00106 
00107     $res=array_merge((array)self::in_cache($path,$cache) ,array('name'=>$file_to_display,
00108                                   'name_clean'=>$name_clean,
00109                                   'path'=>$path
00110                                 ));
00111 
00112     $page->page['boxes']['sort'][$name_clean]=(isset($opt['sort']))? $opt['sort']: ((count($page->page['boxes']['sort'])>0)?(count($page->page['boxes']['sort'])+50):50);
00113     $page->page['boxes']['list'][$name_clean]=   new objectInfo(array_merge($res,$opt));
00114     $page->page['boxes'][$type][$name_clean]='true';
00115   }

oscss_boxes::getInstance (  )  [static]

Definition at line 37 of file page.oscss_boxes.php.

Referenced by resetInstance().

00037                                        {
00038     if(self::$_instance == null) self::$_instance = new self();
00039     return self::$_instance;
00040   }

oscss_boxes::in_cache ( path,
cache = true 
) [static, private]
Parameters:
$path string
$cache boolean

Definition at line 55 of file page.oscss_boxes.php.

00055                                                      {
00056     global $page, $PHP_SELF, $request_type,$language, $lang;
00057 
00058     self::$_key=md5($path);
00059     if($cache && OSCSS_DEBUG == false){
00060       $cache = page::GetCacheVar();
00061       if(!isset($cache['boxes'][self::$_key])) {
00062         include($path);
00063         page::AddCacheVar('boxes',self::$_key,$array);
00064       }
00065       else $array=$cache['boxes'][self::$_key];
00066     }
00067     else include($path);
00068 
00069     if(isset($array) && is_array($array)) return $array;
00070     else return ;
00071   }

static oscss_boxes::resetInstance (  )  [static]

Definition at line 44 of file page.oscss_boxes.php.

00044                                         {
00045     self::$_instance = null;
00046     return self::getInstance();
00047   }

oscss_boxes::ret_boxes ( key  )  [private]

Retrun les info de la boxe.

Parameters:
$key 
Returns:
string path file or boolean false

Definition at line 193 of file page.oscss_boxes.php.

Referenced by _return().

00193                                   {
00194     global $page;
00195     if(!empty($key) && isset($page->page['boxes']['list'][$key]))return $page->page['boxes']['list'][$key];
00196     return false;
00197   }

oscss_boxes::tep_call_boxes ( boxe = '',
type = '' 
) [private]

Chargement de la boxes.

Parameters:
$boxe 
$type 

Definition at line 153 of file page.oscss_boxes.php.

Referenced by _call().

00153                                                     {
00154     global $page, $lang;
00155 
00156     asort($page->page['boxes']['sort']);
00157 
00158     if(!empty($type) && !empty($boxe)) {
00159       $key=(strchr($boxe,'.')==$page->ext)? substr($boxe,0,strlen($boxe)-4) :$boxe ;
00160       if (isset($page->page['boxes'][$type]) && isset($page->page['boxes']['list'][$key]) &&  isset($page->page['boxes'][$type][$key]) && $page->page['boxes'][$type][$key] !='false')
00161         return $page->page['boxes']['list'][$key]->path;
00162       else return false;
00163     }
00164     elseif(!empty($type) && empty($boxe)){
00165       if( isset($page->page['boxes'][$type]) ){
00166         foreach($page->page['boxes']['sort'] as $k=>$v)
00167           if(isset($page->page['boxes'][$type][$k]))$s[$k]=$page->page['boxes']['list'][$k];
00168         return $s;
00169       }
00170       else return array();
00171     }
00172     elseif(empty($type) && !empty($boxe)) {
00173       $key=(strchr($boxe,'.')==$page->ext)? substr($boxe,0,strlen($boxe)-4) :$boxe ;
00174       if (isset($page->page['boxes']['std'][$key]) && $page->page['boxes']['std'][$key] !='false') return $page->page['boxes']['list'][$key]->path;
00175 
00176       foreach($page->page['boxes']['sort'] as $k=>$v)
00177         if (isset($page->page['boxes'][$k][$key]) && $page->page['boxes'][$k][$key] !='false') return $page->page['boxes']['list'][$key]->path;
00178 //       while($r=each($page->page['boxes'])){
00179 //         if (isset($page->page['boxes'][$r['key']][$key]) && $page->page['boxes'][$r['key']][$key] !='false') return $page->page['boxes']['list'][$key]->path;
00180 //       }
00181 
00182       return false;
00183     }
00184     else return $page->page['boxes'];
00185   }

oscss_boxes::widget ( name_clean,
type = 'std',
opt 
) [private]

widget, appel de function chargée a l'identique des boxes.

Parameters:
$name_clean 
$type string
$opt array

Force une taille d'image par defaut pour les images, si aucunne n'est pr�cis�

Definition at line 124 of file page.oscss_boxes.php.

Referenced by _addWidget().

00124                                                         {
00125     global $page, $PHP_SELF, $request_type, $lang;
00126     if (!is_array($opt)) $opt=array();
00127 
00129     if (!isset($opt['img'])) $opt['img']=array('width'=>$page->the_var('SIDEBAR_IMG_WIDTH'),'height'=>$page->the_var('SIDEBAR_IMG_HEIGHT'));
00130     if (!isset($opt['img']['width'])) $opt['img']['width']=$page->the_var('SIDEBAR_IMG_WIDTH');
00131     if (!isset($opt['img']['height'])) $opt['img']['height']=$page->the_var('SIDEBAR_IMG_HEIGHT');
00132 
00133     $boxe=$opt;
00134     if(!function_exists($name_clean) || isset($page->page['boxes']['list'][$name_clean]) ) return false;
00135     $array=call_user_func($name_clean);
00136 
00137     $res=array_merge($array,array('name'=>$name_clean,
00138                                   'name_clean'=>str_replace('Widget_','',$name_clean),
00139                                   'path'=>''
00140                                   ));
00141     $page->page['boxes']['sort'][$name_clean]=(isset($opt['sort']))? $opt['sort']: ((count($page->page['boxes']['sort'])>0)?(count($page->page['boxes']['sort'])+50):50);
00142     $page->page['boxes']['list'][$name_clean]=   new objectInfo(array_merge($res,$opt));
00143     $page->page['boxes'][$type][$name_clean]='true';
00144   }


Member Data Documentation

oscss_boxes::$_instance [static, protected]

Definition at line 19 of file page.oscss_boxes.php.

oscss_boxes::$_key [static, protected]

Definition at line 24 of file page.oscss_boxes.php.


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