$OUTPUT = str_replace('{!_MYSQL_PREFIX!}', getConfig('_MYSQL_PREFIX'), $OUTPUT);
// Prepare the content and eval() it...
+ $content = array();
$newContent = '';
$eval = "\$newContent = \"".COMPILE_CODE(smartAddSlashes($OUTPUT))."\";";
eval($eval);
// But shall I keep simple quotes for later use?
if ($simple) $code = str_replace("'", '{QUOT}', $code);
- // Compile {?some_var?} to getConfig('some_var')
- preg_match_all('/\{\?(([a-zA-Z0-9-_]+)*)\?\}/', $code, $matches);
-
- // Some entries found?
- if ((count($matches) > 0) && (count($matches[0]) > 0)) {
- // Replace all matches
- foreach ($matches[0] as $key => $match) {
- // Replace it
- //* DEBUG: */ if ($key == 0) { print '<pre>'; debug_print_backtrace(); print '</pre>'; }
- //* DEBUG: */ print $match.'='.$matches[1][$key].' ('.$key.')<br />';
- $code = str_replace($match, getConfig($matches[1][$key]), $code);
- } // END - foreach
- } // END - if
-
// Find $content[bla][blub] entries
preg_match_all('/\$(content|GLOBALS|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
} // END - foreach
} // END - if
+ // Compile {?some_var?} to getConfig('some_var')
+ preg_match_all('/\{\?(([a-zA-Z0-9-_]+)*)\?\}/', $code, $matches);
+
+ // Some entries found?
+ if ((count($matches) > 0) && (count($matches[0]) > 0)) {
+ // Replace all matches
+ foreach ($matches[0] as $key => $match) {
+ // Replace it
+ //* DEBUG: */ if ($key == 0) { print '<pre>'; debug_print_backtrace(); print '</pre>'; }
+ //* DEBUG: */ print htmlentities($match).'['.strlen($match).']='.$matches[1][$key].'='.getConfig($matches[1][$key]).' (key='.$key.',len='.strlen($code).')<br />';
+ $code = str_replace($match, getConfig($matches[1][$key]), $code);
+ //* DEBUG: */ if (($match == '{?URL?}') && (strlen($code) > 10000)) die('<pre>'.htmlentities($code).'</pre>');
+ } // END - foreach
+ } // END - if
+
// Return compiled code
return $code;
}
$act = getModeAction(getModule(), $wht);
// Define admin login name and ID number
- define('__ADMIN_LOGIN', getSession('admin_login'));
- define('__ADMIN_ID' , getCurrentAdminId());
+ $content['login'] = getSession('admin_login');
+ $content['id'] = getCurrentAdminId();
// Preload templates
if (EXT_IS_ACTIVE('admins')) {
- define('__ADMIN_WELCOME', LOAD_TEMPLATE('admin_welcome_admins', true));
+ $content['welcome'] = LOAD_TEMPLATE('admin_welcome_admins', true, $content);
} else {
- define('__ADMIN_WELCOME', LOAD_TEMPLATE('admin_welcome', true));
+ $content['welcome'] = LOAD_TEMPLATE('admin_welcome', true, $content);
}
- define('__ADMIN_FOOTER' , LOAD_TEMPLATE('admin_footer' , true));
- define('__ADMIN_MENU' , ADD_ADMIN_MENU($act, $wht, true));
+ $content['footer'] = LOAD_TEMPLATE('admin_footer' , true, $content);
+ $content['menu'] = ADD_ADMIN_MENU($act, $wht, true, $content);
// Tableset header
- LOAD_TEMPLATE('admin_main_header');
+ LOAD_TEMPLATE('admin_main_header', false, $content);
// Check if action/what pair is valid
$result_action = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu`
SQL_FREERESULT($result_action);
// Tableset footer
- LOAD_TEMPLATE('admin_main_footer');
+ LOAD_TEMPLATE('admin_main_footer', false, $content);
}
//
<td class="admin_content"> </td>
</tr>
<tr>
- <td align="center" colspan="2">{!__ADMIN_FOOTER!}</td>
+ <td align="center" colspan="2">
+ $content[footer]
+ </td>
</tr>
</table>
\ No newline at end of file
<table border="0" cellspacing="0" cellpadding="0" class="admin_main">
<tr>
<td colspan="2" align="center" class="admin_welcome">
- {!__ADMIN_WELCOME!}</td>
+ $content[welcome]
+ </td>
</tr>
<tr>
- <td class="admin_menu" valign="top">{!__ADMIN_MENU!}</td>
+ <td class="admin_menu" valign="top">
+ $content[menu]
+ </td>
<td class="admin_content" valign="top">
\ No newline at end of file
<div align="left" class="tiny"> Hallo $username!</div>
</td>
<td align="center" width="300" class="dashed"><div class="tiny">
- Aktueller Admin: [<span class="admin_note" title="Erweiterung admins nicht installiert.">{!__ADMIN_LOGIN!}</span>]
+ Aktueller Admin: [<span class="admin_note" title="Erweiterung admins nicht installiert.">$content[login]</span>]
</div></td>
<td align="center" width="100" class="top2 bottom2 right2"><div class="tiny"> <a class="menu_blur admin_logout"
href="{?URL?}/modules.php?module=admin&action=logout">Ausloggen</a>
</td>
<td align="center" width="300" class="dashed"><div class="tiny">
Aktueller Admin: [<a
- href="{?URL?}/modules.php?module=admin&what=admins_edit&admin={!__ADMIN_ID!}"><strong>{!__ADMIN_LOGIN!}</strong></a>]
+ href="{?URL?}/modules.php?module=admin&what=admins_edit&admin=$content[id]"><strong>$content[login]</strong></a>]
</div></td>
<td align="center" width="100" class="top2 bottom2 right2"><div class="tiny">
<a class="menu_blur admin_logout" href="{?URL?}/modules.php?module=admin&action=logout">Ausloggen</a>