make it possible to override every image and logo with a new version from within a theme. I think we have a very cool theming here. *self-praise*

This commit is contained in:
Frank Karlitschek 2012-02-14 16:32:38 +01:00
parent d10f4f071d
commit d53ed4b40b
1 changed files with 19 additions and 12 deletions

View File

@ -75,18 +75,25 @@ class OC_Helper {
* *
* Returns the path to the image. * Returns the path to the image.
*/ */
public static function imagePath( $app, $image ){ public static function imagePath( $app, $image ){
// Check if the app is in the app folder // Read the selected theme from the config file
if( file_exists( OC::$SERVERROOT."/apps/$app/img/$image" )){ $theme=OC_Config::getValue( "theme" );
return OC::$WEBROOT."/apps/$app/img/$image";
} // Check if the app is in the app folder
elseif( !empty( $app )){ if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/img/$image" )){
return OC::$WEBROOT."/$app/img/$image"; return OC::$WEBROOT."/themes/$theme/apps/$app/img/$image";
} }elseif( file_exists( OC::$SERVERROOT."/apps/$app/img/$image" )){
else{ return OC::$WEBROOT."/apps/$app/img/$image";
return OC::$WEBROOT."/core/img/$image"; }elseif( !empty( $app ) and file_exists( OC::$SERVERROOT."/themes/$theme/$app/img/$image" )){
} return OC::$WEBROOT."/themes/$theme/$app/img/$image";
} }elseif( !empty( $app ) and file_exists( OC::$SERVERROOT."/$app/img/$image" )){
return OC::$WEBROOT."/$app/img/$image";
}elseif( file_exists( OC::$SERVERROOT."/themes/$theme/core/img/$image" )){
return OC::$WEBROOT."/themes/$theme/core/img/$image";
}else{
return OC::$WEBROOT."/core/img/$image";
}
}
/** /**
* @brief get path to icon of file type * @brief get path to icon of file type