- added js:markAllRows(), js:unMarkAllRows()
- check/uncheck all rows now sets mark color for this rows
This commit is contained in:
@@ -23,6 +23,10 @@ $Source$
|
||||
- db with only table specific rights where not displayed if there was not
|
||||
at least one db with db specfic rights
|
||||
- javascript errors
|
||||
* function.js, db_details_structure.php, tbl_properties_structure.php,
|
||||
display_tbl.lib.php, server_databases.php:
|
||||
- added js:markAllRows(), js:unMarkAllRows()
|
||||
- check/uncheck all rows now sets mark color for this rows
|
||||
|
||||
2005-11-08 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||
* Documentation.html, browse_foreigners.php, error.php,
|
||||
|
@@ -134,7 +134,7 @@ if ( true == $cfg['PropertiesIconic'] ) {
|
||||
* Displays the tables list
|
||||
*/
|
||||
?>
|
||||
<form method="post" action="db_details_structure.php" name="tablesForm">
|
||||
<form method="post" action="db_details_structure.php" name="tablesForm" id="tablesForm">
|
||||
<?php
|
||||
echo PMA_generate_common_hidden_inputs( $db );
|
||||
|
||||
@@ -399,11 +399,11 @@ $checkall_url = 'db_details_structure.php?' . PMA_generate_common_url($db);
|
||||
<img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
|
||||
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
||||
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
||||
onclick="setCheckboxes('tablesForm', true); return false;">
|
||||
onclick="if ( markAllRows('tablesForm') ) return false;">
|
||||
<?php echo $strCheckAll; ?></a>
|
||||
/
|
||||
<a href="<?php echo $checkall_url; ?>"
|
||||
onclick="setCheckboxes('tablesForm', false); return false;">
|
||||
onclick="if ( unMarkAllRows('tablesForm') ) return false;">
|
||||
<?php echo $strUncheckAll; ?></a>
|
||||
<?php if ($overhead_check != '') { ?>
|
||||
/
|
||||
|
@@ -454,7 +454,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
global $db, $table, $goto, $dontlimitchars;
|
||||
global $sql_query, $num_rows, $pos, $session_max_rows;
|
||||
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
|
||||
|
||||
|
||||
if ($analyzed_sql == '') {
|
||||
$analyzed_sql = array();
|
||||
}
|
||||
@@ -573,7 +573,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
// Start of form for multi-rows delete
|
||||
|
||||
if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp' ) {
|
||||
echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm">' . "\n";
|
||||
echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm" id="rowsDeleteForm">' . "\n";
|
||||
echo PMA_generate_common_hidden_inputs($db, $table, 1);
|
||||
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
||||
echo '<input type="hidden" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n";
|
||||
@@ -584,7 +584,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
}
|
||||
|
||||
echo '<!-- Results table -->' . "\n"
|
||||
. '<table id="table_results" ';
|
||||
. '<table id="table_results" class="data" ';
|
||||
if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
|
||||
echo 'border="1" cellpadding="2" cellspacing="0"';
|
||||
} else {
|
||||
@@ -1066,7 +1066,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
|
||||
<?php
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
|
||||
// 1. Prepares the row (gets primary keys to use)
|
||||
// 1.1 Results from a "SELECT" statement -> builds the
|
||||
// "primary" key to use in links
|
||||
@@ -1844,7 +1844,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
|
||||
$delete_text = $is_display['del_lnk'] == 'dr' ? $GLOBALS['strDelete'] : $GLOBALS['strKill'];
|
||||
$propicon = (string)$GLOBALS['cfg']['PropertiesIconic'];
|
||||
|
||||
|
||||
$uncheckall_url = 'sql.php?'
|
||||
. PMA_generate_common_url($db, $table)
|
||||
. '&sql_query=' . urlencode($sql_query)
|
||||
@@ -1856,8 +1856,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
||||
. '&goto=' . $goto
|
||||
. '&dontlimitchars=' . $dontlimitchars;
|
||||
$checkall_url = $uncheckall_url . '&checkall=1';
|
||||
$checkall_params['onclick'] = 'setCheckboxesRange(\'rowsDeleteForm\', true, \'id_rows_to_delete\', 0, ' . $num_rows . '); return false;';
|
||||
$uncheckall_params['onclick'] = 'setCheckboxesRange(\'rowsDeleteForm\', false, \'id_rows_to_delete\', 0, ' . $num_rows . '); return false;';
|
||||
$checkall_params['onclick'] = 'if ( markAllRows(\'rowsDeleteForm\') ) return false;';
|
||||
$uncheckall_params['onclick'] = 'if ( unMarkAllRows(\'rowsDeleteForm\') ) return false;';
|
||||
$checkall_link = PMA_linkOrButton( $checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false );
|
||||
$uncheckall_link = PMA_linkOrButton( $uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false );
|
||||
?>
|
||||
|
@@ -23,13 +23,13 @@ function selectContent( element, lock, only_once ) {
|
||||
if ( only_once && only_once_elements[element.name] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
only_once_elements[element.name] = true;
|
||||
|
||||
|
||||
if ( lock ) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
element.select();
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ function confirmLink(theLink, theSqlQuery)
|
||||
|
||||
|
||||
/**
|
||||
* Displays an confirmation box before doing some action
|
||||
* Displays an confirmation box before doing some action
|
||||
*
|
||||
* @param object the message to display
|
||||
* @param object the message to display
|
||||
*
|
||||
* @return boolean whether to run the query or not
|
||||
*/
|
||||
@@ -254,7 +254,7 @@ function checkSqlQuery(theForm)
|
||||
|
||||
|
||||
/**
|
||||
* Check if a form's element is empty
|
||||
* Check if a form's element is empty
|
||||
* should be
|
||||
*
|
||||
* @param object the form
|
||||
@@ -379,7 +379,7 @@ function checkTableEditForm(theForm, fieldsCnt)
|
||||
if (!emptyCheckTheField(theForm, id)) {
|
||||
atLeastOneField = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (atLeastOneField == 0) {
|
||||
var theField = theForm.elements["field_0_1"];
|
||||
@@ -490,8 +490,8 @@ function PMA_markRowsInit() {
|
||||
rows[i].onmousedown = function() {
|
||||
var unique_id;
|
||||
var checkbox;
|
||||
|
||||
var checkbox = this.getElementsByTagName( 'input' )[0];
|
||||
|
||||
checkbox = this.getElementsByTagName( 'input' )[0];
|
||||
if ( checkbox && checkbox.type == 'checkbox' ) {
|
||||
unique_id = checkbox.name + checkbox.value;
|
||||
} else if ( this.id.length > 0 ) {
|
||||
@@ -499,24 +499,24 @@ function PMA_markRowsInit() {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
|
||||
marked_row[unique_id] = true;
|
||||
} else {
|
||||
marked_row[unique_id] = false;
|
||||
}
|
||||
|
||||
|
||||
if ( marked_row[unique_id] ) {
|
||||
this.className += ' marked';
|
||||
} else {
|
||||
this.className = this.className.replace(' marked', '');
|
||||
}
|
||||
|
||||
|
||||
if ( checkbox && checkbox.disabled == false ) {
|
||||
checkbox.checked = marked_row[unique_id];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ... and disable label ...
|
||||
var labeltag = rows[i].getElementsByTagName('label')[0];
|
||||
if ( labeltag ) {
|
||||
@@ -536,6 +536,62 @@ function PMA_markRowsInit() {
|
||||
}
|
||||
window.onload=PMA_markRowsInit;
|
||||
|
||||
/**
|
||||
* marks all rows and selects its first checkbox inside the given element
|
||||
* the given element is usaly a table or a div containing the table or tables
|
||||
*
|
||||
* @param container DOM element
|
||||
*/
|
||||
function markAllRows( container_id ) {
|
||||
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
||||
var unique_id;
|
||||
var checkbox;
|
||||
|
||||
for ( var i = 0; i < rows.length; i++ ) {
|
||||
|
||||
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
||||
|
||||
if ( checkbox && checkbox.type == 'checkbox' ) {
|
||||
unique_id = checkbox.name + checkbox.value;
|
||||
if ( checkbox.disabled == false ) {
|
||||
checkbox.checked = true;
|
||||
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
|
||||
rows[i].className += ' marked';
|
||||
marked_row[unique_id] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* marks all rows and selects its first checkbox inside the given element
|
||||
* the given element is usaly a table or a div containing the table or tables
|
||||
*
|
||||
* @param container DOM element
|
||||
*/
|
||||
function unMarkAllRows( container_id ) {
|
||||
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
||||
var unique_id;
|
||||
var checkbox;
|
||||
|
||||
for ( var i = 0; i < rows.length; i++ ) {
|
||||
|
||||
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
||||
|
||||
if ( checkbox && checkbox.type == 'checkbox' ) {
|
||||
unique_id = checkbox.name + checkbox.value;
|
||||
checkbox.checked = false;
|
||||
rows[i].className = rows[i].className.replace(' marked', '');
|
||||
marked_row[unique_id] = false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets/unsets the pointer and marker in browse mode
|
||||
*
|
||||
@@ -609,7 +665,7 @@ function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerCol
|
||||
currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 4. Defines the new color
|
||||
// 4.1 Current color is the default one
|
||||
if (currentColor == ''
|
||||
|
@@ -164,7 +164,7 @@ if ( count($databases) > 0 ) {
|
||||
'footer' => 0,
|
||||
);
|
||||
|
||||
echo '<form action="./server_databases.php" method="post" name="dbStatsForm">' . "\n"
|
||||
echo '<form action="./server_databases.php" method="post" name="dbStatsForm" id="dbStatsForm">' . "\n"
|
||||
. PMA_generate_common_hidden_inputs('', '', 1)
|
||||
. '<input type="hidden" name="dbstats" value="' . $dbstats . '" />' . "\n"
|
||||
. '<input type="hidden" name="sort_by" value="' . $sort_by . '" />' . "\n"
|
||||
@@ -292,26 +292,20 @@ if ( count($databases) > 0 ) {
|
||||
echo ' <th> </th>' . "\n";
|
||||
}
|
||||
echo '</tr>' . "\n";
|
||||
unset( $column_order, $stat_name, $stat, $databases );
|
||||
echo '</tbody>' . "\n"
|
||||
.'</table>' . "\n";
|
||||
unset( $column_order, $stat_name, $stat, $databases, $table_columns );
|
||||
|
||||
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
||||
$common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats;
|
||||
echo '<tr><td colspan="' . $table_columns . '">' . "\n"
|
||||
. ' <img class="icon" src="' . $pmaThemeImage . 'arrow_' . $text_dir . '.png" width="38" height="22" alt="' . $strWithChecked . '" />' . "\n"
|
||||
. ' <a href="./server_databases.php?' . $common_url_query . '&checkall=1" onclick="setCheckboxes(\'dbStatsForm\', true); return false;">' . "\n"
|
||||
. ' ' . $strCheckAll
|
||||
. ' </a> / ' . "\n"
|
||||
. ' <a href="./server_databases.php?' . $common_url_query . '" onclick="setCheckboxes(\'dbStatsForm\', false); return false;">' . "\n"
|
||||
. ' ' . $strUncheckAll
|
||||
. ' </a>' . "\n"
|
||||
. ' <i>' . $strWithChecked . '</i>' . "\n";
|
||||
echo '<img class="selectallarrow" src="' . $pmaThemeImage . 'arrow_' . $text_dir . '.png" width="38" height="22" alt="' . $strWithChecked . '" />' . "\n"
|
||||
. '<a href="./server_databases.php?' . $common_url_query . '&checkall=1" onclick="if ( markAllRows(\'tabledatabases\') ) return false;">' . "\n"
|
||||
. ' ' . $strCheckAll . '</a> / ' . "\n"
|
||||
. '<a href="./server_databases.php?' . $common_url_query . '" onclick="if ( unMarkAllRows(\'tabledatabases\') ) return false;">' . "\n"
|
||||
. ' ' . $strUncheckAll . '</a>' . "\n"
|
||||
. '<i>' . $strWithChecked . '</i>' . "\n";
|
||||
PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' );
|
||||
echo ' </td>' . "\n"
|
||||
. '</tr>' . "\n";
|
||||
}
|
||||
echo '</tbody>' . "\n"
|
||||
.'</table>' . "\n";
|
||||
unset( $table_columns );
|
||||
|
||||
if ( $GLOBALS['cfg']['PropertiesIconic'] ) {
|
||||
// iconic view
|
||||
|
@@ -85,7 +85,7 @@ $fields_cnt = PMA_DBI_num_rows($fields_rs);
|
||||
// the info given by SHOW FULL FIELDS FROM.
|
||||
//
|
||||
// We also need this to correctly learn if a TIMESTAMP is NOT NULL, since
|
||||
// SHOW FULL FIELDS says NULL and SHOW CREATE TABLE says NOT NULL (tested
|
||||
// SHOW FULL FIELDS says NULL and SHOW CREATE TABLE says NOT NULL (tested
|
||||
// in MySQL 4.0.25).
|
||||
|
||||
$show_create_table = PMA_DBI_fetch_value(
|
||||
@@ -155,7 +155,7 @@ if ( $cfg['PropertiesIconic'] == true ) {
|
||||
// table header
|
||||
$i = 0;
|
||||
?>
|
||||
<form method="post" action="tbl_properties_structure.php" name="fieldsForm">
|
||||
<form method="post" action="tbl_properties_structure.php" name="fieldsForm" id="fieldsForm">
|
||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||
<table id="tablestructure" class="data">
|
||||
<thead>
|
||||
@@ -220,7 +220,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
||||
|
||||
// for the case ENUM('–','“')
|
||||
$type = htmlspecialchars($type);
|
||||
|
||||
|
||||
$type_nowrap = '';
|
||||
|
||||
$binary = 0;
|
||||
@@ -291,14 +291,14 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
||||
if ($zerofill) {
|
||||
$attribute = 'UNSIGNED ZEROFILL';
|
||||
}
|
||||
|
||||
|
||||
// MySQL 4.1.2+ TIMESTAMP options
|
||||
// (if on_update_current_timestamp is set, then it's TRUE)
|
||||
if (isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) {
|
||||
$attribute = 'ON UPDATE CURRENT_TIMESTAMP';
|
||||
}
|
||||
|
||||
// here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
|
||||
// here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
|
||||
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
|
||||
// the latter.
|
||||
if (!empty($analyzed_sql[0]['create_table_fields'][$row['Field']]['type']) && $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null']) {
|
||||
@@ -443,11 +443,11 @@ $checkall_url = 'tbl_properties_structure.php?' . PMA_generate_common_url($db,$t
|
||||
<img class="selectallarrow" src="<?php echo $pmaThemeImage . 'arrow_' . $text_dir . '.png'; ?>"
|
||||
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
||||
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
||||
onclick="setCheckboxes('fieldsForm', true); return false;">
|
||||
onclick="if ( markAllRows('fieldsForm') ) return false;">
|
||||
<?php echo $strCheckAll; ?></a>
|
||||
/
|
||||
<a href="<?php echo $checkall_url; ?>"
|
||||
onclick="setCheckboxes('fieldsForm', false); return false;">
|
||||
onclick="if ( unMarkAllRows('fieldsForm') ) return false;">
|
||||
<?php echo $strUncheckAll; ?></a>
|
||||
|
||||
<i><?php echo $strWithChecked; ?></i>
|
||||
|
Reference in New Issue
Block a user