📄 tbl_properties.inc.php
字号:
$length_to_display = $length; if (!preg_match('@BINARY[\(]@i', $row['Type']) && PMA_MYSQL_INT_VERSION < 40100) { $binary = stristr($row['Type'], 'binary'); } else { $binary = FALSE; } $unsigned = stristr($row['Type'], 'unsigned'); $zerofill = stristr($row['Type'], 'zerofill'); } $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"; $ci++; if (PMA_MYSQL_INT_VERSION >= 40100) { $tmp_collation = empty($row['Collation']) ? null : $row['Collation']; $content_cells[$i][$ci] = PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[]', 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, FALSE); unset($tmp_collation); $ci++; } $content_cells[$i][$ci] = '<select style="font-size: 70%;" name="field_attribute[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n"; $attribute = ''; if ($binary) { $attribute = 'BINARY'; } if ($unsigned) { $attribute = 'UNSIGNED'; } if ($zerofill) { $attribute = 'UNSIGNED ZEROFILL'; } if (isset($submit_attribute) && $submit_attribute != FALSE) { $attribute = $submit_attribute; } // here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the // NULL attribute, but SHOW CREATE TABLE says the contrary. Believe // the latter. if (isset($row['Field']) && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['create_table_fields']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['type']) && $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null'] == true) { $row['Null'] = ''; } // MySQL 4.1.2+ TIMESTAMP options // (if on_update_current_timestamp is set, then it's TRUE) if (isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) { $attribute = 'ON UPDATE CURRENT_TIMESTAMP'; } if ((isset($row['Field']) && isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['default_current_timestamp'])) || (isset($submit_default_current_timestamp) && $submit_default_current_timestamp) ) { $default_current_timestamp = TRUE; } else { $default_current_timestamp = FALSE; } // Dynamically add ON UPDATE CURRENT_TIMESTAMP to the possible attributes if (PMA_MYSQL_INT_VERSION >= 40102 && !in_array('ON UPDATE CURRENT_TIMESTAMP', $cfg['AttributeTypes'])) { $cfg['AttributeTypes'][] = 'ON UPDATE CURRENT_TIMESTAMP'; } $cnt_attribute_types = count($cfg['AttributeTypes']); for ($j = 0;$j < $cnt_attribute_types; $j++) { if (PMA_MYSQL_INT_VERSION >= 40100 && $cfg['AttributeTypes'][$j] == 'BINARY') { continue; } $content_cells[$i][$ci] .= ' <option value="'. $cfg['AttributeTypes'][$j] . '"'; if (strtoupper($attribute) == strtoupper($cfg['AttributeTypes'][$j])) { $content_cells[$i][$ci] .= ' selected="selected"'; } $content_cells[$i][$ci] .= '>' . $cfg['AttributeTypes'][$j] . '</option>' . "\n"; } $content_cells[$i][$ci] .= '</select>'; $ci++; $content_cells[$i][$ci] = '<select name="field_null[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">'; if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NO' || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) { $content_cells[$i][$ci] .= "\n"; $content_cells[$i][$ci] .= ' <option value="NOT NULL" selected="selected" >not null</option>' . "\n"; $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n"; } else { $content_cells[$i][$ci] .= "\n"; $content_cells[$i][$ci] .= ' <option value="" selected="selected" >null</option>' . "\n"; $content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n"; } $content_cells[$i][$ci] .= "\n" . '</select>'; $ci++; if (isset($row) && !isset($row['Default']) && isset($row['Null']) && $row['Null'] == 'YES') { $row['Default'] = 'NULL'; } if ($is_backup) { $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_default_orig[]" size="8" value="' . (isset($row) && isset($row['Default']) ? urlencode($row['Default']) : '') . '" />'; } else { $content_cells[$i][$ci] = "\n"; } // for a TIMESTAMP, do not show CURRENT_TIMESTAMP as a default value if (PMA_MYSQL_INT_VERSION >= 40102 && $type_upper == 'TIMESTAMP' && $default_current_timestamp && isset($row) && isset($row['Default'])) { $row['Default'] = ''; } $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" />'; if (PMA_MYSQL_INT_VERSION >= 40102) { if ($type_upper == 'TIMESTAMP') { $tmp_display_type = 'block'; } else { $tmp_display_type = 'none'; $default_current_timestamp = FALSE; } $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 . ']"'; if ($default_current_timestamp) { $content_cells[$i][$ci] .= ' checked="checked" '; } $content_cells[$i][$ci] .= ' /><label for="field_' . $i . '_' . ($ci - $ci_offset) . 'a" style="font-size: 70%;">CURRENT_TIMESTAMP</label></div>'; } $ci++; $content_cells[$i][$ci] = '<select name="field_extra[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">'; if (!isset($row) || empty($row['Extra'])) { $content_cells[$i][$ci] .= "\n"; $content_cells[$i][$ci] .= '<option value=""></option>' . "\n"; $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n"; } else { $content_cells[$i][$ci] .= "\n"; $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n"; $content_cells[$i][$ci] .= '<option value=""></option>' . "\n"; } $content_cells[$i][$ci] .= "\n" . '</select>'; $ci++; // lem9: See my other comment about removing this 'if'. if (!$is_backup) { if (isset($row) && isset($row['Key']) && $row['Key'] == 'PRI') { $checked_primary = ' checked="checked"'; } else { $checked_primary = ''; } if (isset($row) && isset($row['Key']) && $row['Key'] == 'MUL') { $checked_index = ' checked="checked"'; } else { $checked_index = ''; } if (isset($row) && isset($row['Key']) && $row['Key'] == 'UNI') { $checked_unique = ' checked="checked"'; } else { $checked_unique = ''; } if (empty($checked_primary) && empty($checked_index) && empty($checked_unique)) { $checked_none = ' checked="checked"'; } else { $checked_none = ''; } if ((isset($row) && isset($row['Comment']) && $row['Comment'] == 'FULLTEXT')) { $checked_fulltext = ' checked="checked"'; } else { $checked_fulltext = ''; } $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="primary_' . $i . '"' . $checked_primary . ' title="' . $strPrimary . '" />'; $ci++; $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="index_' . $i . '"' . $checked_index . ' title="' . $strIndex . '" />'; $ci++; $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="unique_' . $i . '"' . $checked_unique . ' title="' . $strUnique . '" />'; $ci++; $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="none_' . $i . '"' . $checked_none . ' title="---" />'; $ci++; $content_cells[$i][$ci] = '<input type="checkbox" name="field_fulltext[]" value="' . $i . '"' . $checked_fulltext . ' title="' . $strIdxFulltext . '" />'; $ci++; } // end if ($action ==...) // garvin: comments if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $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" />'; $ci++; } // garvin: MIME-types if ($cfgRelation['mimework'] && $cfg['BrowseMIME'] && $cfgRelation['commwork']) { $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_mimetype[]">' . "\n"; $content_cells[$i][$ci] .= ' <option value=""></option>' . "\n"; $content_cells[$i][$ci] .= ' <option value="auto">auto-detect</option>' . "\n"; if (is_array($available_mime['mimetype'])) { foreach ($available_mime['mimetype'] AS $mimekey => $mimetype) { $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['mimetype']) && ($mime_map[$row['Field']]['mimetype'] == str_replace('/', '_', $mimetype)) ? 'selected ' : ''); $content_cells[$i][$ci] .= ' <option value="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option>'; } } $content_cells[$i][$ci] .= '</select>'; $ci++; $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_transformation[]">' . "\n"; $content_cells[$i][$ci] .= ' <option value="" title="' . $strNone . '"></option>' . "\n"; if (is_array($available_mime['transformation'])) { foreach ($available_mime['transformation'] AS $mimekey => $transform) { $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 ' : ''); $tooltip = 'strTransformation_' . strtolower(preg_replace('@(\.inc\.php3?)$@', '', $available_mime['transformation_file'][$mimekey])); $tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', $strMIME_nodescription), 'PMA_transformation_' . $tooltip . '()'); $content_cells[$i][$ci] .= '<option value="' . $available_mime['transformation_file'][$mimekey] . '" ' . $checked . ' title="' . htmlspecialchars($tooltip) . '">' . htmlspecialchars($transform) . '</option>' . "\n"; } } $content_cells[$i][$ci] .= '</select>'; $ci++; $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" />'; //$ci++; }} // end forif ( is_array( $content_cells ) && is_array( $header_cells ) ) { // last row is for javascript insert $empty_row = array_pop( $content_cells ); echo '<table id="table_columns">'; if ( $cfg['DefaultPropDisplay'] == 'horizontal' ) { ?><tr> <?php foreach ( $header_cells as $header_val ) { ?> <th><?php echo $header_val; ?></th> <?php } ?></tr> <?php $odd_row = true; foreach ( $content_cells as $content_row ) { echo '<tr class="' . ( $odd_row ? 'odd' : 'even' ) . ' noclick">'; $odd_row = ! $odd_row; if ( is_array( $content_row ) ) { foreach ($content_row as $content_row_val) { ?> <td align="center"><?php echo $content_row_val; ?></td> <?php } } echo '</tr>'; } } else { $i = 0; $odd_row = true; foreach ( $header_cells as $header_val ) { echo '<tr class="' . ( $odd_row ? 'odd' : 'even' ) . ' noclick">'; $odd_row = ! $odd_row; ?> <th><?php echo $header_val; ?></th> <?php foreach ( $content_cells as $content_cell ) { if ( isset( $content_cell[$i] ) && $content_cell[$i] != '' ) { ?> <td><?php echo $content_cell[$i]; ?></td> <?php } } echo '</tr>'; $i++; } } ?></table><br /> <?php}/** * needs to be finished * *if ( $cfg['DefaultPropDisplay'] == 'horizontal' ) { $new_field = ''; foreach ( $empty_row as $content_row_val ) { $new_field .= '<td align="center">' . $content_row_val . '</td>'; } ?><script type="text/javascript" language="javascript"><!--var odd_row = <?php echo $odd_row; ?>;function addField() { var new_fields = document.getElementById('added_fields').value; var new_field_container = document.getElementById('table_columns'); var new_field = '<?php echo preg_replace( '锟絓s+锟
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -