2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
12 PMA_checkParameters(array('db', 'table', 'action', 'num_fields'));
15 // Get available character sets and storage engines
16 require_once './libraries/mysql_charsets.lib.php';
17 require_once './libraries/StorageEngine.class.php';
19 if (is_int($cfg['DefaultPropDisplay'])) {
20 if ($num_fields <= $cfg['DefaultPropDisplay']) {
21 $display_type = 'vertical';
23 $display_type = 'horizontal';
26 $display_type = $cfg['DefaultPropDisplay'];
29 if ($cfg['CtrlArrowsMoving']) {
31 <script src
="./js/keyhandler.js" type
="text/javascript"></script
>
32 <script type
="text/javascript">
34 var switch_movement
= <?php
echo $display_type == 'horizontal' ?
'0' : '1'; ?
>;
35 document
.onkeydown
= onKeyDownArrowsHandler
;
40 // here, the div_x_7 represents a div id which contains
41 // the default CURRENT TIMESTAMP checkbox and label
42 // and, field_x_7a represents the checkbox itself
44 if (PMA_MYSQL_INT_VERSION
>= 40102) {
46 <script type
="text/javascript">
48 function display_field_options(field_type
, i
) {
49 if (field_type
== 'TIMESTAMP') {
50 getElement('div_' + i +
'_7').style
.display
= 'block';
52 getElement('div_' + i +
'_7').style
.display
= 'none';
53 getElement('field_' + i +
'_7a').checked
= false;
61 <form method
="post" action
="<?php echo $action; ?>">
63 echo PMA_generate_common_hidden_inputs($db, $table);
64 if ($action == 'tbl_create.php') {
66 <input type
="hidden" name
="reload" value
="1" />
68 } elseif ($action == 'tbl_addfield.php') {
70 <input type
="hidden" name
="field_where" value
="<?php echo $field_where; ?>" />
71 <input type
="hidden" name
="after_field" value
="<?php echo $after_field; ?>" />
75 if (isset($num_fields)) {
77 <input type
="hidden" name
="orig_num_fields" value
="<?php echo $num_fields; ?>" />
81 if (isset($field_where)) {
83 <input type
="hidden" name
="orig_field_where" value
="<?php echo $field_where; ?>" />
87 if (isset($after_field)) {
89 <input type
="hidden" name
="orig_after_field" value
="<?php echo $after_field; ?>" />
93 if (isset($selected) && is_array($selected)) {
94 foreach ($selected AS $o_fld_nr => $o_fld_val) {
96 <input type
="hidden" name
="selected[<?php echo $o_fld_nr; ?>]" value
="<?php echo urlencode($o_fld_val); ?>" />
98 if (!isset($true_selected)) {
100 <input type
="hidden" name
="true_selected[<?php echo $o_fld_nr; ?>]" value
="<?php echo urlencode($o_fld_val); ?>" />
106 if (isset($true_selected) && is_array($true_selected)) {
107 foreach ($true_selected AS $o_fld_nr => $o_fld_val) {
109 <input type
="hidden" name
="true_selected[<?php echo $o_fld_nr; ?>]" value
="<?php echo urlencode($o_fld_val); ?>" />
114 } elseif (isset($field)) {
116 <input type
="hidden" name
="orig_field" value
="<?php echo urlencode($field); ?>" />
117 <input type
="hidden" name
="true_selected[] value="<?php
echo (isset($orig_field) ?
$orig_field : urlencode($field)); ?
>" />
121 $is_backup = ($action != 'tbl_create.php' && $action != 'tbl_addfield.php');
123 $header_cells = array();
124 $content_cells = array();
126 $header_cells[] = $strField;
127 $header_cells[] = $strType . ($GLOBALS['cfg']['ReplaceHelpImg'] ? PMA_showMySQLDocu('SQL-Syntax', 'data-types') : '<br /><span style="font
-weight
: normal
">' . PMA_showMySQLDocu('SQL-Syntax', 'data-types') . '</span>');
128 $header_cells[] = $strLengthSet . '<sup>1</sup>';
129 if (PMA_MYSQL_INT_VERSION >= 40100) {
130 $header_cells[] = $strCollation;
132 $header_cells[] = $strAttr;
133 $header_cells[] = $strNull;
134 $header_cells[] = $strDefault . '<sup>2</sup>';
135 $header_cells[] = $strExtra;
139 // lem9: We could remove this 'if' and let the key information be shown and
140 // editable. However, for this to work, tbl_alter must be modified to use the
141 // key fields, as tbl_addfield does.
144 $header_cells[] = $cfg['PropertiesIconic'] ? '<img class="icon
" src="' . $pmaThemeImage . 'b_primary
.png
" width="16" height="16" alt="' . $strPrimary . '" title="' . $strPrimary . '" />' : $strPrimary;
145 $header_cells[] = $cfg['PropertiesIconic'] ? '<img class="icon
" src="' . $pmaThemeImage . 'b_index
.png
" width="16" height="16" alt="' . $strIndex . '" title="' . $strIndex . '" />' : $strIndex;
146 $header_cells[] = $cfg['PropertiesIconic'] ? '<img class="icon
" src="' . $pmaThemeImage . 'b_unique
.png
" width="16" height="16" alt="' . $strUnique . '" title="' . $strUnique . '" />' : $strUnique;
147 $header_cells[] = '---';
148 $header_cells[] = $cfg['PropertiesIconic'] ? '<img class="icon
" src="' . $pmaThemeImage . 'b_ftext
.png
" width="16" height="16" alt="' . $strIdxFulltext . '" title="' . $strIdxFulltext . '" />' : $strIdxFulltext;
151 require_once './libraries/relation.lib.php';
152 require_once './libraries/transformations.lib.php';
153 $cfgRelation = PMA_getRelationsParam();
155 $comments_map = array();
157 $available_mime = array();
159 if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) {
160 $comments_map = PMA_getComments($db, $table);
161 $header_cells[] = $strComments;
163 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
164 $mime_map = PMA_getMIME($db, $table);
165 $available_mime = PMA_getAvailableMIMEtypes();
167 $header_cells[] = $strMIME_MIMEtype;
168 $header_cells[] = $strMIME_transformation;
169 $header_cells[] = $strMIME_transformation_options . '<sup>3</sup>';
173 // garvin: workaround for field_fulltext, because its submitted indizes contain
174 // the index as a value, not a key. Inserted here for easier maintaineance
175 // and less code to change in existing files.
176 if (isset($field_fulltext) && is_array($field_fulltext)) {
177 foreach ($field_fulltext AS $fulltext_nr => $fulltext_indexkey) {
178 $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
182 for ($i = 0 ; $i <= $num_fields; $i++) {
183 $submit_null = FALSE;
184 if (isset($regenerate) && $regenerate == TRUE) {
185 // An error happened with previous inputs, so we will restore the data
186 // to embed it once again in this form.
188 $row['Field'] = (isset($field_name) && isset($field_name[$i]) ? $field_name[$i] : FALSE);
189 $row['Type'] = (isset($field_type) && isset($field_type[$i]) ? $field_type[$i] : FALSE);
190 if (PMA_MYSQL_INT_VERSION >= 40100) {
191 $row['Collation'] = (isset($field_collation) && isset($field_collation[$i]) ? $field_collation[$i] : '');
193 $row['Null'] = (isset($field_null) && isset($field_null[$i]) ? $field_null[$i] : '');
194 if (isset($field_type[$i]) && $row['Null'] == '') {
198 if (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'primary_' . $i) {
200 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'index_' . $i) {
202 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'unique_' . $i) {
208 $row['Default'] = (isset($field_default) && isset($field_default[$i]) ? $field_default[$i] : FALSE);
209 $row['Extra'] = (isset($field_extra) && isset($field_extra[$i]) ? $field_extra[$i] : FALSE);
210 $row['Comment'] = (isset($submit_fulltext) && isset($submit_fulltext[$i]) && ($submit_fulltext[$i] == $i) ? 'FULLTEXT' : FALSE);
212 $submit_length = (isset($field_length) && isset($field_length[$i]) ? $field_length[$i] : FALSE);
213 $submit_attribute = (isset($field_attribute) && isset($field_attribute[$i]) ? $field_attribute[$i] : FALSE);
215 $submit_default_current_timestamp = (isset($field_default_current_timestamp) && isset($field_default_current_timestamp[$i]) ? TRUE : FALSE);
217 if (isset($field_comments) && isset($field_comments[$i])) {
218 $comments_map[$row['Field']] = $field_comments[$i];
221 if (isset($field_mimetype) && isset($field_mimetype[$i])) {
222 $mime_map[$row['Field']]['mimetype'] = $field_mimetype[$i];
225 if (isset($field_transformation) && isset($field_transformation[$i])) {
226 $mime_map[$row['Field']]['transformation'] = $field_transformation[$i];
229 if (isset($field_transformation_options) && isset($field_transformation_options[$i])) {
230 $mime_map[$row['Field']]['transformation_options'] = $field_transformation_options[$i];
233 } elseif (isset($fields_meta) && isset($fields_meta[$i])) {
234 $row = $fields_meta[$i];
237 // Cell index: If certain fields get left out, the counter shouldn't chage.
239 // Everytime a cell shall be left out the STRG-jumping feature, $ci_offset
240 // has to be incremented ($ci_offset++)
244 $backup_field = (isset($true_selected) && isset($true_selected[$i]) && $true_selected[$i] ? $true_selected[$i] : (isset($row) && isset($row['Field']) ? urlencode($row['Field']) : ''));
245 $content_cells[$i][$ci] = "\n
" . '<input type="hidden
" name="field_orig
[]" value="' . $backup_field . '" />' . "\n
";
247 $content_cells[$i][$ci] = '';
250 $content_cells[$i][$ci] .= "\n
" . '<input id="field_
' . $i . '_
' . ($ci - $ci_offset) . '" type="text
" name="field_name
[]" size="10" maxlength="64" value="' . (isset($row) && isset($row['Field
']) ? str_replace('"', '"', $row['Field']) : '') . '" class="textfield" title
="' . $strField . '" />';
252 $content_cells[$i][$ci] = '<select name
="field_type[]" id
="field_' . $i . '_' . ($ci - $ci_offset) . '" ';
253 if (PMA_MYSQL_INT_VERSION >= 40102) {
254 $content_cells[$i][$ci] .= 'onchange
="display_field_options(this.options[this.selectedIndex].value,' . $i .')" ';
256 $content_cells[$i][$ci] .= '>' . "\n";
258 if (empty($row['Type
'])) {
262 $type = $row['Type
'];
264 // set or enum types: slashes single quotes inside options
265 if (preg_match('@^
(set|enum
)\
((.+
)\
)$@i
', $type, $tmp)) {
267 $length = substr(preg_replace('@([^
,])\'\'@', '\\
1\\\'', ',' . $tmp[2]), 1);
269 // strip the "BINARY" attribute, except if we find "BINARY(" because
270 // this would be a BINARY or VARBINARY field type
271 $type = preg_replace('@BINARY
([^\
(])@i
', '', $type);
272 $type = preg_replace('@ZEROFILL@i
', '', $type);
273 $type = preg_replace('@UNSIGNED@i
', '', $type);
275 if (strpos($type, '(')) {
276 $length = chop(substr($type, (strpos($type, '(') + 1), (strpos($type, ')') - strpos($type, '(') - 1)));
277 $type = chop(substr($type, 0, strpos($type, '(')));
283 // some types, for example longtext, are reported as
284 // "longtext character set latin7" when their charset and / or collation
285 // differs from the ones of the corresponding database.
286 if (PMA_MYSQL_INT_VERSION >= 40100) {
287 $tmp = strpos($type, 'character set
');
289 $type = substr($type, 0, $tmp-1);
293 if (isset($submit_length) && $submit_length != FALSE) {
294 $length = $submit_length;
297 // rtrim the type, for cases like "float unsigned"
298 $type = rtrim($type);
299 $type_upper = strtoupper($type);
301 $cnt_column_types = count($cfg['ColumnTypes
']);
302 for ($j = 0; $j < $cnt_column_types; $j++) {
303 $content_cells[$i][$ci] .= ' <option value
="'. $cfg['ColumnTypes'][$j] . '"';
304 if ($type_upper == strtoupper($cfg['ColumnTypes
'][$j])) {
305 $content_cells[$i][$ci] .= ' selected
="selected"';
307 $content_cells[$i][$ci] .= '>' . $cfg['ColumnTypes
'][$j] . '</option
>' . "\n";
310 $content_cells[$i][$ci] .= ' </select
>';
314 $content_cells[$i][$ci] = "\n" . '<input type
="hidden" name
="field_length_orig[]" value
="' . urlencode($length) . '" />';
316 $content_cells[$i][$ci] = '';
319 if (preg_match('@^
(set|enum
)$@i
', $type)) {
323 $length_to_display = htmlspecialchars($length);
325 $length_to_display = $length;
326 if (!preg_match('@BINARY
[\
(]@i
', $row['Type
']) && PMA_MYSQL_INT_VERSION < 40100) {
327 $binary = stristr($row['Type
'], 'binary
');
331 $unsigned = stristr($row['Type
'], 'unsigned
');
332 $zerofill = stristr($row['Type
'], 'zerofill
');
335 $content_cells[$i][$ci] .= "\n" . '<input id
="field_' . $i . '_' . ($ci - $ci_offset) . '" type
="text" name
="field_length[]" size
="8" value
="' . str_replace('"', '"
;', $length_to_display) . '" class="textfield
" />' . "\n
";
338 if (PMA_MYSQL_INT_VERSION >= 40100) {
339 $tmp_collation = empty($row['Collation']) ? null : $row['Collation'];
340 $content_cells[$i][$ci] = PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[]', 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, FALSE);
341 unset($tmp_collation);
345 $content_cells[$i][$ci] = '<select style="font
-size
: 70%
;" name="field_attribute
[]" id="field_
' . $i . '_
' . ($ci - $ci_offset) . '">' . "\n
";
349 $attribute = 'BINARY';
352 $attribute = 'UNSIGNED';
355 $attribute = 'UNSIGNED ZEROFILL';
358 if (isset($submit_attribute) && $submit_attribute != FALSE) {
359 $attribute = $submit_attribute;
362 // here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the
363 // NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
365 if (isset($row['Field'])
366 && isset($analyzed_sql[0])
367 && isset($analyzed_sql[0]['create_table_fields'])
368 && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['type'])
369 && $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP'
370 && $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null'] == true) {
374 // MySQL 4.1.2+ TIMESTAMP options
375 // (if on_update_current_timestamp is set, then it's TRUE)
376 if (isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) {
377 $attribute = 'ON UPDATE CURRENT_TIMESTAMP';
379 if ((isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp']))
380 || (isset($submit_default_current_timestamp) && $submit_default_current_timestamp)) {
381 $default_current_timestamp = TRUE;
383 $default_current_timestamp = FALSE;
386 // Dynamically add ON UPDATE CURRENT_TIMESTAMP to the possible attributes
387 if (PMA_MYSQL_INT_VERSION >= 40102 && !in_array('ON UPDATE CURRENT_TIMESTAMP', $cfg['AttributeTypes'])) {
388 $cfg['AttributeTypes'][] = 'ON UPDATE CURRENT_TIMESTAMP';
392 $cnt_attribute_types = count($cfg['AttributeTypes']);
393 for ($j = 0;$j < $cnt_attribute_types; $j++) {
394 if (PMA_MYSQL_INT_VERSION >= 40100 && $cfg['AttributeTypes'][$j] == 'BINARY') {
397 $content_cells[$i][$ci] .= ' <option value="'. $cfg['AttributeTypes
'][$j] . '"';
398 if (strtoupper($attribute) == strtoupper($cfg['AttributeTypes'][$j])) {
399 $content_cells[$i][$ci] .= ' selected="selected
"';
401 $content_cells[$i][$ci] .= '>' . $cfg['AttributeTypes'][$j] . '</option>' . "\n
";
404 $content_cells[$i][$ci] .= '</select>';
407 $content_cells[$i][$ci] = '<select name="field_null
[]" id="field_
' . $i . '_
' . ($ci - $ci_offset) . '">';
409 if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NO' || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) {
410 $content_cells[$i][$ci] .= "\n
";
411 $content_cells[$i][$ci] .= ' <option value="NOT
NULL" selected="selected
" >not null</option>' . "\n
";
412 $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n
";
414 $content_cells[$i][$ci] .= "\n
";
415 $content_cells[$i][$ci] .= ' <option value="" selected="selected
" >null</option>' . "\n
";
416 $content_cells[$i][$ci] .= ' <option value="NOT
NULL">not null</option>' . "\n
";
419 $content_cells[$i][$ci] .= "\n
" . '</select>';
423 && !isset($row['Default']) && isset($row['Null']) && $row['Null'] == 'YES') {
424 $row['Default'] = 'NULL';
428 $content_cells[$i][$ci] = "\n
" . '<input type="hidden
" name="field_default_orig
[]" size="8" value="' . (isset($row) && isset($row['Default']) ? urlencode($row['Default']) : '') . '" />';
430 $content_cells[$i][$ci] = "\n
";
433 // for a TIMESTAMP, do not show CURRENT_TIMESTAMP as a default value
434 if (PMA_MYSQL_INT_VERSION >= 40102
435 && $type_upper == 'TIMESTAMP'
436 && $default_current_timestamp
438 && isset($row['Default'])) {
439 $row['Default'] = '';
442 $content_cells[$i][$ci] .= '<input id="field_
' . $i . '_
' . ($ci - $ci_offset) . '" type="text
" name="field_default
[]" size="12" value="' . (isset($row) && isset($row['Default']) ? str_replace('"', '"', $row['Default']) : '') . '" class="textfield" />';
443 if (PMA_MYSQL_INT_VERSION >= 40102) {
444 if ($type_upper == 'TIMESTAMP
') {
445 $tmp_display_type = 'block
';
447 $tmp_display_type = 'none
';
448 $default_current_timestamp = FALSE;
450 $content_cells[$i][$ci] .= '<br
/><div id
="div_' . $i . '_' . ($ci - $ci_offset) . '" style
="white-space: nowrap; display: ' . $tmp_display_type . '"><input id
="field_' . $i . '_' . ($ci - $ci_offset) . 'a" type
="checkbox" name
="field_default_current_timestamp[' . $i . ']"';
451 if ($default_current_timestamp) {
452 $content_cells[$i][$ci] .= ' checked
="checked" ';
454 $content_cells[$i][$ci] .= ' /><label
for="field_' . $i . '_' . ($ci - $ci_offset) . 'a" style
="font-size: 70%;">CURRENT_TIMESTAMP
</label
></div
>';
458 $content_cells[$i][$ci] = '<select name
="field_extra[]" id
="field_' . $i . '_' . ($ci - $ci_offset) . '">';
460 if (!isset($row) || empty($row['Extra
'])) {
461 $content_cells[$i][$ci] .= "\n";
462 $content_cells[$i][$ci] .= '<option value
=""> 
;</option
>' . "\n";
463 $content_cells[$i][$ci] .= '<option value
="AUTO_INCREMENT">auto_increment
</option
>' . "\n";
465 $content_cells[$i][$ci] .= "\n";
466 $content_cells[$i][$ci] .= '<option value
="AUTO_INCREMENT">auto_increment
</option
>' . "\n";
467 $content_cells[$i][$ci] .= '<option value
=""> 
;</option
>' . "\n";
470 $content_cells[$i][$ci] .= "\n" . '</select
>';
474 // lem9: See my other comment about removing this 'if'.
476 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'PRI
') {
477 $checked_primary = ' checked
="checked"';
479 $checked_primary = '';
481 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'MUL
') {
482 $checked_index = ' checked
="checked"';
486 if (isset($row) && isset($row['Key
']) && $row['Key
'] == 'UNI
') {
487 $checked_unique = ' checked
="checked"';
489 $checked_unique = '';
491 if (empty($checked_primary)
492 && empty($checked_index)
493 && empty($checked_unique)) {
494 $checked_none = ' checked
="checked"';
499 if ((isset($row) && isset($row['Comment
']) && $row['Comment
'] == 'FULLTEXT
')) {
500 $checked_fulltext = ' checked
="checked"';
502 $checked_fulltext = '';
505 $content_cells[$i][$ci] = "\n" . '<input type
="radio" name
="field_key_' . $i . '" value
="primary_' . $i . '"' . $checked_primary . ' title
="' . $strPrimary . '" />';
508 $content_cells[$i][$ci] = "\n" . '<input type
="radio" name
="field_key_' . $i . '" value
="index_' . $i . '"' . $checked_index . ' title
="' . $strIndex . '" />';
511 $content_cells[$i][$ci] = "\n" . '<input type
="radio" name
="field_key_' . $i . '" value
="unique_' . $i . '"' . $checked_unique . ' title
="' . $strUnique . '" />';
514 $content_cells[$i][$ci] = "\n" . '<input type
="radio" name
="field_key_' . $i . '" value
="none_' . $i . '"' . $checked_none . ' title
="---" />';
517 $content_cells[$i][$ci] = '<input type
="checkbox" name
="field_fulltext[]" value
="' . $i . '"' . $checked_fulltext . ' title
="' . $strIdxFulltext . '" />';
519 } // end if ($action ==...)
522 if ($cfgRelation['commwork
'] || PMA_MYSQL_INT_VERSION >= 40100) {
523 $content_cells[$i][$ci] = '<input id
="field_' . $i . '_' . ($ci - $ci_offset) . '" type
="text" name
="field_comments[]" size
="12" value
="' . (isset($row) && isset($row['Field']) && is_array($comments_map) && isset($comments_map[$row['Field']]) ? htmlspecialchars($comments_map[$row['Field']]) : '') . '" class="textfield" />';
527 // garvin: MIME-types
528 if ($cfgRelation['mimework
'] && $cfg['BrowseMIME
'] && $cfgRelation['commwork
']) {
529 $content_cells[$i][$ci] = '<select id
="field_' . $i . '_' . ($ci - $ci_offset) . '" size
="1" name
="field_mimetype[]">' . "\n";
530 $content_cells[$i][$ci] .= ' <option value
=""> 
;</option
>' . "\n";
532 if (is_array($available_mime['mimetype
'])) {
533 foreach ($available_mime['mimetype
'] AS $mimekey => $mimetype) {
534 $checked = (isset($row) && isset($row['Field
']) && isset($mime_map[$row['Field
']]['mimetype
']) && ($mime_map[$row['Field
']]['mimetype
'] == str_replace('/', '_
', $mimetype)) ? 'selected
' : '');
535 $content_cells[$i][$ci] .= ' <option value
="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option
>';
539 $content_cells[$i][$ci] .= '</select
>';
542 $content_cells[$i][$ci] = '<select id
="field_' . $i . '_' . ($ci - $ci_offset) . '" size
="1" name
="field_transformation[]">' . "\n";
543 $content_cells[$i][$ci] .= ' <option value
="" title
="' . $strNone . '"></option
>' . "\n";
544 if (is_array($available_mime['transformation
'])) {
545 foreach ($available_mime['transformation
'] AS $mimekey => $transform) {
546 $checked = (isset($row) && isset($row['Field
']) && isset($mime_map[$row['Field
']]['transformation
']) && (preg_match('@' . preg_quote($available_mime['transformation_file
'][$mimekey]) . '3?@i
', $mime_map[$row['Field
']]['transformation
'])) ? 'selected
' : '');
547 $tooltip = 'strTransformation_
' . strtolower(preg_replace('@(\
.inc\
.php3?
)$
@', '', $available_mime['transformation_file
'][$mimekey]));
548 $tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br
/>', ' ', $strMIME_nodescription), 'PMA_transformation_
' . $tooltip . '()');
549 $content_cells[$i][$ci] .= '<option value
="' . $available_mime['transformation_file'][$mimekey] . '" ' . $checked . ' title
="' . htmlspecialchars($tooltip) . '">' . htmlspecialchars($transform) . '</option
>' . "\n";
553 $content_cells[$i][$ci] .= '</select
>';
556 $content_cells[$i][$ci] = '<input id
="field_' . $i . '_' . ($ci - $ci_offset) . '" type
="text" name
="field_transformation_options[]" size
="16" value
="' . (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation_options']) ? htmlspecialchars($mime_map[$row['Field']]['transformation_options']) : '') . '" class="textfield" />';
561 if (is_array($content_cells) && is_array($header_cells)) {
562 // last row is for javascript insert
563 $empty_row = array_pop($content_cells);
565 echo '<table id
="table_columns">';
566 if ($display_type == 'horizontal
') {
569 <?php foreach ($header_cells as $header_val) { ?>
570 <th><?php echo $header_val; ?></th>
576 foreach ($content_cells as $content_row) {
577 echo '<tr
class="' . ($odd_row ? 'odd' : 'even') . ' noclick">';
578 $odd_row = ! $odd_row;
580 if (is_array($content_row)) {
581 foreach ($content_row as $content_row_val) {
583 <td align="center"><?php echo $content_row_val; ?></td>
592 foreach ($header_cells as $header_val) {
593 echo '<tr
class="' . ($odd_row ? 'odd' : 'even') . ' noclick">';
594 $odd_row = ! $odd_row;
596 <th><?php echo $header_val; ?></th>
598 foreach ($content_cells as $content_cell) {
599 if (isset($content_cell[$i]) && $content_cell[$i] != '') {
601 <td><?php echo $content_cell[$i]; ?></td>
616 * needs to be finished
619 if ($display_type == 'horizontal
') {
621 foreach ($empty_row as $content_row_val) {
622 $new_field .= '<td align
="center">' . $content_row_val . '</td
>';
625 <script type="text/javascript">
627 var odd_row = <?php echo $odd_row; ?>;
629 function addField() {
630 var new_fields = document.getElementById('added_fields
').value;
631 var new_field_container = document.getElementById('table_columns
');
632 var new_field = '<?php
echo preg_replace('�\s+�', ' ', preg_replace('�\'�', '\\\'', $new_field)); ?
>';
634 for (i = 0; i < new_fields; i++) {
636 new_field_container.innerHTML += '<tr
class="odd">' + new_field + '</tr
>';
638 new_field_container.innerHTML += '<tr
class="even">' + new_field + '</tr
>';
651 if ($action == 'tbl_create
.php
') {
655 <th><?php echo $strTableComments; ?>: </th>
656 <td width="25"> </td>
657 <th><?php echo $strStorageEngine; ?>: <?php echo PMA_showMySQLDocu('Storage_engines
', 'Storage_engines
'); ?>
660 if (PMA_MYSQL_INT_VERSION >= 40100) {
661 echo ' <td width
="25"> 
;</td
>' . "\n"
662 . ' <th
>' . $strCollation . ': 
;</th
>' . "\n";
666 <tr><td><input type="text" name="comment" size="40" maxlength="80"
667 value="<?php echo (isset($comment) ? $comment : ''); ?>"
670 <td width="25"> </td>
672 <?php echo PMA_StorageEngine::getHtmlSelect('tbl_type
', null, (isset($GLOBALS['tbl_type
']) ? $GLOBALS['tbl_type
'] : null)); ?>
675 if (PMA_MYSQL_INT_VERSION >= 40100) {
676 echo ' <td width
="25"> 
;</td
>' . "\n"
678 . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation
', null, (isset($tbl_collation) ? $tbl_collation : null), FALSE, 3)
686 } // end if ($action == 'tbl_create
.php
')
689 <fieldset class="tblFooters">
690 <input type="submit" name="do_save_data" value="<?php echo $strSave; ?>" onclick="return checkTableEditForm(this.form, <?php echo $num_fields; ?>)" />
691 <?php if ($action == 'tbl_create
.php
' || $action == 'tbl_addfield
.php
') { ?>
692 <?php echo $GLOBALS['strOr
']; ?>
693 <?php echo sprintf($strAddFields, '<input type
="text" id
="added_fields" name
="added_fields" size
="2" value
="1" onfocus
="this.select()" />'); ?>
694 <input type="submit" name="submit_num_fields"
695 value="<?php echo $GLOBALS['strGo
']; ?>"
696 <?php /* onclick="if (addField()) return false;" */ ?>
697 onclick="return checkFormElementInRange(this.form, 'added_fields
', '<?php
echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldAddCount']); ?
>', 1)"
705 <p> <a name="footnoote_setenumval"><sup>1</sup></a> <?php echo $strSetEnumVal; ?></p>
706 <p> <a name="footnoote_defaultvalue"><sup>2</sup></a> <?php echo $strDefaultValueHelp; ?></p>
708 if ($cfgRelation['commwork
'] && $cfgRelation['mimework
'] && $cfg['BrowseMIME
']) {
709 echo '<p
> <a name
="footnoote_mime"><sup
>3</sup
></a
> ' . $strMIME_transformation_options_note . '</p
>';
711 printf($strMIME_transformation_note,
712 '<a href
="transformation_overview.php?'
713 . PMA_generate_common_url($db, $table) . '" target
="_blank">',
720 <center><?php echo PMA_showMySQLDocu('SQL
-Syntax
', 'CREATE_TABLE
'); ?></center>