Ignore:
Timestamp:
Feb 7, 2004, 12:50:26 PM (20 years ago)
Author:
gweltas
Message:

Template modification
Split of the french language file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/template/default/htmlfunctions.inc.php

    r345 r351  
    1818 ***************************************************************************/
    1919
    20 //include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' );
    2120$user['lien_expanded']='./template/'.$user['template'].'/theme/expanded.gif';
    2221$user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif';
    23 //include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php');
    2422
    2523function get_icon( $date_comparaison )
     
    105103  return '<table style="width:';
    106104}
    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 */
    123105
    124106function get_frame_begin()
     
    159141function initialize_template()
    160142{
    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  {
    165156  $vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() );
    166157  $vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() );
    167158  $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
     162function display_category( $category, $indent )
     163{
     164  global $user,$lang,$template, $vtp, $handle;
     165 
     166  $style='';
     167  $url = './category.php?cat='.$category['id'];
     168  $url.= '&amp;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
    180186  if ( $user['expand'] or $category['nb_sub_categories'] == 0 )
    181187  {
    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']));
    186189  }
    187190  else
    188191  {
    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']))
    192194        {
    193         $url .='?cat='.$page['cat'];
    194     $url.= '&amp;expand='.$category['expand_string'];
     195          $url .='?cat='.$page['cat'];
     196      $url.= '&amp;expand='.$category['expand_string'];
    195197        }
    196198        else if ($category['expand_string']<>'')
    197199        {
    198                 $url.= '?expand='.$category['expand_string'];
     200          $url.= '?expand='.$category['expand_string'];
    199201        }
    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'];
    205206    }
    206207    else
    207208    {
    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.= '&amp;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  }
    235217
    236218  // recursive call
     
    238220  {
    239221    foreach ( $category['subcats'] as $subcat ) {
    240       display_category( $subcat, $indent.str_repeat( '&nbsp', 2 ), $handle );
     222          $template->assign_block_vars('category.subcat', array());
     223      display_category( $subcat, $indent.str_repeat( '&nbsp', 2 ));
    241224    }
    242225  }
Note: See TracChangeset for help on using the changeset viewer.