From 9d35ff8f9559ae7087ce189880db749fe1569efa Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 31 Jan 2017 10:56:52 +1300 Subject: [PATCH] API Remove ViewableData::ThemeDir, update changelog to reflect suggested replacement --- docs/en/04_Changelogs/4.0.0.md | 1 + src/View/ViewableData.php | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 2e78b427c..a8ee9d134 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -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. #### General and Core Deprecated API diff --git a/src/View/ViewableData.php b/src/View/ViewableData.php index e69787252..e7e9f5107 100644 --- a/src/View/ViewableData.php +++ b/src/View/ViewableData.php @@ -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. . - * - * 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. *