template.php File Reference
Go to the source code of this file.
Functions
- tep_extrac_querystring ($query='')
- tep_build_tree ($tree, $categories_string='', $entry, $last_member=false, $level=0, $path= '')
- in_menu_info ($format='< li class="informationBox">< a href="%s">%s</a ></li >')
- in_menu_cat ($arg=array())
- templ_draw_list ($arg=array())
- TempModRes ($arg=array())
- the_description ($mod='desc_base')
- Specific Products Display desc min by module type products, desc_base.
- Specific Products Display desc min by module type products, desc_base.
Detailed Description
Definition in file template.php.
Function Documentation
| in_menu_cat | ( | $ | arg = array() |
) |
Consrtuit la liste des categories.
- Parameters:
-
$arg string catID=1&max_level=1
Definition at line 113 of file template.php.
00113 { 00114 global $page; 00115 $cf=tep_extrac_querystring($arg); 00116 $max_level=(isset($cf['max_level'])? $cf['max_level'] : 1); 00117 $catID=(isset($cf['catID'])? $cf['catID'] : 0); 00118 $ParentGroupString=(isset($cf['ParentGroupString'])? $cf['ParentGroupString'] : ''); 00119 00120 $osC_CategoryTree = new category_tree(); 00121 00122 if(!empty($ParentGroupString)) $osC_CategoryTree->setParentGroupString('<'.$ParentGroupString.'>'."\n", '</'.$ParentGroupString.'>'."\n"); 00123 else $osC_CategoryTree->setParentGroupString(''."\n", ''."\n"); 00124 00125 $osC_CategoryTree->setChildString('<li %s>', '</li>'."\n"); 00126 $osC_CategoryTree->setRootString('<li %s>', '</li>'."\n"); 00127 $osC_CategoryTree->setSpacerString(' ', 1); 00128 $osC_CategoryTree->setMaximumLevel($max_level); 00129 $osC_CategoryTree->setCategoryProductCountString(' (',')'); 00130 00131 return $osC_CategoryTree->buildTree($catID) ; 00132 }
| in_menu_info | ( | $ | format = ' <li class="informationBox"><a href="%s">%s</a></li>' |
) |
Construit liste des page content de "class" (informationBox_).
- Parameters:
-
$format string for printf
- Returns:
- string
Definition at line 95 of file template.php.
00095 { 00096 global $template,$page; 00097 $s=''; 00098 $language=$page->the_var('language'); 00099 $content_query=content::get_query('','informationBox_','',array('limit'=>20)); 00100 if($content_query ==false) return false; 00101 00102 foreach($content_query as $content) 00103 $s.= sprintf($format."\n",$content->href,$content->title); 00104 00105 return $s; 00106 }
| templ_draw_list | ( | $ | arg = array() |
) |
Consrtuit L'appel et l'incrementation de la pile, utilisé dans les boucles de module, boxes et plugin du template.
- Parameters:
-
$arg array , catID=1&max_level=1
- Returns:
- object
Definition at line 142 of file template.php.
00142 { 00143 global $page; 00144 $cf=tep_extrac_querystring($arg); 00145 $sortie=array(); 00146 $pile=(isset($cf['pile'])? $cf['pile'] : 'center'); /* center, rght, left */ 00147 $type=(isset($cf['type'])? $cf['type'] : 'modules'); /* modules, boxes */ 00148 $methode='oscss_'.$type; 00149 $page->pos_init($type,$pile,$page->$methode->_call('',$pile)); 00150 $key=$page->pos_next($type,$pile); 00151 00152 return TempModRes('type='.$type.'&key='.$key); 00153 }
| TempModRes | ( | $ | arg = array() |
) |
return object current in pile
- Parameters:
-
$arg array key=>value
Definition at line 160 of file template.php.
Referenced by templ_draw_list().
00160 { 00161 global $page; 00162 $cf=tep_extrac_querystring($arg); 00163 00164 $sortie=array(); 00165 $type=(isset($cf['type'])? $cf['type'] : 'modules'); /* modules, boxes */ 00166 $methode='oscss_'.$type; 00167 if(!isset($cf['key'])) return false; 00168 $key=$cf['key'] ; 00169 00170 $mo =$page->$methode->_return($key); 00171 00172 if(is_array($mo) && !isset($mo['result_sql'])) $page->$methode->_call($key); 00173 elseif(is_object($mo) && !isset($mo->result_sql)) $page->$methode->_call($key); 00174 00175 if(( $mod=$page->$methode->_in_obj($mo)) !=false){ 00176 00177 if(is_array($mo)) { 00178 $sortie['id']=$mo['name_clean'].'Box'; 00179 $sortie['css_class']=$key.' '.$mo['name_clean']; 00180 $sortie['key']=$key; 00181 $sortie['template']=$type.'.php'; 00182 $sortie['module_db']=$mod; 00183 return new objectInfo($sortie); 00184 }elseif(is_object($mo)) { 00185 return $mo; 00186 } 00187 else return false; 00188 } 00189 else return false; 00190 }
| tep_build_tree | ( | $ | tree, | |
| $ | categories_string = '', |
|||
| $ | entry, | |||
| $ | last_member = false, |
|||
| $ | level = 0, |
|||
| $ | path = '' | |||
| ) |
Specific boxes categories_dropdown.
- Parameters:
-
$tree $categories_string $entry $last_member $level $path
Definition at line 45 of file template.php.
00045 { 00046 global $page; 00047 $prefix = ''; 00048 $pinc = ''; 00049 if(empty($cpath))$cPath=$page->the_var('cPath'); 00050 00051 00052 for ($i = 0; $i <= $level; $i++) { 00053 $prefix .= ' '; 00054 } 00055 00056 if (_cst_bool('SHOW_COUNTS')) 00057 $pinc = (($products_in_category=tep_count_products_in_category($entry)) >0)? ' (' . $products_in_category . ')' : ''; 00058 00059 00060 if ($path == '') $new_path = $entry; 00061 else $new_path = $path . '_' . $entry; 00062 00063 $categories_string .= $prefix . '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $new_path) . '">'. addslashes($tree[$entry]['name']) . $pinc .'</a>'; 00064 00065 $array_size = sizeof($tree[$entry]['children']); 00066 if ($array_size > 0) { 00067 $categories_string .= "\n" . '<ul class="cats">' . "\n"; 00068 $children = $tree[$entry]['children']; 00069 reset($children); 00070 end($children); 00071 $end_key = key($children); 00072 reset($children); 00073 while (list($key, $new_entry) = each($children)) { 00074 $new_last_member = ($key == $end_key) ? true : false; 00075 $categories_string = tep_build_tree($tree, $categories_string,$new_entry, $new_last_member, $level + 1, $new_path); 00076 } 00077 $categories_string .= $prefix; 00078 $categories_string .= ($last_member == true) ? '</li>'. "\n" . '</ul>' : '</li>'; 00079 $categories_string .= "\n"; 00080 } else { 00081 $categories_string .= ($last_member == true) ? '</li>'. "\n" . '</ul>' : '</li>'; 00082 $categories_string .= "\n"; 00083 } 00084 00085 return $categories_string; 00086 }
| tep_extrac_querystring | ( | $ | query = '' |
) |
Extraction chaine en tableau.
- Parameters:
-
$query string type Query_string
- Returns:
- array key=>value
Definition at line 23 of file template.php.
Referenced by in_menu_cat(), templ_draw_list(), and TempModRes().
| the_description | ( | $ | mod = 'desc_base' |
) |
Specific Products Display desc min by module type products, desc_base.
- Parameters:
-
$mod string module name
- Returns:
- string module->content
Definition at line 198 of file template.php.
00198 { 00199 global $module; 00200 if(!isset($module[$mod])) return; 00201 $ele=$module[$mod]->display_view($_GET['products_id']); 00202 return unhtmlentities($ele[0]->content); 00203 }
