summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-04-13 00:18:19 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-04-13 00:18:19 +1000
commit51675e7a9bf4d5055ed45b37bac964f788800399 (patch)
tree3df1b07b09315b184556a4418d2102e095c26cdd /inc/template.php
parentda52307c67818893cb7ee54d8e2d6c93c0e34a02 (diff)
code cleanup
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/inc/template.php b/inc/template.php
index fc9f167d..8d679d25 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -4,7 +4,7 @@
* Copyright (c) 2010-2012 Tinyboard Development Group
*/
-if(realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) {
+if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
exit;
}
@@ -36,15 +36,15 @@ function load_twig() {
function Element($templateFile, array $options) {
global $config, $debug, $twig;
- if(!$twig)
+ if (!$twig)
load_twig();
- if(function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod']))) {
+ if (function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod']))) {
$options['pm'] = create_pm_header();
}
- if(isset($options['body']) && $config['debug']) {
- if(isset($debug['start'])) {
+ if (isset($options['body']) && $config['debug']) {
+ if (isset($debug['start'])) {
$debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms';
unset($debug['start']);
}
@@ -57,10 +57,10 @@ function Element($templateFile, array $options) {
}
// Read the template file
- if(@file_get_contents("{$config['dir']['template']}/${templateFile}")) {
+ if (@file_get_contents("{$config['dir']['template']}/${templateFile}")) {
$body = $twig->render($templateFile, $options);
- if($config['minify_html'] && preg_match('/\.html$/', $templateFile)) {
+ if ($config['minify_html'] && preg_match('/\.html$/', $templateFile)) {
$body = trim(preg_replace("/[\t\r\n]/", '', $body));
}