From 6e68e2d149a90e4207a85730f425ad06930d8272 Mon Sep 17 00:00:00 2001 From: Brian Douglass Date: Mon, 5 Apr 2010 10:06:36 -0400 Subject: [PATCH] Patch #2981165 Optionally disable the Type column --- 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 a87c0ca47..f50e8bda7 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 4a4a360ad..9f915f7a9 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1551,6 +1551,12 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE displayed in edit/insert mode. Since version 2.10, the user can toggle this setting from the interface. + +
$cfg['ShowFieldTypesInDataEditView'] boolean
+
Defines whether or not type fields should be initially + displayed in edit/insert mode. The user can + toggle this setting from the interface. +
$cfg['CharEditing'] string
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 377d82855..2d1ca1c7e 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -919,6 +919,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 diff --git a/tbl_change.php b/tbl_change.php index cbeda52fd..835ccf6a8 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 . ' : ' . $strFunction . '' . "\n"; + array('ShowFunctionFields' => 1, 'ShowFieldTypesInDataEditView' => $cfg['ShowFieldTypesInDataEditView'], 'goto' => 'sql.php')); + echo ' : ' . $strFunction . '' . "\n"; +} +if (! $cfg['ShowFieldTypesInDataEditView']) { + $this_other_url_params = array_merge($url_params, + array('ShowFieldTypesInDataEditView' => 1, 'ShowFunctionFields' => $cfg['ShowFunctionFields'], 'goto' => 'sql.php')); + echo ' : ' . $strType . '' . "\n"; } foreach ($rows as $row_id => $vrow) { @@ -293,11 +304,17 @@ foreach ($rows as $row_id => $vrow) { - - 0, 'ShowFunctionFields' => $cfg['ShowFunctionFields'], 'goto' => 'sql.php')); + echo ' ' . $strType . '' . "\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 ' ' . $strFunction . '' . "\n"; } ?> @@ -418,11 +435,12 @@ foreach ($rows as $row_id => $vrow) { - > - - - - + > + + + +