summaryrefslogtreecommitdiffstats
path: root/inc/render.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2015-11-30 13:49:14 +0100
committerSimon Rettberg2015-11-30 13:49:14 +0100
commite80954c6d6585de94f6718411e28206e8d9bd8ba (patch)
tree49fd72b9dfae0299160dc61acb11f3d0d5a042fb /inc/render.inc.php
parentImprove client logging (diff)
downloadslx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.tar.gz
slx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.tar.xz
slx-admin-e80954c6d6585de94f6718411e28206e8d9bd8ba.zip
Show missing template names with all params passed
Diffstat (limited to 'inc/render.inc.php')
-rw-r--r--inc/render.inc.php9
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;
}