X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ftemplate-functions.php;h=4ec0827401bd3a5afe38f0b56b91486e372d27e5;hb=5c0d2c01826cb3802aed682513b7f98454394867;hp=9e9a252d1840d44918ce901742311291dc057a3e;hpb=2f8a3c36ac4051c0f87a6eb50828f339f49fad3f;p=mailer.git
diff --git a/inc/template-functions.php b/inc/template-functions.php
index 9e9a252d18..4ec0827401 100644
--- a/inc/template-functions.php
+++ b/inc/template-functions.php
@@ -16,7 +16,7 @@
* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -144,7 +144,7 @@ function outputHtml ($htmlCode = NULL, $newLine = TRUE) {
reportBug(__FUNCTION__, __LINE__, '{--FATAL_ERROR--}: {--NO_RENDER_DIRECT--}');
break;
} // END - switch
- } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['http_header'])) || (count($GLOBALS['http_header']) == 0)) && (!isRawOutputMode())) {
+ } elseif ((getPhpCaching() == 'on') && (!isFilledArray($GLOBALS['http_header'])) && (!isRawOutputMode())) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getPhpCaching()=' . getPhpCaching() . ',isset(http_header)=' . intval(isset($GLOBALS['http_header'])) . ',getScriptOutputMode()=' . getScriptOutputMode() . '');
// Output cached HTML code
$GLOBALS['__output'] = ob_get_contents();
@@ -305,7 +305,7 @@ function loadTemplate ($template, $return = FALSE, $content = array(), $compileC
}
// Init returned content
- $ret = '';
+ $templateContent = '';
// Set current template
$GLOBALS['current_template'] = $template;
@@ -322,17 +322,17 @@ function loadTemplate ($template, $return = FALSE, $content = array(), $compileC
$template = strtolower($template);
// Base directory
- $basePath = sprintf("%stemplates/%s/html/", getPath(), getLanguage());
+ $basePath = getTemplateBasePath('html');
$extraPath = detectExtraTemplatePath('html', $template);
// Generate FQFN
- $FQFN = $basePath . $extraPath . $template . '.tpl';
+ $FQFN = $basePath . '/' . $extraPath . $template . '.tpl';
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Template ' . $template . ' is solved to FQFN=' . $FQFN);
// Does the special template exists?
if (!isFileReadable($FQFN)) {
// Reset to default template
- $FQFN = $basePath . $template . '.tpl';
+ $FQFN = $basePath . '/' . $template . '.tpl';
} // END - if
// Now does the final template exists?
@@ -509,18 +509,18 @@ function loadEmailTemplate ($template, $content = array(), $userid = NULL, $load
unset($GLOBALS['template_eval']['email'][$template]);
} elseif (!isset($GLOBALS['template_eval']['email'][$template])) {
// Base directory
- $basePath = sprintf("%stemplates/%s/emails/", getPath(), getLanguage());
+ $basePath = getTemplateBasePath('emails');
// Detect extra path
$extraPath = detectExtraTemplatePath('email', $template);
// Generate full FQFN
- $FQFN = $basePath . $extraPath . $template . '.tpl';
+ $FQFN = $basePath . '/' . $extraPath . $template . '.tpl';
// Does the special template exists?
if (!isFileReadable($FQFN)) {
// Reset to default template
- $FQFN = $basePath . $template . '.tpl';
+ $FQFN = $basePath . '/' . $template . '.tpl';
} // END - if
// Now does the final template exists?
@@ -562,6 +562,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = NULL, $load
// Eval the code
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - BEFORE EVAL');
//* DEBUG: */ print('