Almost completed appending of newly created database to the database table. Still need to get db statistics
This commit is contained in:
@@ -54,7 +54,45 @@ if (! $result) {
|
|||||||
$GLOBALS['db'] = $new_db;
|
$GLOBALS['db'] = $new_db;
|
||||||
|
|
||||||
if($GLOBALS['is_ajax_request'] == true) {
|
if($GLOBALS['is_ajax_request'] == true) {
|
||||||
PMA_ajaxResponse($message, true);
|
|
||||||
|
$extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query, 'success');
|
||||||
|
|
||||||
|
//Construct the html for the new database, so that it can be appended to the list of databases on server_databases.php
|
||||||
|
|
||||||
|
$db_url_params['db'] = $new_db;
|
||||||
|
|
||||||
|
$is_superuser = PMA_isSuperuser();
|
||||||
|
|
||||||
|
$new_db_string = '<tr>';
|
||||||
|
|
||||||
|
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
||||||
|
$new_db_string .= '<td class="tool">';
|
||||||
|
$new_db_string .= '<input type="checkbox" title="'. $new_db .'" value="' . $new_db . '" name="selected_dbsp[]" />';
|
||||||
|
$new_db_string .='</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$new_db_string .= '<td class="name">';
|
||||||
|
$new_db_string .= '<a target="_parent" title="Jump to database" href="index.php' . PMA_generate_common_url($db_url_params) . '">';
|
||||||
|
$new_db_string .= $new_db . '</a>';
|
||||||
|
$new_db_string .= '</td>';
|
||||||
|
|
||||||
|
if($is_superuser) {
|
||||||
|
|
||||||
|
$db_url_params['checkprivs'] = $new_db;
|
||||||
|
|
||||||
|
$new_db_string .= '<td class="tool">';
|
||||||
|
$new_db_string .= '<a title="Check privileges for database" href="server_privileges.php' . PMA_generate_common_url($db_url_params) . '">';
|
||||||
|
$new_db_string .= ($cfg['PropertiesIconic']
|
||||||
|
? '<img class="icon" src="' . $pmaThemeImage . 's_rights.png" width="16" height="16" alt=" ' . __('Check Privileges') . '" /> '
|
||||||
|
: __('Check Privileges')) . '</a>';
|
||||||
|
$new_db_string .= '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$new_db_string .= '</tr>';
|
||||||
|
|
||||||
|
$extra_data['new_db_string'] = $new_db_string;
|
||||||
|
|
||||||
|
PMA_ajaxResponse($message, true, $extra_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once './libraries/header.inc.php';
|
require_once './libraries/header.inc.php';
|
||||||
|
@@ -2090,9 +2090,10 @@ $(document).ready(function() {
|
|||||||
$("#tabledatabases")
|
$("#tabledatabases")
|
||||||
.find('tbody')
|
.find('tbody')
|
||||||
.append(data.new_db_string)
|
.append(data.new_db_string)
|
||||||
.PMA_sort_table('.name');
|
.PMA_sort_table('.name')
|
||||||
|
.find('#db_summary_row')
|
||||||
//PMA_sort_table($("#tabledatabases tbody"), '.name');
|
.appendTo('#tabledatabases tbody')
|
||||||
|
.removeClass('odd even');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PMA_ajaxShowMessage(data.error);
|
PMA_ajaxShowMessage(data.error);
|
||||||
|
@@ -295,7 +295,7 @@ if ($databases_count > 0) {
|
|||||||
} // end foreach ($databases as $key => $current)
|
} // end foreach ($databases as $key => $current)
|
||||||
unset($current, $odd_row);
|
unset($current, $odd_row);
|
||||||
|
|
||||||
echo '<tr>' . "\n";
|
echo '<tr id="db_summary_row">' . "\n";
|
||||||
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
||||||
echo ' <th></th>' . "\n";
|
echo ' <th></th>' . "\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user