Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Wide-spread improvements to navigation tabs.

  • Loading branch information...
commit 34f9fa9a10e42c9e7eecacc1a578d7ca452c9ba0 1 parent de0f964
jollytoad authored
View
3  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 @@ function aggPre(&$rowdata) {
$misc->printHeader($lang['straggregates']);
$misc->printBody();
+ $misc->printNav('schema', 'aggregates');
switch ($action) {
default:
View
5 all_db.php
@@ -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 @@ function doDrop($confirm) {
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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strdatabases']);
$misc->printBody();
+ $misc->printNav('server','databases');
switch ($action) {
case 'save_create':
View
16 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&amp;' . 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 @@ function addNodes(&$schemanode, $querystr) {
$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 @@ function addNodes(&$schemanode, $querystr) {
$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 @@ function addNodes(&$schemanode, $querystr) {
|| $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 @@ function addNodes(&$schemanode, $querystr) {
$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 @@ function addNodes(&$schemanode, $querystr) {
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
View
3  casts.php
@@ -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 @@ function castPre(&$rowdata) {
$misc->printHeader($lang['strcasts']);
$misc->printBody();
+ $misc->printNav('database','casts');
switch ($action) {
default:
View
409 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 @@ function printReload($database) {
/**
* 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']}&amp;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 . '&amp;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}&amp;reltype=table&amp;relation=" . urlencode($_REQUEST['table']),
- ),
- 'info' => array (
- 'title' => $lang['strinfo'],
- 'url' => "info.php?{$vars}",
- ),
- 'privileges' => array (
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?{$vars}&amp;type=table&amp;object=" . urlencode($_REQUEST['table']),
- ),
- 'import' => array (
- 'title' => $lang['strimport'],
- 'url' => "tblproperties.php?{$vars}&amp;action=import",
- ),
- 'export' => array (
- 'title' => $lang['strexport'],
- 'url' => "tblproperties.php?{$vars}&amp;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 . '&amp;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&amp;{$vars}",
- ),
- 'rules' => array (
- 'title' => $lang['strrules'],
- 'url' => "rules.php?{$this->href}&amp;reltype=view&amp;relation=" . urlencode($_REQUEST['view']),
- ),
- 'privileges' => array (
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?{$vars}&amp;type=view&amp;object=" . urlencode($_REQUEST['view']),
- ),
- 'export' => array (
- 'title' => $lang['strexport'],
- 'url' => "viewproperties.php?action=export&amp;{$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}&amp;action=sql",
- ),
- 'find' => array (
- 'title' => $lang['strfind'],
- 'url' => "database.php?{$vars}&amp;action=find",
- ),
- 'variables' => array (
- 'title' => $lang['strvariables'],
- 'url' => "database.php?{$vars}&amp;action=variables",
- ),
- 'processes' => array (
- 'title' => $lang['strprocesses'],
- 'url' => "database.php?{$vars}&amp;action=processes",
- ),
- 'admin' => array (
- 'title' => $lang['stradmin'],
- 'url' => "database.php?{$vars}&amp;action=admin",
- ),
- 'privileges' => array (
- 'title' => $lang['strprivileges'],
- 'url' => "privileges.php?{$vars}&amp;type=database&amp;object=" . urlencode($_REQUEST['database']),
- ),
- 'export' => array (
- 'title' => $lang['strexport'],
- 'url' => "database.php?{$vars}&amp;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 = '&amp;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;
}
/**
View
7 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 @@ function addPrimaryOrUniqueKey($type, $confirm, $msg = '') {
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 @@ function cnPre(&$rowdata, $actions) {
}
}
- $misc->printTableNav();
$misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strconstraints']),'constraints');
$misc->printMsg($msg);
@@ -548,6 +547,8 @@ function cnPre(&$rowdata, $actions) {
else
$misc->printBody();
+ $misc->printNav('table','constraints');
+
switch ($action) {
case 'cluster_constraint':
if (isset($_POST['cluster'])) doClusterIndex(false);
View
3  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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strconversions']);
$misc->printBody();
+ $misc->printNav('schema','conversions');
switch ($action) {
default:
View
21 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 @@ function doFind($confirm = true, $msg = '') {
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 @@ function doExport($msg = '') {
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 @@ function doVariables() {
// 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 @@ function doProcesses($msg = '') {
// 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 @@ function doAdmin($action = '', $msg = '') {
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 @@ function doSQL() {
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 @@ function doDrop($confirm) {
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 @@ function doCreate($msg = '') {
// 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 @@ function doDefault($msg = '') {
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 @@ function doDefault($msg = '') {
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => 'schema.php?database='.urlencode($_REQUEST['database'])."&amp;",
+ 'url' => "redirect.php?section=schema&amp;database=".urlencode($_REQUEST['database'])."&amp;",
'vars' => array('schema' => 'nspname'),
),
'drop' => array(
View
22 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 @@ function _charHandler($parser, $cdata) {
$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 @@ function _charHandler($parser, $cdata) {
}
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:
View
3  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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strdomains']);
$misc->printBody();
+ $misc->printNav('schema','domains');
switch ($action) {
case 'add_check':
View
3  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 @@ function fnPre(&$rowdata) {
$misc->printHeader($lang['strfunctions']);
$misc->printBody();
+ $misc->printNav('schema','functions');
switch ($action) {
case 'save_create':
View
3  groups.php
@@ -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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strgroups']);
$misc->printBody();
+ $misc->printNav('server','groups');
switch ($action) {
case 'add_member':
View
7 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 @@ function doDefault($msg = '') {
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 @@ function doDefault($msg = '') {
echo "<body onload=\"init();\">";
else
$misc->printBody();
-
+
+ $misc->printNav('table','indexes');
+
switch ($action) {
case 'cluster_index':
if (isset($_POST['cluster'])) doClusterIndex(false);
View
4 info.php
@@ -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 @@ function doDefault($msg = '') {
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);
View
3  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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strlanguages']);
$misc->printBody();
+ $misc->printNav('database','languages');
switch ($action) {
default:
View
4 links.js
@@ -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;
View
3  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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['stropclasses']);
$misc->printBody();
+ $misc->printNav('schema','opclasses');
switch ($action) {
default:
View
3  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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['stroperators']);
$misc->printBody();
+ $misc->printNav('schema','operators');
switch ($action) {
case 'save_create':
View
11 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 @@ function doDefault($msg = '') {
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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strprivileges']);
$misc->printBody();
+ $misc->printNav($_REQUEST['type'], 'privileges');
switch ($action) {
case 'save':
View
14 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();
+?>
View
8 rules.php
@@ -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 @@ function doDefault($msg = '') {
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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strviews'] . ' - ' . $_REQUEST['relation'] . ' - ' . $lang['strrules']);
}
$misc->printBody();
-
+ $misc->printNav($_REQUEST['reltype'],'rules');
+
switch ($action) {
case 'create_rule':
createRule(true);
View
5 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 @@ function doReset() {
// Print header
$misc->printHeader($lang['strsequences']);
$misc->printBody();
-
+ $misc->printNav('schema','sequences');
+
switch($action) {
case 'create':
doCreateSequence();
View
4 sql.php
@@ -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
View
6 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 @@ function doFind() {
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 @@ function doDefault() {
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>";
View
5 tables.php
@@ -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 @@ function doDefault($msg = '') {
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => "tblproperties.php?{$misc->href}&amp;",
+ 'url' => "redirect.php?section=table&amp;{$misc->href}&amp;",
'vars' => array('table' => 'relname'),
),
'browse' => array(
@@ -549,6 +549,7 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strtables']);
$misc->printBody();
+ $misc->printNav('schema','tables');
switch ($action) {
case 'create':
View
12 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 @@ function doAlter($msg = '') {
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 @@ function doExport($msg = '') {
// 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 @@ function doImport($msg = '') {
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 @@ function doAddColumn($msg = '') {
// 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 @@ function doProperties($msg = '') {
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 @@ function doDrop($confirm) {
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 @@ function attPre(&$rowdata) {
$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);
View
4 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 @@ function tgPre(&$rowdata) {
: $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 @@ function tgPre(&$rowdata) {
$misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $lang['strtriggers']);
$misc->printBody();
+ $misc->printNav('table','triggers');
switch ($action) {
case 'alter':
View
3  types.php
@@ -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 @@ function doDefault($msg = '') {
$misc->printHeader($lang['strtypes']);
$misc->printBody();
+ $misc->printNav('schema','types');
switch ($action) {
case 'save_create':
View
3  users.php
@@ -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 @@ function uPre(&$rowdata) {
$misc->printHeader($lang['strusers']);
$misc->printBody();
+ $misc->printNav('server','users');
switch ($action) {
case 'changepassword':
View
9 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 @@ function doExport($msg = '') {
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 @@ function doDefinition($msg = '') {
// 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 @@ function doProperties($msg = '') {
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 @@ function attPre(&$rowdata) {
$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);
View
5 views.php
@@ -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 @@ function vwPre(&$rowdata) {
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => "viewproperties.php?{$misc->href}&amp;",
+ 'url' => "redirect.php?section=view&amp;{$misc->href}&amp;",
'vars' => array('view' => 'relname'),
),
'browse' => array(
@@ -586,6 +586,7 @@ function vwPre(&$rowdata) {
$misc->printHeader($lang['strviews']);
$misc->printBody();
+ $misc->printNav('schema','views');
switch ($action) {
case 'selectrows':
Please sign in to comment.
Something went wrong with that request. Please try again.