diff options
| author | Greg Roach <fisharebest@gmail.com> | 2018-01-13 14:40:56 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2018-01-13 14:40:56 +0000 |
| commit | f21917b27521dbd8f569caf3f12c5b27b776cf76 (patch) | |
| tree | 6b8b2b2d3c93607297c39d2af978cb81f5382ae4 /app/View.php | |
| parent | ffd24702121b371b8426f65a1fa5080586ead096 (diff) | |
| download | webtrees-f21917b27521dbd8f569caf3f12c5b27b776cf76.tar.gz webtrees-f21917b27521dbd8f569caf3f12c5b27b776cf76.tar.bz2 webtrees-f21917b27521dbd8f569caf3f12c5b27b776cf76.zip | |
Fix: #1516 - allow themes to override views
Diffstat (limited to 'app/View.php')
| -rw-r--r-- | app/View.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/View.php b/app/View.php index 8d78b832ae..d081dce0e2 100644 --- a/app/View.php +++ b/app/View.php @@ -102,14 +102,14 @@ class View { * @return string */ public static function getFilenameForView($view_name) { - $view_file = $view_name . '.php'; - //$theme_view = WT_THEMES_DIR . Theme::theme()->themeId() . '/resources/views/' . $view_file; + $view_file = '/resources/views/' . $view_name . '.php'; + $theme_view = WT_ROOT . WT_THEMES_DIR . Theme::theme()->themeId() . $view_file; - //if (file_exists($theme_view)) { - // return $theme_view; - //} else { - return WT_ROOT . 'resources/views/' . $view_file; - //} + if (is_file($theme_view)) { + return $theme_view; + } else { + return WT_ROOT . $view_file; + } } /** |
