Index: trunk/template/default/htmlfunctions.inc.php
===================================================================
--- trunk/template/default/htmlfunctions.inc.php	(revision 345)
+++ trunk/template/default/htmlfunctions.inc.php	(revision 351)
@@ -18,8 +18,6 @@
  ***************************************************************************/
 
-//include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' );
 $user['lien_expanded']='./template/'.$user['template'].'/theme/expanded.gif';
 $user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif';
-//include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php');
 
 function get_icon( $date_comparaison )
@@ -105,20 +103,4 @@
   return '<table style="width:';
 }
-/*
-function get_frame_begin()
-{
-  return ';">
-            <tr>
-              <td style="border:1px dashed gray;width:100%;padding:5px;background-color:white;">';
-}
-
-function get_frame_end()
-{
-  return '
-              </td>
-            </tr>   
-          </table>';
-}
-*/
 
 function get_frame_begin()
@@ -159,78 +141,78 @@
 function initialize_template()
 {
-  global $vtp, $handle, $user, $lang;
-
- // $vtp->setGlobalVar( $handle, 'charset', $lang['charset'] );
-  //$vtp->setGlobalVar( $handle, 'style', $user['style'] );
+  global $template, $user, $lang;
+  
+  $template->assign_vars(array(
+	'F_START' => get_frame_start(),
+	'F_BEGIN' => get_frame_begin(),
+	'F_END' =>  get_frame_end()
+	)
+	);
+
+
+  global $vtp, $handle;
+  if (isset($handle))
+  {
   $vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() );
   $vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() );
   $vtp->setGlobalVar( $handle, 'frame_end',   get_frame_end() );
- //$vtp->setVarF( $handle, 'header',
- //                './template/'.$user['template'].'/header.htm' );
-  //$vtp->setVarF( $handle, 'footer',
-   //              './template/'.$user['template'].'/footer.htm' );
-}
-
-function display_category( $category, $indent, $handle )
-{
-  global $user,$lang,$vtp;
-
-  $vtp->addSession( $handle, 'category' );
-  $vtp->setVar( $handle, 'category.indent', $indent );
+  }
+}
+
+function display_category( $category, $indent )
+{
+  global $user,$lang,$template, $vtp, $handle;
+  
+  $style='';
+  $url = './category.php?cat='.$category['id'];
+  $url.= '&amp;expand='.$category['expand_string'];
+  $name = $category['name'];
+  if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] );
+  if ( $category['id_uppercat'] == '' )
+  {
+    $style = 'font-weight:bold;';
+  }
+  
+  $template->assign_block_vars('category', array(
+    'LINK_NAME' => $name,
+	'INDENT' => $indent,
+	'NB_SUBCATS'=>$category['nb_sub_categories'],
+	'TOTAL_CAT'=>$category['nb_images'],
+	'CAT_ICON'=>get_icon($category['date_last']),
+	
+	'T_NAME'=>$style,
+    'U_LINK' => add_session_id($url)));
+
   if ( $user['expand'] or $category['nb_sub_categories'] == 0 )
   {
-    $vtp->addSession( $handle, 'bullet_wo_link' );
-    $vtp->setVar( $handle, 'bullet_wo_link.bullet_url',
-                  $user['lien_collapsed'] );
-    $vtp->closeSession( $handle, 'bullet_wo_link' );
+  	$template->assign_block_vars('category.bulletnolink', array('BULLET_IMAGE' =>  $user['lien_collapsed']));
   }
   else
   {
-    $vtp->addSession( $handle, 'bullet_w_link' );
-    $url = './category.php';
-	if (isset($page['cat']))
+	$url = './category.php';
+  	if (isset($page['cat']))
 	{
-	$url .='?cat='.$page['cat'];
-    $url.= '&amp;expand='.$category['expand_string'];
+	  $url .='?cat='.$page['cat'];
+      $url.= '&amp;expand='.$category['expand_string'];
 	}
 	else if ($category['expand_string']<>'')
 	{
-		$url.= '?expand='.$category['expand_string'];
+	  $url.= '?expand='.$category['expand_string'];
 	}
-    $vtp->setVar( $handle, 'bullet_w_link.bullet_link', add_session_id($url) );
-    if ( $category['expanded'] )
-    {
-      $vtp->setVar( $handle, 'bullet_w_link.bullet_url',
-                    $user['lien_expanded'] );
+	
+	if ( $category['expanded'] )
+    {
+      $img=$user['lien_expanded'];
     }
     else
     {
-      $vtp->setVar( $handle, 'bullet_w_link.bullet_url',
-                    $user['lien_collapsed'] );
-    }
-    $vtp->closeSession( $handle, 'bullet_w_link' );
-  }
-
-  $url = './category.php?cat='.$category['id'];
-  $url.= '&amp;expand='.$category['expand_string'];
-  $vtp->setVar( $handle, 'category.link_url', add_session_id( $url ) );
-
-  $name = $category['name'];
-  if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] );
-  $vtp->setVar( $handle, 'category.link_name', $name );
-
-  if ( $category['id_uppercat'] == '' )
-  {
-    $vtp->setVar( $handle, 'category.name_style', 'font-weight:bold;' );
-  }
-  if ( $category['nb_sub_categories'] > 0 )
-  {
-    $vtp->addSession( $handle, 'subcat' );
-    $vtp->setVar( $handle,'subcat.nb_subcats',$category['nb_sub_categories'] );
-    $vtp->closeSession( $handle, 'subcat' );
-  }
-  $vtp->setVar( $handle, 'category.total_cat', $category['nb_images'] );
-  $vtp->setVar( $handle, 'category.cat_icon',get_icon($category['date_last']));
-  $vtp->closeSession( $handle, 'category' );
+      $img=$user['lien_collapsed'];
+    }
+	
+    $template->assign_block_vars('category.bulletlink', array(
+      'BULLET_IMAGE' =>  $img,
+	  'U_BULLET_LINK'=>  add_session_id($url)		
+	));
+  }
 
   // recursive call
@@ -238,5 +220,6 @@
   {
     foreach ( $category['subcats'] as $subcat ) {
-      display_category( $subcat, $indent.str_repeat( '&nbsp', 2 ), $handle );
+	  $template->assign_block_vars('category.subcat', array());
+      display_category( $subcat, $indent.str_repeat( '&nbsp', 2 ));
     }
   }
