Changeset 2273


Ignore:
Timestamp:
03/16/10 18:27:59 (14 years ago)
Author:
rodsouza
Message:

Ticket #987 - Unificando local da inclusão do css do tema.

Location:
trunk/phpgwapi
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.common.inc.php

    r2269 r2273  
    12551255                * @author Dave Hall (*based* on verdilak? css inclusion code) 
    12561256                */ 
    1257                 function get_css() 
     1257                function get_css( ) 
    12581258                { 
    12591259                        $tpl = createObject('phpgwapi.Template', $this->get_tpl_dir('phpgwapi')); 
     
    12791279                        if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) ) 
    12801280                        { 
    1281                                 $css = "/{$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]}/templates/%s/%s.css"; 
     1281                                $css = "/%s/templates/%s/%s.css"; 
    12821282 
    12831283                                global $path, $link, $template; 
     
    12921292                                $template = $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ]; 
    12931293 
    1294                                 function _css( $css ) 
     1294                                function _css( $module, $css ) 
    12951295                                { 
    12961296                                        global $link, $path, $template; 
    1297                                         if ( file_exists( sprintf( $path, $template, str_replace( '/', SEP, $css ) ) ) ) 
    1298                                                 return sprintf( $link, $template, $css ); 
    1299  
    1300                                         if ( file_exists( sprintf( $path, 'default', str_replace( '/', SEP, $css ) ) ) ) 
    1301                                                 return sprintf( $link, 'default', $css ); 
     1297 
     1298                                        error_log( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) . "\n", 3, '/tmp/log' ); 
     1299 
     1300                                        if ( file_exists( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) ) ) 
     1301                                                return sprintf( $link, $module, $template, $css ); 
     1302 
     1303                                        if ( file_exists( sprintf( $path, $module, 'default', str_replace( '/', SEP, $css ) ) ) ) 
     1304                                                return sprintf( $link, $module, 'default', $css ); 
    13021305 
    13031306                                        return ''; 
    13041307                                } 
    13051308 
    1306                                 $css = _css( 'app' ); 
    1307                                 $css .= _css( "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" ); 
     1309                                $css = _css( 'phpgwapi', "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" ); 
     1310                                $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], 'app' ); 
     1311                                $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], "css/{$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ]}" ); 
    13081312 
    13091313                                if ( $css ) 
  • trunk/phpgwapi/templates/classic/head.tpl

    r1151 r2273  
    1313                <link rel="icon" href="{img_icon}" type="image/x-ico" /> 
    1414                <link rel="shortcut icon" href="{img_shortcut}" /> 
    15                 <link href="{theme_css}" title="eGroupWareStyle" type="text/css" rel="StyleSheet"/> 
    1615                <META http-equiv="Default-Style" content="eGroupWareStyle"> 
    1716                {slider_effects} 
  • trunk/phpgwapi/templates/default/head.inc.php

    r890 r2273  
    3333 
    3434        #_debug_array($GLOBALS['phpgw_info']['user']['preferences']['common']); 
    35         $theme_css = ".".$GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
    36         if(!file_exists($theme_css)) 
    37         { 
    38                 $theme_css = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$GLOBALS['phpgw_info']['server']['template_set'].'/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css'; 
    39         } 
    4035 
    4136        //pngfix defaults to yes 
     
    9489                'website_title' => $GLOBALS['phpgw_info']['server']['site_title'].$app, 
    9590                'body_tags'     => $bodyheader .' '. $GLOBALS['phpgw']->common->get_body_attribs(), 
    96                 'theme_css'     => $theme_css, 
    9791                'css'           => $GLOBALS['phpgw']->common->get_css(), 
    9892                'java_script'   => $GLOBALS['phpgw']->common->get_java_script(), 
  • trunk/phpgwapi/templates/default/head.tpl

    r1247 r2273  
    1313                <link rel="icon" href="{img_icon}" type="image/x-ico" /> 
    1414                <link rel="shortcut icon" href="{img_shortcut}" /> 
    15                 <link href="{theme_css}" title="eGroupWareStyle" type="text/css" rel="StyleSheet"/> 
    1615                <META http-equiv="Default-Style" content="eGroupWareStyle"> 
    1716                {slider_effects} 
Note: See TracChangeset for help on using the changeset viewer.