Made tabindex/id of multi-edit table unique.
Restrict calendar to maximum values (and removed TABs from .js file)
This commit is contained in:
@@ -11,8 +11,12 @@ $Source$
|
|||||||
any (bug #943626).
|
any (bug #943626).
|
||||||
|
|
||||||
2004-04-28 Garvin Hicking <pma@supergarv.de>
|
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
|
* 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.
|
some debugging non-xhtml tags.
|
||||||
* css/phpmyadmin.css.php: Added zero margin/padding to nowrap element
|
* css/phpmyadmin.css.php: Added zero margin/padding to nowrap element
|
||||||
for compatibility to the good old nobr-tag
|
for compatibility to the good old nobr-tag
|
||||||
|
@@ -68,7 +68,7 @@ function unNullify(urlField, multi_edit)
|
|||||||
/**
|
/**
|
||||||
* Allows moving around inputs/select by Ctrl+arrows
|
* Allows moving around inputs/select by Ctrl+arrows
|
||||||
*
|
*
|
||||||
* @param object event data
|
* @param object event data
|
||||||
*/
|
*/
|
||||||
function onKeyDownArrowsHandler(e) {
|
function onKeyDownArrowsHandler(e) {
|
||||||
e = e||window.event;
|
e = e||window.event;
|
||||||
@@ -82,7 +82,7 @@ function onKeyDownArrowsHandler(e) {
|
|||||||
if (pos[0] != "field" || typeof pos[2] == "undefined") return;
|
if (pos[0] != "field" || typeof pos[2] == "undefined") return;
|
||||||
|
|
||||||
var x = pos[2], y=pos[1];
|
var x = pos[2], y=pos[1];
|
||||||
|
|
||||||
// skip non existent fields
|
// skip non existent fields
|
||||||
for (i=0; i<10; i++)
|
for (i=0; i<10; i++)
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ function onKeyDownArrowsHandler(e) {
|
|||||||
}
|
}
|
||||||
if (nO) break;
|
if (nO) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nO) return;
|
if (!nO) return;
|
||||||
nO.focus();
|
nO.focus();
|
||||||
if (nO.tagName != 'SELECT') {
|
if (nO.tagName != 'SELECT') {
|
||||||
@@ -129,8 +129,8 @@ var clock_set = 0;
|
|||||||
* @param string edit type - date/timestamp
|
* @param string edit type - date/timestamp
|
||||||
*/
|
*/
|
||||||
function openCalendar(params, form, field, type) {
|
function openCalendar(params, form, field, type) {
|
||||||
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
|
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
|
||||||
dateField = eval("document." + form + "." + field);
|
dateField = eval("document." + form + "." + field);
|
||||||
dateType = type;
|
dateType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,10 +139,33 @@ function openCalendar(params, form, field, type) {
|
|||||||
*
|
*
|
||||||
* @param int number to format.
|
* @param int number to format.
|
||||||
*/
|
*/
|
||||||
function formatNum2(i) {
|
function formatNum2(i, valtype) {
|
||||||
return (i < 10 ? '0' : '') + i;
|
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.
|
* Formats number to four digits.
|
||||||
*
|
*
|
||||||
@@ -156,7 +179,7 @@ function formatNum4(i) {
|
|||||||
* Initializes calendar window.
|
* Initializes calendar window.
|
||||||
*/
|
*/
|
||||||
function initCalendar() {
|
function initCalendar() {
|
||||||
if (!year && !month && !day) {
|
if (!year && !month && !day) {
|
||||||
/* Called for first time */
|
/* Called for first time */
|
||||||
if (window.opener.dateField.value) {
|
if (window.opener.dateField.value) {
|
||||||
value = window.opener.dateField.value;
|
value = window.opener.dateField.value;
|
||||||
@@ -164,7 +187,7 @@ function initCalendar() {
|
|||||||
if (window.opener.dateType == 'datetime') {
|
if (window.opener.dateType == 'datetime') {
|
||||||
parts = value.split(' ');
|
parts = value.split(' ');
|
||||||
value = parts[0];
|
value = parts[0];
|
||||||
|
|
||||||
if (parts[1]) {
|
if (parts[1]) {
|
||||||
time = parts[1].split(':');
|
time = parts[1].split(':');
|
||||||
hour = parseInt(time[0]);
|
hour = parseInt(time[0]);
|
||||||
@@ -197,30 +220,30 @@ function initCalendar() {
|
|||||||
minute = dt.getMinutes();
|
minute = dt.getMinutes();
|
||||||
second = dt.getSeconds();
|
second = dt.getSeconds();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Moving in calendar */
|
/* Moving in calendar */
|
||||||
if (month > 11) {
|
if (month > 11) {
|
||||||
month = 0;
|
month = 0;
|
||||||
year++;
|
year++;
|
||||||
}
|
}
|
||||||
if (month < 0) {
|
if (month < 0) {
|
||||||
month = 11;
|
month = 11;
|
||||||
year--;
|
year--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementById) {
|
if (document.getElementById) {
|
||||||
cnt = document.getElementById("calendar_data");
|
cnt = document.getElementById("calendar_data");
|
||||||
} else if (document.all) {
|
} else if (document.all) {
|
||||||
cnt = document.all["calendar_data"];
|
cnt = document.all["calendar_data"];
|
||||||
}
|
}
|
||||||
|
|
||||||
cnt.innerHTML = "";
|
cnt.innerHTML = "";
|
||||||
|
|
||||||
str = ""
|
str = ""
|
||||||
|
|
||||||
//heading table
|
//heading table
|
||||||
str += '<table class="calendar"><tr><th width="50%">';
|
str += '<table class="calendar"><tr><th width="50%">';
|
||||||
str += '<a href="#" onclick="month--; initCalendar();">«</a> ';
|
str += '<a href="#" onclick="month--; initCalendar();">«</a> ';
|
||||||
str += month_names[month];
|
str += month_names[month];
|
||||||
str += ' <a href="#" onclick="month++; initCalendar();">»</a>';
|
str += ' <a href="#" onclick="month++; initCalendar();">»</a>';
|
||||||
@@ -230,68 +253,68 @@ function initCalendar() {
|
|||||||
str += ' <a href="#" onclick="year++; initCalendar();">»</a>';
|
str += ' <a href="#" onclick="year++; initCalendar();">»</a>';
|
||||||
str += '</th></tr></table>';
|
str += '</th></tr></table>';
|
||||||
|
|
||||||
str += '<table class="calendar"><tr>';
|
str += '<table class="calendar"><tr>';
|
||||||
for (i = 0; i < 7; i++) {
|
for (i = 0; i < 7; i++) {
|
||||||
str += "<th>" + day_names[i] + "</th>";
|
str += "<th>" + day_names[i] + "</th>";
|
||||||
}
|
}
|
||||||
str += "</tr>";
|
str += "</tr>";
|
||||||
|
|
||||||
var firstDay = new Date(year, month, 1).getDay();
|
var firstDay = new Date(year, month, 1).getDay();
|
||||||
var lastDay = new Date(year, month + 1, 0).getDate();
|
var lastDay = new Date(year, month + 1, 0).getDate();
|
||||||
|
|
||||||
|
str += "<tr>";
|
||||||
|
|
||||||
|
dayInWeek = 0;
|
||||||
|
for (i = 0; i < firstDay; i++) {
|
||||||
|
str += "<td> </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> </td>";
|
|
||||||
dayInWeek++;
|
|
||||||
}
|
|
||||||
for (i = 1; i <= lastDay; i++) {
|
|
||||||
if (dayInWeek == 7) {
|
|
||||||
str += "</tr><tr>";
|
|
||||||
dayInWeek = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dispmonth = 1 + month;
|
dispmonth = 1 + month;
|
||||||
|
|
||||||
if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') {
|
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 {
|
} else {
|
||||||
actVal = "" + formatNum4(year) + formatNum2(dispmonth) + formatNum2(i);
|
actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day');
|
||||||
}
|
}
|
||||||
if (i == day) {
|
if (i == day) {
|
||||||
style = ' class="selected"';
|
style = ' class="selected"';
|
||||||
} else {
|
} else {
|
||||||
style = '';
|
style = '';
|
||||||
}
|
}
|
||||||
str += "<td" + style + "><a href='#' onclick='returnDate(\"" + actVal + "\");'>" + i + "</a></td>"
|
str += "<td" + style + "><a href='#' onclick='returnDate(\"" + actVal + "\");'>" + i + "</a></td>"
|
||||||
dayInWeek++;
|
dayInWeek++;
|
||||||
}
|
}
|
||||||
for (i = dayInWeek; i < 7; i++) {
|
for (i = dayInWeek; i < 7; i++) {
|
||||||
str += "<td> </td>";
|
str += "<td> </td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
str += "</tr></table>";
|
|
||||||
|
|
||||||
cnt.innerHTML = str;
|
str += "</tr></table>";
|
||||||
|
|
||||||
|
cnt.innerHTML = str;
|
||||||
|
|
||||||
// Should we handle time also?
|
// Should we handle time also?
|
||||||
if (window.opener.dateType != 'date' && !clock_set) {
|
if (window.opener.dateType != 'date' && !clock_set) {
|
||||||
|
|
||||||
if (document.getElementById) {
|
if (document.getElementById) {
|
||||||
cnt = document.getElementById("clock_data");
|
cnt = document.getElementById("clock_data");
|
||||||
} else if (document.all) {
|
} else if (document.all) {
|
||||||
cnt = document.all["clock_data"];
|
cnt = document.all["clock_data"];
|
||||||
}
|
}
|
||||||
|
|
||||||
str = '';
|
str = '';
|
||||||
str += '<form class="clock">';
|
str += '<form class="clock">';
|
||||||
str += '<input id="hour" type="text" size="2" maxlength="2" value="' + formatNum2(hour) + '" />:';
|
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" value="' + formatNum2(minute) + '" />:';
|
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" value="' + formatNum2(second) + '" />';
|
str += '<input id="second" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'second\')" value="' + formatNum2(second, 'second') + '" />';
|
||||||
str += '</form>';
|
str += '</form>';
|
||||||
|
|
||||||
cnt.innerHTML = str;
|
cnt.innerHTML = str;
|
||||||
clock_set = 1;
|
clock_set = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,13 +333,13 @@ function returnDate(d) {
|
|||||||
m = parseInt(document.getElementById('minute').value);
|
m = parseInt(document.getElementById('minute').value);
|
||||||
s = parseInt(document.getElementById('second').value);
|
s = parseInt(document.getElementById('second').value);
|
||||||
if (window.opener.dateType == 'datetime') {
|
if (window.opener.dateType == 'datetime') {
|
||||||
txt += ' ' + formatNum2(h) + ':' + formatNum2(m) + ':' + formatNum2(s);
|
txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second');
|
||||||
} else {
|
} else {
|
||||||
// timestamp
|
// timestamp
|
||||||
txt += formatNum2(h) + formatNum2(m) + formatNum2(s);
|
txt += formatNum2(h, 'hour') + formatNum2(m, 'minute') + formatNum2(s, 'second');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.opener.dateField.value = txt;
|
window.opener.dateField.value = txt;
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
@@ -205,7 +205,11 @@ while ($trow = PMA_DBI_fetch_assoc($table_def)) {
|
|||||||
$trow_table_def[] = $trow;
|
$trow_table_def[] = $trow;
|
||||||
}
|
}
|
||||||
|
|
||||||
$o_rows = 0;
|
$tabindex = 0;
|
||||||
|
$tab1 = +2;
|
||||||
|
$tab2 = +1;
|
||||||
|
$tab3 = 0;
|
||||||
|
$o_rows = 0;
|
||||||
foreach($loop_array AS $vrowcount => $vrow) {
|
foreach($loop_array AS $vrowcount => $vrow) {
|
||||||
if ($vrow === FALSE) {
|
if ($vrow === FALSE) {
|
||||||
unset($vrow);
|
unset($vrow);
|
||||||
@@ -381,6 +385,9 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
$backup_field = '';
|
$backup_field = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$idindex = ($o_rows * $fields_cnt) + $i + 1;
|
||||||
|
$tabindex = (($idindex - 1) * 3) + 1;
|
||||||
|
|
||||||
// The function column
|
// The function column
|
||||||
// -------------------
|
// -------------------
|
||||||
// Change by Bernard M. Piller <bernard@bmpsystems.com>
|
// Change by Bernard M. Piller <bernard@bmpsystems.com>
|
||||||
@@ -397,7 +404,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<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>
|
<option></option>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -466,13 +473,13 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
|
echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
|
||||||
if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary))
|
if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary))
|
||||||
&& $row_table_def['Null'] == 'YES') {
|
&& $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) . ']"';
|
. ' name="fields_null' . $vkey . '[' . urlencode($field) . ']"';
|
||||||
//if ($data == 'NULL' && !$first_timestamp) {
|
//if ($data == 'NULL' && !$first_timestamp) {
|
||||||
if ($real_null_value && !$first_timestamp) {
|
if ($real_null_value && !$first_timestamp) {
|
||||||
echo ' checked="checked"';
|
echo ' checked="checked"';
|
||||||
}
|
}
|
||||||
echo ' id="field_' . ($i * $m_rows) . '_2"';
|
echo ' id="field_' . ($idindex) . '_2"';
|
||||||
$onclick = ' onclick="if (this.checked) {nullify(';
|
$onclick = ' onclick="if (this.checked) {nullify(';
|
||||||
if (strstr($row_table_def['True_Type'], 'enum')) {
|
if (strstr($row_table_def['True_Type'], 'enum')) {
|
||||||
if (strlen($row_table_def['Type']) > 20) {
|
if (strlen($row_table_def['Type']) > 20) {
|
||||||
@@ -504,8 +511,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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_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="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 (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $mrows); ?>_3" value="<?php echo htmlspecialchars($data); ?>" />
|
<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">
|
<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); ?>&field=<?php echo urlencode($field) . $browse_foreigners_uri; ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>');
|
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); ?>&field=<?php echo urlencode($field) . $browse_foreigners_uri; ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>');
|
||||||
</script>
|
</script>
|
||||||
@@ -516,8 +523,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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_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" />
|
<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 (($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">
|
||||||
<?php echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, 100); ?>
|
<?php echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, 100); ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@@ -531,8 +538,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" align="right" bgcolor="<?php echo $bgcolor; ?>">
|
<td colspan="4" align="right" bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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"
|
<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 (($i * $m_rows) + 1); ?>"><?php echo $special_chars; ?></textarea>
|
<?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>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -540,8 +547,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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"
|
<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 (($i * $m_rows) + 1); ?>"><?php echo $special_chars; ?></textarea>
|
<?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>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -563,7 +570,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
if (strlen($row_table_def['Type']) > 20) {
|
if (strlen($row_table_def['Type']) > 20) {
|
||||||
echo "\n";
|
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>
|
<option value=""></option>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -592,14 +599,14 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
// Removes automatic MySQL escape format
|
// Removes automatic MySQL escape format
|
||||||
$enum_atom = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $enum[$j]));
|
$enum_atom = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $enum[$j]));
|
||||||
echo ' ';
|
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
|
if ($data == $enum_atom
|
||||||
|| ($data == '' && (!isset($primary_key) || $row_table_def['Null'] != 'YES')
|
|| ($data == '' && (!isset($primary_key) || $row_table_def['Null'] != 'YES')
|
||||||
&& isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {
|
&& isset($row_table_def['Default']) && $enum_atom == $row_table_def['Default'])) {
|
||||||
echo ' checked="checked"';
|
echo ' checked="checked"';
|
||||||
}
|
}
|
||||||
echo 'tabindex="' . (($i * $m_rows) + 1) . '" />' . "\n";
|
echo 'tabindex="' . ($tabindex + $tab3) . '" />' . "\n";
|
||||||
echo ' <label for="field_' . ($i * $m_rows) . '_3_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
|
echo ' <label for="field_' . ($tabindex + $tab3) . '_3_' . $j . '">' . htmlspecialchars($enum_atom) . '</label>' . "\n";
|
||||||
} // end for
|
} // end for
|
||||||
|
|
||||||
} // end else
|
} // end else
|
||||||
@@ -625,7 +632,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
<?php echo $backup_field . "\n"; ?>
|
<?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_type<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="set" />
|
||||||
<input type="hidden" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="" />
|
<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
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
for ($j = 0; $j < $countset; $j++) {
|
for ($j = 0; $j < $countset; $j++) {
|
||||||
@@ -667,8 +674,8 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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"
|
<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 (($i * $m_rows) + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
<?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
|
<?php
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -682,7 +689,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?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
|
<?php
|
||||||
} // end if...elseif...else
|
} // end if...elseif...else
|
||||||
|
|
||||||
@@ -691,7 +698,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
// (displayed whatever value the ProtectBinary has)
|
// (displayed whatever value the ProtectBinary has)
|
||||||
|
|
||||||
if ($is_upload && $is_blob) {
|
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" /> ';
|
echo '<input type="file" name="fields_upload_' . urlencode($field) . $vkey . '" class="textfield" id="field_' . ($idindex) . '_3" size="10" /> ';
|
||||||
|
|
||||||
// find maximum upload size, based on field type
|
// find maximum upload size, based on field type
|
||||||
$max_field_sizes = array(
|
$max_field_sizes = array(
|
||||||
@@ -762,19 +769,19 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
if ($is_char && isset($cfg['CharEditing']) && ($cfg['CharEditing'] == 'textarea')) {
|
if ($is_char && isset($cfg['CharEditing']) && ($cfg['CharEditing'] == 'textarea')) {
|
||||||
echo "\n";
|
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"
|
<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 (($i * $m_rows) + 1); ?>" ><?php echo $special_chars; ?></textarea>
|
<?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
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo "\n";
|
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
|
<?php
|
||||||
if ($type == 'date' || $type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
|
if ($type == 'date' || $type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<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>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
@@ -803,9 +810,9 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
|||||||
<?php
|
<?php
|
||||||
if (isset($primary_key)) {
|
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 />
|
||||||
<?php echo $strOr; ?><br />
|
<?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
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -832,25 +839,25 @@ if (!empty($disp_message)) {
|
|||||||
<b>-- <?php echo $strAnd; ?> --</b>
|
<b>-- <?php echo $strAnd; ?> --</b>
|
||||||
</td>
|
</td>
|
||||||
<td valign="middle" nowrap="nowrap">
|
<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 />
|
<label for="radio_after_insert_back"><?php echo $strAfterInsertBack; ?></label><br />
|
||||||
|
|
||||||
<?php echo $strOr; ?><br />
|
<?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 />
|
<label for="radio_after_insert_new_insert"><?php echo $strAfterInsertNewInsert; ?></label><br />
|
||||||
|
|
||||||
<?php if (isset($primary_key)) { ?>
|
<?php if (isset($primary_key)) { ?>
|
||||||
<?php echo $strOr; ?><br />
|
<?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>
|
<label for="radio_after_insert_same_insert"><?php echo $strAfterInsertSame; ?></label>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" align="right" valign="middle">
|
<td colspan="3" align="right" valign="middle">
|
||||||
<input type="submit" value="<?php echo $strGo; ?>" tabindex="<?php echo ((3 * $fields_cnt) + 5); ?>" />
|
<input type="submit" value="<?php echo $strGo; ?>" tabindex="<?php echo ($tabindex + $tab3 + 6); ?>" />
|
||||||
<input type="reset" value="<?php echo $strReset; ?>" tabindex="<?php echo ((3 * $fields_cnt) + 6); ?>" />
|
<input type="reset" value="<?php echo $strReset; ?>" tabindex="<?php echo ($tabindex + $tab3 + 7); ?>" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user