From 00281f4fc907e26c0c46f89b3bee3e26cf9ec7fe Mon Sep 17 00:00:00 2001 From: soranzo Date: Thu, 15 Jul 2004 10:06:24 +0000 Subject: [PATCH] Separate internal function creation andediting. Small fixes. --- classes/database/BaseDB.php | 3 +- functions.php | 80 +++++++++++++++++++++++-------------- lang/english.php | 10 ++--- lang/recoded/english.php | 10 ++--- sqledit.php | 4 +- 5 files changed, 62 insertions(+), 45 deletions(-) diff --git a/classes/database/BaseDB.php b/classes/database/BaseDB.php index 05bc8fc6..10f7bce0 100644 --- a/classes/database/BaseDB.php +++ b/classes/database/BaseDB.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: BaseDB.php,v 1.53 2004/07/14 19:09:38 soranzo Exp $ + * $Id: BaseDB.php,v 1.54 2004/07/15 10:06:25 soranzo Exp $ */ include_once('./classes/database/ADODB_base.php'); @@ -272,7 +272,6 @@ class BaseDB extends ADODB_base { function hasFullExplain() { return false; } function hasStatsCollector() { return false; } function hasSchemaDump() { return false; } - function hasFunctionRename() { return false; } function hasAlterColumnType() { return false; } function hasUserSessionDefaults() { return false; } function hasUserRename() { return false; } diff --git a/functions.php b/functions.php index 60d529ed..3c816a91 100644 --- a/functions.php +++ b/functions.php @@ -3,7 +3,7 @@ /** * Manage functions in a database * - * $Id: functions.php,v 1.38 2004/07/14 19:09:38 soranzo Exp $ + * $Id: functions.php,v 1.39 2004/07/15 10:06:24 soranzo Exp $ */ // Include application functions @@ -19,11 +19,12 @@ function doSaveEdit() { global $data, $lang; - // If the backend does not support renaming functions... - if (!$data->hasFunctionRename()) $_POST['formFunction'] = $_POST['original_function']; - - if (strtolower($_POST['original_lang']) == 'c') { + $fnlang = strtolower($_POST['original_lang']); + + if ($fnlang == 'c') { $def = array($_POST['formObjectFile'], $_POST['formLinkSymbol']); + } else if ($fnlang == 'internal'){ + $def = $_POST['formLinkSymbol']; } else { $def = $_POST['formDefinition']; } @@ -92,12 +93,7 @@ echo "\n"; echo ""; echo "f['proname']),"\" />\n"; - // If we're 7.4 or above, we can rename functions - if ($data->hasFunctionRename()) { - echo "_maxNameLen}\" value=\"", htmlspecialchars($_POST['formFunction']), "\" />"; - } - else - echo $misc->printVal($fndata->f['proname']); + echo "_maxNameLen}\" value=\"", htmlspecialchars($_POST['formFunction']), "\" />"; echo "\n"; echo "", $misc->printVal($args), "\n"; @@ -117,13 +113,17 @@ echo "\n"; $fnlang = strtolower($fndata->f['prolanguage']); - if ($fnlang == 'c' || $fnlang == 'internal') { + if ($fnlang == 'c') { echo "{$lang['strobjectfile']}\n"; echo "{$lang['strlinksymbol']}\n"; echo "\n"; echo "\n"; + } else if ($fnlang == 'internal') { + echo "{$lang['strlinksymbol']}\n"; + echo "\n"; } else { echo "{$lang['strdefinition']}\n"; echo "