Made tabindex/id of multi-edit table unique.

Restrict calendar to maximum values (and removed TABs from .js file)
This commit is contained in:
Garvin Hicking
2004-04-28 11:19:31 +00:00
parent 23f8ddfdbd
commit 40726ea672
3 changed files with 139 additions and 105 deletions

View File

@@ -11,8 +11,12 @@ $Source$
any (bug #943626).
2004-04-28 Garvin Hicking <pma@supergarv.de>
* libraries/tbl_change.js: Restrict calendar to maximum values for
days/hours/minutes/seconds.
* tbl_change.php: Bug #913600 - Made tabindex/id of multi-edit table
unique.
* left.php, libraries/left.js: Fixed unneeded spacing between items
and wrong collapsion in nested mode (Bug #943140). Removed
and wrong collapsing in nested mode (Bug #943140). Removed
some debugging non-xhtml tags.
* css/phpmyadmin.css.php: Added zero margin/padding to nowrap element
for compatibility to the good old nobr-tag

View File

@@ -68,7 +68,7 @@ function unNullify(urlField, multi_edit)
/**
* Allows moving around inputs/select by Ctrl+arrows
*
* @param object event data
* @param object event data
*/
function onKeyDownArrowsHandler(e) {
e = e||window.event;
@@ -82,7 +82,7 @@ function onKeyDownArrowsHandler(e) {
if (pos[0] != "field" || typeof pos[2] == "undefined") return;
var x = pos[2], y=pos[1];
// skip non existent fields
for (i=0; i<10; i++)
{
@@ -102,7 +102,7 @@ function onKeyDownArrowsHandler(e) {
}
if (nO) break;
}
if (!nO) return;
nO.focus();
if (nO.tagName != 'SELECT') {
@@ -129,8 +129,8 @@ var clock_set = 0;
* @param string edit type - date/timestamp
*/
function openCalendar(params, form, field, type) {
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
dateField = eval("document." + form + "." + field);
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
dateField = eval("document." + form + "." + field);
dateType = type;
}
@@ -139,10 +139,33 @@ function openCalendar(params, form, field, type) {
*
* @param int number to format.
*/
function formatNum2(i) {
return (i < 10 ? '0' : '') + i;
function formatNum2(i, valtype) {
f = (i < 10 ? '0' : '') + i;
if (valtype && valtype != '') {
switch(valtype) {
case 'month':
f = (f > 12 ? 12 : f);
break;
case 'day':
f = (f > 31 ? 31 : f);
break;
case 'hour':
f = (f > 24 ? 24 : f);
break;
default:
case 'second':
case 'minute':
f = (f > 59 ? 59 : f);
break;
}
}
return f;
}
/**
* Formats number to four digits.
*
@@ -156,7 +179,7 @@ function formatNum4(i) {
* Initializes calendar window.
*/
function initCalendar() {
if (!year && !month && !day) {
if (!year && !month && !day) {
/* Called for first time */
if (window.opener.dateField.value) {
value = window.opener.dateField.value;
@@ -164,7 +187,7 @@ function initCalendar() {
if (window.opener.dateType == 'datetime') {
parts = value.split(' ');
value = parts[0];
if (parts[1]) {
time = parts[1].split(':');
hour = parseInt(time[0]);
@@ -197,30 +220,30 @@ function initCalendar() {
minute = dt.getMinutes();
second = dt.getSeconds();
}
} else {
} else {
/* Moving in calendar */
if (month > 11) {
month = 0;
month = 0;
year++;
}
if (month < 0) {
month = 11;
month = 11;
year--;
}
}
if (document.getElementById) {
cnt = document.getElementById("calendar_data");
} else if (document.all) {
cnt = document.all["calendar_data"];
}
cnt.innerHTML = "";
str = ""
if (document.getElementById) {
cnt = document.getElementById("calendar_data");
} else if (document.all) {
cnt = document.all["calendar_data"];
}
cnt.innerHTML = "";
str = ""
//heading table
str += '<table class="calendar"><tr><th width="50%">';
str += '<table class="calendar"><tr><th width="50%">';
str += '<a href="#" onclick="month--; initCalendar();">&laquo;</a> ';
str += month_names[month];
str += ' <a href="#" onclick="month++; initCalendar();">&raquo;</a>';
@@ -230,68 +253,68 @@ function initCalendar() {
str += ' <a href="#" onclick="year++; initCalendar();">&raquo;</a>';
str += '</th></tr></table>';
str += '<table class="calendar"><tr>';
for (i = 0; i < 7; i++) {
str += "<th>" + day_names[i] + "</th>";
}
str += "</tr>";
var firstDay = new Date(year, month, 1).getDay();
var lastDay = new Date(year, month + 1, 0).getDate();
str += '<table class="calendar"><tr>';
for (i = 0; i < 7; i++) {
str += "<th>" + day_names[i] + "</th>";
}
str += "</tr>";
var firstDay = new Date(year, month, 1).getDay();
var lastDay = new Date(year, month + 1, 0).getDate();
str += "<tr>";
dayInWeek = 0;
for (i = 0; i < firstDay; i++) {
str += "<td>&nbsp;</td>";
dayInWeek++;
}
for (i = 1; i <= lastDay; i++) {
if (dayInWeek == 7) {
str += "</tr><tr>";
dayInWeek = 0;
}
str += "<tr>";
dayInWeek = 0;
for (i = 0; i < firstDay; i++) {
str += "<td>&nbsp;</td>";
dayInWeek++;
}
for (i = 1; i <= lastDay; i++) {
if (dayInWeek == 7) {
str += "</tr><tr>";
dayInWeek = 0;
}
dispmonth = 1 + month;
if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') {
actVal = formatNum4(year) + "-" + formatNum2(dispmonth) + "-" + formatNum2(i);
actVal = formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day');
} else {
actVal = "" + formatNum4(year) + formatNum2(dispmonth) + formatNum2(i);
actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day');
}
if (i == day) {
style = ' class="selected"';
} else {
style = '';
}
str += "<td" + style + "><a href='#' onclick='returnDate(\"" + actVal + "\");'>" + i + "</a></td>"
dayInWeek++;
}
for (i = dayInWeek; i < 7; i++) {
str += "<td>&nbsp;</td>";
}
str += "</tr></table>";
str += "<td" + style + "><a href='#' onclick='returnDate(\"" + actVal + "\");'>" + i + "</a></td>"
dayInWeek++;
}
for (i = dayInWeek; i < 7; i++) {
str += "<td>&nbsp;</td>";
}
cnt.innerHTML = str;
str += "</tr></table>";
cnt.innerHTML = str;
// Should we handle time also?
if (window.opener.dateType != 'date' && !clock_set) {
if (document.getElementById) {
cnt = document.getElementById("clock_data");
} else if (document.all) {
cnt = document.all["clock_data"];
}
str = '';
str += '<form class="clock">';
str += '<input id="hour" type="text" size="2" maxlength="2" value="' + formatNum2(hour) + '" />:';
str += '<input id="minute" type="text" size="2" maxlength="2" value="' + formatNum2(minute) + '" />:';
str += '<input id="second" type="text" size="2" maxlength="2" value="' + formatNum2(second) + '" />';
str += '<input id="hour" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'hour\')" value="' + formatNum2(hour, 'hour') + '" />:';
str += '<input id="minute" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'minute\')" value="' + formatNum2(minute, 'minute') + '" />:';
str += '<input id="second" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'second\')" value="' + formatNum2(second, 'second') + '" />';
str += '</form>';
cnt.innerHTML = str;
cnt.innerHTML = str;
clock_set = 1;
}
@@ -310,13 +333,13 @@ function returnDate(d) {
m = parseInt(document.getElementById('minute').value);
s = parseInt(document.getElementById('second').value);
if (window.opener.dateType == 'datetime') {
txt += ' ' + formatNum2(h) + ':' + formatNum2(m) + ':' + formatNum2(s);
txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second');
} else {
// timestamp
txt += formatNum2(h) + formatNum2(m) + formatNum2(s);
txt += formatNum2(h, 'hour') + formatNum2(m, 'minute') + formatNum2(s, 'second');
}
}
window.opener.dateField.value = txt;
window.close();
window.opener.dateField.value = txt;
window.close();
}

View File

@@ -205,7 +205,11 @@ while ($trow = PMA_DBI_fetch_assoc($table_def)) {
$trow_table_def[] = $trow;
}
$o_rows = 0;
$tabindex = 0;
$tab1 = +2;
$tab2 = +1;
$tab3 = 0;
$o_rows = 0;
foreach($loop_array AS $vrowcount => $vrow) {
if ($vrow === FALSE) {
unset($vrow);
@@ -381,6 +385,9 @@ foreach($loop_array AS $vrowcount => $vrow) {
$backup_field = '';
}
$idindex = ($o_rows * $fields_cnt) + $i + 1;
$tabindex = (($idindex - 1) * 3) + 1;
// The function column
// -------------------
// Change by Bernard M. Piller <bernard@bmpsystems.com>
@@ -397,7 +404,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
} else {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<select name="funcs<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($fields_cnt + ($i * $m_rows) + 1); ?>" id="field_<?php echo $i * $m_rows; ?>_1">
<select name="funcs<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab1); ?>" id="field_<?php echo $idindex; ?>_1">
<option></option>
<?php
echo "\n";
@@ -466,13 +473,13 @@ foreach($loop_array AS $vrowcount => $vrow) {
echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary))
&& $row_table_def['Null'] == 'YES') {
echo ' <input type="checkbox" tabindex="' . ((2 * $fields_cnt) + ($i * $m_rows) + 1) . '"'
echo ' <input type="checkbox" tabindex="' . ($tabindex + $tab2) . '"'
. ' name="fields_null' . $vkey . '[' . urlencode($field) . ']"';
//if ($data == 'NULL' && !$first_timestamp) {
if ($real_null_value && !$first_timestamp) {
echo ' checked="checked"';
}
echo ' id="field_' . ($i * $m_rows) . '_2"';
echo ' id="field_' . ($idindex) . '_2"';
$onclick = ' onclick="if (this.checked) {nullify(';
if (strstr($row_table_def['True_Type'], 'enum')) {
if (strlen($row_table_def['Type']) > 20) {
@@ -504,8 +511,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<input type="hidden" name="fields_type<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="foreign" />
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" id="field_<?php echo ($i * $m_rows); ?>_1" />
<input type="text" name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $mrows); ?>_3" value="<?php echo htmlspecialchars($data); ?>" />
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" id="field_<?php echo ($idindex); ?>_1" />
<input type="text" name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3" value="<?php echo htmlspecialchars($data); ?>" />
<script type="text/javascript" language="javascript">
document.writeln('<a target="_blank" onclick="window.open(this.href, \'foreigners\', \'width=640,height=240,scrollbars=yes,resizable=yes\'); return false" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&amp;field=<?php echo urlencode($field) . $browse_foreigners_uri; ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>');
</script>
@@ -516,8 +523,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<input type="hidden" name="fields_type<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="foreign" />
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" id="field_<?php echo $i; ?>_1" />
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3">
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" id="field_<?php echo $idindex; ?>_1" />
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3">
<?php echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, 100); ?>
</select>
</td>
@@ -531,8 +538,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
<tr>
<td colspan="4" align="right" bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo ($cfg['TextareaRows']*2); ?>" cols="<?php echo ($cfg['TextareaCols']*2); ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($i * $m_rows); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>"><?php echo $special_chars; ?></textarea>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo ($cfg['TextareaRows']*2); ?>" cols="<?php echo ($cfg['TextareaCols']*2); ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($idindex); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>"><?php echo $special_chars; ?></textarea>
</td>
<?php
}
@@ -540,8 +547,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($i * $m_rows); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>"><?php echo $special_chars; ?></textarea>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($idindex); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>"><?php echo $special_chars; ?></textarea>
</td>
<?php
echo "\n";
@@ -563,7 +570,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
if (strlen($row_table_def['Type']) > 20) {
echo "\n";
?>
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3">
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3">
<option value=""></option>
<?php
echo "\n";
@@ -592,14 +599,14 @@ foreach($loop_array AS $vrowcount => $vrow) {
// Removes automatic MySQL escape format
$enum_atom = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $enum[$j]));
echo ' ';
echo '<input type="radio" name="field_' . md5($field) . $vkey . '[]" value="' . urlencode($enum_atom) . '" id="field_' . ($i*$m_rows) . '_3_' . $j . '" onclick="if (typeof(document.forms[\'insertForm\'].elements[\'fields_null' . str_replace('"', '\"', $vkey) . '[' . urlencode($field) . ']\']) != \'undefined\') {document.forms[\'insertForm\'].elements[\'fields_null' . str_replace('"', '\"', $vkey) . '[' . urlencode($field) .']\'].checked = false}"';
echo '<input type="radio" name="field_' . md5($field) . $vkey . '[]" value="' . urlencode($enum_atom) . '" id="field_' . ($idindex) . '_3_' . $j . '" onclick="if (typeof(document.forms[\'insertForm\'].elements[\'fields_null' . str_replace('"', '\"', $vkey) . '[' . urlencode($field) . ']\']) != \'undefined\') {document.forms[\'insertForm\'].elements[\'fields_null' . str_replace('"', '\"', $vkey) . '[' . urlencode($field) .']\'].checked = false}"';
if ($data == $enum_atom
|| ($data == '' && (!isset($primary_key) || $row_table_def['Null'] != 'YES')
&& isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {
echo ' checked="checked"';
}
echo 'tabindex="' . (($i * $m_rows) + 1) . '" />' . "\n";
echo ' <label for="field_' . ($i * $m_rows) . '_3_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
echo 'tabindex="' . ($tabindex + $tab3) . '" />' . "\n";
echo ' <label for="field_' . ($tabindex + $tab3) . '_3_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
} // end for
} // end else
@@ -625,7 +632,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
<?php echo $backup_field . "\n"; ?>
<input type="hidden" name="fields_type<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="set" />
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" />
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" size="<?php echo $size; ?>" multiple="multiple" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3">
<select name="field_<?php echo md5($field); ?><?php echo $vkey; ?>[]" size="<?php echo $size; ?>" multiple="multiple" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3">
<?php
echo "\n";
for ($j = 0; $j < $countset; $j++) {
@@ -667,8 +674,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($i*$m_rows); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" ><?php echo $special_chars; ?></textarea>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($idindex); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" ><?php echo $special_chars; ?></textarea>
<?php
} else {
@@ -682,7 +689,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
?>
<td bgcolor="<?php echo $bgcolor; ?>">
<?php echo $backup_field . "\n"; ?>
<input type="text" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3" />
<input type="text" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3" />
<?php
} // end if...elseif...else
@@ -691,7 +698,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
// (displayed whatever value the ProtectBinary has)
if ($is_upload && $is_blob) {
echo '<input type="file" name="fields_upload_' . urlencode($field) . $vkey . '" class="textfield" id="field_' . ($i * $m_rows) . '_3" size="10" />&nbsp;';
echo '<input type="file" name="fields_upload_' . urlencode($field) . $vkey . '" class="textfield" id="field_' . ($idindex) . '_3" size="10" />&nbsp;';
// find maximum upload size, based on field type
$max_field_sizes = array(
@@ -762,19 +769,19 @@ foreach($loop_array AS $vrowcount => $vrow) {
if ($is_char && isset($cfg['CharEditing']) && ($cfg['CharEditing'] == 'textarea')) {
echo "\n";
?>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['CharTextareaRows']; ?>" cols="<?php echo $cfg['CharTextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($i * $m_rows); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" ><?php echo $special_chars; ?></textarea>
<textarea name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" rows="<?php echo $cfg['CharTextareaRows']; ?>" cols="<?php echo $cfg['CharTextareaCols']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" id="field_<?php echo ($idindex); ?>_3"
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" ><?php echo $special_chars; ?></textarea>
<?php
} else {
echo "\n";
?>
<input type="text" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3" />
<input type="text" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo ($tabindex + $tab3); ?>" id="field_<?php echo ($idindex); ?>_3" />
<?php
if ($type == 'date' || $type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
?>
<script type="text/javascript">
<!--
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($i * $m_rows); ?>_3\', \'<?php echo substr($type, 0, 9)?>\')" <img class="calendar" src="images/button_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($idindex); ?>_3\', \'<?php echo substr($type, 0, 9)?>\')" <img class="calendar" src="images/button_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
//-->
</script>
<?php
@@ -803,9 +810,9 @@ foreach($loop_array AS $vrowcount => $vrow) {
<?php
if (isset($primary_key)) {
?>
<input type="radio" name="submit_type" value="<?php echo $strSave; ?>" id="radio_submit_type_save" checked="checked" tabindex="<?php echo ((3 * $fields_cnt) + 1); ?>" /><label for="radio_submit_type_save"><?php echo $strSave; ?></label><br />
<input type="radio" name="submit_type" value="<?php echo $strSave; ?>" id="radio_submit_type_save" checked="checked" tabindex="<?php echo ($tabindex + $tab3 + 1); ?>" /><label for="radio_submit_type_save"><?php echo $strSave; ?></label><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strOr; ?><br />
<input type="radio" name="submit_type" value="<?php echo $strInsertAsNewRow; ?>" id="radio_submit_type_insert_as_new_row" tabindex="<?php echo ((3 * $fields_cnt) + 2); ?>" /><label for="radio_submit_type_insert_as_new_row"><?php echo $strInsertAsNewRow; ?></label>
<input type="radio" name="submit_type" value="<?php echo $strInsertAsNewRow; ?>" id="radio_submit_type_insert_as_new_row" tabindex="<?php echo ($tabindex + $tab3 + 2); ?>" /><label for="radio_submit_type_insert_as_new_row"><?php echo $strInsertAsNewRow; ?></label>
<?php
} else {
echo "\n";
@@ -832,25 +839,25 @@ if (!empty($disp_message)) {
&nbsp;&nbsp;&nbsp;<b>-- <?php echo $strAnd; ?> --</b>&nbsp;&nbsp;&nbsp;
</td>
<td valign="middle" nowrap="nowrap">
<input type="radio" name="after_insert" value="back" id="radio_after_insert_back" <?php echo $checked_after_insert_back; ?> tabindex="<?php echo ((3 * $fields_cnt) + 3); ?>" />
<input type="radio" name="after_insert" value="back" id="radio_after_insert_back" <?php echo $checked_after_insert_back; ?> tabindex="<?php echo ($tabindex + $tab3 + 3); ?>" />
<label for="radio_after_insert_back"><?php echo $strAfterInsertBack; ?></label><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strOr; ?><br />
<input type="radio" name="after_insert" value="new_insert" id="radio_after_insert_new_insert"<?php echo $checked_after_insert_new_insert; ?> tabindex="<?php echo ((3 * $fields_cnt) + 4); ?>" />
<input type="radio" name="after_insert" value="new_insert" id="radio_after_insert_new_insert"<?php echo $checked_after_insert_new_insert; ?> tabindex="<?php echo ($tabindex + $tab3 + 4); ?>" />
<label for="radio_after_insert_new_insert"><?php echo $strAfterInsertNewInsert; ?></label><br />
<?php if (isset($primary_key)) { ?>
<?php if (isset($primary_key)) { ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strOr; ?><br />
<input type="radio" name="after_insert" value="same_insert" id="radio_after_insert_same_insert"<?php echo $checked_after_insert_new_insert; ?> tabindex="<?php echo ((3 * $fields_cnt) + 4); ?>" />
<input type="radio" name="after_insert" value="same_insert" id="radio_after_insert_same_insert"<?php echo $checked_after_insert_new_insert; ?> tabindex="<?php echo ($tabindex + $tab3+ 5); ?>" />
<label for="radio_after_insert_same_insert"><?php echo $strAfterInsertSame; ?></label>
<?php } ?>
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" align="right" valign="middle">
<input type="submit" value="<?php echo $strGo; ?>" tabindex="<?php echo ((3 * $fields_cnt) + 5); ?>" />
<input type="reset" value="<?php echo $strReset; ?>" tabindex="<?php echo ((3 * $fields_cnt) + 6); ?>" />
<input type="submit" value="<?php echo $strGo; ?>" tabindex="<?php echo ($tabindex + $tab3 + 6); ?>" />
<input type="reset" value="<?php echo $strReset; ?>" tabindex="<?php echo ($tabindex + $tab3 + 7); ?>" />
</td>
</tr>
</table>