Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<?php if ($privs_available) : ?>
<input name="field_adjust_privileges[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
checked="checked"
type="checkbox"
value="NULL"
class="allow_null"/>
<?php else : ?>
<input name="field_adjust_privileges[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
disabled
type="checkbox"
value="NULL"
class="allow_null"
title="<?= __('You don\'t have sufficient privileges to perform this '
. 'operation; Please refer to the documentation for more details');?>"/>
<?php endif; ?>

View File

@ -0,0 +1,28 @@
<?php
$attribute_types = $GLOBALS['PMA_Types']->getAttributes();
$cnt_attribute_types = count($attribute_types);
$attribute = '';
if (isset($submit_attribute) && $submit_attribute != false) {
$attribute = $submit_attribute;
} elseif (isset($columnMeta['Extra'])
&& $columnMeta['Extra'] == 'on update CURRENT_TIMESTAMP') {
$attribute = 'on update CURRENT_TIMESTAMP';
} elseif (isset($extracted_columnspec['attribute'])) {
$attribute = $extracted_columnspec['attribute'];
}
$attribute = mb_strtoupper($attribute);
?>
<select style="width: 7em;"
name="field_attribute[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>">
<?php for ($j = 0; $j < $cnt_attribute_types; $j++): ?>
<option value="<?= $attribute_types[$j];?>"
<?php if ($attribute == mb_strtoupper($attribute_types[$j])): ?>
selected="selected"
<?php endif; ?>>
<?= $attribute_types[$j]; ?>
</option>
<?php endfor; ?>
</select>

View File

@ -0,0 +1,231 @@
<?php
// Cell index: If certain fields get left out, the counter shouldn't change.
$ci = 0;
// Every time a cell shall be left out the STRG-jumping feature, $ci_offset
// has to be incremented ($ci_offset++)
$ci_offset = -1;
?>
<td class="center">
<!-- column name -->
<?= PMA\libraries\Template::get('columns_definitions/column_name')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => isset($columnMeta) ? $columnMeta : null,
'cfgRelation' => $cfgRelation
)); ?>
</td>
<td class="center">
<!-- column type -->
<?= PMA\libraries\Template::get('columns_definitions/column_type')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'type_upper' => $type_upper,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<td class="center">
<!-- column length -->
<?= PMA\libraries\Template::get('columns_definitions/column_length')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'length_values_input_size' => $length_values_input_size,
'length_to_display' => $length
)); ?>
</td>
<td class="center">
<!-- column default -->
<?= PMA\libraries\Template::get('columns_definitions/column_default')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'type_upper' => isset($type_upper) ? $type_upper : null,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<td class="center">
<!-- column collation -->
<?php $tmp_collation = empty($columnMeta['Collation']) ? null : $columnMeta['Collation']; ?>
<?= PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION,
'field_collation[' . $columnNumber . ']',
'field_' . $columnNumber . '_' . ($ci - $ci_offset),
$tmp_collation,
false
); ?>
</td>
<td class="center">
<!-- column attribute -->
<?= PMA\libraries\Template::get('columns_definitions/column_attribute')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'extracted_columnspec' => isset($extracted_columnspec) ? $extracted_columnspec : null,
'columnMeta' => isset($columnMeta) ? $columnMeta : null,
'submit_attribute' => isset($submit_attribute) ? $submit_attribute : null,
)); ?>
</td>
<td class="center">
<!-- column NULL -->
<?= PMA\libraries\Template::get('columns_definitions/column_null')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<?php if (isset($_REQUEST['change_column']) && !empty($_REQUEST['change_column'])): ?>
<!-- column Adjust privileges, Only for 'Edit' Column(s) -->
<td class="center">
<?php $privs_available = $GLOBALS['col_priv'] && $GLOBALS['is_reload_priv']; ?>
<?= PMA\libraries\Template::get('columns_definitions/column_adjust_privileges')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'privs_available' => $privs_available
)); ?>
</td>
<?php endif; ?>
<?php if (!$is_backup): ?>
<!-- column indexes, See my other comment about this 'if'. -->
<td class="center">
<?= PMA\libraries\Template::get('columns_definitions/column_indexes')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta
)); ?>
</td>
<?php endif; ?>
<td class="center">
<!-- column auto_increment -->
<?= PMA\libraries\Template::get('columns_definitions/column_auto_increment')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta
)); ?>
</td>
<td class="center">
<!-- column comments -->
<?= PMA\libraries\Template::get('columns_definitions/column_comment')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => isset($columnMeta) ? $columnMeta : null,
'comments_map' => $comments_map
)); ?>
</td>
<!-- column virtuality -->
<?php if (PMA\libraries\Util::isVirtualColumnsSupported()): ?>
<td class="center">
<?= PMA\libraries\Template::get('columns_definitions/column_virtuality')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => isset($columnMeta) ? $columnMeta : null
)); ?>
</td>
<?php endif; ?>
<!-- move column -->
<?php if (isset($fields_meta)): ?>
<?php $current_index = 0;
for ($mi = 0, $cols = count($move_columns); $mi < $cols; $mi++) {
if ($move_columns[$mi]->name == $columnMeta['Field']) {
$current_index = $mi;
break;
}
} ?>
<td class="center">
<?= PMA\libraries\Template::get('columns_definitions/move_column')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'move_columns' => $move_columns,
'current_index' => $current_index
)); ?>
</td>
<?php endif; ?>
<?php if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME'] && $cfgRelation['commwork']): ?>
<td class="center">
<!-- Column Mime-type -->
<?= PMA\libraries\Template::get('columns_definitions/mime_type')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'available_mime' => $available_mime,
'columnMeta' => $columnMeta,
'mime_map' => $mime_map
)); ?>
</td>
<td class="center">
<!-- Column Browser transformation -->
<?= PMA\libraries\Template::get('columns_definitions/transformation')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'available_mime' => $available_mime,
'columnMeta' => $columnMeta,
'mime_map' => $mime_map,
'type' => 'transformation'
)); ?>
</td>
<td class="center">
<!-- column Transformation options -->
<?= PMA\libraries\Template::get('columns_definitions/transformation_option')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'mime_map' => $mime_map,
'type_prefix' => '',
)); ?>
</td>
<td class="center">
<!-- Column Input transformation -->
<?= PMA\libraries\Template::get('columns_definitions/transformation')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'available_mime' => $available_mime,
'columnMeta' => $columnMeta,
'mime_map' => $mime_map,
'type' => 'input_transformation'
)); ?>
</td>
<td class="center">
<!-- column Input transformation options -->
<?= PMA\libraries\Template::get('columns_definitions/transformation_option')
->render(array(
'columnNumber' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'mime_map' => $mime_map,
'type_prefix' => 'input_',
)); ?>
</td>
<?php endif; ?>

View File

@ -0,0 +1,8 @@
<input name="field_extra[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber?>_<?= ($ci - $ci_offset); ?>"
<?php if (isset($columnMeta['Extra'])
&& mb_strtolower($columnMeta['Extra']) == 'auto_increment'): ?>
checked="checked"
<?php endif; ?>
type="checkbox"
value="AUTO_INCREMENT" />

View File

@ -0,0 +1,10 @@
<input id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
type="text"
name="field_comments[<?= $columnNumber; ?>]"
size="12"
maxlength="<?= PMA_MYSQL_INT_VERSION >= 50503 ? 1024 : 255; ?>"
value="<?= (isset($columnMeta['Field']) && is_array($comments_map) && isset($comments_map[$columnMeta['Field']])) ?
htmlspecialchars($comments_map[$columnMeta['Field']])
: ''
?>"
class="textfield" />

View File

@ -0,0 +1,51 @@
<?php
// here we put 'NONE' as the default value of drop-down; otherwise
// users would have problems if they forget to enter the default
// value (example, for an INT)
$default_options = array(
'NONE' => _pgettext('for default', 'None'),
'USER_DEFINED' => __('As defined:'),
'NULL' => 'NULL',
'CURRENT_TIMESTAMP' => 'CURRENT_TIMESTAMP',
);
// for a TIMESTAMP, do not show the string "CURRENT_TIMESTAMP" as a default
// value
$defaultValue = '';
if (isset($columnMeta['DefaultValue'])) {
$defaultValue = $columnMeta['DefaultValue'];
}
if ($type_upper == 'BIT') {
$defaultValue = PMA\libraries\Util::convertBitDefaultValue($columnMeta['DefaultValue']);
} elseif ($type_upper == 'BINARY' || $type_upper == 'VARBINARY') {
$defaultValue = bin2hex($columnMeta['DefaultValue']);
}
?>
<select name="field_default_type[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?=($ci - $ci_offset); ?>"
class="default_type">
<?php foreach ($default_options as $key => $value): ?>
<option value="<?= $key; ?>"
<?php if (isset($columnMeta['DefaultType']) && $columnMeta['DefaultType'] == $key): ?>
selected="selected"
<?php endif; ?>>
<?= $value; ?>
</option>
<?php endforeach; ?>
</select>
<br />
<?php if ($GLOBALS['cfg']['CharEditing'] == 'textarea'): ?>
<textarea name="field_default_value[<?= $columnNumber; ?>]"
cols="15"
class="textfield
default_value">
<?= htmlspecialchars($defaultValue); ?>
</textarea>
<?php else: ?>
<input type="text"
name="field_default_value[<?= $columnNumber; ?>]"
size="12"
value="<?= htmlspecialchars($defaultValue); ?>"
class="textfield default_value" />
<?php endif; ?>

View File

@ -0,0 +1,170 @@
<?php
use PMA\libraries\Partition;
use PMA\libraries\StorageEngine;
?>
<form method="post"
action="<?= $action; ?>"
class="<?= ($action == 'tbl_create.php' ? 'create_table' : 'append_fields'); ?>_form ajax lock-page">
<?= PMA_URL_getHiddenInputs($form_params); ?>
<!-- happens when an index has been set on a column -->
<!-- and a column is added to the table creation dialog -->
<!-- This contains a JSON-encoded string -->
<input type="hidden"
name="primary_indexes"
value="<?= (! empty($_REQUEST['primary_indexes'])) ?
htmlspecialchars($_REQUEST['primary_indexes'])
: '[]'
?>">
<input type="hidden"
name="unique_indexes"
value="<?= (! empty($_REQUEST['unique_indexes'])) ?
htmlspecialchars($_REQUEST['unique_indexes'])
: '[]'
?>">
<input type="hidden"
name="indexes"
value="<?= (! empty($_REQUEST['indexes'])) ?
htmlspecialchars($_REQUEST['indexes'])
: '[]'
?>">
<input type="hidden"
name="fulltext_indexes"
value="<?= (! empty($_REQUEST['fulltext_indexes'])) ?
htmlspecialchars($_REQUEST['fulltext_indexes'])
: '[]'
?>">
<input type="hidden"
name="spatial_indexes"
value="<?= (! empty($_REQUEST['spatial_indexes'])) ?
htmlspecialchars($_REQUEST['spatial_indexes'])
: '[]'
?>">
<?php if ($action == 'tbl_create.php'): ?>
<div id="table_name_col_no_outer">
<table id="table_name_col_no">
<tr class="vmiddle floatleft">
<td><?= __('Table name'); ?>:&nbsp;
<input type="text"
name="table"
size="40"
maxlength="64"
value="<?= (isset($_REQUEST['table']) ? htmlspecialchars($_REQUEST['table']) : '') ?>"
class="textfield" autofocus required />
</td>
<td>
<?= __('Add'); ?>
<input type="number"
id="added_fields"
name="added_fields"
size="2"
value="1"
min="1"
onfocus="this.select()" />
<?= __('column(s)'); ?>
<input type="button"
name="submit_num_fields"
value="<?= __('Go'); ?>" />
</td>
</tr>
</table>
</div>
<?php endif; ?>
<?php if (is_array($content_cells)): ?>
<?= PMA\libraries\Template::get(
'columns_definitions/table_fields_definitions'
)->render(array(
'is_backup' => $is_backup,
'fields_meta' => $fields_meta,
'mimework' => $mimework,
'content_cells' => $content_cells
)); ?>
<?php endif; ?>
<?php if ($action == 'tbl_create.php'): ?>
<table>
<tr class="vtop">
<th>
<?= __('Table comments:'); ?>
</th>
<td width="25">&nbsp;</td>
<th>
<?= __('Collation:'); ?>
</th>
<td width="25">&nbsp;</td>
<th>
<?= __('Storage Engine:'); ?>
<?= PMA\libraries\Util::showMySQLDocu('Storage_engines'); ?>
</th>
<td width="25">&nbsp;</td>
<th>
<?= __('Connection:'); ?>
<?= PMA\libraries\Util::showMySQLDocu('federated-create-connection'); ?>
</th>
</tr>
<tr>
<td>
<input type="text"
name="comment"
size="40"
maxlength="60"
value="<?= (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']): ''); ?>"
class="textfield" />
</td>
<td width="25">&nbsp;</td>
<td>
<?= PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION,
'tbl_collation',
null,
isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null,
false
); ?>
</td>
<td width="25">&nbsp;</td>
<td>
<?= StorageEngine::getHtmlSelect(
'tbl_storage_engine',
null,
(isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null)
); ?>
</td>
<td width="25">&nbsp;</td>
<td>
<input type="text"
name="connection"
size="40"
value="<?= (isset($_REQUEST['connection']) ? htmlspecialchars($_REQUEST['connection']) : ''); ?>"
placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"
class="textfield"
required="required" />
</td>
</tr>
<?php if (Partition::havePartitioning()): ?>
<tr class="vtop">
<th colspan="5">
<?= __('PARTITION definition:'); ?>
&nbsp;
<?= PMA\libraries\Util::showMySQLDocu('Partitioning'); ?>
</th>
</tr>
<tr>
<td colspan="5">
<?php include 'libraries/tbl_partition_definition.inc.php'; ?>
</td>
</tr>
<?php endif; ?>
</table>
<br />
<?php endif; ?>
<fieldset class="tblFooters">
<input type="button"
class="preview_sql"
value="<?= __('Preview SQL') ?>" />
<input type="submit"
name="do_save_data"
value="<?= __('Save'); ?>" />
</fieldset>
<div id="properties_message">
</div>
</form>

View File

@ -0,0 +1,7 @@
<input name="col_extra[<?= $columnNumber;?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
<?php if (! empty($columnMeta['Extra']) && $columnMeta['Extra'] == 'auto_increment'): ?>
checked="checked"
<?php endif; ?>
type="checkbox"
value="auto_increment" />

View File

@ -0,0 +1,30 @@
<select name="field_key[<?= $columnNumber;?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset);?>"
data-index="">
<option value="none_<?= $columnNumber; ?>">---</option>
<option value="primary_<?= $columnNumber; ?>"
title="<?= __("Primary"); ?>"
<?= ((isset($columnMeta['Key']) && $columnMeta['Key'] == 'PRI') ? 'selected="selected"' : '');?>>
PRIMARY
</option>
<option value="unique_<?= $columnNumber; ?>"
title="<?= __("Unique"); ?>"
<?= ((isset($columnMeta['Key']) && $columnMeta['Key'] == 'UNI') ? 'selected="selected"' : '');?>>
UNIQUE
</option>
<option value="index_<?= $columnNumber; ?>"
title="<?= __("Index"); ?>"
<?= ((isset($columnMeta['Key']) && $columnMeta['Key'] == 'MUL') ? 'selected="selected"' : '');?>>
INDEX
</option>
<option value="fulltext_<?= $columnNumber; ?>"
title="<?= __("Fulltext"); ?>"
<?= ((isset($columnMeta['Key']) && $columnMeta['Key'] == 'FULLTEXT') ? 'selected="selected"' : '');?>>
FULLTEXT
</option>
<option value="spatial_<?= $columnNumber; ?>"
title="<?= __("Spatial"); ?>"
<?= ((isset($columnMeta['Key']) && $columnMeta['Key'] == 'SPATIAL') ? 'selected="selected"' : '');?>>
SPATIAL
</option>
</select>

View File

@ -0,0 +1,11 @@
<input id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
type="text"
name="field_length[<?= $columnNumber; ?>]"
size="<?= $length_values_input_size ?>"
value="<?= htmlspecialchars($length_to_display); ?>"
class="textfield" />
<p class="enum_notice" id="enum_notice_<?= $columnNumber ?>_<?= ($ci - $ci_offset); ?>">
<a href="#" class="open_enum_editor">
<?= __('Edit ENUM/SET values'); ?>
</a>
</p>

View File

@ -0,0 +1,46 @@
<?php
$title = '';
if (isset($columnMeta['column_status'])) {
if ($columnMeta['column_status']['isReferenced']) {
$title .= sprintf(
__('Referenced by %s.'),
implode(",", $columnMeta['column_status']['references'])
);
}
if ($columnMeta['column_status']['isForeignKey']) {
if (!empty($title)) {
$title .= "\n";
}
$title .= __('Is a foreign key.');
}
}
if (empty($title)) {
$title = __('Column');
}
?>
<input id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
<?php if (isset($columnMeta['column_status'])
&& !$columnMeta['column_status']['isEditable']): ?>
disabled="disabled"
<?php endif; ?>
type="text"
name="field_name[<?= $columnNumber; ?>]"
maxlength="64"
class="textfield"
title="<?= $title; ?>"
size="10"
value="<?= isset($columnMeta['Field'])? htmlspecialchars($columnMeta['Field']) : '' ?>" />
<?php if ($cfgRelation['centralcolumnswork']
&& !(isset($columnMeta['column_status'])
&& !$columnMeta['column_status']['isEditable'])
): ?>
<p style="font-size:80%;margin:5px 2px"
id="central_columns_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>">
<a data-maxrows="<?= intval($GLOBALS['cfg']['MaxRows']); ?>"
href="#"
class="central_columns_dialog">
<?= __('Pick from Central Columns'); ?>
</a>
</p>
<?php endif; ?>

View File

@ -0,0 +1,8 @@
<input name="field_null[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
<?php if (! empty($columnMeta['Null']) && $columnMeta['Null'] != 'NO' && $columnMeta['Null'] != 'NOT NULL'): ?>
checked="checked"
<?php endif; ?>
type="checkbox"
value="NULL"
class="allow_null"/>

View File

@ -0,0 +1,8 @@
<select class="column_type"
name="field_type[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
<?php if (isset($columnMeta['column_status']) && !$columnMeta['column_status']['isEditable']): ?>
disabled="disabled"
<?php endif; ?>>
<?= PMA\libraries\Util::getSupportedDatatypes(true, $type_upper); ?>
</select>

View File

@ -0,0 +1,48 @@
<?php
$options = array(
'' => '',
'VIRTUAL' => 'VIRTUAL',
);
$serverType = PMA\libraries\Util::getServerType();
if ($serverType == 'MariaDB') {
$options['PERSISTENT'] = 'PERSISTENT';
} else {
$options['STORED'] = 'STORED';
}
$expression = '';
if (isset($columnMeta['Expression'])) {
$expression = $columnMeta['Expression'];
}
?>
<select name="field_virtuality[<?= $columnNumber; ?>]"
id="field_<?= $columnNumber; ?>_<?=($ci - $ci_offset); ?>"
class="virtuality">
<?php foreach ($options as $key => $value): ?>
<option value="<?= $key; ?>"
<?php if (isset($columnMeta['Extra'])
&& $key != ''
&& strpos($columnMeta['Extra'], $key) === 0): ?>
selected="selected"
<?php endif; ?>>
<?= $value; ?>
</option>
<?php endforeach; ?>
</select>
<br />
<?php if ($GLOBALS['cfg']['CharEditing'] == 'textarea'): ?>
<textarea name="field_expression[<?= $columnNumber; ?>]"
cols="15"
class="textfield
expression">
<?= htmlspecialchars($expression); ?>
</textarea>
<?php else: ?>
<input type="text"
name="field_expression[<?= $columnNumber; ?>]"
size="12"
value="<?= htmlspecialchars($expression); ?>"
placeholder="<?= __('Expression'); ?>"
class="textfield expression" />
<?php endif; ?>

View File

@ -0,0 +1,17 @@
<select id="field_<?= $columnNumber;?>_<?=($ci - $ci_offset); ?>"
size="1"
name="field_mimetype[<?= $columnNumber; ?>]">
<option value="">&nbsp;</option>
<?php if (isset($available_mime['mimetype'])
&& is_array($available_mime['mimetype'])): ?>
<?php foreach ($available_mime['mimetype'] as $mimetype): ?>
<?php $checked = (isset($columnMeta['Field'])
&& isset($mime_map[$columnMeta['Field']]['mimetype'])
&& ($mime_map[$columnMeta['Field']]['mimetype'] == str_replace('/', '_', $mimetype))
? 'selected ' : '');?>
<option value="<?= str_replace('/', '_', $mimetype)?>" <?= $checked; ?>>
<?= htmlspecialchars(strtolower($mimetype)); ?>
</option>
<?php endforeach; ?>
<?php endif; ?>
</select>

View File

@ -0,0 +1,15 @@
<select id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
name="field_move_to[<?= $columnNumber; ?>]"
size="1"
width="5em">
<option value="" selected="selected">&nbsp;</option>
<option value="-first" <?= ($current_index == 0 ? ' disabled="disabled"' : ''); ?>>
<?= __('first'); ?>
</option>
<?php for ($mi = 0, $cols = count($move_columns); $mi < $cols; $mi++): ?>
<option value="<?= htmlspecialchars($move_columns[$mi]->name); ?>"
<?= (($current_index == $mi || $current_index == $mi + 1) ? ' disabled="disabled"' : '');?>>
<?= sprintf(__('after %s'), PMA\libraries\Util::backquote(htmlspecialchars($move_columns[$mi]->name))); ?>
</option>
<?php endfor; ?>
</select>

View File

@ -0,0 +1,174 @@
<?php
$partitionOptions = array('', 'HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY', 'RANGE', 'RANGE COLUMNS', 'LIST', 'LIST COLUMNS');
$subPartitionOptions = array('', 'HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY');
$valueTypeOptions = array('', 'LESS THAN', 'LESS THAN MAXVALUE', 'IN');
?>
<table id="partition_table">
<tr class="vmiddle">
<td><label for="partition_by"><?= __('Partition by:'); ?></label></td>
<td>
<select name="partition_by" id="partition_by">
<?php foreach ($partitionOptions as $option): ?>
<option value="<?= $option?>"
<?php if ($partitionDetails['partition_by'] == $option): ?>
selected="selected"
<?php endif; ?>
>
<?= $option; ?>
</option>
<?php endforeach; ?>
</select>
</td>
<td>(
<input name="partition_expr" type="text"
placeholder="<?= __('Expression or column list'); ?>"
value="<?= htmlspecialchars($partitionDetails['partition_expr']); ?>"/>
)</td>
</tr>
<tr class="vmiddle">
<td><label for="partition_count"><?= __('Partitions:'); ?></label></td>
<td>
<input name="partition_count" type="number" min="2"
value="<?= htmlspecialchars($partitionDetails['partition_count']); ?>" />
</td>
</tr>
<?php if ($partitionDetails['can_have_subpartitions']): ?>
<tr class="vmiddle">
<td><label for="subpartition_by"><?= __('Subpartition by:'); ?></label></td>
<td>
<select name="subpartition_by" id="subpartition_by">
<?php foreach ($subPartitionOptions as $option): ?>
<option value="<?= $option?>"
<?php if ($partitionDetails['subpartition_by'] == $option): ?>
selected="selected"
<?php endif; ?>
>
<?= $option; ?>
</option>
<?php endforeach; ?>
</select>
</td>
<td>(
<input name="subpartition_expr" type="text"
placeholder="<?= __('Expression or column list'); ?>"
value="<?= htmlspecialchars($partitionDetails['subpartition_expr']); ?>"/>
)</td>
</tr>
<tr class="vmiddle">
<td><label for="subpartition_count"><?= __('Subpartitions:'); ?></label></td>
<td>
<input name="subpartition_count" type="number" min="2"
value="<?= htmlspecialchars($partitionDetails['subpartition_count']); ?>" />
</td>
</tr>
<?php endif; ?>
</table>
<?php if ($partitionDetails['partition_count'] > 1): ?>
<table id="partition_definition_table">
<tr>
<th><?= __('Partition'); ?></th>
<?php if ($partitionDetails['value_enabled']): ?>
<th><?= __('Values'); ?></th>
<?php endif; ?>
<?php if ($partitionDetails['can_have_subpartitions'] && $partitionDetails['subpartition_count'] > 1): ?>
<th><?= __('Subpartition'); ?></th>
<?php endif; ?>
<th><?= __('Engine'); ?></th>
<th><?= __('Comment'); ?></th>
<th><?= __('Data directory'); ?></th>
<th><?= __('Index directory'); ?></th>
<th><?= __('Max rows'); ?></th>
<th><?= __('Min rows'); ?></th>
<th><?= __('Table space'); ?></th>
<th><?= __('Node group'); ?></th>
</tr>
<?php $odd = true; ?>
<?php foreach ($partitionDetails['partitions'] as $partition): ?>
<?php $rowspan = ! empty($partition['subpartition_count']) ? ($partition['subpartition_count'] + 1) : 2; ?>
<tr class="<?= ($odd ? 'odd' : 'even'); ?>">
<td rowspan="<?= $rowspan; ?>">
<input type="text" name="<?= $partition['prefix']; ?>[name]"
value="<?= htmlspecialchars($partition['name']); ?>" />
</td>
<?php if ($partitionDetails['value_enabled']): ?>
<td rowspan="<?= $rowspan; ?>" class="vmiddle">
<select class="partition_value"
name="<?= $partition['prefix']; ?>[value_type]">
<?php foreach ($valueTypeOptions as $option): ?>
<option value="<?= $option?>"
<?php if ($partition['value_type'] == $option): ?>
selected="selected"
<?php endif; ?>
>
<?= $option; ?>
</option>
<?php endforeach; ?>
</select>
<input type="text" class="partition_value"
name="<?= $partition['prefix']; ?>[value]"
value="<?= $partition['value']; ?>" />
</td>
<?php endif; ?>
</tr>
<?php
if (isset($partition['subpartitions'])):
$subpartitions = $partition['subpartitions'];
else:
$subpartitions = array($partition);
endif;
?>
<?php foreach ($subpartitions as $subpartition): ?>
<tr class="<?= ($odd ? 'odd' : 'even'); ?>">
<?php if ($partitionDetails['can_have_subpartitions'] && $partitionDetails['subpartition_count'] > 1): ?>
<td>
<input type="text" name="<?= $subpartition['prefix']; ?>[name]"
value="<?= htmlspecialchars($subpartition['name']); ?>" />
</td>
<?php endif; ?>
<td>
<?= PMA\libraries\StorageEngine::getHtmlSelect(
$subpartition['prefix'] . '[engine]',
null,
$subpartition['engine'],
false,
true
); ?>
</td>
<td>
<?php //Please keep this at one line to avoid extra spaces in textarea value. ?>
<textarea name="<?= $subpartition['prefix']; ?>[comment]"><?= htmlspecialchars($subpartition['comment']); ?></textarea>
</td>
<td>
<input type="text" name="<?= $subpartition['prefix']; ?>[data_directory]"
value="<?= htmlspecialchars($subpartition['data_directory']); ?>" />
</td>
<td>
<input type="text" name="<?= $subpartition['prefix']; ?>[index_directory]"
value="<?= htmlspecialchars($subpartition['index_directory']); ?>" />
</td>
<td>
<input type="number" name="<?= $subpartition['prefix']; ?>[max_rows]"
value="<?= htmlspecialchars($subpartition['max_rows']); ?>" />
</td>
<td>
<input type="number" min="0" name="<?= $subpartition['prefix']; ?>[min_rows]"
value="<?= htmlspecialchars($subpartition['min_rows']); ?>" />
</td>
<td>
<input type="text" min="0" name="<?= $subpartition['prefix']; ?>[tablespace]"
value="<?= htmlspecialchars($subpartition['tablespace']); ?>" />
</td>
<td>
<input type="text" name="<?= $subpartition['prefix']; ?>[node_group]"
value="<?= htmlspecialchars($subpartition['node_group']); ?>" />
</td>
</tr>
<?php endforeach; ?>
<?php $odd = !$odd; ?>
<?php endforeach; ?>
</table>
<?php endif; ?>

View File

@ -0,0 +1,133 @@
<table id="table_columns" class="noclick">
<caption class="tblHeaders">
<?= __('Structure'); ?>
<?= PMA\libraries\Util::showMySQLDocu('CREATE_TABLE'); ?>
</caption>
<tr>
<th>
<?= __('Name'); ?>
</th>
<th>
<?= __('Type') , PMA\libraries\Util::showMySQLDocu('data-types'); ?>
</th>
<th>
<?= __('Length/Values') , PMA\libraries\Util::showHint(
__(
'If column type is "enum" or "set", please enter the values using'
. ' this format: \'a\',\'b\',\'c\'…<br />If you ever need to put'
. ' a backslash ("\") or a single quote ("\'") amongst those'
. ' values, precede it with a backslash (for example \'\\\\xyz\''
. ' or \'a\\\'b\').'
)
); ?>
</th>
<th>
<?= __('Default') , PMA\libraries\Util::showHint(
__(
'For default values, please enter just a single value,'
. ' without backslash escaping or quotes, using this format: a'
)
); ?>
</th>
<th>
<?= __('Collation'); ?>
</th>
<th>
<?= __('Attributes'); ?>
</th>
<th>
<?= __('Null'); ?>
</th>
<!-- Only for 'Edit' Column(s) -->
<?php if (isset($_REQUEST['change_column'])
&& ! empty($_REQUEST['change_column'])
): ?>
<th>
<?= __('Adjust privileges') , PMA\libraries\Util::showDocu('faq', 'faq6-39'); ?>
</th>
<?php endif; ?>
<?php
// We could remove this 'if' and let the key information be shown and
// editable. However, for this to work, structure.lib.php must be modified
// to use the key fields, as tbl_addfield does.
if (!$is_backup): ?>
<th>
<?= __('Index'); ?>
</th>
<?php endif; ?>
<th>
<abbr title="AUTO_INCREMENT">A_I</abbr>
</th>
<th>
<?= __('Comments'); ?>
</th>
<?php if (PMA\libraries\Util::isVirtualColumnsSupported()): ?>
<th>
<?= __('Virtuality'); ?>
</th>
<?php endif; ?>
<?php if (isset($fields_meta)): ?>
<th>
<?= __('Move column'); ?>
</th>
<?php endif; ?>
<?php if ($mimework && $GLOBALS['cfg']['BrowseMIME']): ?>
<th>
<?= __('MIME type'); ?>
</th>
<th>
<a href="transformation_overview.php<?= PMA_URL_getCommon(); ?>#transformation"
title="<?= __('List of available transformations and their options'); ?>"
target="_blank">
<?= __('Browser display transformation'); ?>
</a>
</th>
<th>
<?= __('Browser display transformation options'); ?>
<?= PMA\libraries\Util::showHint(
__(
'Please enter the values for transformation options using this'
. ' format: \'a\', 100, b,\'c\'…<br />If you ever need to put'
. ' a backslash ("\") or a single quote ("\'") amongst those'
. ' values, precede it with a backslash (for example \'\\\\xyz\''
. ' or \'a\\\'b\').'
)
); ?>
</th>
<th>
<a href="transformation_overview.php<?= PMA_URL_getCommon(); ?>#input_transformation"
title="<?= __('List of available transformations and their options'); ?>"
target="_blank">
<?= __('Input transformation'); ?>
</a>
</th>
<th>
<?= __('Input transformation options'); ?>
<?= PMA\libraries\Util::showHint(
__(
'Please enter the values for transformation options using this'
. ' format: \'a\', 100, b,\'c\'…<br />If you ever need to put'
. ' a backslash ("\") or a single quote ("\'") amongst those'
. ' values, precede it with a backslash (for example \'\\\\xyz\''
. ' or \'a\\\'b\').'
)
); ?>
</th>
<?php endif; ?>
</tr>
<?php $odd_row = true;?>
<?php foreach($content_cells as $content_row): ?>
<tr class="<?= ($odd_row ? 'odd' : 'even'); ?>">
<?php $odd_row = !$odd_row; ?>
<?= PMA\libraries\Template::get('columns_definitions/column_attributes')
->render($content_row); ?>
</tr>
<?php endforeach; ?>
</table>
<br />

View File

@ -0,0 +1,27 @@
<select id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
size="1"
name="field_<?= $type;?>[<?= $columnNumber;?>]">
<option value="" title="<?= __('None'); ?>"></option>
<?php if (isset($available_mime[$type]) && is_array($available_mime[$type])): ?>
<?php foreach ($available_mime[$type] as $mimekey => $transform): ?>
<?php
$checked = isset($columnMeta['Field'])
&& isset($mime_map[$columnMeta['Field']][$type])
&& preg_match('@' . preg_quote($available_mime[$type . '_file'][$mimekey], '@') . '3?@i',
$mime_map[$columnMeta['Field']][$type]) ? 'selected ' : '';
$tooltip = PMA_getTransformationDescription(
$available_mime[$type . '_file'][$mimekey]
);
$parts = explode(":", $transform);
$name = PMA_getTransformationName(
$available_mime[$type . '_file'][$mimekey]
) . ' (' . strtolower($parts[0]) . ":" . $parts[1] . ')';
?>
<option value="<?= $available_mime[$type . '_file'][$mimekey]; ?>"
<?= $checked; ?>
title="<?= htmlspecialchars($tooltip); ?>">
<?= htmlspecialchars($name); ?>
</option>
<?php endforeach; ?>
<?php endif; ?>
</select>

View File

@ -0,0 +1,9 @@
<?php $options_key = $type_prefix . 'transformation_options'; ?>
<input id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
type="text"
name="field_<?= $options_key; ?>[<?= $columnNumber; ?>]"
size="16"
class="textfield"
value="<?= (isset($columnMeta['Field']) && isset($mime_map[$columnMeta['Field']][$options_key])) ?
htmlspecialchars($mime_map[$columnMeta['Field']][$options_key])
: '' ?>" />