2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 if (! defined('PHPMYADMIN')) {
15 require_once './libraries/common.inc.php';
18 // Cross-framing protection
19 if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
21 <script src
="./js/cross_framing_protection.js" type
="text/javascript"></script
>
36 PMA_getenv('HTTP_HOST') ?
PMA_getenv('HTTP_HOST') : '',
37 isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : '',
38 isset($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : '',
39 !empty($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : (isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : ''),
42 'phpMyAdmin ' . PMA_VERSION
,
44 !empty($GLOBALS['table']) ?
$GLOBALS['cfg']['TitleTable'] :
45 (!empty($GLOBALS['db']) ?
$GLOBALS['cfg']['TitleDatabase'] :
46 (!empty($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['TitleServer'] :
47 $GLOBALS['cfg']['TitleDefault']))
49 // here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
50 $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
52 $GLOBALS['js_include'][] = 'tooltip.js';
53 $params = array('lang' => $GLOBALS['lang']);
54 if (isset($GLOBALS['db'])) {
55 $params['db'] = $GLOBALS['db'];
57 $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
59 $GLOBALS['js_events'][] = array(
61 'function' => 'PMA_TT_init',
65 * Here we add a timestamp when loading the file, so that users who
66 * upgrade phpMyAdmin are not stuck with older .js files in their
67 * browser cache. This produces an HTTP 304 request for each file.
70 // avoid loading twice a js file
71 $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']);
72 foreach ($GLOBALS['js_include'] as $js_script_file) {
73 if (strpos($js_script_file, '?') === FALSE) {
74 echo '<script src="./js/' . $js_script_file . '?ts=' . filemtime('./js/' . $js_script_file) . '" type="text/javascript"></script>' . "\n";
76 echo '<script src="./js/' . $js_script_file . '" type="text/javascript"></script>' . "\n";
80 <script type
="text/javascript">
82 // Updates the title of the frameset if possible (ns4 does not allow this)
83 if (typeof(parent
.document
) != 'undefined' && typeof(parent
.document
) != 'unknown'
84 && typeof(parent
.document
.title
) == 'string') {
85 parent
.document
.title
= '<?php echo PMA_sanitize(PMA_escapeJsString($title)); ?>';
89 foreach ($GLOBALS['js_events'] as $js_event) {
90 echo "$(window.parent).bind('" . $js_event['event'] . "', "
91 . $js_event['function'] . ");\n";
97 // Reloads the navigation frame via JavaScript if required
98 PMA_reloadNavigation();