correctly fix browse foreigners popup for search page

This commit is contained in:
Garvin Hicking
2004-09-16 10:01:12 +00:00
parent 20c5dd53f2
commit ed5c160745
3 changed files with 6 additions and 5 deletions

View File

@@ -49,9 +49,9 @@ PMA_setFontSizes();
opener.document.insertForm.elements['field_' + field + '<?php echo (isset($pk) ? '[multi_edit][' . urlencode($pk) . ']' : ''); ?>[]'].value = key; opener.document.insertForm.elements['field_' + field + '<?php echo (isset($pk) ? '[multi_edit][' . urlencode($pk) . ']' : ''); ?>[]'].value = key;
self.close(); self.close();
return false; return false;
} else if (opener.document.insertForm.elements['field_' + field + '[1]']) { } else if (opener.document.insertForm.elements['field_' + field + '[<?php echo isset($fieldkey) ? $fieldkey : 0; ?>]']) {
// Search form // Search form
opener.document.insertForm.elements['field_' + field + '[1]'].value = key; opener.document.insertForm.elements['field_' + field + '[<?php echo isset($fieldkey) ? $fieldkey : 0; ?>]'].value = key;
self.close(); self.close();
return false; return false;
} }
@@ -87,6 +87,7 @@ require('./libraries/get_foreign.lib.php');
<form action="browse_foreigners.php" method="post"> <form action="browse_foreigners.php" method="post">
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="field" value="<?php echo urlencode($field); ?>" /> <input type="hidden" name="field" value="<?php echo urlencode($field); ?>" />
<input type="hidden" name="field" value="<?php echo isset($fieldkey) ? $fieldkey : ''; ?>" />
<?php <?php
if (isset($pk)) { if (isset($pk)) {
$pk_uri = '&amp;pk=' . urlencode($pk); $pk_uri = '&amp;pk=' . urlencode($pk);
@@ -112,7 +113,7 @@ $nbTotalPage = @ceil($the_total / $session_max_rows);
if ($the_total > $per_page) { if ($the_total > $per_page) {
$gotopage = '<br />' . $GLOBALS['strPageNumber'] $gotopage = '<br />' . $GLOBALS['strPageNumber']
. '<select name="goToPage" onchange="goToUrl(this, \'browse_foreigners.php?field=' . urlencode($field) . '&amp;' . PMA_generate_common_url($db, $table) . $pk_uri . '&amp;\');">'; . '<select name="goToPage" onchange="goToUrl(this, \'browse_foreigners.php?field=' . urlencode($field) . '&amp;' . PMA_generate_common_url($db, $table) . $pk_uri . '&amp;fieldkey=' . (isset($fieldkey) ? $fieldkey : '') . '&amp;\');">';
if ($nbTotalPage < 200) { if ($nbTotalPage < 200) {
$firstPage = 1; $firstPage = 1;
$lastPage = $nbTotalPage; $lastPage = $nbTotalPage;

View File

@@ -830,7 +830,7 @@ function insertValueQuery() {
/** /**
* listbox redirection * listbox redirection
*/ */
function goToUrl(selObj, goToLocation){ function goToUrl(selObj, goToLocation) {
eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'"); eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
} }

View File

@@ -279,7 +279,7 @@ function PMA_tbl_select_operator(f, index, multiple) {
?> ?>
<input type="text" name="fields[<?php echo $i; ?>]" id="field_<?php echo md5($field); ?>[<?php echo $i; ?>]" class="textfield" /> <input type="text" name="fields[<?php echo $i; ?>]" id="field_<?php echo md5($field); ?>[<?php echo $i; ?>]" class="textfield" />
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
document.writeln('<a target="_blank" onclick="window.open(this.href, \'foreigners\', \'width=640,height=240,scrollbars=yes\'); return false" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&amp;field=<?php echo urlencode($field); ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>'); document.writeln('<a target="_blank" onclick="window.open(this.href, \'foreigners\', \'width=640,height=240,scrollbars=yes\'); return false" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&amp;field=<?php echo urlencode($field); ?>&amp;fieldkey=<?php echo $i; ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>');
</script> </script>
<?php <?php
} else if (strncasecmp($fields_type[$i], 'enum', 4) == 0) { } else if (strncasecmp($fields_type[$i], 'enum', 4) == 0) {