Ignore:
Timestamp:
04/23/10 10:41:56 (14 years ago)
Author:
rodsouza
Message:

Ticket #1009 - Organizando o HTML do template default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/templates/default/head.inc.php

    r2561 r2623  
    1313        if($GLOBALS['phpgw_info']['user']['preferences']['common']['show_generation_time']) 
    1414        { 
    15                 $mtime = microtime();  
    16                 $mtime = explode(' ',$mtime);  
    17                 $mtime = $mtime[1] + $mtime[0];  
    18                 $GLOBALS['page_start_time'] = $mtime;  
     15                $mtime = microtime(); 
     16                $mtime = explode(' ',$mtime); 
     17                $mtime = $mtime[1] + $mtime[0]; 
     18                $GLOBALS['page_start_time'] = $mtime; 
    1919        } 
    2020 
    21         // get used language code 
    22         $lang_code = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; 
     21        $pngfix = ''; 
     22        if ( ! $GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'disable_pngfix' ] ) 
     23                $pngfix = "\t\t" . '<!--[if lt IE 7]>' . "\n\t\t\t" 
     24                        . '<script src="' 
     25                        . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] . '/phpgwapi/templates/' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '/js/pngfix.js' 
     26                        . '" type="text/javascript">' 
     27                        . "</script>\n\t\t" 
     28                        . "<![endif]-->\n"; 
    2329 
    24         $bodyheader = ' bgcolor="' . $GLOBALS['phpgw_info']['theme']['bg_color'] . '" alink="' 
    25                 . $GLOBALS['phpgw_info']['theme']['alink'] . '" link="' . $GLOBALS['phpgw_info']['theme']['link'] . '" vlink="' 
    26                 . $GLOBALS['phpgw_info']['theme']['vlink'] . '"'; 
     30        error_log( var_export( $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 
     31                ( ( ! $GLOBALS['phpgw_info']['user']['preferences']['common']['disable_slider_effects'] ) ? 'slidereffects' : 'simple_show_hide' ), 
     32                'phpgwapi/templates/' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ], true ), true ) . "\n\n" , 3, '/tmp/log' ); 
    2733 
    28         if(!$GLOBALS['phpgw_info']['server']['htmlcompliant']) 
    29         { 
    30                 $bodyheader .= ''; 
    31         } 
    32         $currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'] ; 
     34        $bodyheader = ' bgcolor="' . $GLOBALS['phpgw_info']['theme']['bg_color'] 
     35                . '" link="' . $GLOBALS['phpgw_info']['theme']['link'] 
     36                . '" alink="' . $GLOBALS['phpgw_info']['theme']['alink'] 
     37                . '" vlink="' . $GLOBALS['phpgw_info']['theme']['vlink'] . '"'; 
    3338 
    34         #_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']); 
     39        $app = $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]; 
     40        $app = ( $app ) ? ' [' . ( isset( $GLOBALS[ 'phpgw_info' ][ 'apps' ][ $app ] ) ? $GLOBALS[ 'phpgw_info' ][ 'apps' ][ $app ][ 'title' ] : lang( $app ) ) . ']' : ''; 
    3541 
    36         //pngfix defaults to yes 
    37         if(!$GLOBALS['phpgw_info']['user']['preferences']['common']['disable_pngfix']) 
    38         { 
    39                 $pngfix_src = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/js/pngfix.js'; 
    40                 $pngfix ='<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 and higher -->  
    41                 <!--[if lt IE 7]> 
    42                 <script src="'.$pngfix_src.'" type="text/javascript"> 
    43                 </script> 
    44                 <![endif]-->'; 
    45         } 
     42        $webserver_url = ( ! empty( $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] ) ) ? 
     43                $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] : '/'; 
    4644 
    47         $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'jscode', 
    48                 ( ( ! $GLOBALS['phpgw_info']['user']['preferences']['common']['disable_slider_effects'] ) ? 'slidereffects' : 'simple_show_hide' ), 
    49                 'phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'], true ); 
     45        if ( strpos( $webserver_url, '/' ) != ( strlen( $webserver_url ) - 1 ) ) 
     46                $webserver_url .= '/'; 
    5047 
    51         $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR); 
    52         $tpl->set_unknowns('remove'); 
    53         $tpl->set_file(array('_head' => 'head.tpl')); 
    54         $tpl->set_block('_head','head'); 
    55  
    56         $app = $GLOBALS['phpgw_info']['flags']['currentapp']; 
    57         $app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? $GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':''; 
    58  
    59         $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    60         $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
    61          
    62         if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1)) 
    63                 $webserver_url .= '/'; 
    64          
    6548        if( is_null($_SESSION['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']]['user'])) 
    6649                $tmpDefault = "default"; 
     
    6952 
    7053        $var = Array( 
    71                 'img_icon'      => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png', 
    72                 'img_shortcut'  => $webserver_url . $currentapp . '/templates/'.$tmpDefault.'/images/navbar.png', 
    73                 'pngfix'        => $pngfix, 
    74                 'slider_effects'=> $slider_effects, 
    75                 'simple_show_hide'=> '',//$simple_show_hide, 
    76                 'lang_code'=> $lang_code, 
    77                 'charset'       => $GLOBALS['phpgw']->translation->charset(), 
    78                 'font_family'   => $GLOBALS['phpgw_info']['theme']['font'], 
    79                 'website_title' => $GLOBALS['phpgw_info']['server']['site_title'].$app, 
    80                 'body_tags'     => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(), 
    81                 'css'           => $GLOBALS['phpgw']->common->get_css(), 
    82                 'java_script'   => $GLOBALS['phpgw']->common->get_java_script(), 
    83                 'cookie_manager'=> '' 
     54                'img_icon'       => "{$webserver_url}{$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]}/templates/{$tmpDefault}/images/navbar.png", 
     55                'img_shortcut'   => "{$webserver_url}{$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]}/templates/{$tmpDefault}/images/navbar.png", 
     56                'pngfix'         => $pngfix, 
     57                'lang_code'      => $GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ], 
     58                'charset'        => $GLOBALS[ 'phpgw' ] -> translation -> charset( ), 
     59                'font_family'    => $GLOBALS[ 'phpgw_info' ][ 'theme' ][ 'font' ], 
     60                'website_title'  => "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'site_title' ]} $app", 
     61                'body_tags'      => "{$bodyheader} {$GLOBALS[ 'phpgw' ] -> common -> get_body_attribs()}", 
     62                'css'            => $GLOBALS[ 'phpgw' ] -> common -> get_css( ), 
     63                'java_script'    => $GLOBALS[ 'phpgw' ] -> common -> get_java_script( ), 
     64                'content'        => $content 
    8465        ); 
    85         $tpl->set_var($var); 
    86         $tpl->pfp('out','head'); 
    87         unset($tpl); 
     66 
     67        $tpl = CreateObject( 'phpgwapi.Template', PHPGW_TEMPLATE_DIR ); 
     68        $tpl -> set_unknowns( 'remove' ); 
     69        $tpl -> set_file( array( '_head' => 'head.tpl' ) ); 
     70        $tpl -> set_block( '_head', 'head' ); 
     71        $tpl -> set_var( $var ); 
     72        $tpl -> pfp( 'out', 'head' ); 
     73        unset( $tpl ); 
    8874?> 
Note: See TracChangeset for help on using the changeset viewer.