if ($GLOBALS['text_dir'] === 'ltr') { echo ' <bdo dir="ltr">(' . PMA_getTableCount($db) . ')</bdo> '; } echo '</a></p>'; $table_list = PMA_getTableList($db); if (count($table_list) > 0) { PMA_displayTableList($table_list, true, '', $db); } else { echo $strNoTablesFound; } unset($table_list); } elseif ($GLOBALS['cfg']['LeftFrameLight']) { echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n"; } else { $common_url_query = PMA_generate_common_url(); PMA_displayDbList(PMA_getDbList()); } /** * displays collapsable db list * * @uses $_REQUEST['dbgroup'] * @uses $GLOBALS['cfg']['DefaultTabDatabase'] * @uses $GLOBALS['strSelectADb'] * @uses strpos() * @uses urlencode() * @uses printf() * @uses htmlspecialchars() * @uses PMA_generate_common_url() * @uses PMA_getTableList() * @uses PMA_displayTableList() * @global $element_counter
/** * returns html code for select form element with dbs * * @return string html code select */ function PMA_getHtmlSelectDb($selected = '') { $dblist = PMA_getDbList(); // TODO: IE can not handle different text directions in select boxes // so, as mostly names will be in english, we set the whole selectbox to LTR // and EN $return = '<select name="db" id="lightm_db" xml:lang="en" dir="ltr"' . ' onchange="if (this.value != \'\') window.parent.openDb(this.value);">' . "\n" . '<option value="" dir="' . $GLOBALS['text_dir'] . '">(' . $GLOBALS['strDatabases'] . ') ...</option>' . "\n"; foreach ($dblist as $group => $dbs) { if (count($dbs) > 1) { $return .= '<optgroup label="' . htmlspecialchars($group) . '">' . "\n"; // wether display db_name cuted by the group part $cut = true; } else { // .. or full $cut = false; } foreach ($dbs as $db) { $return .= '<option value="' . $db['name'] . '"' . ' title="' . $db['comment'] . '"'; if ($db['name'] == $selected) { $return .= ' selected="selected"'; } $return .= '>' . ($cut ? $db['disp_name_cut'] : $db['disp_name']) . ' (' . $db['num_tables'] . ')</option>' . "\n"; } if (count($dbs) > 1) { $return .= '</optgroup>' . "\n"; } } $return .= '</select>'; return $return; }