$cnt = 0;
// Compile all out
- while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{!') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
+ while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
// Init common variables
$content = array();
$newContent = '';
// Do we have to compile the code?
$ret = '';
- if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{!') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
+ if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
// Normal HTML output?
if (getOutputMode() == '0') {
// Add surrounding HTML comments to help finding bugs faster
}
// Why did we end up here? This should not happen
- debug_report_bug('Ending up: template=' . $template);
+ debug_report_bug(__FUNCTION__, __LINE__, 'Ending up: template=' . $template);
}
// Check to use wether legacy mail() command or PHPMailer class
case 'N': $content[$prefix . 'visible_css'] = $prefix . 'menu_invisible'; break;
default:
// Please report this
- debug_report_bug('Unsupported visible value detected. content=<pre>'.print_r($content, true).'</pre>');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported visible value detected. content=<pre>'.print_r($content, true).'</pre>');
break;
} // END - switch
case 'N': $content[$prefix . 'locked_css'] = $prefix . 'menu_unlocked'; break;
default:
// Please report this
- debug_report_bug('Unsupported locked value detected. content=<pre>'.print_r($content, true).'</pre>');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported locked value detected. content=<pre>'.print_r($content, true).'</pre>');
break;
} // END - switch
}
// Compiles the code (use compileCode() only for HTML because of the comments)
-// @TODO $simple is deprecated
+// @TODO $simple/$constants are deprecated
function compileRawCode ($code, $simple = false, $constants = true, $full = true) {
// Is the code a string?
if (!is_string($code)) {
// Compile more through a filter
$code = runFilterChain('compile_code', $code);
- // Compile constants
- if ($constants === true) {
- // BEFORE 0.2.1 : Language and data constants
- // WITH 0.2.1+ : Only language constants
- $code = str_replace('{--', "{DQUOTE} . getMessage('", str_replace('--}', "') . {DQUOTE}", $code));
-
- // BEFORE 0.2.1 : Not used
- // WITH 0.2.1+ : Data constants
- $code = str_replace('{!', "{DQUOTE} . constant('", str_replace('!}', "') . {DQUOTE}", $code));
- } // END - if
+ // Compile message strings
+ $code = str_replace('{--', '{%message,', str_replace('--}', '%}', $code));
// Compile QUOT and other non-HTML codes
foreach ($secChars['to'] as $k => $to) {
$GLOBALS['cache_instance'] = new CacheSystem();
if ($GLOBALS['cache_instance']->getStatus() != 'done') {
// Failed to initialize cache sustem
- addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMessage('CACHE_CANNOT_INITIALIZE'));
+ addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_CANNOT_INITIALIZE--}');
} // END - if
}