/**
* Manage aggregates in a database
*
- * $Id: aggregates.php,v 1.10 2004/09/20 14:41:38 jollytoad Exp $
+ * $Id: aggregates.php,v 1.10.4.1 2005/03/01 10:47:02 jollytoad Exp $
*/
// Include application functions
$misc->printTable($aggregates, $columns, $actions, $lang['strnoaggregates']);
}
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $aggregates = &$data->getAggregates();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('proname'),
+ 'icon' => 'functions',
+ ),
+ );
+
+ $misc->printTreeXML($aggregates, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['straggregates']);
$misc->printBody();
/**
* Manage databases within a server
*
- * $Id: all_db.php,v 1.35 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: all_db.php,v 1.35.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
echo "<p>", sprintf($lang['strconfdropdatabase'], $misc->printVal($_REQUEST['database'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
- echo "<input type=\"hidden\" name=\"database\" value=\"",
- htmlspecialchars($_REQUEST['database']), "\" />\n";
+ echo $misc->form;
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
echo "</form>\n";
echo "</table>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create\" />\n";
+ echo $misc->form;
echo "<input type=\"submit\" value=\"{$lang['strcreate']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
echo "</form>\n";
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => 'redirect.php?section=database&',
+ 'url' => "redirect.php?section=database&{$misc->href}&",
'vars' => array('database' => 'datname'),
),
'drop' => array(
'title' => $lang['strdrop'],
- 'url' => "{$PHP_SELF}?action=confirm_drop&subject=database&",
+ 'url' => "{$PHP_SELF}?action=confirm_drop&subject=database&{$misc->href}&",
'vars' => array('database' => 'datname'),
),
'privileges' => array(
'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=database&",
+ 'url' => "privileges.php?subject=database&{$misc->href}&",
'vars' => array('database' => 'datname'),
)
);
$misc->printTable($databases, $columns, $actions, $lang['strnodatabases']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreatedatabase']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreatedatabase']}</a></p>\n";
}
+
+ function doTree() {
+ global $misc, $data, $lang;
+
+ $databases = &$data->getDatabases();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('datname'),
+ 'icon' => 'database',
+ 'url' => 'redirect.php',
+ 'urlvars' => array(
+ 'subject' => 'database',
+ 'database' => field('datname'),
+ ),
+ ),
+ 'expand' => array(
+ 'url' => 'database.php',
+ 'urlvars' => array(
+ 'subject' => 'database',
+ 'action' => 'tree',
+ 'database' => field('datname'),
+ ),
+ ),
+ );
+
+ $opts = array(
+ 'postxml' =>
+ "<tree text=\"{$lang['strusers']}\" action=\"users.php?{$misc->href}\" target=\"detail\"/>".
+ "<tree text=\"{$lang['strgroups']}\" action=\"groups.php?{$misc->href}\" target=\"detail\"/>".
+ "<tree text=\"{$lang['strreports']}\" action=\"reports.php?{$misc->href}\" target=\"detail\"/>"
+ );
+
+ $misc->printTreeXML($databases, $actions, $opts);
+ exit;
+ }
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strdatabases']);
$misc->printBody();
* if you click on a database it shows a list of database objects in that
* database.
*
- * $Id: browser.php,v 1.44 2005/02/08 13:32:44 mr-russ Exp $
+ * $Id: browser.php,v 1.44.2.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
+ $_no_db_connection = true;
include_once('./libraries/lib.inc.php');
- // Include tree classe
- include_once('./classes/HTML_TreeMenu/TreeMenu.php');
-
// Output header
- $misc->printHeader('', "<script src=\"classes/HTML_TreeMenu/TreeMenu.js\" type=\"text/javascript\"></script>\n<script src=\"links.js\" type=\"text/javascript\"></script>");
+ $misc->printHeader('', "<script src=\"xloadtree/xtree.js\" type=\"text/javascript\"></script>\n<script src=\"xloadtree/xmlextras.js\" type=\"text/javascript\"></script>\n<script src=\"xloadtree/xloadtree.js\" type=\"text/javascript\"></script>");
$misc->printBody('browser');
-
- // Construct expanding tree
- $menu = new HTML_TreeMenu(null, array('usePersistence' => false));
- $root = new HTML_TreeNode(array(
- 'text' => $misc->printVal(($conf['servers'][$_SESSION['webdbServerID']]['desc'])),
- 'link' => addslashes('redirect.php?section=server&' . SID),
- 'icon' => 'folder.gif',
- 'expandedIcon' => 'folder-expanded.gif',
- 'expanded' => true,
- 'linkTarget' => 'detail'));
-
- // Add root node to menu
- $menu->addItem($root);
-
- /**
- * Helper function for adding nodes
- * @param $schemanode Node onto which to add
- */
- function addNodes(&$schemanode, $querystr) {
- global $data, $misc, $lang, $conf;
-
- // Tables
- $table_node = &new HTML_TreeNode(array(
- 'text' => $lang['strtables'],
- 'link' => addslashes(htmlspecialchars("tables.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/tables.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/tables.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add table folder to schema
- $schemanode->addItem($table_node);
-
- $tables = &$data->getTables();
- while (!$tables->EOF) {
- $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("redirect.php?section=table&{$querystr}&table=" . urlencode($tables->f['relname']))),
- 'icon' => "../../../images/themes/{$conf['theme']}/tables.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/tables.png",
- 'expanded' => false,
- 'linkTarget' => 'detail',
- 'iconLink' => addslashes(htmlspecialchars('display.php?table=' . urlencode($tables->f['relname']) . '&subject=table&' . $querystr . "&return_url={$return_url}&return_desc=" . urlencode($lang['strback'])))
- ));
- // Add table folder to schema
- $table_node->addItem($item_node);
-
- $tables->moveNext();
- }
-
- // Views
- $view_node = &new HTML_TreeNode(array(
- 'text' => $lang['strviews'],
- 'link' => addslashes(htmlspecialchars("views.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/views.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/views.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add view folder to schema
- $schemanode->addItem($view_node);
-
- $views = &$data->getViews();
- while (!$views->EOF) {
- $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("redirect.php?section=view&{$querystr}&view=" .
- urlencode($views->f['relname']))),
- 'icon' => "../../../images/themes/{$conf['theme']}/views.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/views.png",
- 'expanded' => false,
- 'linkTarget' => 'detail',
- // XXX: FIX BROWSE
- 'iconLink' => addslashes(htmlspecialchars('display.php?view='.urlencode($views->f['relname']).'&subject=view&'.$querystr.
- "&return_url={$return_url}&return_desc=" . urlencode($lang['strback'])))
- ));
- // Add view folder to schema
- $view_node->addItem($item_node);
-
- $views->moveNext();
- }
-
- // Sequences
- $seq_node = &new HTML_TreeNode(array(
- 'text' => $lang['strsequences'],
- 'link' => addslashes(htmlspecialchars("sequences.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/sequences.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/sequences.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $schemanode->addItem($seq_node);
-
- // Functions
- $func_node = &new HTML_TreeNode(array(
- 'text' => $lang['strfunctions'],
- 'link' => addslashes(htmlspecialchars("functions.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/functions.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/functions.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $schemanode->addItem($func_node);
-
- // Domains
- if ($data->hasDomains()) {
- $dom_node = &new HTML_TreeNode(array(
- 'text' => $lang['strdomains'],
- 'link' => addslashes(htmlspecialchars("domains.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/domains.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/domains.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
-
- // Add folder to schema
- $schemanode->addItem($dom_node);
- }
-
- // Advanced
- if ($conf['show_advanced']) {
- $adv_node = &new HTML_TreeNode(array(
- 'text' => $lang['stradvanced'],
-# 'link' => ($data->hasSchemas()) ? addslashes(htmlspecialchars("schema.php?{$querystr}&" . SID)) : null,
- 'icon' => 'folder.gif',
- 'expandedIcon' => 'folder-expanded.gif',
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $schemanode->addItem($adv_node);
-
- // Aggregates
- $agg_node = &new HTML_TreeNode(array(
- 'text' => $lang['straggregates'],
- 'link' => addslashes(htmlspecialchars("aggregates.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $adv_node->addItem($agg_node);
-
- // Types
- $type_node = &new HTML_TreeNode(array(
- 'text' => $lang['strtypes'],
- 'link' => addslashes(htmlspecialchars("types.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $adv_node->addItem($type_node);
-
- // Operators
- $opr_node = &new HTML_TreeNode(array(
- 'text' => $lang['stroperators'],
- 'link' => addslashes(htmlspecialchars("operators.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/operators.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/operators.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $adv_node->addItem($opr_node);
-
- // Operator Classes
- $opc_node = &new HTML_TreeNode(array(
- 'text' => $lang['stropclasses'],
- 'link' => addslashes(htmlspecialchars("opclasses.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/operators.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/operators.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to schema
- $adv_node->addItem($opc_node);
-
- // Conversions
- if ($data->hasConversions()) {
- $con_node = &new HTML_TreeNode(array(
- 'text' => $lang['strconversions'],
- 'link' => addslashes(htmlspecialchars("conversions.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
-
- // Add folder to schema
- $adv_node->addItem($con_node);
- }
- }
- }
-
- $databases = &$data->getDatabases(isset($_REQUEST['database']) ? $_REQUEST['database'] : NULL);
- while (!$databases->EOF) {
- // If database is selected, show folder, otherwise show document
- if (isset($_REQUEST['database']) && $_REQUEST['database'] == $databases->f['datname']) {
- // Very ugly hack to work around the fact that the PEAR HTML_Tree can't have links with embedded
- // apostrophes create the get string we need to append
- $querystr = 'database=' . urlencode($databases->f['datname']) . '&' . SID;
- $db_node = &new HTML_TreeNode(array(
- 'text' => $misc->printVal($databases->f['datname']),
- 'link' => addslashes(htmlspecialchars("redirect.php?section=database&{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/database.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/database.png",
- 'expanded' => true,
- 'linkTarget' => 'detail'));
-
- // If database supports schemas, add the extra level of hierarchy
- if ($data->hasSchemas()) {
- $schemas = &$data->getSchemas();
- while (!$schemas->EOF) {
- $data->setSchema($schemas->f['nspname']);
- // Construct database & schema query string
- $querystr = 'database=' . urlencode($databases->f['datname']). '&schema=' .
- urlencode($schemas->f['nspname']) . '&' . SID;
- $schemanode = &new HTML_TreeNode(array(
- 'text' => $misc->printVal($schemas->f['nspname']),
- '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
- // only one schema in the database.
- 'expanded' => ($schemas->f['nspname'] == $_SESSION['webdbUsername']
- || $schemas->recordCount() == 1),
- 'linkTarget' => 'detail'));
-
- addNodes($schemanode, $querystr);
+?>
- // Add schema to database
- $db_node->addItem($schemanode);
+ <div class="logo"><a href="intro.php" target="detail"><img src="images/themes/<?php echo $conf['theme'] ?>/title.png" width="200" height="50" alt="<?php echo htmlspecialchars($appName) ?>" title="<?php echo htmlspecialchars($appName) ?>" /></a></div>
- $schemas->moveNext();
- }
- }
- // Database doesn't support schemas
- else {
- // Construct database query string
- $querystr = 'database=' . urlencode($databases->f['datname']) . '&' . SID;
+<script type="text/javascript">
- addNodes($db_node, $querystr);
- }
-
- // Reset database query string
- $querystr = 'database=' . urlencode($databases->f['datname']) . '&' . SID;
+webFXTreeConfig.rootIcon = "<?php echo $misc->icon('root') ?>";
+webFXTreeConfig.openRootIcon = "<?php echo $misc->icon('root') ?>";
+webFXTreeConfig.folderIcon = "<?php echo $misc->icon('folder') ?>";
+webFXTreeConfig.openFolderIcon = "<?php echo $misc->icon('folderOpen') ?>";
+webFXTreeConfig.fileIcon = "<?php echo $misc->icon('file') ?>";
+webFXTreeConfig.iIcon = "<?php echo $misc->icon('I') ?>";
+webFXTreeConfig.lIcon = "<?php echo $misc->icon('L') ?>";
+webFXTreeConfig.lMinusIcon = "<?php echo $misc->icon('Lminus') ?>";
+webFXTreeConfig.lPlusIcon = "<?php echo $misc->icon('Lplus') ?>";
+webFXTreeConfig.tIcon = "<?php echo $misc->icon('T') ?>";
+webFXTreeConfig.tMinusIcon = "<?php echo $misc->icon('Tminus') ?>";
+webFXTreeConfig.tPlusIcon = "<?php echo $misc->icon('Tplus') ?>";
+webFXTreeConfig.blankIcon = "<?php echo $misc->icon('blank') ?>";
- // Languages
- if ($conf['show_advanced']) {
- $lang_node = &new HTML_TreeNode(array(
- 'text' => $lang['strlanguages'],
- 'link' => addslashes(htmlspecialchars("languages.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
- // Add folder to database
- $db_node->addItem($lang_node);
-
- // Casts
- if ($data->hasCasts()) {
- $cast_node = &new HTML_TreeNode(array(
- 'text' => $lang['strcasts'],
- 'link' => addslashes(htmlspecialchars("casts.php?{$querystr}")),
- 'icon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/types.png",
- 'expanded' => false,
- 'linkTarget' => 'detail'));
+var tree = new WebFXLoadTree("<?php echo $lang['strservers']; ?>", "servers.php?action=tree", "servers.php");
+tree.target = 'detail';
- // Add folder to database
- $db_node->addItem($cast_node);
- }
- }
-
- // Add node to menu
- $root->addItem($db_node);
+document.write(tree);
- } else {
- // Very ugly hack to work around the fact that the PEAR HTML_Tree can't have links with embedded
- // apostrophes create the get string we need to append
- $jsLink = '?database=' . addslashes(htmlspecialchars(urlencode($databases->f['datname']) . '&' . SID));
- $jsLink = "javascript:updateLinks(' + \"'{$jsLink}'\" + ')";
- $db_node = &new HTML_TreeNode(array(
- 'text' => $misc->printVal($databases->f['datname']),
- 'link' => $jsLink,
- 'icon' => "../../../images/themes/{$conf['theme']}/database.png",
- 'expandedIcon' => "../../../images/themes/{$conf['theme']}/database.png",
- 'expanded' => false,
- 'linkTarget' => '_self'));
-
- // Add node to menu
- $root->addItem($db_node);
- }
-
- $databases->moveNext();
- }
- // Create the presentation class
- $treeMenu = &new HTML_TreeMenu_DHTML($menu, array('images' => 'classes/HTML_TreeMenu/images', 'defaultClass' => 'treeMenuDefault'));
-
- // Actually display the menu
- $treeMenu->printMenu();
+</script>
+<?php
// Output footer
$misc->printFooter();
/**
* List constraints on a table
*
- * $Id: constraints.php,v 1.40 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: constraints.php,v 1.40.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
$misc->printTable($constraints, $columns, $actions, $lang['strnoconstraints'], 'cnPre');
- echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=add_check&{$misc->href}&table=", urlencode($_REQUEST['table']),
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=add_check&{$misc->href}&table=", urlencode($_REQUEST['table']),
"\">{$lang['straddcheck']}</a> |\n";
- echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_unique_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
+ echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_unique_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
"\">{$lang['stradduniq']}</a> |\n";
- echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_primary_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
+ echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_primary_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
"\">{$lang['straddpk']}</a> |\n";
- echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_foreign_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
+ echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=add_foreign_key&{$misc->href}&table=", urlencode($_REQUEST['table']),
"\">{$lang['straddfk']}</a></p>\n";
}
/**
* Manage conversions in a database
*
- * $Id: conversions.php,v 1.9 2004/09/01 16:35:58 jollytoad Exp $
+ * $Id: conversions.php,v 1.9.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
$misc->printTable($conversions, $columns, $actions, $lang['strnoconversions']);
}
-
+
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $conversions = &$data->getconversions();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('conname'),
+ 'icon' => 'conversions',
+ ),
+ );
+
+ $misc->printTreeXML($conversions, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strconversions']);
$misc->printBody();
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.65 2004/11/29 01:48:38 chriskl Exp $
+ * $Id: database.php,v 1.65.2.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
if ($data->hasSignals()) {
$columns['actions'] = array('title' => $lang['stractions']);
-
+
+ $href = $misc->getHREF('schema');
+
$actions = array(
'cancel' => array(
'title' => $lang['strcancel'],
- 'url' => "{$PHP_SELF}?action=signal&signal=CANCEL&database=" . urlencode($_REQUEST['database']) . "&",
+ 'url' => "{$PHP_SELF}?action=signal&signal=CANCEL&{$href}&",
'vars' => array('procpid' => 'procpid')
)
);
$status = $data->recluster();
if ($status == 0) doAdmin('', $lang['strclusteredgood']);
else doAdmin('', $lang['strclusteredbad']);
- break;
+ break;
case 'reindex';
$status = $data->reindex('DATABASE', $_REQUEST['database'], isset($_REQUEST['reindex_force']));
if ($status == 0) doAdmin('', $lang['strreindexgood']);
echo "<p>", sprintf($lang['strconfdropschema'], $misc->printVal($_REQUEST['schema'])), "</p>\n";
echo "<form action=\"{$PHP_SELF}\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"database\" value=\"", htmlspecialchars($_REQUEST['database']), "\" />\n";
echo "<input type=\"hidden\" name=\"schema\" value=\"", htmlspecialchars($_REQUEST['schema']), "\" />\n";
global $data, $misc;
global $PHP_SELF, $lang;
+ $server_info = $misc->getServerInfo();
+
if (!isset($_POST['formName'])) $_POST['formName'] = '';
- if (!isset($_POST['formAuth'])) $_POST['formAuth'] = $_SESSION['webdbUsername'];
+ if (!isset($_POST['formAuth'])) $_POST['formAuth'] = $server_info['username'];
if (!isset($_POST['formSpc'])) $_POST['formSpc'] = '';
if (!isset($_POST['formComment'])) $_POST['formComment'] = '';
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table width=\"100%\">\n";
echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strname']}</th>\n";
echo "\t\t<td class=\"data1\"><input name=\"formName\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
),
);
+ $href = $misc->getHREF('schema');
+
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => "redirect.php?section=schema&database=".urlencode($_REQUEST['database'])."&",
+ 'url' => "redirect.php?section=schema&{$href}&",
'vars' => array('schema' => 'nspname'),
),
'drop' => array(
'title' => $lang['strdrop'],
- 'url' => "{$PHP_SELF}?action=confirm_drop&database=".urlencode($_REQUEST['database'])."&",
+ 'url' => "{$PHP_SELF}?action=confirm_drop&{$href}&",
'vars' => array('schema' => 'nspname'),
),
'privileges' => array(
'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=schema&database=".urlencode($_REQUEST['database'])."&",
+ 'url' => "privileges.php?subject=schema&{$href}&",
'vars' => array('schema' => 'nspname'),
),
'alter' => array(
'title' => $lang['stralter'],
- 'url' => "{$PHP_SELF}?action=alter_schema&database=".urlencode($_REQUEST['database'])."&",
+ 'url' => "{$PHP_SELF}?action=alter_schema&{$href}&",
'vars' => array('schema' => 'nspname'),
),
);
$misc->printTable($schemas, $columns, $actions, $lang['strnoschemas']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?database=", urlencode($_REQUEST['database']),
- "&action=create\">{$lang['strcreateschema']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$href}\">{$lang['strcreateschema']}</a></p>\n";
} else {
// If the database does not support schemas...
echo "<p>{$lang['strnoschemas']}</p>\n";
}
}
+ function doTree() {
+ global $misc, $data, $lang, $PHP_SELF;
+
+ $schemas = &$data->getSchemas();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('nspname'),
+ 'icon' => 'folder',
+ 'url' => 'redirect.php',
+ 'urlvars' => array(
+ 'subject' => 'schema',
+ 'schema' => field('nspname')
+ ),
+ ),
+ 'expand' => array(
+ 'url' => 'database.php',
+ 'urlvars' => array(
+ 'subject' => 'schema',
+ 'action' => 'subtree',
+ 'schema' => field('nspname')
+ ),
+ ),
+ );
+
+ $opts = array(
+ 'prexml' =>
+ "<tree text=\"{$lang['strprocesses']}\" action=\"database.php?{$misc->href}&subject=database&action=processes\" target=\"detail\"/>"
+ );
+
+ $misc->printTreeXML($schemas, $actions, $opts);
+ exit;
+ }
+
+ function doSubTree() {
+ global $misc, $data, $lang;
+
+ include_once('classes/ArrayRecordSet.php');
+ $tabs = $misc->getNavTabs('schema');
+ unset($tabs['privileges']);
+ $items =& new ArrayRecordSet($tabs);
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('title'),
+ 'icon' => field('icon', 'folder'),
+ 'url' => field('url'),
+ 'urlvars' => field('urlvars', array()),
+ ),
+ 'expand' => array(
+ 'url' => field('url'),
+ 'urlvars' => merge(field('urlvars'), array('action' => 'tree')),
+ ),
+ );
+
+ $misc->printTreeXML($items, $actions);
+ exit;
+ }
+
/**
* Display a form to permit editing schema properies.
* TODO: permit changing name, owner
doAlterSchema($lang['strschemaalteredbad']);
}
+ if ($action == 'tree') doTree();
+ if ($action == 'subtree') doSubTree();
+
$misc->printHeader($lang['strschemas']);
$misc->printBody();
/**
* Manage domains in a database
*
- * $Id: domains.php,v 1.19 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: domains.php,v 1.19.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$misc->href}\">{$lang['strcreatedomain']}</a></p>\n";
}
+
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data, $PHP_SELF;
+
+ $domains = &$data->getDomains();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('domname'),
+ 'icon' => 'domains',
+ 'url' => 'domains.php',
+ 'urlvars' => array(
+ 'subject' => 'domain',
+ 'action' => 'properties',
+ 'domain' => field('domname'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($domains, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
$misc->printHeader($lang['strdomains']);
$misc->printBody();
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.47 2004/09/18 11:59:40 soranzo Exp $
+ * $Id: functions.php,v 1.47.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
global $data, $conf, $misc, $func;
global $PHP_SELF, $lang;
- function fnPre(&$rowdata) {
- global $data;
- $rowdata->f['+proproto'] = $rowdata->f['proname'] . " (" . $rowdata->f['proarguments'] . ")";
- $rowdata->f['+proreturns'] = ($data->phpBool($rowdata->f['proretset']) ? 'setof ' : '') . $rowdata->f['proresult'];
- }
-
$misc->printTrail('schema');
$misc->printTabs('schema','functions');
$misc->printMsg($msg);
$columns = array(
'function' => array(
'title' => $lang['strfunction'],
- 'field' => '+proproto',
+ 'field' => 'proproto',
'type' => 'verbatim',
),
'returns' => array(
'title' => $lang['strreturns'],
- 'field' => '+proreturns',
+ 'field' => 'proreturns',
'type' => 'verbatim',
),
'proglanguage' => array(
'properties' => array(
'title' => $lang['strproperties'],
'url' => "redirect.php?section=function&action=properties&{$misc->href}&",
- 'vars' => array('function' => '+proproto', 'function_oid' => 'prooid'),
+ 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
),
'alter' => array(
'title' => $lang['stralter'],
'url' => "{$PHP_SELF}?action=edit&{$misc->href}&",
- 'vars' => array('function' => '+proproto', 'function_oid' => 'prooid'),
+ 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
),
'drop' => array(
'title' => $lang['strdrop'],
'url' => "{$PHP_SELF}?action=confirm_drop&{$misc->href}&",
- 'vars' => array('function' => '+proproto', 'function_oid' => 'prooid'),
+ 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
),
'privileges' => array(
'title' => $lang['strprivileges'],
'url' => "privileges.php?{$misc->href}&subject=function&",
- 'vars' => array('function' => '+proproto', 'function_oid' => 'prooid'),
+ 'vars' => array('function' => 'proproto', 'function_oid' => 'prooid'),
),
);
- $misc->printTable($funcs, $columns, $actions, $lang['strnofunctions'], 'fnPre');
+ $misc->printTable($funcs, $columns, $actions, $lang['strnofunctions']);
echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$misc->href}\">{$lang['strcreateplfunction']}</a> | ";
echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=create&language=internal&{$misc->href}\">{$lang['strcreateinternalfunction']}</a> | ";
echo "<a class=\"navlink\" href=\"{$PHP_SELF}?action=create&language=C&{$misc->href}\">{$lang['strcreatecfunction']}</a></p>\n";
}
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $funcs = &$data->getFunctions();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('proname'),
+ 'icon' => 'functions',
+ 'url' => 'redirect.php',
+ 'urlvars' => array(
+ 'subject' => 'function',
+ 'action' => 'properties',
+ 'function' => field('proproto'),
+ 'function_oid' => field('prooid'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($funcs, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strfunctions']);
$misc->printBody();
/**
* Manage groups in a database cluster
*
- * $Id: groups.php,v 1.19 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: groups.php,v 1.19.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
echo "<p>", sprintf($lang['strconfdropmember'], $misc->printVal($_REQUEST['user']), $misc->printVal($_REQUEST['group'])), "</p>\n";
echo "<form action=\"{$PHP_SELF}\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop_member\" />\n";
echo "<input type=\"hidden\" name=\"group\" value=\"", htmlspecialchars($_REQUEST['group']), "\" />\n";
echo "<input type=\"hidden\" name=\"user\" value=\"", htmlspecialchars($_REQUEST['user']), "\" />\n";
echo "<input type=\"hidden\" name=\"action\" value=\"add_member\" />\n";
echo "</form>\n";
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF\">{$lang['strshowallgroups']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?{$misc->href}\">{$lang['strshowallgroups']}</a></p>\n";
}
/**
echo "<p>", sprintf($lang['strconfdropgroup'], $misc->printVal($_REQUEST['group'])), "</p>\n";
echo "<form action=\"{$PHP_SELF}\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"group\" value=\"", htmlspecialchars($_REQUEST['group']), "\" />\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strname']}</th>\n";
echo "\t\t<td class=\"data\"><input size=\"32\" maxlength=\"{$data->_maxNameLen}\" name=\"name\" value=\"", htmlspecialchars($_POST['name']), "\" /></td>\n\t</tr>\n";
echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strmembers']}</th>\n";
echo "\t\t<td class=\"data\">\n";
- echo "\t\t\t<select name=\"members[]\" multiple=\"multiple\" size=\"", min(6, $users->recordCount()), "\">\n";
+ echo "\t\t\t<select name=\"members[]\" multiple=\"multiple\" size=\"", min(40, $users->recordCount()), "\">\n";
while (!$users->EOF) {
$username = $users->f['usename'];
echo "\t\t\t\t<option value=\"{$username}\"",
$misc->printTable($groups, $columns, $actions, $lang['strnogroups']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreategroup']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$misc->href}\">{$lang['strcreategroup']}</a></p>\n";
}
/**
* Main access point to the app.
*
- * $Id: index.php,v 1.11 2004/07/12 04:18:40 chriskl Exp $
+ * $Id: index.php,v 1.11.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
+ $_no_db_connection = true;
include_once('./libraries/lib.inc.php');
$misc->printHeader();
+
+ $rtl = (strcasecmp($lang['applangdir'], 'rtl') == 0);
+
+ $cols = $rtl ? '*,'.$conf['left_width'] : $conf['left_width'].',*';
+ $mainframe = '<frame src="intro.php" name="detail" id="detail" frameborder="0" />'
?>
-<frameset rows="52,*,12">
- <frame src="topbar.php" name="topbar" scrolling="no" noresize="noresize" frameborder="0" />
-<?php if (strcasecmp($lang['applangdir'], 'rtl') == 0) : ?>
- <frameset cols="*,<?php echo $conf['left_width'] ?>">
- <frame src="intro.php" name="detail" frameborder="0" />
- <frame src="browser.php" name="browser" frameborder="0" />
- </frameset>
-<?php else: ?>
- <frameset cols="<?php echo $conf['left_width'] ?>,*">
- <frame src="browser.php" name="browser" frameborder="0" />
- <frame src="intro.php" name="detail" frameborder="0" />
- </frameset>
-<?php endif; ?>
- <frame src="bottombar.php" name="bottombar" scrolling="no" noresize="noresize" frameborder="0" />
+<frameset cols="<?php echo $cols ?>">
+
+<?php if ($rtl) echo $mainframe; ?>
+
+ <frame src="browser.php" name="browser" id="browser" frameborder="0" />
+
+<?php if (!$rtl) echo $mainframe; ?>
+
<noframes>
<body>
- <?php echo $lang['strnoframes'] ?>
+ <?php echo $lang['strnoframes'] ?><br />
+ <a href="intro.php"><?php echo $lang['strnoframeslink'] ?></a>
</body>
</noframes>
+
</frameset>
+
<?php
$misc->printFooter(false);
?>
/**
* List indexes on a table
*
- * $Id: indexes.php,v 1.34 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: indexes.php,v 1.34.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
$misc->printTable($indexes, $columns, $actions, $lang['strnoindexes'], 'indPre');
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create_index&{$misc->href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreateindex']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create_index&{$misc->href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreateindex']}</a></p>\n";
}
$misc->printHeader($lang['strindexes'], "<script src=\"indexes.js\" type=\"text/javascript\"></script>");
/**
* Intro screen
*
- * $Id: intro.php,v 1.14 2005/01/17 10:09:43 jollytoad Exp $
+ * $Id: intro.php,v 1.14.2.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions (no db conn)
$misc->printHeader();
$misc->printBody();
+
+ $misc->printTrail('root');
+ $misc->printTabs('root','intro');
?>
<h1><?php echo "$appName $appVersion (PHP ". phpversion() .')' ?></h1>
<p><?php echo $lang['strintro'] ?></p>
<ul>
-<li><b><a href="all_db.php"><?php echo $lang['strdatabases'] ?></a></b></li>
<li><b><a href="http://phppgadmin.sourceforge.net/" target="_top"><?php echo $lang['strppahome'] ?></a></b></li>
<li><b><a href="<?php echo $lang['strpgsqlhome_url'] ?>" target="_top"><?php echo $lang['strpgsqlhome'] ?></a></b></li>
<?php
/**
* Login screen
*
- * $Id: login.php,v 1.23 2005/02/18 11:39:46 chriskl Exp $
+ * $Id: login.php,v 1.23.2.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// This needs to be an include once to prevent lib.inc.php infinite recursive includes.
// Check to see if the configuration file exists, if not, explain
require_once('./libraries/lib.inc.php');
+
+ $misc->printHeader($lang['strlogin']);
+ $misc->printBody();
+ $misc->printTrail('root');
+
+ $server_info = $misc->getServerInfo($_REQUEST['server']);
+
+ $misc->printTitle(sprintf($lang['strlogintitle'], $server_info['desc']));
+
+ $loginServer = htmlspecialchars($_REQUEST['server']);
+ $loginUsername = '';
+
+ if (isset($msg)) $misc->printMsg($msg);
+?>
- // Prepare form variables
- if (!isset($_POST['formServer'])) $_POST['formServer'] = '';
- if (!isset($_POST['formLanguage'])) {
- // Parse the user acceptable language in HTTP_ACCEPT_LANGUAGE
- // ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 )
- // If there's one available, then overwrite the default language.
- if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
- $userLanguage = '';
- $userLanguages = array();
- $acceptableLanguages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
- foreach ($acceptableLanguages as $accLang) {
- $languageInfos = explode(';', trim($accLang));
- $languageRange = strtolower($languageInfos[0]);
- if (isset($languageInfos[1]) && substr($languageInfos[1], 0, 2) == 'q=')
- $languageQuality = (float)substr($languageInfos[1], 2, 5);
- else
- $languageQuality = 1;
- // If the language is already in the array, check that we
- // don't overwrite its quality value with a lower one
- if ((!array_key_exists($languageRange, $userLanguages))
- || ($userLanguages[$languageRange] < $languageQuality))
- $userLanguages[$languageRange] = $languageQuality;
- }
- arsort($userLanguages, SORT_NUMERIC);
-
- // if it's available 'language-country', but not general 'language' translation
- // (eg. 'portuguese-br', but not 'portuguese')
- // specify both 'la' => 'language-country' and 'la-co' => 'language-country'.
- // See http://www.w3.org/WAI/ER/IG/ert/iso639.htm for language codes
- $availableLanguages = array(
- 'af' => 'afrikaans',
- 'ar' => 'arabic',
- 'zh' => 'chinese-tr',
- 'zh-cn' => 'chinese-sim',
- 'cs' => 'czech',
- 'da' => 'danish',
- 'nl' => 'dutch',
- 'en' => 'english',
- 'fr' => 'french',
- 'de' => 'german',
- 'he' => 'hebrew',
- 'it' => 'italian',
- 'ja' => 'japanese',
- 'hu' => 'hungarian',
- 'mn' => 'mongol',
- 'pl' => 'polish',
- 'pt' => 'portuguese-br',
- 'pt-br' => 'portuguese-br',
- 'ro' => 'romanian',
- 'ru' => 'russian',
- 'sk' => 'slovak',
- 'sv' => 'swedish',
- 'es' => 'spanish',
- 'tr' => 'turkish',
- 'uk' => 'ukrainian'
- );
-
- reset($userLanguages);
- do {
- $languageRange = key($userLanguages);
- if (array_key_exists($languageRange, $availableLanguages)) {
- $userLanguage = $availableLanguages[$languageRange];
- }
- } while ($userLanguage == '' && next($userLanguages));
- if ($userLanguage != '') $conf['default_lang'] = $userLanguage;
- }
- $_POST['formLanguage'] = $conf['default_lang'];
- // Include default language over english.
- include_once('./lang/recoded/' . strtolower($conf['default_lang']) . '.php');
- }
-
- // Check for config file version mismatch
- if (!isset($conf['version']) || $conf['base_version'] > $conf['version']) {
- echo $lang['strbadconfig'];
- exit;
- }
-
- // Force encoding to UTF-8
- $lang['appcharset'] = 'UTF-8';
-
- // Output header
- if (isset($_failed) && $_failed) {
- $misc->printHeader($lang['strlogin'], "<script type=\"text/javascript\"><!--
- // show login form in top frame
- if (top != self) {
- window.top.location.href='./index.php?{$_SERVER['QUERY_STRING']}';
- }
- //-->
-</script>");
- } else {
- $misc->printHeader($lang['strlogin']);
+<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="login_form">
+<?php
+ // Pass request vars through form (is this a security risk???)
+ foreach ($_REQUEST as $key => $val) {
+ if (substr($key,0,5) == 'login' || $key == 'PPA_ID') continue;
+ echo "<input type=\"hidden\" name=\"", htmlspecialchars($key), "\" value=\"", htmlspecialchars($val), "\" />\n";
}
- $misc->printBody();
?>
+ <input type="hidden" name="loginServer" value="<?php echo $loginServer; ?>" />
+ <table class="navbar" border="0" cellpadding="5" cellspacing="3">
+ <tr>
+ <td><?php echo $lang['strusername']; ?></td>
+ <td><input type="text" name="loginUsername" value="<?php echo $loginUsername; ?>" size="24" /></td>
+ </tr>
+ <tr>
+ <td><?php echo $lang['strpassword']; ?></td>
+ <td><input type="password" name="loginPassword" size="24" /></td>
+ </tr>
+ </table>
+ <p><input type="submit" name="loginSubmit" value="<?php echo $lang['strlogin']; ?>" /></p>
+</form>
- <table class="navbar" border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
- <tr>
- <td height="115" align="center" valign="middle">
- <center>
- <h1><?php echo $appName ?> <?php echo $appVersion ?> <?php echo $lang['strlogin'] ?></h1>
- <?php
- if (isset($_failed) && $_failed)
- echo "<p class=\"message\">{$lang['strloginfailed']}</p>";
- elseif (isset($_allowed) && !$_allowed) {
- echo "<p class=\"message\">{$lang['strlogindisallowed']}\n";
- echo "<br /><a href=\"{$lang['strviewfaq_url']}\">{$lang['strviewfaq']}</a></p>";
- }
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="login_form">
- <table class="navbar" border="0" cellpadding="5" cellspacing="3">
- <tr>
- <th><?php echo $lang['strusername'] ?>:</th>
- <td><input type="text" name="formUsername" value="<?php echo (isset($_POST['formUsername'])) ? htmlspecialchars($_POST['formUsername']) : '' ?>" size="24" /></td>
- </tr>
- <tr>
- <th><?php echo $lang['strpassword'] ?>:</th>
- <td><input type="password" name="formPassword" size="24" /></td>
- </tr>
- <tr>
- <th><?php echo $lang['strserver'] ?>:</th>
- <td><select name="formServer">
- <?php
- for ($i = 0; $i < sizeof($conf['servers']); $i++) {
- echo "<option value=\"{$i}\"",
- ($i == $_POST['formServer']) ? ' selected="selected"' : '',
- ">", htmlspecialchars($conf['servers'][$i]['desc']), "</option>\n";
- }
- ?>
- </select></td>
- </tr>
- <tr>
- <th><?php echo $lang['strlanguage'] ?>:</th>
- <td><select name="formLanguage">
- <?php
- // Language name already encoded
- foreach ($appLangFiles as $k => $v) {
- echo "<option value=\"{$k}\"",
- ($k == $_POST['formLanguage']) ? ' selected="selected"' : '',
- ">{$v}</option>\n";
- }
- ?>
- </select></td>
- </tr>
- </table>
- <p><input type="submit" name="submitLogin" value="<?php echo $lang['strlogin'] ?>" /></p>
- </form>
- </center>
- <script type="text/javascript">
- <!--
- var uname = document.login_form.formUsername;
- var pword = document.login_form.formPassword;
- if (uname.value == "") {
- uname.focus();
- } else {
- pword.focus();
- }
- //-->
- </script>
- </td>
- </tr>
- </table>
<?php
// Output footer
$misc->printFooter();
/**
* Manage opclasss in a database
*
- * $Id: opclasses.php,v 1.6 2004/09/01 16:35:59 jollytoad Exp $
+ * $Id: opclasses.php,v 1.6.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
$misc->printTable($opclasses, $columns, $actions, $lang['strnoopclasses']);
}
-
+
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $opclasses = &$data->getOpClasses();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('amname'),
+ 'icon' => 'operators',
+ ),
+ );
+
+ $misc->printTreeXML($opclasses, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['stropclasses']);
$misc->printBody();
/**
* Manage operators in a database
*
- * $Id: operators.php,v 1.17 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: operators.php,v 1.17.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
// echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreateoperator']}</a></p>\n";
}
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data, $PHP_SELF;
+
+ $operators = &$data->getOperators();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('oprname'),
+ 'icon' => 'operators',
+ 'url' => 'operators.php',
+ 'urlvars' => array(
+ 'subject' => 'operator',
+ 'action' => 'properties',
+ 'operator' => field('oprname'),
+ 'operator_oid' => field('oid'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($operators, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['stroperators']);
$misc->printBody();
<?php
+ # TEMP: until all URL's converted 'section' to 'subject'
+ $subject = isset($_REQUEST['subject']) ? $_REQUEST['subject'] : $_REQUEST['section'];
+
+ if ($subject == 'root')
+ $_no_db_connection = true;
+
include_once('./libraries/lib.inc.php');
- $url = parse_url($misc->getLastTabURL($_REQUEST['section']));
+ $url = parse_url($misc->getLastTabURL($subject));
$_SERVER['PHP_SELF'] = $url['path'];
/**
* List reports in a database
*
- * $Id: reports.php,v 1.19 2004/09/02 13:53:56 jollytoad Exp $
+ * $Id: reports.php,v 1.19.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table width=\"100%\">\n";
echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n";
echo "<td class=\"data1\"><input name=\"report_name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
}
else echo "<p>{$lang['strinvalidparam']}</p>\n";
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF\">{$lang['strshowallreports']}</a> |\n";
- echo "<a class=\"navlink\" href=\"$PHP_SELF?action=edit&report_id={$report->f['report_id']}\">{$lang['stredit']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?{$misc->href}\">{$lang['strshowallreports']}</a> |\n";
+ echo "<a class=\"navlink\" href=\"$PHP_SELF?action=edit&{$misc->href}&report_id={$report->f['report_id']}\">{$lang['stredit']}</a></p>\n";
}
/**
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table width=\"100%\">\n";
echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n";
echo "<td class=\"data1\"><input name=\"report_name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
echo "<p>", sprintf($lang['strconfdropreport'], $misc->printVal($report->f['report_name'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"report_id\" value=\"", htmlspecialchars($_REQUEST['report_id']), "\" />\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
global $PHP_SELF, $lang;
$misc->printTrail('server');
- $misc->printTitle($lang['strreports']);
+ $misc->printTabs('server','reports');
$misc->printMsg($msg);
$reports = &$reportsdb->getReports();
),
);
+ $return_url = urlencode("{$PHP_SELF}?{$misc->href}");
+
$actions = array(
'properties' => array(
'title' => $lang['strproperties'],
- 'url' => "{$PHP_SELF}?action=properties&",
+ 'url' => "{$PHP_SELF}?action=properties&{$misc->href}&",
'vars' => array('report_id' => 'report_id'),
),
'run' => array(
'title' => $lang['strrun'],
- 'url' => "display.php?subject=report&return_url={$PHP_SELF}&return_desc=".urlencode($lang['strback'])."&",
+ 'url' => "display.php?subject=report&{$misc->href}&return_url={$return_url}&return_desc=".urlencode($lang['strback'])."&",
'vars' => array('report' => 'report_name', 'database' => 'db_name', 'query' => 'report_sql'),
),
'edit' => array(
'title' => $lang['stredit'],
- 'url' => "{$PHP_SELF}?action=edit&",
+ 'url' => "{$PHP_SELF}?action=edit&{$misc->href}&",
'vars' => array('report_id' => 'report_id'),
),
'drop' => array(
'title' => $lang['strdrop'],
- 'url' => "{$PHP_SELF}?action=confirm_drop&",
+ 'url' => "{$PHP_SELF}?action=confirm_drop&{$misc->href}&",
'vars' => array('report_id' => 'report_id'),
),
);
$misc->printTable($reports, $columns, $actions, $lang['strnoreports']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreatereport']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$misc->href}\">{$lang['strcreatereport']}</a></p>\n";
}
$misc->printHeader($lang['strreports']);
include_once('./classes/Reports.php');
$reportsdb = new Reports($status);
if ($status != 0) {
- echo "<p>{$lang['strnoreportsdb']}</p>\n";
+ $misc->printTrail('server');
+ $misc->printTabs('server','reports');
+ $misc->printMsg($lang['strnoreportsdb']);
}
else {
switch ($action) {
/**
* Manage sequences in a database
*
- * $Id: sequences.php,v 1.27 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: sequences.php,v 1.27.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreatesequence']}</a></p>\n";
}
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $sequences = &$data->getSequences();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('seqname'),
+ 'icon' => 'sequences',
+ 'url' => 'sequences.php',
+ 'urlvars' => array(
+ 'subject' => 'sequence',
+ 'action' => 'properties',
+ 'sequence' => field('seqname'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($sequences, $actions);
+ exit;
+ }
+
/**
* Display the properties of a sequence
*/
doProperties($lang['strsequenceresetbad']);
}
+ if ($action == 'tree') doTree();
+
// Print header
$misc->printHeader($lang['strsequences']);
$misc->printBody();
/**
* List tables in a database
*
- * $Id: tables.php,v 1.69 2005/01/23 12:42:35 soranzo Exp $
+ * $Id: tables.php,v 1.69.2.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreatetable']}</a></p>\n";
}
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $tables = &$data->getTables();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('relname'),
+ 'icon' => 'tables',
+ 'url' => 'redirect.php',
+ 'urlvars' => array(
+ 'subject' => 'table',
+ 'table' => field('relname'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($tables, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strtables']);
$misc->printBody();
/**
* Manage tablespaces in a database cluster
*
- * $Id: tablespaces.php,v 1.6 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: tablespaces.php,v 1.6.4.1 2005/03/01 10:47:03 jollytoad Exp $
*/
// Include application functions
if (!isset($_POST['owner'])) $_POST['owner'] = $tablespace->f['spcowner'];
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n";
echo "<td class=\"data1\">";
echo "</table>\n";
echo "<p><input type=\"hidden\" name=\"action\" value=\"save_edit\" />\n";
echo "<input type=\"hidden\" name=\"tablespace\" value=\"", htmlspecialchars($_REQUEST['tablespace']), "\" />\n";
- echo $misc->form;
echo "<input type=\"submit\" name=\"alter\" value=\"{$lang['stralter']}\" />\n";
echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
echo "</form>\n";
echo "<p>", sprintf($lang['strconfdroptablespace'], $misc->printVal($_REQUEST['tablespace'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"tablespace\" value=\"", htmlspecialchars($_REQUEST['tablespace']), "\" />\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
global $data, $misc, $spcname;
global $PHP_SELF, $lang;
+ $server_info = $misc->getServerInfo();
+
if (!isset($_POST['formSpcname'])) $_POST['formSpcname'] = '';
- if (!isset($_POST['formOwner'])) $_POST['formOwner'] = $_SESSION['webdbUsername'];
+ if (!isset($_POST['formOwner'])) $_POST['formOwner'] = $server_info['username'];
if (!isset($_POST['formLoc'])) $_POST['formLoc'] = '';
// Fetch all users
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strname']}</th>\n";
echo "\t\t<td class=\"data1\"><input size=\"32\" name=\"formSpcname\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_POST['formSpcname']), "\" /></td>\n\t</tr>\n";
)
);
+ $href = $misc->getHREF('database');
+
$actions = array(
'alter' => array(
'title' => $lang['stralter'],
- 'url' => "{$PHP_SELF}?action=edit&",
+ 'url' => "{$PHP_SELF}?action=edit&{$href}&",
'vars' => array('tablespace' => 'spcname')
),
'drop' => array(
'title' => $lang['strdrop'],
- 'url' => "{$PHP_SELF}?action=confirm_drop&",
+ 'url' => "{$PHP_SELF}?action=confirm_drop&{$href}&",
'vars' => array('tablespace' => 'spcname')
),
'privileges' => array(
'title' => $lang['strprivileges'],
- 'url' => "privileges.php?subject=tablespace&",
+ 'url' => "privileges.php?subject=tablespace&{$href}&",
'vars' => array('tablespace' => 'spcname')
)
);
$misc->printTable($tablespaces, $columns, $actions, $lang['strnotablespaces']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreatetablespace']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$href}\">{$lang['strcreatetablespace']}</a></p>\n";
}
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.62 2004/11/02 03:33:35 chriskl Exp $
+ * $Id: tblproperties.php,v 1.62.4.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
echo "<td class=\"data1\">";
echo "<input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
htmlspecialchars($_POST['name']), "\" /></td></tr>\n";
- if ($data->hasAlterTableOwner() && $data->isSuperUser($_SESSION['webdbUsername'])) {
+
+ $server_info = $misc->getServerInfo();
+ if ($data->hasAlterTableOwner() && $data->isSuperUser($server_info['username'])) {
echo "<tr><th class=\"data left required\">{$lang['strowner']}</th>\n";
echo "<td class=\"data1\"><select name=\"owner\">";
while (!$users->EOF) {
echo "<ul>\n";
$return_url = urlencode("tblproperties.php?{$misc->href}&table={$_REQUEST['table']}");
- echo "\t<li><a href=\"display.php?{$misc->href}&table=", urlencode($_REQUEST['table']), "&subject=table&return_url={$return_url}&return_desc=",
+ echo "\t<li><a href=\"display.php?{$misc->href}&table=", urlencode($_REQUEST['table']), "&subject=table&return_url={$return_url}&return_desc=",
urlencode($lang['strback']), "\">{$lang['strbrowse']}</a></li>\n";
- echo "\t<li><a href=\"tables.php?action=confselectrows&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strselect']}</a></li>\n";
- echo "\t<li><a href=\"tables.php?action=confinsertrow&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strinsert']}</a></li>\n";
- echo "\t<li><a href=\"tables.php?action=confirm_empty&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strempty']}</a></li>\n";
- echo "\t<li><a href=\"tables.php?action=confirm_drop&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strdrop']}</a></li>\n";
- echo "\t<li><a href=\"{$PHP_SELF}?action=add_column&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['straddcolumn']}</a></li>\n";
- echo "\t<li><a href=\"{$PHP_SELF}?action=confirm_alter&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['stralter']}</a></li>\n";
+ echo "\t<li><a href=\"tables.php?action=confselectrows&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strselect']}</a></li>\n";
+ echo "\t<li><a href=\"tables.php?action=confinsertrow&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strinsert']}</a></li>\n";
+ echo "\t<li><a href=\"tables.php?action=confirm_empty&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strempty']}</a></li>\n";
+ echo "\t<li><a href=\"tables.php?action=confirm_drop&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['strdrop']}</a></li>\n";
+ echo "\t<li><a href=\"{$PHP_SELF}?action=add_column&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['straddcolumn']}</a></li>\n";
+ echo "\t<li><a href=\"{$PHP_SELF}?action=confirm_alter&{$misc->href}&table=", urlencode($_REQUEST['table']),"\">{$lang['stralter']}</a></li>\n";
echo "</ul>\n";
}
/**
* List triggers on a table
*
- * $Id: triggers.php,v 1.24 2004/09/28 13:09:31 jollytoad Exp $
+ * $Id: triggers.php,v 1.24.4.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
$misc->printTable($triggers, $columns, $actions, $lang['strnotriggers'], 'tgPre');
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreatetrigger']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreatetrigger']}</a></p>\n";
}
$misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $lang['strtriggers']);
/**
* Manage types in a database
*
- * $Id: types.php,v 1.25 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: types.php,v 1.25.4.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
echo "</p>\n";
}
-
+
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $types = &$data->getTypes();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('basename'),
+ 'icon' => 'types',
+ 'url' => 'types.php',
+ 'urlvars' => array(
+ 'subject' => 'type',
+ 'action' => 'properties',
+ 'type' => field('basename'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($types, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strtypes']);
$misc->printBody();
/**
* Manage users in a database cluster
*
- * $Id: users.php,v 1.29 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: users.php,v 1.29.4.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
global $data, $misc;
global $PHP_SELF, $lang;
- $userdata = &$data->getUser($_SESSION['webdbUsername']);
- $_REQUEST['user'] = $_SESSION['webdbUsername'];
+ $server_info = $misc->getServerInfo();
+
+ $userdata = &$data->getUser($server_info['username']);
+ $_REQUEST['user'] = $server_info['username'];
$misc->printTrail('user');
- $misc->printTitle($lang['straccount'],'pg.user');
+ $misc->printTabs('server','account');
$misc->printMsg($msg);
if ($userdata->recordCount() > 0) {
}
else echo "<p>{$lang['strnodata']}</p>\n";
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=confchangepassword\">{$lang['strchangepassword']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=confchangepassword&{$misc->href}\">{$lang['strchangepassword']}</a></p>\n";
}
/**
function doChangePassword($confirm, $msg = '') {
global $data, $misc;
global $PHP_SELF, $lang, $conf;
-
+
+ $server_info = $misc->getServerInfo();
+
if ($confirm) {
- $_REQUEST['user'] = $_SESSION['webdbUsername'];
+ $_REQUEST['user'] = $server_info['username'];
$misc->printTrail('user');
$misc->printTitle($lang['strchangepassword'],'pg.user.alter');
$misc->printMsg($msg);
if (!isset($_POST['confirm'])) $_POST['confirm'] = '';
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strpassword']}</th>\n";
echo "\t\t<td><input type=\"password\" name=\"password\" size=\"32\" value=\"",
elseif ($_POST['password'] != $_POST['confirm'])
doChangePassword(true, $lang['strpasswordconfirm']);
else {
- $status = $data->changePassword($_SESSION['webdbUsername'],
+ $status = $data->changePassword($server_info['username'],
$_POST['password']);
if ($status == 0)
doAccount($lang['strpasswordchanged']);
$userdata = &$data->getUser($_REQUEST['username']);
if ($userdata->recordCount() > 0) {
- $canRename = $data->hasUserRename() && ($_REQUEST['username'] != $_SESSION['webdbUsername']);
+ $server_info = $misc->getServerInfo();
+ $canRename = $data->hasUserRename() && ($_REQUEST['username'] != $server_info['username']);
$userdata->f['usesuper'] = $data->phpBool($userdata->f['usesuper']);
$userdata->f['usecreatedb'] = $data->phpBool($userdata->f['usecreatedb']);
}
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strusername']}</th>\n";
echo "\t\t<td class=\"data1\">", ($canRename ? "<input name=\"newname\" size=\"15\" value=\"" . htmlspecialchars($_POST['newname']) . "\" />" : $misc->printVal($userdata->f['usename'])), "</td>\n\t</tr>\n";
echo "<p>", sprintf($lang['strconfdropuser'], $misc->printVal($_REQUEST['username'])), "</p>\n";
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
echo "<input type=\"hidden\" name=\"username\" value=\"", htmlspecialchars($_REQUEST['username']), "\" />\n";
echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
$misc->printMsg($msg);
echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
+ echo $misc->form;
echo "<table>\n";
echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strusername']}</th>\n";
echo "\t\t<td class=\"data1\"><input size=\"15\" name=\"formUsername\" value=\"", htmlspecialchars($_POST['formUsername']), "\" /></td>\n\t</tr>\n";
$misc->printTable($users, $columns, $actions, $lang['strnousers']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create\">{$lang['strcreateuser']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"{$PHP_SELF}?action=create&{$misc->href}\">{$lang['strcreateuser']}</a></p>\n";
}
/**
* List views in a database
*
- * $Id: viewproperties.php,v 1.13 2004/09/07 13:58:21 jollytoad Exp $
+ * $Id: viewproperties.php,v 1.13.4.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
echo "<br />\n";
echo "<ul>\n";
- $return_url = urlencode("viewproperties.php?{$misc->href}&view=" . urlencode($_REQUEST['view']));
- echo "\t<li><a href=\"display.php?{$misc->href}&view=", urlencode($_REQUEST['view']), "&subject=view&return_url={$return_url}&return_desc=",
+ $return_url = urlencode("viewproperties.php?{$misc->href}&view=" . urlencode($_REQUEST['view']));
+ echo "\t<li><a href=\"display.php?{$misc->href}&view=", urlencode($_REQUEST['view']), "&subject=view&return_url={$return_url}&return_desc=",
urlencode($lang['strback']), "\">{$lang['strbrowse']}</a></li>\n";
- echo "\t<li><a href=\"views.php?action=confselectrows&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strselect']}</a></li>\n";
- echo "\t<li><a href=\"views.php?action=confirm_drop&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strdrop']}</a></li>\n";
+ echo "\t<li><a href=\"views.php?action=confselectrows&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strselect']}</a></li>\n";
+ echo "\t<li><a href=\"views.php?action=confirm_drop&{$misc->href}&view=", urlencode($_REQUEST['view']),"\">{$lang['strdrop']}</a></li>\n";
echo "</ul>\n";
}
/**
* Manage views in a database
*
- * $Id: views.php,v 1.52 2005/01/23 12:42:35 soranzo Exp $
+ * $Id: views.php,v 1.52.2.1 2005/03/01 10:47:04 jollytoad Exp $
*/
// Include application functions
$misc->printTable($views, $columns, $actions, $lang['strnoviews']);
- echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreateview']}</a> |\n";
- echo "<a class=\"navlink\" href=\"$PHP_SELF?action=wiz_create&{$misc->href}\">{$lang['strcreateviewwiz']}</a></p>\n";
+ echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreateview']}</a> |\n";
+ echo "<a class=\"navlink\" href=\"$PHP_SELF?action=wiz_create&{$misc->href}\">{$lang['strcreateviewwiz']}</a></p>\n";
}
-
+
+ /**
+ * Generate XML for the browser tree.
+ */
+ function doTree() {
+ global $misc, $data;
+
+ $views = &$data->getViews();
+
+ $actions = array(
+ 'item' => array(
+ 'text' => field('relname'),
+ 'icon' => 'views',
+ 'url' => 'redirect.php',
+ 'urlvars' => array(
+ 'subject' => 'view',
+ 'view' => field('relname'),
+ ),
+ ),
+ );
+
+ $misc->printTreeXML($views, $actions);
+ exit;
+ }
+
+ if ($action == 'tree') doTree();
+
$misc->printHeader($lang['strviews']);
$misc->printBody();