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 type
="text/javascript">
24 // can't access this if on a different domain
25 var topdomain
= top
.document
.domain
;
26 // double-check just for sure
27 if (topdomain
!= self
.document
.domain
) {
28 alert("Redirecting...");
29 top
.location
.replace(self
.document
.URL
.substring(0, self
.document
.URL
.lastIndexOf("/")+
1));
33 alert("Redirecting... (error: " + e
);
34 top
.location
.replace(self
.document
.URL
.substring(0, self
.document
.URL
.lastIndexOf("/")+
1));
52 PMA_getenv('HTTP_HOST') ?
PMA_getenv('HTTP_HOST') : '',
53 isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : '',
54 isset($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : '',
55 !empty($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : (isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : ''),
58 'phpMyAdmin ' . PMA_VERSION
,
60 !empty($GLOBALS['table']) ?
$GLOBALS['cfg']['TitleTable'] :
61 (!empty($GLOBALS['db']) ?
$GLOBALS['cfg']['TitleDatabase'] :
62 (!empty($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['TitleServer'] :
63 $GLOBALS['cfg']['TitleDefault']))
65 // here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
66 $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
68 if (in_array('functions.js', $GLOBALS['js_include'])) {
69 $GLOBALS['js_messages']['strFormEmpty'] = $GLOBALS['strFormEmpty'];
70 $GLOBALS['js_messages']['strNotNumber'] = $GLOBALS['strNotNumber'];
71 $GLOBALS['js_messages']['strClickToSelect'] = $GLOBALS['strClickToSelect'];
72 $GLOBALS['js_messages']['strClickToUnselect'] = $GLOBALS['strClickToUnselect'];
74 if (!$is_superuser && !$GLOBALS['cfg']['AllowUserDropDatabase']) {
75 $GLOBALS['js_messages']['strNoDropDatabases'] = $GLOBALS['strNoDropDatabases'];
77 $GLOBALS['js_messages']['strNoDropDatabases'] = '';
80 if ($GLOBALS['cfg']['Confirm']) {
81 $GLOBALS['js_messages']['strDoYouReally'] = $GLOBALS['strDoYouReally'];
82 $GLOBALS['js_messages']['strDropDatabaseStrongWarning'] = $GLOBALS['strDropDatabaseStrongWarning'];
84 // rajk - for blobstreaming
85 $GLOBALS['js_messages']['strBLOBRepositoryDisableStrongWarning'] = $GLOBALS['strBLOBRepositoryDisableStrongWarning'];
86 $GLOBALS['js_messages']['strBLOBRepositoryDisableAreYouSure'] = sprintf($GLOBALS['strBLOBRepositoryDisableAreYouSure'], $GLOBALS['db']);
88 $GLOBALS['js_messages']['strDoYouReally'] = '';
89 $GLOBALS['js_messages']['strDropDatabaseStrongWarning'] = '';
91 // rajk - for blobstreaming
92 $GLOBALS['js_messages']['strBLOBRepositoryDisableStrongWarning'] = '';
93 $GLOBALS['js_messages']['strBLOBRepositoryDisableAreYouSure'] = '';
95 } elseif (in_array('indexes.js', $GLOBALS['js_include'])) {
96 $GLOBALS['js_messages']['strFormEmpty'] = $GLOBALS['strFormEmpty'];
97 $GLOBALS['js_messages']['strNotNumber'] = $GLOBALS['strNotNumber'];
100 if (in_array('server_privileges.js', $GLOBALS['js_include'])) {
101 $GLOBALS['js_messages']['strHostEmpty'] = $GLOBALS['strHostEmpty'];
102 $GLOBALS['js_messages']['strUserEmpty'] = $GLOBALS['strUserEmpty'];
103 $GLOBALS['js_messages']['strPasswordEmpty'] = $GLOBALS['strPasswordEmpty'];
104 $GLOBALS['js_messages']['strPasswordNotSame'] = $GLOBALS['strPasswordNotSame'];
107 $GLOBALS['js_include'][] = 'tooltip.js';
109 $GLOBALS['js_events'][] = array(
110 'object' => 'window',
112 'function' => 'PMA_TT_init',
115 // avoid loading twice a js file
116 $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']);
117 foreach ($GLOBALS['js_include'] as $js_script_file) {
118 echo '<script src="./js/' . $js_script_file . '" type="text/javascript"></script>' . "\n";
121 <script type
="text/javascript">
123 // Updates the title of the frameset if possible (ns4 does not allow this)
124 if (typeof(parent
.document
) != 'undefined' && typeof(parent
.document
) != 'unknown'
125 && typeof(parent
.document
.title
) == 'string') {
126 parent
.document
.title
= '<?php echo PMA_sanitize(PMA_escapeJsString($title)); ?>';
129 var PMA_messages
= new Array();
131 foreach ($GLOBALS['js_messages'] as $name => $js_message) {
132 echo "PMA_messages['" . $name . "'] = '" . PMA_escapeJsString($js_message) . "';\n";
135 foreach ($GLOBALS['js_events'] as $js_event) {
136 echo "window.parent.addEvent(" . $js_event['object'] . ", '" . $js_event['event'] . "', "
137 . $js_event['function'] . ");\n";
143 // Reloads the navigation frame via JavaScript if required
144 PMA_reloadNavigation();