/**
* 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
$misc->printHeader($lang['straggregates']);
$misc->printBody();
+ $misc->printNav('schema', 'aggregates');
switch ($action) {
default:
/**
* 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
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";
$misc->printHeader($lang['strdatabases']);
$misc->printBody();
+ $misc->printNav('server','databases');
switch ($action) {
case 'save_create':
* 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
$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,
/**
* Helper function for adding nodes
* @param $schemanode Node onto which to add
- */
+ */
function addNodes(&$schemanode, $querystr) {
global $data, $misc, $lang, $conf;
$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",
$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",
|| $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'));
$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,
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
/**
* 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
$misc->printHeader($lang['strcasts']);
$misc->printBody();
+ $misc->printNav('database','casts');
switch ($action) {
default:
/**
* 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 {
/**
* 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;
}
/**
/**
* 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
doDefault($lang['strinvalidparam']);
return;
}
-
+
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}: ",
$misc->printVal($_REQUEST['table']), ": {$desc}</h2>\n";
$misc->printMsg($msg);
}
}
- $misc->printTableNav();
$misc->printTitle(array($misc->printVal($_REQUEST['database']), $misc->printVal($_REQUEST['table']), $lang['strconstraints']),'constraints');
$misc->printMsg($msg);
else
$misc->printBody();
+ $misc->printNav('table','constraints');
+
switch ($action) {
case 'cluster_constraint':
if (isset($_POST['cluster'])) doClusterIndex(false);
/**
* 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
$misc->printHeader($lang['strconversions']);
$misc->printBody();
+ $misc->printNav('schema','conversions');
switch ($action) {
default:
/**
* 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
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);
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);
// 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(
// 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);
else doAdmin('', $lang['strreindexbad']);
break;
default:
- $misc->printDatabaseNav();
+ $misc->printNav('database','admin');
$misc->printTitle(array($misc->printVal($_REQUEST['database']),$lang['stradmin']));
$misc->printMsg($msg);
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";
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";
// 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);
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);
$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(
/**
* 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
$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
}
break;
case 'xml':
- $parser = xml_parser_create();\r
- xml_set_element_handler($parser, '_startElement', '_endElement');\r
- xml_set_character_data_handler($parser, '_charHandler');\r
- \r
- while (!feof($fd)) {\r
- $line = fgets($fd, 4096);\r
- xml_parse($parser, $line);\r
- }\r
- \r
+ $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:
/**
* 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
$misc->printHeader($lang['strdomains']);
$misc->printBody();
+ $misc->printNav('schema','domains');
switch ($action) {
case 'add_check':
/**
* 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
$misc->printHeader($lang['strfunctions']);
$misc->printBody();
+ $misc->printNav('schema','functions');
switch ($action) {
case 'save_create':
/**
* 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
$misc->printHeader($lang['strgroups']);
$misc->printBody();
+ $misc->printNav('server','groups');
switch ($action) {
case 'add_member':
/**
* 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
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);
echo "<body onload=\"init();\">";
else
$misc->printBody();
-
+
+ $misc->printNav('table','indexes');
+
switch ($action) {
case 'cluster_index':
if (isset($_POST['cluster'])) doClusterIndex(false);
/**
* 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
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);
/**
* 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
$misc->printHeader($lang['strlanguages']);
$misc->printBody();
+ $misc->printNav('database','languages');
switch ($action) {
default:
* 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;
/**
* 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
$misc->printHeader($lang['stropclasses']);
$misc->printBody();
+ $misc->printNav('schema','opclasses');
switch ($action) {
default:
/**
* 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
$misc->printHeader($lang['stroperators']);
$misc->printBody();
+ $misc->printNav('schema','operators');
switch ($action) {
case 'save_create':
/**
* 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
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;
$misc->printHeader($lang['strprivileges']);
$misc->printBody();
+ $misc->printNav($_REQUEST['type'], 'privileges');
switch ($action) {
case 'save':
--- /dev/null
+<?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();
+?>
/**
* 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
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);
$misc->printHeader($lang['strviews'] . ' - ' . $_REQUEST['relation'] . ' - ' . $lang['strrules']);
}
$misc->printBody();
-
+ $misc->printNav($_REQUEST['reltype'],'rules');
+
switch ($action) {
case 'create_rule':
createRule(true);
/**
* 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
// Print header
$misc->printHeader($lang['strsequences']);
$misc->printBody();
-
+ $misc->printNav('schema','sequences');
+
switch($action) {
case 'create':
doCreateSequence();
* 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
$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
/**
* 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
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>";
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>";
/**
* 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
$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(
$misc->printHeader($lang['strtables']);
$misc->printBody();
+ $misc->printNav('schema','tables');
switch ($action) {
case 'create':
/**
* 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
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);
// 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);
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);
// 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);
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);
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']),
$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);
/**
* 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
: $data->getTriggerDef($rowdata->f);
}
- $misc->printTableNav();
$misc->printTitle(array($misc->printVal($_REQUEST['database'])), $misc->printVal($_REQUEST['table']), $lang['strtriggers']);
$misc->printMsg($msg);
$misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $lang['strtriggers']);
$misc->printBody();
+ $misc->printNav('table','triggers');
switch ($action) {
case 'alter':
/**
* 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
$misc->printHeader($lang['strtypes']);
$misc->printBody();
+ $misc->printNav('schema','types');
switch ($action) {
case 'save_create':
/**
* 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
$misc->printHeader($lang['strusers']);
$misc->printBody();
+ $misc->printNav('server','users');
switch ($action) {
case 'changepassword':
/**
* 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
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);
// 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);
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);
$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);
/**
* 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
$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(
$misc->printHeader($lang['strviews']);
$misc->printBody();
+ $misc->printNav('schema','views');
switch ($action) {
case 'selectrows':