API Remove ViewableData::ThemeDir, update changelog to reflect suggested replacement

This commit is contained in:
Robbie Averill 2017-01-31 10:56:52 +13:00
parent 77bfea1197
commit 9d35ff8f95
2 changed files with 1 additions and 23 deletions

View File

@ -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

View File

@ -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.
*