diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-12 02:08:55 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-12 02:08:55 +0000 |
commit | 030477b02a1d00d4957bed88ba221c06e81abff3 (patch) | |
tree | 1582ac599213ca764c25357d9600dcb80529edba /lib/theme.php | |
parent | 1f33df4715f4293787beb5b64721df6db3a2083c (diff) |
Separation of themes (i.e., layout, typography) and skins (i.e., background
images, colours).
A theme can have multiple skins.
Majority of the changes in this commit are due to restructuring the
path/files for themes and skins.
Both theme and skin will be set to 'default' if not set in
config.php.
This commit also allows each instance of this software to create
its own theme without having to override any style from the default
distribution.
Added Cloudy theme.
Diffstat (limited to 'lib/theme.php')
-rw-r--r-- | lib/theme.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/theme.php b/lib/theme.php index 95030affe..bef660cbf 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -69,4 +69,31 @@ function theme_path($relative, $theme=null) } else { return common_path('theme/'.$theme.'/'.$relative); } -}
\ No newline at end of file +} + +/** + * Gets the full URL of a file in a skin dir based on its relative name + * + * @param string $relative relative path within the theme, skin directory + * @param string $theme name of the theme; defaults to current theme + * @param string $skin name of the skin; defaults to current theme + * + * @return string URL of the file + */ + +function skin_path($relative, $theme=null, $skin=null) +{ + if (!$theme) { + $theme = common_config('site', 'theme'); + } + if (!$skin) { + $skin = common_config('site', 'skin'); + } + $server = common_config('theme', 'server'); + if ($server) { + return 'http://'.$server.'/'.$theme.'/skin/'.$skin.'/'.$relative; + } else { + return common_path('theme/'.$theme.'/skin/'.$skin.'/'.$relative); + } +} + |