diff options
author | jollytoad | 2004-07-13 15:24:40 +0000 |
---|---|---|
committer | jollytoad | 2004-07-13 15:24:40 +0000 |
commit | 34f9fa9a10e42c9e7eecacc1a578d7ca452c9ba0 (patch) | |
tree | d1ec8a70da457d1d677f59d7e201bc2f088242c0 | |
parent | de0f964ed35464ca83c13ab60139009e16fc0356 (diff) |
Wide-spread improvements to navigation tabs.
-rw-r--r-- | aggregates.php | 3 | ||||
-rw-r--r-- | all_db.php | 5 | ||||
-rw-r--r-- | browser.php | 16 | ||||
-rw-r--r-- | casts.php | 3 | ||||
-rw-r--r-- | classes/Misc.php | 409 | ||||
-rw-r--r-- | constraints.php | 7 | ||||
-rw-r--r-- | conversions.php | 3 | ||||
-rwxr-xr-x | database.php | 21 | ||||
-rw-r--r-- | dataimport.php | 22 | ||||
-rw-r--r-- | domains.php | 3 | ||||
-rw-r--r-- | functions.php | 3 | ||||
-rw-r--r-- | groups.php | 3 | ||||
-rw-r--r-- | indexes.php | 7 | ||||
-rw-r--r-- | info.php | 4 | ||||
-rw-r--r-- | languages.php | 3 | ||||
-rw-r--r-- | links.js | 4 | ||||
-rw-r--r-- | opclasses.php | 3 | ||||
-rw-r--r-- | operators.php | 3 | ||||
-rw-r--r-- | privileges.php | 11 | ||||
-rw-r--r-- | redirect.php | 14 | ||||
-rw-r--r-- | rules.php | 8 | ||||
-rw-r--r-- | sequences.php | 5 | ||||
-rw-r--r-- | sql.php | 4 | ||||
-rw-r--r-- | sqledit.php | 6 | ||||
-rw-r--r-- | tables.php | 5 | ||||
-rw-r--r-- | tblproperties.php | 12 | ||||
-rw-r--r-- | triggers.php | 4 | ||||
-rw-r--r-- | types.php | 3 | ||||
-rw-r--r-- | users.php | 3 | ||||
-rwxr-xr-x | viewproperties.php | 9 | ||||
-rw-r--r-- | views.php | 5 |
31 files changed, 370 insertions, 241 deletions
diff --git a/aggregates.php b/aggregates.php index 43245237..b7257d11 100644 --- a/aggregates.php +++ b/aggregates.php @@ -3,7 +3,7 @@ /** * Manage aggregates in a database * - * $Id: aggregates.php,v 1.5 2004/07/07 02:59:56 chriskl Exp $ + * $Id: aggregates.php,v 1.6 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -51,6 +51,7 @@ $misc->printHeader($lang['straggregates']); $misc->printBody(); + $misc->printNav('schema', 'aggregates'); switch ($action) { default: @@ -3,7 +3,7 @@ /** * Manage databases within a server * - * $Id: all_db.php,v 1.29 2004/07/10 08:57:56 chriskl Exp $ + * $Id: all_db.php,v 1.30 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -20,7 +20,7 @@ global $data, $misc; global $PHP_SELF, $lang, $_reload_drop_database; - if ($confirm) { + if ($confirm) { $misc->printTitle(array($lang['strdatabases'], $misc->printVal($_REQUEST['db']), $lang['strdrop']), 'drop_database'); echo "<p>", sprintf($lang['strconfdropdatabase'], $misc->printVal($_REQUEST['db'])), "</p>\n"; echo "<form action=\"$PHP_SELF\" method=\"post\">\n"; @@ -196,6 +196,7 @@ $misc->printHeader($lang['strdatabases']); $misc->printBody(); + $misc->printNav('server','databases'); switch ($action) { case 'save_create': diff --git a/browser.php b/browser.php index 3dc2fad1..7060c753 100644 --- a/browser.php +++ b/browser.php @@ -5,7 +5,7 @@ * if you click on a database it shows a list of database objects in that * database. * - * $Id: browser.php,v 1.39 2004/07/07 02:59:56 chriskl Exp $ + * $Id: browser.php,v 1.40 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -22,7 +22,7 @@ $menu = new HTML_TreeMenu(null, array('usePersistence' => false)); $root = new HTML_TreeNode(array( 'text' => $misc->printVal(($conf['servers'][$_SESSION['webdbServerID']]['desc'])), - 'link' => addslashes('all_db.php?' . SID), + 'link' => addslashes('redirect.php?section=server&' . SID), 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', 'expanded' => true, @@ -34,7 +34,7 @@ /** * Helper function for adding nodes * @param $schemanode Node onto which to add - */ + */ function addNodes(&$schemanode, $querystr) { global $data, $misc, $lang, $conf; @@ -56,7 +56,7 @@ $return_url = urlencode("tblproperties.php?table=" . urlencode($tables->f['relname']) . "&{$querystr}"); $item_node = &new HTML_TreeNode(array( 'text' => $misc->printVal($tables->f['relname']), - 'link' => addslashes(htmlspecialchars("tblproperties.php?{$querystr}&table=" . + 'link' => addslashes(htmlspecialchars("redirect.php?section=table&{$querystr}&table=" . urlencode($tables->f['relname']))), 'icon' => "../../../images/themes/{$conf['theme']}/tables.png", 'expandedIcon' => "../../../images/themes/{$conf['theme']}/tables.png", @@ -90,7 +90,7 @@ $return_url = urlencode("viewproperties.php?view=" . urlencode($views->f['relname']) . "&{$querystr}"); $item_node = &new HTML_TreeNode(array( 'text' => $misc->printVal($views->f['relname']), - 'link' => addslashes(htmlspecialchars("viewproperties.php?{$querystr}&view=" . + 'link' => addslashes(htmlspecialchars("redirect.php?section=view&{$querystr}&view=" . urlencode($views->f['relname']))), 'icon' => "../../../images/themes/{$conf['theme']}/views.png", 'expandedIcon' => "../../../images/themes/{$conf['theme']}/views.png", @@ -152,7 +152,7 @@ || $data->hasAggregates() || $data->hasOpClasses()) { $adv_node = &new HTML_TreeNode(array( 'text' => $lang['stradvanced'], - 'link' => ($data->hasSchemas()) ? addslashes(htmlspecialchars("schema.php?{$querystr}&" . SID)) : null, +# 'link' => ($data->hasSchemas()) ? addslashes(htmlspecialchars("schema.php?{$querystr}&" . SID)) : null, 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', 'linkTarget' => 'detail')); @@ -237,7 +237,7 @@ $querystr = 'database=' . urlencode($databases->f['datname']) . '&' . SID; $db_node = &new HTML_TreeNode(array( 'text' => $misc->printVal($databases->f['datname']), - 'link' => addslashes(htmlspecialchars("database.php?{$querystr}")), + 'link' => addslashes(htmlspecialchars("redirect.php?section=database&{$querystr}")), 'icon' => "../../../images/themes/{$conf['theme']}/database.png", 'expandedIcon' => "../../../images/themes/{$conf['theme']}/database.png", 'expanded' => true, @@ -253,7 +253,7 @@ urlencode($schemas->f['nspname']) . '&' . SID; $schemanode = &new HTML_TreeNode(array( 'text' => $misc->printVal($schemas->f['nspname']), - 'link' => addslashes(htmlspecialchars("schema.php?{$querystr}")), + 'link' => addslashes(htmlspecialchars("redirect.php?section=schema&{$querystr}")), 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', // Auto-expand your personal schema, if it exists. Also expand schema if there is @@ -3,7 +3,7 @@ /** * Manage casts in a database * - * $Id: casts.php,v 1.6 2004/07/07 02:59:56 chriskl Exp $ + * $Id: casts.php,v 1.7 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -67,6 +67,7 @@ $misc->printHeader($lang['strcasts']); $misc->printBody(); + $misc->printNav('database','casts'); switch ($action) { default: diff --git a/classes/Misc.php b/classes/Misc.php index f8d920dc..93659637 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -2,7 +2,7 @@ /** * Class to hold various commonly used functions * - * $Id: Misc.php,v 1.71 2004/07/12 04:18:40 chriskl Exp $ + * $Id: Misc.php,v 1.72 2004/07/13 15:24:40 jollytoad Exp $ */ class Misc { @@ -294,182 +294,283 @@ /** * Display navigation tabs - * @params $tabs An associative array of tabs definitions, see printTableNav() for an example. + * @param $tabs An associative array of tabs definitions, see printNav() for an example. + * @param $activetab The name of the tab to be highlighted. */ - function printTabs($tabs) { + function printTabs($tabs, $activetab) { + global $misc; + echo "<table class=\"navbar\" border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"3\"><tr>\n"; + # FIXME: don't count hiden tags $width = round(100 / count($tabs)).'%'; - if (!isset($_REQUEST['tab'])) $_REQUEST['tab'] = ''; foreach ($tabs as $tab_id => $tab) { - if ($tab_id == $_REQUEST['tab']) - $class = ' class="active"'; - else - $class = ''; - echo "<td width=\"{$width}\"{$class}><a href=\"{$tab['url']}&tab={$tab_id}\">{$tab['title']}</a></td>\n"; + $class = ($tab_id == $activetab) ? ' class="active"' : ''; + + if (!isset($tab['hide']) || $tab['hide'] !== true) + echo "<td width=\"{$width}\"{$class}><a href=\"" . htmlspecialchars($tab['url']) . "\">{$tab['title']}</a></td>\n"; } echo "</tr></table>\n"; } - - /** - * Display the navigation header for tables - */ - function printTableNav() { - global $lang; - - $vars = $this->href . '&table=' . urlencode($_REQUEST['table']); - - $tabs = array ( - 'columns' => array ( - 'title' => $lang['strcolumns'], - 'url' => "tblproperties.php?{$vars}", - ), - 'indexes' => array ( - 'title' => $lang['strindexes'], - 'url' => "indexes.php?{$vars}", - ), - 'constraints' => array ( - 'title' => $lang['strconstraints'], - 'url' => "constraints.php?{$vars}", - ), - 'triggers' => array ( - 'title' => $lang['strtriggers'], - 'url' => "triggers.php?{$vars}", - ), - 'rules' => array ( - 'title' => $lang['strrules'], - 'url' => "rules.php?{$this->href}&reltype=table&relation=" . urlencode($_REQUEST['table']), - ), - 'info' => array ( - 'title' => $lang['strinfo'], - 'url' => "info.php?{$vars}", - ), - 'privileges' => array ( - 'title' => $lang['strprivileges'], - 'url' => "privileges.php?{$vars}&type=table&object=" . urlencode($_REQUEST['table']), - ), - 'import' => array ( - 'title' => $lang['strimport'], - 'url' => "tblproperties.php?{$vars}&action=import", - ), - 'export' => array ( - 'title' => $lang['strexport'], - 'url' => "tblproperties.php?{$vars}&action=export", - ), - ); - - $this->printTabs($tabs); - } /** - * Display the navigation header for views + * Retreive the tab info for a specific tab bar. + * @param $section The name of the tab bar. */ - function printViewNav() { - global $lang; - - $vars = $this->href . '&view=' . urlencode($_REQUEST['view']); + function getNavTabs($section) { + global $data, $lang, $conf; - $tabs = array ( - 'columns' => array ( - 'title' => $lang['strcolumns'], - 'url' => "viewproperties.php?{$vars}", - ), - 'definition' => array ( - 'title' => $lang['strdefinition'], - 'url' => "viewproperties.php?action=definition&{$vars}", - ), - 'rules' => array ( - 'title' => $lang['strrules'], - 'url' => "rules.php?{$this->href}&reltype=view&relation=" . urlencode($_REQUEST['view']), - ), - 'privileges' => array ( - 'title' => $lang['strprivileges'], - 'url' => "privileges.php?{$vars}&type=view&object=" . urlencode($_REQUEST['view']), - ), - 'export' => array ( - 'title' => $lang['strexport'], - 'url' => "viewproperties.php?action=export&{$vars}", - ), - ); + $databasevar = isset($_REQUEST['database']) ? 'database=' . urlencode($_REQUEST['database']) : ''; + $schemavar = isset($_REQUEST['schema']) ? '&schema=' . urlencode($_REQUEST['schema']) : ''; - $this->printTabs($tabs); + switch ($section) { + case 'server': + $hide_users = !$data->isSuperUser($_SESSION['webdbUsername']); + return array ( + 'databases' => array ( + 'title' => $lang['strdatabases'], + 'url' => "all_db.php", + ), + 'users' => array ( + 'title' => $lang['strusers'], + 'url' => "users.php", + 'hide' => $hide_users, + ), + 'groups' => array ( + 'title' => $lang['strgroups'], + 'url' => "groups.php", + 'hide' => $hide_users, + ), + ); + + case 'database': + $vars = $databasevar; + return array ( + 'schemas' => array ( + 'title' => $lang['strschemas'], + 'url' => "database.php?{$vars}", + 'hide' => (!$data->hasSchemas()), + ), + 'sql' => array ( + 'title' => $lang['strsql'], + 'url' => "database.php?{$vars}&action=sql", + ), + 'find' => array ( + 'title' => $lang['strfind'], + 'url' => "database.php?{$vars}&action=find", + ), + 'variables' => array ( + 'title' => $lang['strvariables'], + 'url' => "database.php?{$vars}&action=variables", + 'hide' => (!$data->hasVariables()), + ), + 'processes' => array ( + 'title' => $lang['strprocesses'], + 'url' => "database.php?{$vars}&action=processes", + 'hide' => (!$data->hasProcesses()), + ), + 'admin' => array ( + 'title' => $lang['stradmin'], + 'url' => "database.php?{$vars}&action=admin", + ), + 'privileges' => array ( + 'title' => $lang['strprivileges'], + 'url' => "privileges.php?{$vars}&type=database&object=" . urlencode($_REQUEST['database']), + 'hide' => (!isset($data->privlist['database'])), + ), + 'languages' => array ( + 'title' => $lang['strlanguages'], + 'url' => "languages.php?{$vars}", + ), + 'casts' => array ( + 'title' => $lang['strcasts'], + 'url' => "casts.php?{$vars}", + ), + 'export' => array ( + 'title' => $lang['strexport'], + 'url' => "database.php?{$vars}&action=export", + 'hide' => (!$this->isDumpEnabled()), + ), + ); + + case 'schema': + $vars = $databasevar . $schemavar; + $hide_advanced = ($conf['show_advanced'] === false); + return array ( + 'tables' => array ( + 'title' => $lang['strtables'], + 'url' => "tables.php?{$vars}", + ), + 'views' => array ( + 'title' => $lang['strviews'], + 'url' => "views.php?{$vars}", + ), + 'sequences' => array ( + 'title' => $lang['strsequences'], + 'url' => "sequences.php?{$vars}", + ), + 'functions' => array ( + 'title' => $lang['strfunctions'], + 'url' => "functions.php?{$vars}", + ), + 'domains' => array ( + 'title' => $lang['strdomains'], + 'url' => "domains.php?{$vars}", + ), + 'aggregates' => array ( + 'title' => $lang['straggregates'], + 'url' => "aggregates.php?{$vars}", + 'hide' => $hide_advanced, + ), + 'types' => array ( + 'title' => $lang['strtypes'], + 'url' => "types.php?{$vars}", + 'hide' => $hide_advanced, + ), + 'operators' => array ( + 'title' => $lang['stroperators'], + 'url' => "operators.php?{$vars}", + 'hide' => $hide_advanced, + ), + 'opclasses' => array ( + 'title' => $lang['stropclasses'], + 'url' => "opclasses.php?{$vars}", + 'hide' => $hide_advanced, + ), + 'conversions' => array ( + 'title' => $lang['strconversions'], + 'url' => "conversions.php?{$vars}", + 'hide' => $hide_advanced, + ), + ); + + case 'table': + $table = urlencode($_REQUEST['table']); + $vars = $databasevar . $schemavar . "&table={$table}"; + return array ( + 'columns' => array ( + 'title' => $lang['strcolumns'], + 'url' => "tblproperties.php?{$vars}", + ), + 'indexes' => array ( + 'title' => $lang['strindexes'], + 'url' => "indexes.php?{$vars}", + ), + 'constraints' => array ( + 'title' => $lang['strconstraints'], + 'url' => "constraints.php?{$vars}", + ), + 'triggers' => array ( + 'title' => $lang['strtriggers'], + 'url' => "triggers.php?{$vars}", + ), + 'rules' => array ( + 'title' => $lang['strrules'], + 'url' => "rules.php?{$vars}&reltype=table&relation={$table}", + ), + 'info' => array ( + 'title' => $lang['strinfo'], + 'url' => "info.php?{$vars}", + ), + 'privileges' => array ( + 'title' => $lang['strprivileges'], + 'url' => "privileges.php?{$vars}&type=table&object={$table}", + ), + 'import' => array ( + 'title' => $lang['strimport'], + 'url' => "tblproperties.php?{$vars}&action=import", + ), + 'export' => array ( + 'title' => $lang['strexport'], + 'url' => "tblproperties.php?{$vars}&action=export", + ), + ); + + case 'view': + $view = urlencode($_REQUEST['view']); + $vars = $databasevar . $schemavar . "&view={$view}"; + return array ( + 'columns' => array ( + 'title' => $lang['strcolumns'], + 'url' => "viewproperties.php?{$vars}", + ), + 'definition' => array ( + 'title' => $lang['strdefinition'], + 'url' => "viewproperties.php?{$vars}&action=definition", + ), + 'rules' => array ( + 'title' => $lang['strrules'], + 'url' => "rules.php?{$vars}&reltype=view&relation={$view}", + ), + 'privileges' => array ( + 'title' => $lang['strprivileges'], + 'url' => "privileges.php?{$vars}&type=view&object={$view}", + ), + 'export' => array ( + 'title' => $lang['strexport'], + 'url' => "viewproperties.php?{$vars}&action=export", + ), + ); + + case 'popup': + $vars = $databasevar; + return array ( + 'sql' => array ( + 'title' => $lang['strsql'], + 'url' => "sqledit.php?{$vars}&action=sql", + ), + 'find' => array ( + 'title' => $lang['strfind'], + 'url' => "sqledit.php?{$vars}&action=find", + ), + ); + + default: + return array(); + } } - + /** - * Display the navigation header for tables + * Display a navigation tab bar. + * @param $section The name of the tab bar. + * @param $activetab The tab to highlight and set as default for the bar. */ - function printDatabaseNav() { - global $lang, $conf, $data; - - $vars = 'database=' . urlencode($_REQUEST['database']); + function printNav($section, $activetab) { + global $data; - $tabs = array ( - 'schemas' => array ( - 'title' => $lang['strschemas'], - 'url' => "database.php?{$vars}", - ), - 'sql' => array ( - 'title' => $lang['strsql'], - 'url' => "database.php?{$vars}&action=sql", - ), - 'find' => array ( - 'title' => $lang['strfind'], - 'url' => "database.php?{$vars}&action=find", - ), - 'variables' => array ( - 'title' => $lang['strvariables'], - 'url' => "database.php?{$vars}&action=variables", - ), - 'processes' => array ( - 'title' => $lang['strprocesses'], - 'url' => "database.php?{$vars}&action=processes", - ), - 'admin' => array ( - 'title' => $lang['stradmin'], - 'url' => "database.php?{$vars}&action=admin", - ), - 'privileges' => array ( - 'title' => $lang['strprivileges'], - 'url' => "privileges.php?{$vars}&type=database&object=" . urlencode($_REQUEST['database']), - ), - 'export' => array ( - 'title' => $lang['strexport'], - 'url' => "database.php?{$vars}&action=export", - ), - ); - - if (!$data->hasSchemas()) unset($tabs['schemas']); - if (!$data->hasVariables()) unset($tabs['variables']); - if (!$data->hasProcesses()) unset($tabs['processes']); - if (!isset($data->privlist['database'])) unset($tabs['privileges']); - if (!$this->isDumpEnabled()) unset($tabs['export']); - - $this->printTabs($tabs); + switch ($section) { + case 'database': + case 'schema': + if ($data->hasSchemas() === false) { + $this->printTabs($this->getNavTabs('database'),$activetab); + $this->printTabs($this->getNavTabs('schema'),$activetab); + $_SESSION['webdbLastTab']['database'] = $activetab; + $_SESSION['webdbLastTab']['schema'] = $activetab; + break; + } + default: + $tabs = $this->getNavTabs($section); + if (!empty($tabs)) { + $this->printTabs($tabs, $activetab); + $_SESSION['webdbLastTab'][$section] = $activetab; + } + } } - + /** - * Display the navigation header for popup window + * Get the URL for the last active tab of a particular tab bar. */ - function printPopUpNav() { - global $lang, $data; - - if (isset($_REQUEST['database'])) $url = '&database=' . urlencode($_REQUEST['database']); - else $url = ''; - - $tabs = array ( - 'sql' => array ( - 'title' => $lang['strsql'], - 'url' => "sqledit.php?action=sql{$url}", - ), - 'find' => array ( - 'title' => $lang['strfind'], - 'url' => "sqledit.php?action=find{$url}", - ), - ); + function getLastTabURL($section) { + $tabs = $this->getNavTabs($section); + + if (isset($_SESSION['webdbLastTab'][$section])) + $tab = $tabs[$_SESSION['webdbLastTab'][$section]]; + else + $tab = reset($tabs); - $this->printTabs($tabs); + return isset($tab['url']) ? $tab['url'] : null; } /** diff --git a/constraints.php b/constraints.php index 705a4278..255c2d9d 100644 --- a/constraints.php +++ b/constraints.php @@ -3,7 +3,7 @@ /** * List constraints on a table * - * $Id: constraints.php,v 1.32 2004/07/08 17:57:32 xzilla Exp $ + * $Id: constraints.php,v 1.33 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -285,7 +285,7 @@ doDefault($lang['strinvalidparam']); return; } - + echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ", $misc->printVal($_REQUEST['table']), ": {$desc}</h2>\n"; $misc->printMsg($msg); @@ -478,7 +478,6 @@ } } - $misc->printTableNav(); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strconstraints']),'constraints'); $misc->printMsg($msg); @@ -548,6 +547,8 @@ else $misc->printBody(); + $misc->printNav('table','constraints'); + switch ($action) { case 'cluster_constraint': if (isset($_POST['cluster'])) doClusterIndex(false); diff --git a/conversions.php b/conversions.php index 4148eac2..ce99a7ea 100644 --- a/conversions.php +++ b/conversions.php @@ -3,7 +3,7 @@ /** * Manage conversions in a database * - * $Id: conversions.php,v 1.6 2004/07/07 02:59:56 chriskl Exp $ + * $Id: conversions.php,v 1.7 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -58,6 +58,7 @@ $misc->printHeader($lang['strconversions']); $misc->printBody(); + $misc->printNav('schema','conversions'); switch ($action) { default: diff --git a/database.php b/database.php index 3a0f6d9e..cf308d43 100755 --- a/database.php +++ b/database.php @@ -3,7 +3,7 @@ /** * Manage schemas within a database * - * $Id: database.php,v 1.53 2004/07/12 07:13:32 chriskl Exp $ + * $Id: database.php,v 1.54 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -40,7 +40,7 @@ if (!isset($_GET['term'])) $_GET['term'] = ''; if (!isset($_GET['filter'])) $_GET['filter'] = ''; - $misc->printDatabaseNav(); + $misc->printNav('database','find'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strfind'])); $misc->printMsg($msg); @@ -290,7 +290,7 @@ global $data, $misc; global $PHP_SELF, $lang; - $misc->printDatabaseNav(); + $misc->printNav('database','export'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strexport'])); $misc->printMsg($msg); @@ -342,8 +342,7 @@ // Fetch the variables from the database $variables = &$data->getVariables(); - $misc->printDatabaseNav(); - + $misc->printNav('database','variables'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strvariables']),'runtime_config'); $columns = array( @@ -373,7 +372,7 @@ // Fetch the processes from the database $processes = &$data->getProcesses($_REQUEST['database']); - $misc->printDatabaseNav(); + $misc->printNav('database','processes'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strprocesses']), 'processes'); $misc->printMsg($msg); @@ -448,7 +447,7 @@ else doAdmin('', $lang['strreindexbad']); break; default: - $misc->printDatabaseNav(); + $misc->printNav('database','admin'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['stradmin'])); $misc->printMsg($msg); @@ -504,7 +503,7 @@ if (!isset($_REQUEST['query'])) $_REQUEST['query'] = ''; - $misc->printDatabaseNav(); + $misc->printNav('database','sql'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strsql']),'sql'); echo "<p>{$lang['strentersql']}</p>\n"; @@ -549,6 +548,7 @@ global $lang, $_reload_browser; if ($confirm) { + $misc->printNav('database','schemas'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$misc->printVal($_REQUEST['schema']),$lang['strdrop']),'drop_schema'); echo "<p>", sprintf($lang['strconfdropschema'], $misc->printVal($_REQUEST['schema'])), "</p>\n"; @@ -594,6 +594,7 @@ // Fetch all tablespaces from the database if ($data->hasTablespaces()) $tablespaces = &$data->getTablespaces(); + $misc->printNav('database','schemas'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strcreateschema']),'create_schema'); $misc->printMsg($msg); @@ -674,7 +675,7 @@ global $data, $misc, $conf; global $PHP_SELF, $lang; - $misc->printDatabaseNav(); + $misc->printNav('database','schemas'); $misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['strschemas']),'schemas'); $misc->printMsg($msg); @@ -707,7 +708,7 @@ $actions = array( 'properties' => array( 'title' => $lang['strproperties'], - 'url' => 'schema.php?database='.urlencode($_REQUEST['database'])."&", + 'url' => "redirect.php?section=schema&database=".urlencode($_REQUEST['database'])."&", 'vars' => array('schema' => 'nspname'), ), 'drop' => array( diff --git a/dataimport.php b/dataimport.php index 09741ec4..e76c5145 100644 --- a/dataimport.php +++ b/dataimport.php @@ -3,7 +3,7 @@ /** * Does an import to a particular table from a text file * - * $Id: dataimport.php,v 1.3 2004/07/01 06:41:42 chriskl Exp $ + * $Id: dataimport.php,v 1.4 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -150,7 +150,7 @@ $misc->printHeader($lang['strimport']); - $misc->printTableNav(); + $misc->printNav('table','import'); echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strimport']}</h2>\n"; // Check that file is specified and is an uploaded file @@ -228,15 +228,15 @@ } break; case 'xml': - $parser = xml_parser_create();
- xml_set_element_handler($parser, '_startElement', '_endElement');
- xml_set_character_data_handler($parser, '_charHandler');
-
- while (!feof($fd)) {
- $line = fgets($fd, 4096);
- xml_parse($parser, $line);
- }
-
+ $parser = xml_parser_create(); + xml_set_element_handler($parser, '_startElement', '_endElement'); + xml_set_character_data_handler($parser, '_charHandler'); + + while (!feof($fd)) { + $line = fgets($fd, 4096); + xml_parse($parser, $line); + } + xml_parser_free($parser); break; default: diff --git a/domains.php b/domains.php index 1dc88bc1..0f574d30 100644 --- a/domains.php +++ b/domains.php @@ -3,7 +3,7 @@ /** * Manage domains in a database * - * $Id: domains.php,v 1.14 2004/07/07 02:59:57 chriskl Exp $ + * $Id: domains.php,v 1.15 2004/07/13 15:24:40 jollytoad Exp $ */ // Include application functions @@ -423,6 +423,7 @@ $misc->printHeader($lang['strdomains']); $misc->printBody(); + $misc->printNav('schema','domains'); switch ($action) { case 'add_check': diff --git a/functions.php b/functions.php index e37cc66e..2eb0c0ee 100644 --- a/functions.php +++ b/functions.php @@ -3,7 +3,7 @@ /** * Manage functions in a database * - * $Id: functions.php,v 1.35 2004/07/13 09:00:32 chriskl Exp $ + * $Id: functions.php,v 1.36 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -490,6 +490,7 @@ $misc->printHeader($lang['strfunctions']); $misc->printBody(); + $misc->printNav('schema','functions'); switch ($action) { case 'save_create': @@ -3,7 +3,7 @@ /** * Manage groups in a database cluster * - * $Id: groups.php,v 1.16 2004/07/07 02:59:57 chriskl Exp $ + * $Id: groups.php,v 1.17 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -239,6 +239,7 @@ $misc->printHeader($lang['strgroups']); $misc->printBody(); + $misc->printNav('server','groups'); switch ($action) { case 'add_member': diff --git a/indexes.php b/indexes.php index e3ba2637..f79d6dd0 100644 --- a/indexes.php +++ b/indexes.php @@ -3,7 +3,7 @@ /** * List indexes on a table * - * $Id: indexes.php,v 1.28 2004/07/10 09:23:24 chriskl Exp $ + * $Id: indexes.php,v 1.29 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -237,7 +237,6 @@ global $data, $misc; global $PHP_SELF, $lang; - $misc->printTableNav(); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strindexes'])); $misc->printMsg($msg); @@ -295,7 +294,9 @@ echo "<body onload=\"init();\">"; else $misc->printBody(); - + + $misc->printNav('table','indexes'); + switch ($action) { case 'cluster_index': if (isset($_POST['cluster'])) doClusterIndex(false); @@ -3,7 +3,7 @@ /** * List extra information on a table * - * $Id: info.php,v 1.6 2004/03/06 11:30:00 chriskl Exp $ + * $Id: info.php,v 1.7 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -19,7 +19,7 @@ global $data, $misc; global $lang; - $misc->printTableNav(); + $misc->printNav('table','info'); echo "<h2>", $misc->printVal($_REQUEST['database']), ": ", $misc->printVal($_REQUEST['table']), ": {$lang['strinfo']}</h2>\n"; $misc->printMsg($msg); diff --git a/languages.php b/languages.php index 638c612e..f3f6819d 100644 --- a/languages.php +++ b/languages.php @@ -3,7 +3,7 @@ /** * Manage languages in a database * - * $Id: languages.php,v 1.4 2004/07/07 02:59:57 chriskl Exp $ + * $Id: languages.php,v 1.5 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -50,6 +50,7 @@ $misc->printHeader($lang['strlanguages']); $misc->printBody(); + $misc->printNav('database','languages'); switch ($action) { default: @@ -2,12 +2,12 @@ * Function for updating browser frame and topbar frame so that sqledit window * pops up with properly selected database. * - * $Id: links.js,v 1.3 2003/12/28 08:15:34 chriskl Exp $ + * $Id: links.js,v 1.4 2004/07/13 15:24:41 jollytoad Exp $ */ function updateLinks(getVars) { var topbarLink = 'topbar.php' + getVars; var browserLink = 'browser.php' + getVars; - var detailLink = 'database.php' + getVars; + var detailLink = 'redirect.php' + getVars + 'section=database'; parent.frames.topbar.location = topbarLink; parent.frames.detail.location = detailLink; diff --git a/opclasses.php b/opclasses.php index 6d0cbbc7..ad21602c 100644 --- a/opclasses.php +++ b/opclasses.php @@ -3,7 +3,7 @@ /** * Manage opclasss in a database * - * $Id: opclasses.php,v 1.3 2004/07/07 02:59:57 chriskl Exp $ + * $Id: opclasses.php,v 1.4 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -57,6 +57,7 @@ $misc->printHeader($lang['stropclasses']); $misc->printBody(); + $misc->printNav('schema','opclasses'); switch ($action) { default: diff --git a/operators.php b/operators.php index d8b2822d..8a9f734b 100644 --- a/operators.php +++ b/operators.php @@ -3,7 +3,7 @@ /** * Manage operators in a database * - * $Id: operators.php,v 1.14 2004/07/07 02:59:57 chriskl Exp $ + * $Id: operators.php,v 1.15 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -155,6 +155,7 @@ $misc->printHeader($lang['stroperators']); $misc->printBody(); + $misc->printNav('schema','operators'); switch ($action) { case 'save_create': diff --git a/privileges.php b/privileges.php index b9fd4449..7f023842 100644 --- a/privileges.php +++ b/privileges.php @@ -3,7 +3,7 @@ /** * Manage privileges in a database * - * $Id: privileges.php,v 1.25 2004/07/10 08:51:01 chriskl Exp $ + * $Id: privileges.php,v 1.26 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -134,14 +134,6 @@ global $PHP_SELF, $lang; switch ($_REQUEST['type']) { - case 'table': - $misc->printTableNav(); - $name = $_REQUEST['object']; - break; - case 'view': - $misc->printViewNav(); - $name = $_REQUEST['object']; - break; case 'function': $name = $_REQUEST['function']; break; @@ -242,6 +234,7 @@ $misc->printHeader($lang['strprivileges']); $misc->printBody(); + $misc->printNav($_REQUEST['type'], 'privileges'); switch ($action) { case 'save': diff --git a/redirect.php b/redirect.php new file mode 100644 index 00000000..974b598c --- /dev/null +++ b/redirect.php @@ -0,0 +1,14 @@ +<?php + include_once('./libraries/lib.inc.php'); + + $url = $misc->getLastTabURL($_REQUEST['section']); + + if (is_string($url)) { + header("Location: http://{$_SERVER['HTTP_HOST']}/{$url}"); + exit; + } + + $misc->printHeader('ERROR'); + $misc->printBody(); + $misc->printFooter(); +?> @@ -3,7 +3,7 @@ /** * List rules on a table OR view * - * $Id: rules.php,v 1.19 2004/07/07 02:59:58 chriskl Exp $ + * $Id: rules.php,v 1.20 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -127,9 +127,6 @@ global $PHP_SELF; global $lang; - if ($_REQUEST['reltype'] == 'table') $misc->printTableNav(); - else $misc->printViewNav(); - $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['relation']), $lang['strrules'])); $misc->printMsg($msg); @@ -174,7 +171,8 @@ $misc->printHeader($lang['strviews'] . ' - ' . $_REQUEST['relation'] . ' - ' . $lang['strrules']); } $misc->printBody(); - + $misc->printNav($_REQUEST['reltype'],'rules'); + switch ($action) { case 'create_rule': createRule(true); diff --git a/sequences.php b/sequences.php index 771608ba..9d78a12a 100644 --- a/sequences.php +++ b/sequences.php @@ -3,7 +3,7 @@ /** * Manage sequences in a database * - * $Id: sequences.php,v 1.23 2004/07/12 07:13:32 chriskl Exp $ + * $Id: sequences.php,v 1.24 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -249,7 +249,8 @@ // Print header $misc->printHeader($lang['strsequences']); $misc->printBody(); - + $misc->printNav('schema','sequences'); + switch($action) { case 'create': doCreateSequence(); @@ -6,7 +6,7 @@ * how many SQL statements have been strung together with semi-colons * @param $query The SQL query string to execute * - * $Id: sql.php,v 1.22 2004/07/07 02:59:59 chriskl Exp $ + * $Id: sql.php,v 1.23 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -33,7 +33,7 @@ $misc->printHeader($lang['strqueryresults']); $misc->printBody(); - $misc->printDatabaseNav(); + $misc->printNav('database','sql'); echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strsql']}: {$lang['strqueryresults']}</h2>\n"; // Set the schema search path diff --git a/sqledit.php b/sqledit.php index e571c11b..e4208808 100644 --- a/sqledit.php +++ b/sqledit.php @@ -3,7 +3,7 @@ /** * Alternative SQL editing window * - * $Id: sqledit.php,v 1.17 2004/07/12 07:13:32 chriskl Exp $ + * $Id: sqledit.php,v 1.18 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -61,7 +61,7 @@ if (!isset($_GET['term'])) $_GET['term'] = ''; if (!isset($_GET['filter'])) $_GET['filter'] = ''; - $misc->printPopUpNav(); + $misc->printNav('popup','find'); echo "<h2>{$lang['strfind']}</h2>\n"; echo "<form action=\"database.php\" method=\"get\" target=\"detail\">\n<p>"; @@ -126,7 +126,7 @@ if (!isset($_REQUEST['query'])) $_REQUEST['query'] = ''; - $misc->printPopUpNav(); + $misc->printNav('popup','sql'); echo "<h2>{$lang['strsql']}</h2>\n"; echo "<form action=\"sql.php\" method=\"post\" target=\"detail\">\n<p>"; @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tables.php,v 1.59 2004/07/10 09:23:24 chriskl Exp $ + * $Id: tables.php,v 1.60 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -510,7 +510,7 @@ $actions = array( 'properties' => array( 'title' => $lang['strproperties'], - 'url' => "tblproperties.php?{$misc->href}&", + 'url' => "redirect.php?section=table&{$misc->href}&", 'vars' => array('table' => 'relname'), ), 'browse' => array( @@ -549,6 +549,7 @@ $misc->printHeader($lang['strtables']); $misc->printBody(); + $misc->printNav('schema','tables'); switch ($action) { case 'create': diff --git a/tblproperties.php b/tblproperties.php index 824075d3..38703e08 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tblproperties.php,v 1.54 2004/07/13 09:00:39 chriskl Exp $ + * $Id: tblproperties.php,v 1.55 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -46,6 +46,7 @@ global $data, $misc; global $PHP_SELF, $lang; + $misc->printNav('table','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['stralter']), 'alter_table'); $misc->printMsg($msg); @@ -120,7 +121,7 @@ // Determine whether or not the table has an object ID $hasID = $data->hasObjectID($_REQUEST['table']); - $misc->printTableNav(); + $misc->printNav('table','export'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strexport'])); $misc->printMsg($msg); @@ -174,7 +175,7 @@ global $data, $misc; global $PHP_SELF, $lang; - $misc->printTableNav(); + $misc->printNav('table','import'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strimport'])); $misc->printMsg($msg); @@ -232,6 +233,7 @@ // Fetch all available types $types = &$data->getTypes(true, false, true); + $misc->printNav('table','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['straddcolumn']), 'add_column'); $misc->printMsg($msg); @@ -328,6 +330,7 @@ case 1: global $lang; + $misc->printNav('table','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['straltercolumn'], $misc->printVal($_REQUEST['column'])), 'alter_column'); $misc->printMsg($msg); @@ -475,6 +478,7 @@ global $PHP_SELF, $lang; if ($confirm) { + $misc->printNav('table','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $misc->printVal($_REQUEST['column']), $lang['strdrop']), 'drop_column'); echo "<p>", sprintf($lang['strconfdropcolumn'], $misc->printVal($_REQUEST['column']), @@ -516,7 +520,7 @@ $rowdata->f['+type'] = $data->formatType($rowdata->f['type'], $rowdata->f['atttypmod']); } - $misc->printTableNav(); + $misc->printNav('table','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']))); $misc->printMsg($msg); diff --git a/triggers.php b/triggers.php index fed4f28b..217b0aba 100644 --- a/triggers.php +++ b/triggers.php @@ -3,7 +3,7 @@ /** * List triggers on a table * - * $Id: triggers.php,v 1.20 2004/07/07 02:59:59 chriskl Exp $ + * $Id: triggers.php,v 1.21 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -196,7 +196,6 @@ : $data->getTriggerDef($rowdata->f); } - $misc->printTableNav(); $misc->printTitle(array($misc->printVal($_REQUEST['database'])), $misc->printVal($_REQUEST['table']), $lang['strtriggers']); $misc->printMsg($msg); @@ -238,6 +237,7 @@ $misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $lang['strtriggers']); $misc->printBody(); + $misc->printNav('table','triggers'); switch ($action) { case 'alter': @@ -3,7 +3,7 @@ /** * Manage types in a database * - * $Id: types.php,v 1.18 2004/07/07 03:00:00 chriskl Exp $ + * $Id: types.php,v 1.19 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -259,6 +259,7 @@ $misc->printHeader($lang['strtypes']); $misc->printBody(); + $misc->printNav('schema','types'); switch ($action) { case 'save_create': @@ -3,7 +3,7 @@ /** * Manage users in a database cluster * - * $Id: users.php,v 1.24 2004/07/07 03:00:00 chriskl Exp $ + * $Id: users.php,v 1.25 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -325,6 +325,7 @@ $misc->printHeader($lang['strusers']); $misc->printBody(); + $misc->printNav('server','users'); switch ($action) { case 'changepassword': diff --git a/viewproperties.php b/viewproperties.php index 45fae03c..1ba8de2e 100755 --- a/viewproperties.php +++ b/viewproperties.php @@ -3,7 +3,7 @@ /** * List views in a database * - * $Id: viewproperties.php,v 1.8 2004/07/09 18:51:02 xzilla Exp $ + * $Id: viewproperties.php,v 1.9 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -74,7 +74,7 @@ global $data, $misc; global $PHP_SELF, $lang; - $misc->printViewNav(); + $misc->printNav('view','export'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['view']), $lang['strexport'])); $misc->printMsg($msg); @@ -133,7 +133,7 @@ // Get view $vdata = &$data->getView($_REQUEST['view']); - $misc->printViewNav(); + $misc->printNav('view','definition'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strviews'], $misc->printVal($_REQUEST['view']), $lang['strdefinition'])); $misc->printMsg($msg); @@ -166,6 +166,7 @@ case 1: global $lang; + $misc->printNav('view','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strviews'], $lang['straltercolumn'], $misc->printVal($_REQUEST['column']))); $misc->printMsg($msg); @@ -252,7 +253,7 @@ $rowdata->f['+type'] = $data->formatType($rowdata->f['type'], $rowdata->f['atttypmod']); } - $misc->printViewNav(); + $misc->printNav('view','columns'); $misc->printTitle(array($misc->printVal($_REQUEST['database']), $lang['strviews'], $misc->printVal($_REQUEST['view']))); $misc->printMsg($msg); @@ -3,7 +3,7 @@ /** * Manage views in a database * - * $Id: views.php,v 1.45 2004/07/07 03:00:00 chriskl Exp $ + * $Id: views.php,v 1.46 2004/07/13 15:24:41 jollytoad Exp $ */ // Include application functions @@ -549,7 +549,7 @@ $actions = array( 'properties' => array( 'title' => $lang['strproperties'], - 'url' => "viewproperties.php?{$misc->href}&", + 'url' => "redirect.php?section=view&{$misc->href}&", 'vars' => array('view' => 'relname'), ), 'browse' => array( @@ -586,6 +586,7 @@ $misc->printHeader($lang['strviews']); $misc->printBody(); + $misc->printNav('schema','views'); switch ($action) { case 'selectrows': |