Changeset 3470 for branches/2.2
- Timestamp:
- 11/05/10 09:11:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/phpgwapi/inc/class.common.inc.php
r3410 r3470 1247 1247 * @author Dave Hall (*based* on verdilak? css inclusion code) 1248 1248 */ 1249 function get_css()1249 function get_css( ) 1250 1250 { 1251 1251 $tpl = createObject('phpgwapi.Template', $this->get_tpl_dir('phpgwapi')); … … 1268 1268 $tpl->set_var('app_css', $app_css); 1269 1269 1270 // search for app specific css filie 1271 if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) ) 1272 { 1273 $template = $GLOBALS['phpgw_info']['server']['template_set']; 1274 $GLOBALS['phpgw']->css->validate_file( "phpgwapi/templates/".$template."/css/base.css"); 1275 $GLOBALS['phpgw']->css->validate_file( "phpgwapi/templates/".$template."/css/".get_theme().".css"); 1276 $GLOBALS['phpgw']->css->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/".get_theme().".css"); 1277 $GLOBALS['phpgw']->css->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/app.css"); 1278 1279 $tpl -> set_var( 'css_file', $GLOBALS['phpgw']->css->get_css() ); 1280 1281 } 1282 1283 return $tpl -> subst('css'); 1284 1285 } 1270 // search for app specific css file 1271 if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) ) 1272 { 1273 $css = "/%s/templates/%s/%s.css"; 1274 1275 global $path, $link, $template; 1276 1277 $path = PHPGW_SERVER_ROOT . str_replace( '/', SEP, $css ); 1278 1279 $link = '<LINK href="%s" type="text/css" rel="StyleSheet">'; 1280 $link = sprintf( $link, 1281 "{$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ]}{$css}" 1282 ); 1283 1284 $template = $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ]; 1285 1286 function _css( $module, $css ) 1287 { 1288 global $link, $path, $template; 1289 1290 if ( file_exists( sprintf( $path, $module, $template, str_replace( '/', SEP, $css ) ) ) ) 1291 return sprintf( $link, $module, $template, $css ); 1292 1293 if ( file_exists( sprintf( $path, $module, 'default', str_replace( '/', SEP, $css ) ) ) ) 1294 return sprintf( $link, $module, 'default', $css ); 1295 1296 return ''; 1297 } 1298 1299 $css = _css( 'phpgwapi', 'css/base' ); 1300 $css .= _css( 'phpgwapi', "css/".get_theme()); 1301 $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], "css/".get_theme()); 1302 $css .= _css( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ], 'app' ); 1303 1304 if ( $css ) 1305 $tpl -> set_var( 'css_file', $css ); 1306 } 1307 1308 return $tpl -> subst('css'); 1309 } 1310 1286 1311 1287 1312 /**
Note: See TracChangeset
for help on using the changeset viewer.