* View, add, edit and delete comments on tables, views, schemas,
aggregates, conversions, operators, functions and
columns (Dan Boren & ChrisKL)
+* Add config file option for turning off the display of comments
* Allow creating array columns in tables
* Allow adding array columns to tables
* Allow creating domains with type length and arrays
/**
* Manage aggregates in a database
*
- * $Id: aggregates.php,v 1.2 2004/04/17 12:59:03 chriskl Exp $
+ * $Id: aggregates.php,v 1.3 2004/05/08 14:44:56 chriskl Exp $
*/
// Include application functions
* Show default list of aggregates in the database
*/
function doDefault($msg = '') {
- global $data, $misc;
+ global $data, $conf, $misc;
global $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['straggregates']}</h2>\n";
if ($aggregates->recordCount() > 0) {
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strtype']}</th>";
- echo "<th class=\"data\">{$lang['strcomment']}</th>";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>";
echo "</tr>\n";
$i = 0;
while (!$aggregates->EOF) {
else
echo $misc->printVal($aggregates->f['proargtypes']);
echo "</td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($aggregates->f['aggcomment']), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($aggregates->f['aggcomment']), "</td>\n";
echo "</tr>\n";
$aggregates->moveNext();
$i++;
/**
* Manage databases within a server
*
- * $Id: all_db.php,v 1.22 2004/01/04 07:30:12 chriskl Exp $
+ * $Id: all_db.php,v 1.23 2004/05/08 14:44:56 chriskl Exp $
*/
// Include application functions
* Show default list of databases in the server
*/
function doDefault($msg = '') {
- global $data, $misc;
+ global $data, $conf, $misc;
global $PHP_SELF, $lang;
echo "<h2>{$lang['strdatabases']}</h2>\n";
if ($databases->recordCount() > 0) {
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strdatabase']}</th><th class=\"data\">{$lang['strowner']}</th>";
- echo "<th class=\"data\">{$lang['strencoding']}</th><th class=\"data\">{$lang['strcomment']}</th>";
- echo "<th class=\"data\">{$lang['stractions']}</th></tr>\n";
+ echo "<th class=\"data\">{$lang['strencoding']}</th>";
+ echo "<th class=\"data\">{$lang['stractions']}</th>\n";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>";
+ echo "</tr>\n";
$i = 0;
while (!$databases->EOF) {
$id = (($i % 2) == 0 ? '1' : '2');
echo "<tr><td class=\"data{$id}\">", $misc->printVal($databases->f[$data->dbFields['dbname']]), "</td>\n";
echo "<td class=\"data{$id}\">", $misc->printVal($databases->f[$data->dbFields['owner']]), "</td>\n";
echo "<td class=\"data{$id}\">", $misc->printVal($databases->f[$data->dbFields['encoding']]), "</td>\n";
- echo "<td class=\"data{$id}\">", htmlspecialchars($databases->f[$data->dbFields['dbcomment']]), "</td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&db=",
urlencode($databases->f[$data->dbFields['dbname']]), "\">{$lang['strdrop']}</a></td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", htmlspecialchars($databases->f[$data->dbFields['dbcomment']]), "</td>\n";
echo "</tr>\n";
$databases->moveNext();
$i++;
* Central phpPgAdmin configuration. As a user you may modify the
* settings here for your particular configuration.
*
- * $Id: config.inc.php-dist,v 1.33 2004/03/04 20:12:24 xzilla Exp $
+ * $Id: config.inc.php-dist,v 1.34 2004/05/08 14:45:10 chriskl Exp $
*/
// An example server. Create as many of these as you wish,
// other means. (eg. Run 'SELECT * FROM pg_database' in the SQL area.)
$conf['owned_only'] = false;
+ // Display comments on objects? Comments are a good way of documenting
+ // a database, but they do take up space in the interface.
+ $conf['show_comments'] = true;
+
// Display "advanced" objects? Setting this to true will show types,
// operators conversions, languages and casts in phpPgAdmin. These
// objects are rarely administered and can clutter the interface.
* Don't modify anything below this line *
*****************************************/
- $conf['version'] = 12;
+ $conf['version'] = 13;
?>
/**
* Manage conversions in a database
*
- * $Id: conversions.php,v 1.4 2004/04/17 12:59:03 chriskl Exp $
+ * $Id: conversions.php,v 1.5 2004/05/08 14:44:56 chriskl Exp $
*/
// Include application functions
* Show default list of conversions in the database
*/
function doDefault($msg = '') {
- global $data, $misc, $database;
+ global $data, $conf, $misc, $database;
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strconversions']}</h2>\n";
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strsourceencoding']}</th>";
echo "<th class=\"data\">{$lang['strtargetencoding']}</th><th class=\"data\">{$lang['strdefault']}</th>";
- echo "<th class=\"data\">{$lang['strcomment']}</th>\n";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>\n";
echo "</tr>\n";
$i = 0;
while (!$conversions->EOF) {
echo "<td class=\"data{$id}\">", $misc->printVal($conversions->f['conforencoding']), "</td>\n";
echo "<td class=\"data{$id}\">", $misc->printVal($conversions->f['contoencoding']), "</td>\n";
echo "<td class=\"data{$id}\">", ($conversions->f['condefault']) ? $lang['stryes'] : $lang['strno'], "</td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($conversions->f['concomment']), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($conversions->f['concomment']), "</td>\n";
echo "</tr>\n";
$conversions->moveNext();
$i++;
/**
* Manage schemas within a database
*
- * $Id: database.php,v 1.39 2004/04/20 01:34:43 chriskl Exp $
+ * $Id: database.php,v 1.40 2004/05/08 14:44:56 chriskl Exp $
*/
// Include application functions
* Show default list of schemas in the server
*/
function doDefault($msg = '') {
- global $data, $misc;
+ global $data, $misc, $conf;
global $PHP_SELF, $lang;
$misc->printDatabaseNav();
if ($schemas->recordCount() > 0) {
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strname']}</th><th class=\"data\">{$lang['strowner']}</th>";
- echo "<th colspan=\"3\" class=\"data\">{$lang['stractions']}</th><th class=\"data\">{$lang['strcomment']}</th>\n";
+ echo "<th colspan=\"3\" class=\"data\">{$lang['stractions']}</th>";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>\n";
+ echo "</tr>\n";
$i = 0;
while (!$schemas->EOF) {
$id = (($i % 2) == 0 ? '1' : '2');
echo "<td class=\"opbutton{$id}\"><a href=\"schema.php?database=",
urlencode($_REQUEST['database']), "&schema=",
urlencode($schemas->f[$data->nspFields['nspname']]), "&action=alter\">{$lang['stralter']}</a></td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($schemas->f[$data->nspFields['nspcomment']]), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($schemas->f[$data->nspFields['nspcomment']]), "</td>\n";
echo "</tr>\n";
$schemas->moveNext();
$i++;
/**
* Manage domains in a database
*
- * $Id: domains.php,v 1.10 2004/03/31 08:09:55 chriskl Exp $
+ * $Id: domains.php,v 1.11 2004/05/08 14:44:56 chriskl Exp $
*/
// Include application functions
* Show default list of domains in the database
*/
function doDefault($msg = '') {
- global $data, $misc;
+ global $data, $conf, $misc;
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strdomains']}</h2>\n";
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strdomain']}</th><th class=\"data\">{$lang['strtype']}</th><th class=\"data\">{$lang['strnotnull']}</th>";
echo "<th class=\"data\">{$lang['strdefault']}</th><th class=\"data\">{$lang['strowner']}</th>";
- echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th><th class=\"data\">{$lang['strcomment']}</th></tr>\n";
+ echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th>";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>";
+ echo "</tr>\n";
$i = 0;
while (!$domains->EOF) {
$domains->f['domnotnull'] = $data->phpBool($domains->f['domnotnull']);
echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domowner']), "</td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=properties&{$misc->href}&domain=", urlencode($domains->f['domname']), "\">{$lang['strproperties']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&domain=", urlencode($domains->f['domname']), "\">{$lang['strdrop']}</a></td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domcomment']), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($domains->f['domcomment']), "</td>\n";
echo "</tr>\n";
$domains->moveNext();
$i++;
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.28 2004/05/08 14:08:00 chriskl Exp $
+ * $Id: functions.php,v 1.29 2004/05/08 14:45:09 chriskl Exp $
*/
// Include application functions
* Show default list of functions in the database
*/
function doDefault($msg = '') {
- global $data, $misc, $func;
+ global $data, $conf, $misc, $func;
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}</h2>\n";
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strfunctions']}</th><th class=\"data\">{$lang['strreturns']}</th>\n";
echo "<th class=\"data\">{$lang['strarguments']}</th><th colspan=\"4\" class=\"data\">{$lang['stractions']}</th>\n";
- echo "<th class=\"data\">{$lang['strcomment']}</th>\n";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>\n";
echo "</tr>\n";
$i = 0;
while (!$funcs->EOF) {
$funcs->f[$data->fnFields['fnoid']], "&type=function\">{$lang['strprivileges']}</a></td>\n";
}
else echo "<td></td>";
- echo "<td class=\"data{$id}\">", $misc->printVal($funcs->f['funccomment']), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($funcs->f['funccomment']), "</td>\n";
echo "</tr>\n";
$funcs->moveNext();
$i++;
/**
* Function library read in upon startup
*
- * $Id: lib.inc.php,v 1.74 2004/03/04 01:27:29 chriskl Exp $
+ * $Id: lib.inc.php,v 1.75 2004/05/08 14:45:10 chriskl Exp $
*/
// Set error reporting level to max
// Configuration file version. If this is greater than that in config.inc.php, then
// the app will refuse to run. This and $conf['version'] should be incremented whenever
// backwards incompatible changes are made to config.inc.php-dist.
- $conf['base_version'] = 12;
+ $conf['base_version'] = 13;
// List of available language files
$appLangFiles = array(
/**
* Manage operators in a database
*
- * $Id: operators.php,v 1.11 2004/04/17 12:59:03 chriskl Exp $
+ * $Id: operators.php,v 1.12 2004/05/08 14:45:10 chriskl Exp $
*/
// Include application functions
* Show default list of operators in the database
*/
function doDefault($msg = '') {
- global $data, $misc, $database;
+ global $data, $conf, $misc;
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['stroperators']}</h2>\n";
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['stroperator']}</th><th class=\"data\">{$lang['strleftarg']}</th>";
echo "<th class=\"data\">{$lang['strrightarg']}</th><th class=\"data\">{$lang['strreturns']}</th>";
- echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th><th class=\"data\">{$lang['strcomment']}</th\n";
+ echo "<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th>";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th\n";
echo "</tr>\n";
$i = 0;
while (!$operators->EOF) {
urlencode($operators->f['oprname']), "&operator_oid=", urlencode($operators->f['oid']), "\">{$lang['strproperties']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&operator=",
urlencode($operators->f['oprname']), "&operator_oid=", urlencode($operators->f['oid']), "\">{$lang['strdrop']}</a></td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($operators->f['oprcomment']), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($operators->f['oprcomment']), "</td>\n";
echo "</tr>\n";
$operators->moveNext();
$i++;
/**
* List tables in a database
*
- * $Id: tables.php,v 1.49 2004/04/17 12:59:04 chriskl Exp $
+ * $Id: tables.php,v 1.50 2004/05/08 14:45:10 chriskl Exp $
*/
// Include application functions
* Show default list of tables in the database
*/
function doDefault($msg = '') {
- global $data, $misc, $data;
+ global $data, $conf, $misc, $data;
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strtables']}</h2>\n";
if ($tables->recordCount() > 0) {
echo "<table>\n";
echo "<tr>\n\t<th class=\"data\">{$lang['strtable']}</th>\n\t<th class=\"data\">{$lang['strowner']}</th>\n";
- echo "\t<th colspan=\"6\" class=\"data\">{$lang['stractions']}</th>\n\t<th class=\"data\">{$lang['strcomment']}</th>\n</tr>\n";
+ echo "\t<th colspan=\"6\" class=\"data\">{$lang['stractions']}</th>\n";
+ if ($conf['show_comments']) echo "\t<th class=\"data\">{$lang['strcomment']}</th>\n";
+ echo "</tr>\n";
$i = 0;
while (!$tables->EOF) {
$return_url = urlencode("tables.php?{$misc->href}");
urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strempty']}</a></td>\n";
echo "\t<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&table=",
urlencode($tables->f[$data->tbFields['tbname']]), "\">{$lang['strdrop']}</a></td>\n";
- echo "\t<td class=\"data{$id}\">", $misc->printVal($tables->f['tablecomment']), "</td>\n";
+ if ($conf['show_comments']) echo "\t<td class=\"data{$id}\">", $misc->printVal($tables->f['tablecomment']), "</td>\n";
echo "</tr>\n";
$tables->moveNext();
$i++;
/**
* List tables in a database
*
- * $Id: tblproperties.php,v 1.42 2004/04/12 07:50:33 chriskl Exp $
+ * $Id: tblproperties.php,v 1.43 2004/05/08 14:45:10 chriskl Exp $
*/
// Include application functions
* Show default list of columns in the table
*/
function doDefault($msg = '') {
- global $data, $misc;
+ global $data, $conf, $misc;
global $PHP_SELF, $lang;
$misc->printTableNav();
echo "\t<th colspan=\"2\" class=\"data\">{$lang['stractions']}</th>\n";
else
echo "\t<th class=\"data\">{$lang['stractions']}</th>\n";
- echo "\t<th class=\"data\">{$lang['strcomment']}</th>\n";
- echo "</tr>\n";
+ if ($conf['show_comments']) echo "\t<th class=\"data\">{$lang['strcomment']}</th>\n";
+ echo "</tr>\n";
$i = 0;
while (!$attrs->EOF) {
echo "\t<td class=\"opbutton{$id}\"><a href=\"{$PHP_SELF}?{$misc->href}&table=", urlencode($_REQUEST['table']),
"&column=", urlencode($attrs->f['attname']), "&action=confirm_drop\">{$lang['strdrop']}</a></td>\n";
}
- echo "\t<td class=\"data{$id}\">", $misc->printVal($attrs->f['comment']), "</td>\n";
+ if ($conf['show_comments']) echo "\t<td class=\"data{$id}\">", $misc->printVal($attrs->f['comment']), "</td>\n";
echo "</tr>\n";
$attrs->moveNext();
$i++;
/**
* Manage views in a database
*
- * $Id: views.php,v 1.28 2004/03/12 08:56:52 chriskl Exp $
+ * $Id: views.php,v 1.29 2004/05/08 14:45:10 chriskl Exp $
*/
// Include application functions
global $PHP_SELF, $lang;
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strviews']}</h2>\n";
- //$misc->printHelp("/tutorial-views.html");
$misc->printMsg($msg);
$views = &$data->getViews();
echo "<table>\n";
echo "<tr><th class=\"data\">{$lang['strview']}</th><th class=\"data\">{$lang['strowner']}</th>";
echo "<th colspan=\"5\" class=\"data\">{$lang['stractions']}</th>\n";
- echo "<th class=\"data\">{$lang['strcomment']}</th></tr>\n";
+ if ($conf['show_comments']) echo "<th class=\"data\">{$lang['strcomment']}</th>";
+ echo "</tr>\n";
$i = 0;
while (!$views->EOF) {
// @@@@@@@@@ FIX THIS!!!!!
echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&{$misc->href}&view=", urlencode($views->f[$data->vwFields['vwname']]), "\">{$lang['strdrop']}</a></td>\n";
echo "<td class=\"opbutton{$id}\"><a href=\"privileges.php?{$misc->href}&object=", urlencode($views->f[$data->vwFields['vwname']]),
"&type=view\">{$lang['strprivileges']}</a></td>\n";
- echo "<td class=\"data{$id}\">", $misc->printVal($views->f[$data->vwFields['vwcomment']]), "</td>\n";
+ if ($conf['show_comments']) echo "<td class=\"data{$id}\">", $misc->printVal($views->f[$data->vwFields['vwcomment']]), "</td>\n";
echo "</tr>\n";
$views->moveNext();
$i++;