Changeset 351 for trunk/template/default/htmlfunctions.inc.php
- Timestamp:
- Feb 7, 2004, 12:50:26 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/template/default/htmlfunctions.inc.php
r345 r351 18 18 ***************************************************************************/ 19 19 20 //include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' );21 20 $user['lien_expanded']='./template/'.$user['template'].'/theme/expanded.gif'; 22 21 $user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif'; 23 //include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php');24 22 25 23 function get_icon( $date_comparaison ) … … 105 103 return '<table style="width:'; 106 104 } 107 /*108 function get_frame_begin()109 {110 return ';">111 <tr>112 <td style="border:1px dashed gray;width:100%;padding:5px;background-color:white;">';113 }114 115 function get_frame_end()116 {117 return '118 </td>119 </tr>120 </table>';121 }122 */123 105 124 106 function get_frame_begin() … … 159 141 function initialize_template() 160 142 { 161 global $vtp, $handle, $user, $lang; 162 163 // $vtp->setGlobalVar( $handle, 'charset', $lang['charset'] ); 164 //$vtp->setGlobalVar( $handle, 'style', $user['style'] ); 143 global $template, $user, $lang; 144 145 $template->assign_vars(array( 146 'F_START' => get_frame_start(), 147 'F_BEGIN' => get_frame_begin(), 148 'F_END' => get_frame_end() 149 ) 150 ); 151 152 153 global $vtp, $handle; 154 if (isset($handle)) 155 { 165 156 $vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() ); 166 157 $vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() ); 167 158 $vtp->setGlobalVar( $handle, 'frame_end', get_frame_end() ); 168 //$vtp->setVarF( $handle, 'header', 169 // './template/'.$user['template'].'/header.htm' ); 170 //$vtp->setVarF( $handle, 'footer', 171 // './template/'.$user['template'].'/footer.htm' ); 172 } 173 174 function display_category( $category, $indent, $handle ) 175 { 176 global $user,$lang,$vtp; 177 178 $vtp->addSession( $handle, 'category' ); 179 $vtp->setVar( $handle, 'category.indent', $indent ); 159 } 160 } 161 162 function display_category( $category, $indent ) 163 { 164 global $user,$lang,$template, $vtp, $handle; 165 166 $style=''; 167 $url = './category.php?cat='.$category['id']; 168 $url.= '&expand='.$category['expand_string']; 169 $name = $category['name']; 170 if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] ); 171 if ( $category['id_uppercat'] == '' ) 172 { 173 $style = 'font-weight:bold;'; 174 } 175 176 $template->assign_block_vars('category', array( 177 'LINK_NAME' => $name, 178 'INDENT' => $indent, 179 'NB_SUBCATS'=>$category['nb_sub_categories'], 180 'TOTAL_CAT'=>$category['nb_images'], 181 'CAT_ICON'=>get_icon($category['date_last']), 182 183 'T_NAME'=>$style, 184 'U_LINK' => add_session_id($url))); 185 180 186 if ( $user['expand'] or $category['nb_sub_categories'] == 0 ) 181 187 { 182 $vtp->addSession( $handle, 'bullet_wo_link' ); 183 $vtp->setVar( $handle, 'bullet_wo_link.bullet_url', 184 $user['lien_collapsed'] ); 185 $vtp->closeSession( $handle, 'bullet_wo_link' ); 188 $template->assign_block_vars('category.bulletnolink', array('BULLET_IMAGE' => $user['lien_collapsed'])); 186 189 } 187 190 else 188 191 { 189 $vtp->addSession( $handle, 'bullet_w_link' ); 190 $url = './category.php'; 191 if (isset($page['cat'])) 192 $url = './category.php'; 193 if (isset($page['cat'])) 192 194 { 193 $url .='?cat='.$page['cat'];194 $url.= '&expand='.$category['expand_string'];195 $url .='?cat='.$page['cat']; 196 $url.= '&expand='.$category['expand_string']; 195 197 } 196 198 else if ($category['expand_string']<>'') 197 199 { 198 200 $url.= '?expand='.$category['expand_string']; 199 201 } 200 $vtp->setVar( $handle, 'bullet_w_link.bullet_link', add_session_id($url) ); 201 if ( $category['expanded'] ) 202 { 203 $vtp->setVar( $handle, 'bullet_w_link.bullet_url', 204 $user['lien_expanded'] ); 202 203 if ( $category['expanded'] ) 204 { 205 $img=$user['lien_expanded']; 205 206 } 206 207 else 207 208 { 208 $vtp->setVar( $handle, 'bullet_w_link.bullet_url', 209 $user['lien_collapsed'] ); 210 } 211 $vtp->closeSession( $handle, 'bullet_w_link' ); 212 } 213 214 $url = './category.php?cat='.$category['id']; 215 $url.= '&expand='.$category['expand_string']; 216 $vtp->setVar( $handle, 'category.link_url', add_session_id( $url ) ); 217 218 $name = $category['name']; 219 if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] ); 220 $vtp->setVar( $handle, 'category.link_name', $name ); 221 222 if ( $category['id_uppercat'] == '' ) 223 { 224 $vtp->setVar( $handle, 'category.name_style', 'font-weight:bold;' ); 225 } 226 if ( $category['nb_sub_categories'] > 0 ) 227 { 228 $vtp->addSession( $handle, 'subcat' ); 229 $vtp->setVar( $handle,'subcat.nb_subcats',$category['nb_sub_categories'] ); 230 $vtp->closeSession( $handle, 'subcat' ); 231 } 232 $vtp->setVar( $handle, 'category.total_cat', $category['nb_images'] ); 233 $vtp->setVar( $handle, 'category.cat_icon',get_icon($category['date_last'])); 234 $vtp->closeSession( $handle, 'category' ); 209 $img=$user['lien_collapsed']; 210 } 211 212 $template->assign_block_vars('category.bulletlink', array( 213 'BULLET_IMAGE' => $img, 214 'U_BULLET_LINK'=> add_session_id($url) 215 )); 216 } 235 217 236 218 // recursive call … … 238 220 { 239 221 foreach ( $category['subcats'] as $subcat ) { 240 display_category( $subcat, $indent.str_repeat( ' ', 2 ), $handle ); 222 $template->assign_block_vars('category.subcat', array()); 223 display_category( $subcat, $indent.str_repeat( ' ', 2 )); 241 224 } 242 225 }
Note: See TracChangeset
for help on using the changeset viewer.