Ignore:
Timestamp:
07/08/10 17:52:20 (14 years ago)
Author:
amuller
Message:

Ticket #1135 - Aplicando alterações do branches 2.0 no branches 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/phpgwapi/inc/class.common.inc.php

    r1576 r3018  
    12641264                        $tpl->set_var('app_css', $app_css); 
    12651265 
    1266                         // search for app specific css file 
    1267                         if(@isset($GLOBALS['phpgw_info']['flags']['currentapp'])) 
    1268                         { 
    1269                                 $appname = $GLOBALS['phpgw_info']['flags']['currentapp']; 
    1270  
    1271                                 if(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP 
    1272                                         . 'templates' . SEP . $GLOBALS['phpgw_info']['server']['template_set'] 
    1273                                         . SEP . 'app.css') 
    1274                                 ) 
    1275                                 { 
    1276                                         $tpl->set_var('css_file', '<LINK href="'.$GLOBALS['phpgw_info']['server']['webserver_url'] 
    1277                                                 . "/$appname/templates/".$GLOBALS['phpgw_info']['server']['template_set'] 
    1278                                                 . "/app.css".'" type=text/css rel=StyleSheet>'); 
    1279                                 } 
    1280                                 elseif(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP 
    1281                                         . 'templates' . SEP . 'default' 
    1282                                         . SEP . 'app.css') 
    1283                                 ) 
    1284                                 { 
    1285                                         $tpl->set_var('css_file', '<LINK href="'.$GLOBALS['phpgw_info']['server']['webserver_url'] 
    1286                                         ."/$appname/templates/default/app.css".'" type=text/css rel=StyleSheet>'); 
    1287                                 } 
    1288                         } 
    1289  
    1290                         return $tpl->subst('css'); 
     1266                        // search for app specific css filie 
     1267                        if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) )  
     1268                        {  
     1269                                $css = "/%s/templates/%s/%s.css";  
     1270 
     1271                                global $path, $link, $template;  
     1272 
     1273                                $path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css );  
     1274 
     1275                                $link = '<LINK href="%s" type="text/css" rel="StyleSheet">';  
     1276                                $link = sprintf( $link,  
     1277                                        "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}"  
     1278                                );  
     1279 
     1280                                $template = $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ];  
     1281 
     1282                                function _css( $module, $css )  
     1283                                {  
     1284                                        global $link, $path, $template;  
     1285 
     1286                                        if ( file_exists( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) ) )  
     1287                                                return sprintf( $link, $module, $template, $css );  
     1288 
     1289                                        if ( file_exists( sprintf( $path, $module, 'default', str_replace( '/', SEP, $css ) ) ) )  
     1290                                                return sprintf( $link, $module, 'default', $css );  
     1291 
     1292                                        return '';  
     1293                                }  
     1294 
     1295                                $css = _css( 'phpgwapi', 'css/base' );  
     1296                                $css .= _css( 'phpgwapi', "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" );  
     1297                                $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" );  
     1298                                $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], 'app' );  
     1299 
     1300                                if ( $css )  
     1301                                        $tpl -> set_var( 'css_file', $css );  
     1302                        }  
     1303 
     1304                        return $tpl -> subst('css');  
     1305 
    12911306                } 
    12921307 
Note: See TracChangeset for help on using the changeset viewer.