83
* function resizeRowsLeft()
84
* added 2004-07-20 by Michael Keck <mail@michaelkeck.de>
85
* - this function checks the complete frameset of
86
* index.php (parent.frames)
87
* - gets the offsetHeight of qfcontainer
88
* - sets a new frameset.rows - definition for the
89
* frameset 'leftFrameset' in 'index.php' dynamic.
90
* this script was tested on
91
* IE 6, Opera 7.53, Netsacpe 7.1 and Firefox 0.9
92
* and should work on all other DOM-Browsers and old IE-Browsers.
93
* It will never work on Netscape smaller Version 6 and IE smaller Version 4.
94
* Please give me feedback if any browser doesn't work with this script
95
* mailto:mail@michaelkeck.de?subject=resizeFrames - Browser: [the browser]
98
function resizeRowsLeft() {
99
if (document.getElementById('qfcontainer')) { // dom browsers
100
// get the height of the div-element 'qfcontainer'
101
// we must add 10 (px) for framespacing
102
newHeight = document.getElementById('qfcontainer').offsetHeight+10;
103
// check if the frameset exists
104
// please see index.php and check the frameset-definitions
105
if (parent.document.getElementById('mainFrameset') && parent.document.getElementById('leftFrameset')) {
106
parent.document.getElementById('leftFrameset').rows=newHeight+',*';
109
if (document.all) { // older ie-browsers
110
// get the height of the div-element 'qfcontainer'
111
// we must add 10 (px) for framespacing
112
newHeight=document.all('qfcontainer').offsetHeight+10;
113
// check if the frameset exists
114
// please see index.php and check the frameset-definitions
115
if (parent.leftFrameset) {
116
parent.leftFrameset.rows=newHeight+',*';
125
// setup the onload handler for resizing frames
126
$js_frame_onload=' onload="resizeRowsLeft();"';
128
if ($cfg['QueryFrame']) {
130
<script type="text/javascript" language="javascript">
132
// added 2004-09-16 by Michael Keck (mkkeck)
134
// drop-down databases list keep focus on database change
135
// modified 2004-11-06: bug #1046434 (Light mode does not work)
136
var focus_removed = false;
137
function remove_focus_select() {
138
focus_removed = false;
141
function set_focus_to_nav() {
142
if (typeof(parent.frames.nav)!='undefined' && focus_removed!=true) {
143
parent.frames.nav.focus();
147
setTimeout("set_focus_to_nav();",500);
79
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>" style="margin-left: 0px; margin-top: 5px; margin-right: 0px; margin-bottom: 0px">
80
<form name="queryframeform" action="queryframe.php" method="get">
81
<input type="hidden" name="db" value="" />
82
<input type="hidden" name="table" value="" />
83
<input type="hidden" name="framename" value="queryframe" />
87
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
88
if ($cfg['QueryFrameJS']) {
91
$onclick = 'onClick="javascript:open_querywindow(this.href); return false;"';
157
<body id="body_queryFrame" bgcolor="<?php echo $cfg['LeftBgColor']; ?>"<?php echo ((isset($js_frame_onload) && $js_frame_onload!='') ? $js_frame_onload : ''); ?>>
158
<div id="qfcontainer">
160
if ($cfg['LeftDisplayLogo']) {
162
<!-- phpMyAdmin logo -->
164
if (@file_exists($pmaThemeImage . 'logo_left.png')) {
168
<a href="http://www.phpmyadmin.net" target="_blank"><img src="<?php echo '' . $pmaThemeImage . 'logo_left.png'; ?>" alt="phpMyAdmin" vspace="3" border="0" /></a>
173
. '<div align="center"><a href="http://www.phpmyadmin.net" target="_blank">'
174
. '<img src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo2.png' .'" alt="phpMyAdmin" border="0" />'
175
. '</a></div>' . "\n";
177
echo '<hr id="hr_first" />';
178
} // end of display logo
180
if ($cfg['MainPageIconic']) {
181
$str_spacer_links='';
183
$str_spacer_links=' - ';
186
<!-- Link to the welcome page -->
189
echo '<a class="item" href="main.php?' . PMA_generate_common_url() . '" target="phpmain' . $hash . '">'
190
. ($cfg['MainPageIconic']
191
? '<img src="' . $pmaThemeImage . 'b_home.png" width="16" height="16" border="0" hspace="2" alt="' . $strHome . '" title="' . $strHome . '"'
192
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
193
: '<b>' . $strHome . '</b>')
195
// if we have chosen server
197
// Logout for advanced authentication
198
if ($cfg['Server']['auth_type'] != 'config') {
199
echo $str_spacer_links;
200
echo '<a class="item" href="index.php?' . PMA_generate_common_url() . '&old_usr=' . urlencode($PHP_AUTH_USER) . '" target="_parent">'
201
. ($cfg['MainPageIconic']
202
? '<img src="' . $pmaThemeImage . 's_loggoff.png" width="16" height="16" border="0" hspace="2" alt="' . $strLogout . '" title="' . $strLogout . '"'
203
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
204
: '<b>' . $strLogout . '</b>')
208
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
209
if ($cfg['QueryFrameJS']) {
212
$onclick = 'onclick="javascript:open_querywindow(this.href); return false;"';
215
$target = 'target="phpmain' . $hash . '"';
218
if ($cfg['MainPageIconic']) {
219
$query_frame_link_text = '<img src="' . $pmaThemeImage . 'b_selboard.png" border="0" hspace="1" width="16" height="16" alt="' . $strQueryFrame . '" title="' . $strQueryFrame . '"'
220
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />';
222
echo ($str_spacer_links != '' ? '<br />' : '');
223
$query_frame_link_text = '<b>' . $strQueryFrame . '</b>';
226
<script type="text/javascript">
228
document.writeln('<a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onclick; ?> class="item"><?php echo addslashes($query_frame_link_text); ?></a>');
232
<a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>" class="item"><?php echo $query_frame_link_text; ?></a>
237
if ($cfg['MainPageIconic']) {
238
echo '<img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' .'" width="2" height="1" border="0" alt="" />'
239
. '<a href="Documentation.html" target="documentation" class="item">'
240
. '<img src="' . $pmaThemeImage . 'b_docs.png" border="0" hspace="1" width="16" height="16" alt="' . $strPmaDocumentation . '" title="' . $strPmaDocumentation . '"'
241
. ' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
244
. '<a href="' . $cfg['MySQLManualBase'] . '" target="documentation" class="item">'
245
. '<img src="' . $pmaThemeImage . 'b_sqlhelp.png" border="0" hspace="1" width="16" height="16" alt="MySQL - ' . $strDocu . '" title="MySQL - ' . $strDocu . '"'
246
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
252
<hr id="hr_second" />
255
if ($cfg['LeftDisplayServers']){
256
$show_server_left = TRUE;
257
include('./libraries/select_server.lib.php');
258
} // end if LeftDisplayServers
260
<!-- Databases list -->
263
* Get the list and number of available databases.
264
* Skipped if no server selected: in this case no database should be displayed
265
* before the user choose among available ones at the welcome screen.
268
PMA_availableDatabases(); // this function is defined in "common.lib.php"
94
$target = 'target="phpmain' . $hash . '"';
99
<script type="text/javascript">
100
document.writeln('<a href="<?php echo $href; ?>" <?php echo $target . ' ' . $onclick; ?>><?php echo addslashes($strQueryFrame); ?></a>');
103
<a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>"><?php echo $strQueryFrame; ?></a>
107
<form name="hashform" action="queryframe.php">
108
<input type="hidden" name="hash" value="<?php echo $hash; ?>">
273
// Don't display expansible/collapsible database info if:
274
// 1. $server == 0 (no server selected)
275
// This is the case when there are multiple servers and
276
// '$cfg['ServerDefault'] = 0' is set. In that case, we want the welcome
277
// screen to appear with no database info displayed.
278
// 2. there is only one database available (ie either only one database exists
279
// or $cfg['Servers']['only_db'] is defined and is not an array)
280
// In this case, the database should not be collapsible/expandable
282
// Light mode -> beginning of the select combo for databases
283
// Note: When javascript is active, the frameset will be changed from
284
// within left.php. With no JS (<noscript>) the whole frameset will
285
// be rebuilt with the new target frame.
286
if ($cfg['LeftFrameLight']) {
288
<table border="0" cellpadding="1" cellspacing="0">
290
<td align="left" class="heada"><?php echo $strDatabase; ?>:</td>
294
<script type="text/javascript" language="javascript">
296
document.writeln('<form method="post" action="left.php" name="left" target="nav" style="margin: 0px; padding: 0px;">');
300
<form method="post" action="index.php" name="left" target="_parent" style="margin: 0px; padding: 0px;">
303
echo PMA_generate_common_hidden_inputs();
304
echo ' <input type="hidden" name="hash" value="' . $hash . '" />' . "\n";
306
<select name="lightm_db" onchange="remove_focus_select();this.form.submit();">
308
echo ' <option value="">(' . $strDatabases . ') ...</option>' . "\n";
310
$table_list_header = '';
314
// natural order for db list
315
if ($cfg['NaturalOrder'] && $num_dbs > 0) {
316
$dblist_temp = $dblist;
317
natsort($dblist_temp);
319
foreach ($dblist_temp as $each) {
325
// Gets the tables list per database
326
for ($i = 0; $i < $num_dbs; $i++) {
329
if (!empty($db_start) && $db == $db_start) {
332
$tables = PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
333
$num_tables = ($tables) ? @PMA_DBI_num_rows($tables) : 0;
334
$common_url_query = PMA_generate_common_url($db);
336
$num_tables_disp = $num_tables;
338
$num_tables_disp = '-';
340
// Get additional information about tables for tooltip
341
if ($cfg['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303
343
&& (!$cfg['LeftFrameLight'] || $selected_db == $j)) {
345
$tooltip_name = array();
346
$result = PMA_DBI_try_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
347
while ($tmp = PMA_DBI_fetch_assoc($result)) {
348
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
349
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] && $cfg['ShowTooltipAliasTB'] !== 'nested' ? $tmp['Name'] : $tmp['Comment']);
350
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
351
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
355
// garvin: Get comments from PMA comments table
357
if ($cfg['ShowTooltip'] && $cfgRelation['commwork']) {
358
$tmp_db_tooltip = PMA_getComments($db);
359
if (is_array($tmp_db_tooltip)) {
360
$db_tooltip = implode(' ', $tmp_db_tooltip);
364
// Builds the databases' names list
365
if (!empty($db_start) && $db == $db_start) {
366
$table_title = array();
367
$table_array = array();
368
// Gets the list of tables from the current database
369
while (list($table) = PMA_DBI_fetch_row($tables)) {
370
$table_array[$table] = '';
371
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
372
? htmlspecialchars($tooltip[$table])
374
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
375
? htmlspecialchars($tooltip_name[$table])
377
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
378
} // end while (tables list)
379
$selected = ' selected="selected"';
382
} // end if... else...
384
if (!empty($num_tables)) {
386
. '<option value="' . htmlspecialchars($db) . '"' . $selected . '>'
387
. ($db_tooltip != '' && $cfg['ShowTooltipAliasDB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' (' . $num_tables . ')</option>' . "\n";
390
. '<option value="' . htmlspecialchars($db) . '"' . $selected . '>'
391
. ($db_tooltip != '' && $cfg['ShowTooltipAliasDB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' (-)</option>' . "\n";
392
} // end if... else...
394
} // end for $i (db list)
397
<noscript><input type="submit" name="Go" value="<?php echo $strGo; ?>" /></noscript>
404
} // end if LeftFrameLight
405
} // end if num_db > 1
407
<form name="queryframeform" action="queryframe.php" method="get" style="margin:0px; padding:0px; display:none;">
408
<input type="hidden" name="db" value="" />
409
<input type="hidden" name="table" value="" />
410
<input type="hidden" name="framename" value="queryframe" />
412
<form name="hashform" action="queryframe.php" style="margin:0px; padding:0px; display:none;">
413
<input type="hidden" name="hash" value="<?php echo $hash; ?>" />