From e80954c6d6585de94f6718411e28206e8d9bd8ba Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 30 Nov 2015 13:49:14 +0100 Subject: Show missing template names with all params passed --- inc/render.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'inc/render.inc.php') diff --git a/inc/render.inc.php b/inc/render.inc.php index 31ba5a7d..6de00eee 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -166,10 +166,13 @@ class Render */ public static function parse($template, $params = false) { - // Get all translated strings for this template - $dictionary = Dictionary::getArrayTemplate($template); // Load html snippet $html = self::getTemplate($template); + if ($html === false) { + return '

Template ' . htmlspecialchars($template) . '

' . nl2br(htmlspecialchars(print_r($params, true))) . '
'; + } + // Get all translated strings for this template + $dictionary = Dictionary::getArrayTemplate($template); // Now find all language tags in this array preg_match_all('/{{(lang_.+?)}}/', $html, $out); foreach ($out[1] as $tag) { @@ -228,8 +231,6 @@ class Render } // Load from disk $data = @file_get_contents('templates/' . $template . '.html'); - if ($data === false) - $data = 'Non-existent template ' . $template . ' requested!'; self::$templateCache[$template] = & $data; return $data; } -- cgit v1.2.3-55-g7522