- 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
|
- db with only table specific rights where not displayed if there was not
|
||||||
at least one db with db specfic rights
|
at least one db with db specfic rights
|
||||||
- javascript errors
|
- 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>
|
2005-11-08 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
* Documentation.html, browse_foreigners.php, error.php,
|
* Documentation.html, browse_foreigners.php, error.php,
|
||||||
|
@@ -134,7 +134,7 @@ if ( true == $cfg['PropertiesIconic'] ) {
|
|||||||
* Displays the tables list
|
* 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
|
<?php
|
||||||
echo PMA_generate_common_hidden_inputs( $db );
|
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'; ?>"
|
<img class="selectallarrow" src="<?php echo $pmaThemeImage .'arrow_'.$text_dir.'.png'; ?>"
|
||||||
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
||||||
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
||||||
onclick="setCheckboxes('tablesForm', true); return false;">
|
onclick="if ( markAllRows('tablesForm') ) return false;">
|
||||||
<?php echo $strCheckAll; ?></a>
|
<?php echo $strCheckAll; ?></a>
|
||||||
/
|
/
|
||||||
<a href="<?php echo $checkall_url; ?>"
|
<a href="<?php echo $checkall_url; ?>"
|
||||||
onclick="setCheckboxes('tablesForm', false); return false;">
|
onclick="if ( unMarkAllRows('tablesForm') ) return false;">
|
||||||
<?php echo $strUncheckAll; ?></a>
|
<?php echo $strUncheckAll; ?></a>
|
||||||
<?php if ($overhead_check != '') { ?>
|
<?php if ($overhead_check != '') { ?>
|
||||||
/
|
/
|
||||||
|
@@ -573,7 +573,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
// Start of form for multi-rows delete
|
// Start of form for multi-rows delete
|
||||||
|
|
||||||
if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp' ) {
|
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 PMA_generate_common_hidden_inputs($db, $table, 1);
|
||||||
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
||||||
echo '<input type="hidden" name="repeat_cells" value="' . $repeat_cells . '" />' . "\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"
|
echo '<!-- Results table -->' . "\n"
|
||||||
. '<table id="table_results" ';
|
. '<table id="table_results" class="data" ';
|
||||||
if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
|
if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
|
||||||
echo 'border="1" cellpadding="2" cellspacing="0"';
|
echo 'border="1" cellpadding="2" cellspacing="0"';
|
||||||
} else {
|
} else {
|
||||||
@@ -1856,8 +1856,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|||||||
. '&goto=' . $goto
|
. '&goto=' . $goto
|
||||||
. '&dontlimitchars=' . $dontlimitchars;
|
. '&dontlimitchars=' . $dontlimitchars;
|
||||||
$checkall_url = $uncheckall_url . '&checkall=1';
|
$checkall_url = $uncheckall_url . '&checkall=1';
|
||||||
$checkall_params['onclick'] = 'setCheckboxesRange(\'rowsDeleteForm\', true, \'id_rows_to_delete\', 0, ' . $num_rows . '); return false;';
|
$checkall_params['onclick'] = 'if ( markAllRows(\'rowsDeleteForm\') ) return false;';
|
||||||
$uncheckall_params['onclick'] = 'setCheckboxesRange(\'rowsDeleteForm\', false, \'id_rows_to_delete\', 0, ' . $num_rows . '); return false;';
|
$uncheckall_params['onclick'] = 'if ( unMarkAllRows(\'rowsDeleteForm\') ) return false;';
|
||||||
$checkall_link = PMA_linkOrButton( $checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false );
|
$checkall_link = PMA_linkOrButton( $checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false );
|
||||||
$uncheckall_link = PMA_linkOrButton( $uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false );
|
$uncheckall_link = PMA_linkOrButton( $uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false );
|
||||||
?>
|
?>
|
||||||
|
@@ -491,7 +491,7 @@ function PMA_markRowsInit() {
|
|||||||
var unique_id;
|
var unique_id;
|
||||||
var checkbox;
|
var checkbox;
|
||||||
|
|
||||||
var checkbox = this.getElementsByTagName( 'input' )[0];
|
checkbox = this.getElementsByTagName( 'input' )[0];
|
||||||
if ( checkbox && checkbox.type == 'checkbox' ) {
|
if ( checkbox && checkbox.type == 'checkbox' ) {
|
||||||
unique_id = checkbox.name + checkbox.value;
|
unique_id = checkbox.name + checkbox.value;
|
||||||
} else if ( this.id.length > 0 ) {
|
} else if ( this.id.length > 0 ) {
|
||||||
@@ -536,6 +536,62 @@ function PMA_markRowsInit() {
|
|||||||
}
|
}
|
||||||
window.onload=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
|
* Sets/unsets the pointer and marker in browse mode
|
||||||
*
|
*
|
||||||
|
@@ -164,7 +164,7 @@ if ( count($databases) > 0 ) {
|
|||||||
'footer' => 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)
|
. PMA_generate_common_hidden_inputs('', '', 1)
|
||||||
. '<input type="hidden" name="dbstats" value="' . $dbstats . '" />' . "\n"
|
. '<input type="hidden" name="dbstats" value="' . $dbstats . '" />' . "\n"
|
||||||
. '<input type="hidden" name="sort_by" value="' . $sort_by . '" />' . "\n"
|
. '<input type="hidden" name="sort_by" value="' . $sort_by . '" />' . "\n"
|
||||||
@@ -292,26 +292,20 @@ if ( count($databases) > 0 ) {
|
|||||||
echo ' <th> </th>' . "\n";
|
echo ' <th> </th>' . "\n";
|
||||||
}
|
}
|
||||||
echo '</tr>' . "\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']) {
|
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
||||||
$common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats;
|
$common_url_query = PMA_generate_common_url() . '&sort_by=' . $sort_by . '&sort_order=' . $sort_order . '&dbstats=' . $dbstats;
|
||||||
echo '<tr><td colspan="' . $table_columns . '">' . "\n"
|
echo '<img class="selectallarrow" src="' . $pmaThemeImage . 'arrow_' . $text_dir . '.png" width="38" height="22" alt="' . $strWithChecked . '" />' . "\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="if ( markAllRows(\'tabledatabases\') ) return false;">' . "\n"
|
||||||
. ' <a href="./server_databases.php?' . $common_url_query . '&checkall=1" onclick="setCheckboxes(\'dbStatsForm\', true); return false;">' . "\n"
|
. ' ' . $strCheckAll . '</a> / ' . "\n"
|
||||||
. ' ' . $strCheckAll
|
. '<a href="./server_databases.php?' . $common_url_query . '" onclick="if ( unMarkAllRows(\'tabledatabases\') ) return false;">' . "\n"
|
||||||
. ' </a> / ' . "\n"
|
. ' ' . $strUncheckAll . '</a>' . "\n"
|
||||||
. ' <a href="./server_databases.php?' . $common_url_query . '" onclick="setCheckboxes(\'dbStatsForm\', false); return false;">' . "\n"
|
. '<i>' . $strWithChecked . '</i>' . "\n";
|
||||||
. ' ' . $strUncheckAll
|
|
||||||
. ' </a>' . "\n"
|
|
||||||
. ' <i>' . $strWithChecked . '</i>' . "\n";
|
|
||||||
PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' );
|
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'] ) {
|
if ( $GLOBALS['cfg']['PropertiesIconic'] ) {
|
||||||
// iconic view
|
// iconic view
|
||||||
|
@@ -155,7 +155,7 @@ if ( $cfg['PropertiesIconic'] == true ) {
|
|||||||
// table header
|
// table header
|
||||||
$i = 0;
|
$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); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||||
<table id="tablestructure" class="data">
|
<table id="tablestructure" class="data">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -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'; ?>"
|
<img class="selectallarrow" src="<?php echo $pmaThemeImage . 'arrow_' . $text_dir . '.png'; ?>"
|
||||||
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
|
||||||
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
<a href="<?php echo $checkall_url; ?>&checkall=1"
|
||||||
onclick="setCheckboxes('fieldsForm', true); return false;">
|
onclick="if ( markAllRows('fieldsForm') ) return false;">
|
||||||
<?php echo $strCheckAll; ?></a>
|
<?php echo $strCheckAll; ?></a>
|
||||||
/
|
/
|
||||||
<a href="<?php echo $checkall_url; ?>"
|
<a href="<?php echo $checkall_url; ?>"
|
||||||
onclick="setCheckboxes('fieldsForm', false); return false;">
|
onclick="if ( unMarkAllRows('fieldsForm') ) return false;">
|
||||||
<?php echo $strUncheckAll; ?></a>
|
<?php echo $strUncheckAll; ?></a>
|
||||||
|
|
||||||
<i><?php echo $strWithChecked; ?></i>
|
<i><?php echo $strWithChecked; ?></i>
|
||||||
|
Reference in New Issue
Block a user