Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-05-06 23:47:44 +02:00
commit 3b28e48f7b

View File

@ -1,6 +1,10 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* DB search optimisation
*
* @package PhpMyAdmin
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/common.lib.php';
@ -12,22 +16,29 @@ $tables_full = PMA_getTableList($db);
$tables_response = array();
foreach ($tables_full as $key => $table) {
if (strpos($key, $table_term) !== FALSE) {
if (strpos($key, $table_term) !== false) {
$link = '<li class="ajax_table"><a class="tableicon" title="'
. htmlspecialchars($link_title)
. ': ' . htmlspecialchars($table['Comment'])
. ' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . __('Rows') . ')"'
. ' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
. ' (' . PMA_formatNumber($table['Rows'], 0)
. ' ' . __('Rows') . ')"' . ' id="quick_'
. htmlspecialchars($table_db . '.' . $table['Name']) . '"'
. ' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
. $common_url_query
. '&amp;table=' . urlencode($table['Name'])
. '&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
. '" >';
$attr = array('id' => 'icon_' . htmlspecialchars($table_db . '.' . $table['Name']));
$attr = array(
'id' => 'icon_' . htmlspecialchars($table_db . '.' . $table['Name'])
);
if (PMA_Table::isView($table_db, $table['Name'])) {
$link .= PMA_getImage('s_views.png', htmlspecialchars($link_title), $attr);
$link .= PMA_getImage(
's_views.png', htmlspecialchars($link_title), $attr
);
} else {
$link .= PMA_getImage('b_browse.png', htmlspecialchars($link_title), $attr);
$link .= PMA_getImage(
'b_browse.png', htmlspecialchars($link_title), $attr
);
}
$link .= '</a>';
// link for the table name itself
@ -36,16 +47,21 @@ foreach ($tables_full as $key => $table) {
. urlencode($table['Name']) . '&amp;pos=0';
$link .= '<a href="' . $href . '" title="'
. htmlspecialchars(
PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
. ' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . __('Rows') . ')'
PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])
. ': ' . $table['Comment']
. ' (' . PMA_formatNumber($table['Rows'], 0)
. ' ' . __('Rows') . ')'
)
. '" id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
. '" id="' . htmlspecialchars($table_db . '.' . $table['Name'])
. '">'
// preserve spaces in table name
. str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
. str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name']))
. '</a>';
$link .= '</li>' . "\n";
$table['line'] = $link;
$tables_response[] = $table;
}
}
PMA_ajaxResponse('', true, array('tables' => $tables_response));
PMA_ajaxResponse('', true, array('tables' => $tables_response));
?>