diff options
| author | Greg Roach <fisharebest@gmail.com> | 2017-09-24 23:27:33 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2017-09-24 23:27:33 +0100 |
| commit | 75d7014448193600301e7b735317ee6074e4b752 (patch) | |
| tree | 179f41e3de8e9c0da73c21c8b50a29f24870f1be /app/View.php | |
| parent | a5c94bb285f15bee621a8e4a887ee48ba48553d0 (diff) | |
| download | webtrees-75d7014448193600301e7b735317ee6074e4b752.tar.gz webtrees-75d7014448193600301e7b735317ee6074e4b752.tar.bz2 webtrees-75d7014448193600301e7b735317ee6074e4b752.zip | |
Fix: #1332 - allow links in welcome block to wrap
Diffstat (limited to 'app/View.php')
| -rw-r--r-- | app/View.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/View.php b/app/View.php index 77352bb648..93cdb4c08c 100644 --- a/app/View.php +++ b/app/View.php @@ -49,19 +49,27 @@ class View { extract($this->data); ob_start(); - require WT_ROOT . 'resources/views/' . $this->name . '.php'; + require $this->getFilenameForView($this->name); + return ob_get_clean(); } /** - * Check whether a view exists. + * Allow a theme to override the default views. * * @param string $view_name * - * @return bool + * @return string */ - public static function exists($view_name) { - return file_exists(WT_ROOT . 'resources/views/' . $view_name . '.php'); + public static function getFilenameForView($view_name) { + $view_file = $view_name . '.php'; + $theme_view = WT_THEMES_DIR . Theme::theme()->themeId() . '/resources/views/' . $view_file; + + if (file_exists($theme_view)) { + return $theme_view; + } else { + return WT_ROOT . 'resources/views/' . $view_file; + } } /** |
