The branch, master has been updated via 6e68e2d149a90e4207a85730f425ad06930d8272 (commit) from 3ca82375d57cb84e37064c82e4291f06b5e4cce6 (commit)
- Log ----------------------------------------------------------------- commit 6e68e2d149a90e4207a85730f425ad06930d8272 Author: Brian Douglass bhdouglass@users.sourceforge.net Date: Mon Apr 5 10:06:36 2010 -0400
Patch #2981165 Optionally disable the Type column
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 2 ++ Documentation.html | 6 ++++++ libraries/config.default.php | 7 +++++++ tbl_change.php | 38 ++++++++++++++++++++++++++++---------- 4 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog index a87c0ca..f50e8bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,8 @@ $Id$ - [core] Provide way for vendors to easily change paths to config files. + patch #2979922, rfe #2804874 [interface] Add inline query editing, thanks to Muhammd Adnan. - bug #2966752 [setup] Allow to configure changes tracking in setup script. ++ patch #2981165 [edit] Optionally disable the Type column, + thanks to Brian Douglass - bhdouglass
3.3.2.0 (not yet released) - patch #2969449 [core] Name for MERGE engine varies depending on the diff --git a/Documentation.html b/Documentation.html index 4a4a360..9f915f7 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1551,6 +1551,12 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre> displayed in edit/insert mode. Since version 2.10, the user can toggle this setting from the interface. </dd> + + <dt id="cfg_ShowFieldTypesInDataEditView">$cfg['ShowFieldTypesInDataEditView'] boolean</dt> + <dd>Defines whether or not type fields should be initially + displayed in edit/insert mode. The user can + toggle this setting from the interface. + </dd>
<dt id="cfg_CharEditing">$cfg['CharEditing'] string</dt> <dd>Defines which type of editing controls should be used for CHAR and diff --git a/libraries/config.default.php b/libraries/config.default.php index 377d828..2d1ca1c 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -920,6 +920,13 @@ $cfg['ProtectBinary'] = 'blob'; $cfg['ShowFunctionFields'] = true;
/** + * Display the type fields in edit/insert mode + * + * @global boolean $cfg['ShowFieldTypesInDataEditView'] + */ +$cfg['ShowFieldTypesInDataEditView'] = true; + +/** * Which editor should be used for CHAR/VARCHAR fields: * input - allows limiting of input length * textarea - allows newlines in fields diff --git a/tbl_change.php b/tbl_change.php index cbeda52..835ccf6 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -41,6 +41,9 @@ if (isset($_REQUEST['sql_query'])) { if (isset($_REQUEST['ShowFunctionFields'])) { $cfg['ShowFunctionFields'] = $_REQUEST['ShowFunctionFields']; } +if (isset($_REQUEST['ShowFieldTypesInDataEditView'])) { + $cfg['ShowFieldTypesInDataEditView'] = $_REQUEST['ShowFieldTypesInDataEditView']; +}
/** * load relation data, foreign keys @@ -268,10 +271,18 @@ if (! empty($sql_query)) { $url_params['sql_query'] = $sql_query; }
+if (! $cfg['ShowFunctionFields'] || ! $cfg['ShowFieldTypesInDataEditView']) { + echo $strShow; +} if (! $cfg['ShowFunctionFields']) { $this_url_params = array_merge($url_params, - array('ShowFunctionFields' => 1, 'goto' => 'sql.php')); - echo $strShow . ' : <a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '">' . $strFunction . '</a>' . "\n"; + array('ShowFunctionFields' => 1, 'ShowFieldTypesInDataEditView' => $cfg['ShowFieldTypesInDataEditView'], 'goto' => 'sql.php')); + echo ' : <a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '">' . $strFunction . '</a>' . "\n"; +} +if (! $cfg['ShowFieldTypesInDataEditView']) { + $this_other_url_params = array_merge($url_params, + array('ShowFieldTypesInDataEditView' => 1, 'ShowFunctionFields' => $cfg['ShowFunctionFields'], 'goto' => 'sql.php')); + echo ' : <a href="tbl_change.php' . PMA_generate_common_url($this_other_url_params) . '">' . $strType . '</a>' . "\n"; }
foreach ($rows as $row_id => $vrow) { @@ -293,11 +304,17 @@ foreach ($rows as $row_id => $vrow) { <thead> <tr> <th><?php echo $strField; ?></th> - <th><?php echo $strType; ?></th> -<?php + + <?php + if ($cfg['ShowFieldTypesInDataEditView']) { + $this_url_params = array_merge($url_params, + array('ShowFieldTypesInDataEditView' => 0, 'ShowFunctionFields' => $cfg['ShowFunctionFields'], 'goto' => 'sql.php')); + echo ' <th><a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '" title="' . $strHide . '">' . $strType . '</a></th>' . "\n"; + } + if ($cfg['ShowFunctionFields']) { $this_url_params = array_merge($url_params, - array('ShowFunctionFields' => 0, 'goto' => 'sql.php')); + array('ShowFunctionFields' => 0, 'ShowFieldTypesInDataEditView' => $cfg['ShowFieldTypesInDataEditView'], 'goto' => 'sql.php')); echo ' <th><a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '" title="' . $strHide . '">' . $strFunction . '</a></th>' . "\n"; } ?> @@ -418,11 +435,12 @@ foreach ($rows as $row_id => $vrow) { <?php echo $field['Field_title']; ?> <input type="hidden" name="fields_name<?php echo $field_name_appendix; ?>" value="<?php echo $field['Field_html']; ?>"/> </td> - <td align="center"<?php echo $field['wrap']; ?>> - <?php echo $field['pma_type']; ?> - </td> - - <?php +<?php if ($cfg['ShowFieldTypesInDataEditView']) { ?> + <td align="center"<?php echo $field['wrap']; ?>> + <?php echo $field['pma_type']; ?> + </td> + + <?php } //End if
// Prepares the field value $real_null_value = FALSE;
hooks/post-receive