diff options
author | Simon Rettberg | 2015-11-30 13:49:14 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-11-30 13:49:14 +0100 |
commit | e80954c6d6585de94f6718411e28206e8d9bd8ba (patch) | |
tree | 49fd72b9dfae0299160dc61acb11f3d0d5a042fb | |
parent | Improve client logging (diff) | |
download | slx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.tar.gz slx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.tar.xz slx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.zip |
Show missing template names with all params passed
-rw-r--r-- | inc/render.inc.php | 9 |
1 files changed, 5 insertions, 4 deletions
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 '<h3>Template ' . htmlspecialchars($template) . '</h3>' . nl2br(htmlspecialchars(print_r($params, true))) . '<hr>'; + } + // 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 = '<b>Non-existent template ' . $template . ' requested!</b>'; self::$templateCache[$template] = & $data; return $data; } |