mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Remove ViewableData::ThemeDir, update changelog to reflect suggested replacement
This commit is contained in:
parent
77bfea1197
commit
9d35ff8f95
@ -975,6 +975,7 @@ specific functions.
|
||||
[oscarotero/Embed](https://github.com/oscarotero/Embed) as a dependency.
|
||||
* Removed TextParser and BBCodeParser. These are available in an archived module,
|
||||
[silverstripe-archive/bbcodeparser](https://github.com/silverstripe-archive/silverstripe-bbcodeparser)
|
||||
* Removed `ViewableData::ThemeDir`. Use `ThemeResourceLoader::findThemedResource` in conjunction with `SSViewer::get_themes` instead.
|
||||
|
||||
#### <a name="overview-general-deprecated"></a>General and Core Deprecated API
|
||||
|
||||
|
@ -546,29 +546,6 @@ class ViewableData extends Object implements IteratorAggregate
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the directory if the current active theme (relative to the site root).
|
||||
*
|
||||
* This method is useful for things such as accessing theme images from your template without hardcoding the theme
|
||||
* page - e.g. <img src="$ThemeDir/images/something.gif">.
|
||||
*
|
||||
* This method should only be used when a theme is currently active. However, it will fall over to the current
|
||||
* project directory.
|
||||
*
|
||||
* @param string $subtheme the subtheme path to get
|
||||
* @return string
|
||||
*/
|
||||
public function ThemeDir($subtheme = null)
|
||||
{
|
||||
if (Config::inst()->get('SilverStripe\\View\\SSViewer', 'theme_enabled')
|
||||
&& $theme = Config::inst()->get('SilverStripe\\View\\SSViewer', 'theme')
|
||||
) {
|
||||
return THEMES_DIR . "/$theme" . ($subtheme ? "_$subtheme" : null);
|
||||
}
|
||||
|
||||
return project();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get part of the current classes ancestry to be used as a CSS class.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user