// Compile all out
while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($totalCompilations < 7)) {
// Init common variables
- $content = array();
+ $content = [];
$newContent = '';
// Compile it
}
// Load a template file and return it's content (only it's name; do not use ' or ")
-function loadTemplate ($template, $return = FALSE, $content = array(), $compileCode = TRUE) {
+function loadTemplate ($template, $return = FALSE, $content = [], $compileCode = TRUE) {
// @TODO Remove these sanity checks if all is fine
if (!is_bool($return)) {
// $return has to be boolean
}
// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = TRUE) {
+function loadEmailTemplate ($template, $content = [], $userid = NULL, $loadUserData = TRUE) {
// Make sure all template names are lowercase!
$template = strtolower($template);
// Are some matches found?
if ((isFilledArray($matches)) && (isFilledArray($matches[0]))) {
// Replace all matches
- $matchesFound = array();
+ $matchesFound = [];
foreach ($matches[0] as $key => $match) {
// Fuzzy look has failed by default
$fuzzyFound = FALSE;
// Generates a selection box for given default value
function generateTimeUnitSelectionBox ($defaultUnit, $fieldName, $unitArray) {
// Init variables
- $messageIds = array();
+ $messageIds = [];
// Generate message id array
foreach ($unitArray as $unit) {
// Name of used template
'template' => $templateName,
// Target array for gathered data
- '__data' => array(),
+ '__data' => [],
// Where the HTML output will go
'__output' => '',
);
// Name of used template
'template' => $templateName,
// Target array for gathered data
- '__data' => array(),
+ '__data' => [],
// Where the HTML output will go
'__output' => '',
);
}
// Load another template and return its content
-function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = array()) {
+function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = []) {
// Load "the" template
return loadTemplate($theTemplate, TRUE, $content);
}