From a8c198249555c51af5af867d77c0067af67aad34 Mon Sep 17 00:00:00 2001 From: chriskl Date: Wed, 13 Aug 2003 03:58:25 +0000 Subject: backport 3.0.1 bug fixes --- indexes.php | 53 ++++++++++++++++++----------------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) (limited to 'indexes.php') diff --git a/indexes.php b/indexes.php index 4f39eb99..09596443 100644 --- a/indexes.php +++ b/indexes.php @@ -3,7 +3,7 @@ /** * List indexes on a table * - * $Id: indexes.php,v 1.17 2003/08/12 08:18:53 chriskl Exp $ + * $Id: indexes.php,v 1.14.2.1 2003/08/13 03:58:25 chriskl Exp $ */ // Include application functions @@ -21,11 +21,9 @@ global $PHP_SELF, $lang; if (!isset($_POST['formIndexName'])) $_POST['formIndexName'] = ''; - if (!isset($_POST['formIndexType'])) $_POST['formIndexType'] = null; if (!isset($_POST['formCols'])) $_POST['formCols'] = ''; - if (!isset($_POST['formWhere'])) $_POST['formWhere'] = ''; - echo "

", $misc->printVal($_REQUEST['database']), ": {$lang['strindexes']}: {$lang['strcreateindex']}

\n"; + echo "

", $misc->printVal($_REQUEST['database']), ": {$lang['strindexes']} : {$lang['strcreateindex']}

\n"; $misc->printMsg($msg); $attrs = &$localData->getTableAttributes($_REQUEST['table']); @@ -51,14 +49,16 @@ $buttonRemove->set_attribute("onclick", "buttonPressed(this);"); $buttonRemove->set_attribute("type", "button"); + $selTypes = new XHTML_select("formIndexType"); + $selTypes->set_data($localData->typIndexes); + echo "
\n"; echo "\n"; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -69,32 +69,20 @@ echo "
{$lang['strindexname']}
_maxNameLen}\" value=\"", - htmlspecialchars($_POST['formIndexName']), "\" />
_maxNameLen}\" />
{$lang['strtablecolumnlist']} {$lang['strindexcolumnlist']}
" . $selColumns->fetch() . "
\n"; echo ""; echo ""; - echo "\n"; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; echo ""; - if ($data->hasPartialIndexes()) { - echo ""; - echo ""; - echo ""; - echo ""; - } echo "
{$lang['strindextype']}
{$lang['strunique']}" . $selTypes->fetch() . "
{$lang['strwhere']}(_maxNameLen}\" value=\"", - htmlspecialchars($_POST['formWhere']), "\" />)
"; + echo "

\n"; echo $misc->form; echo "\n"; echo "\n"; - echo "

\n"; + echo "

\n"; echo "
\n"; + + echo "

href}&table=", urlencode($_REQUEST['table']), + "\">{$lang['strshowallindexes']}

\n"; } /** @@ -105,15 +93,11 @@ global $localData; global $lang; - // Handle databases that don't have partial indexes - if (!isset($_POST['formWhere'])) $_POST['formWhere'] = ''; - // Check that they've given a name and at least one column if ($_POST['formIndexName'] == '') doCreateIndex($lang['strindexneedsname']); - elseif (!isset($_POST['IndexColumnList']) || $_POST['IndexColumnList'] == '') doCreateIndex($lang['strindexneedscols']); + elseif ($_POST['IndexColumnList'] == '') doCreate($lang['strindexneedscols']); else { - $status = $localData->createIndex($_POST['formIndexName'], $_POST['table'], $_POST['IndexColumnList'], - $_POST['formIndexType'], isset($_POST['formUnique']), $_POST['formWhere']); + $status = $localData->createIndex($_POST['formIndexName'], $_POST['table'], $_POST['IndexColumnList'], $_POST['formIndexType']); if ($status == 0) doDefault($lang['strindexcreated']); else @@ -143,8 +127,8 @@ if ($localData->hasDropBehavior()) { echo "

{$lang['strcascade']}

\n"; } - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; } else { @@ -202,14 +186,13 @@ switch ($action) { case 'save_create_index': - if (isset($_POST['cancel'])) doDefault(); - else doSaveCreateIndex(); + doSaveCreateIndex(); break; case 'create_index': doCreateIndex(); break; case 'drop_index': - if (isset($_POST['drop'])) doDropIndex(false); + if (isset($_POST['yes'])) doDropIndex(false); else doDefault(); break; case 'confirm_drop_index': -- cgit v1.2.3