* Add owner everywhere
* Cancel/<Action> buttons everywhere
* pg_dump feature!!!
-* Add default_db_encoding support to lang files and create database
+* True/False conversion doesn't work on table browse
* Default database encoding for languages
* Convert our images to PNG format
* Allow creating tables WITHOUT OIDS
+* Show boolean values as TRUE or FALSE when viewing data
Bug Fixes:
* Lots of NULL value in table dump fixes (XML format changed slightly)
/**
* Class to hold various commonly used functions
*
- * $Id: Misc.php,v 1.37 2003/07/28 07:50:32 chriskl Exp $
+ * $Id: Misc.php,v 1.38 2003/08/05 06:04:36 chriskl Exp $
*/
class Misc {
* Replace all spaces with in a string
* @param $str The string to change
* @param $shownull True to show NULLs, false otherwise
+ * @param $type Field type if available, other NULL
* @return The string with replacements
*/
- function printVal($str, $shownull = false) {
+ function printVal($str, $shownull = false, $type = null) {
+ global $lang;
+
// If the string contains at least one instance of >1 space in a row, a tab character, a
// space at the start of a line, or a space at the start of the whole string then
// substitute all spaces for s
if ($str === null && $shownull) return '<i>NULL</i>';
- elseif (strstr($str, ' ') || strstr($str, "\t") || strstr($str, "\n ") || ereg('^[ ]', $str)) {
- $str = str_replace(' ', ' ', htmlspecialchars($str));
- // Replace tabs with 8 spaces
- $str = str_replace("\t", ' ', $str);
- return nl2br($str);
+ else {
+ switch ($type) {
+ case 'bool':
+ case 'boolean':
+ if ($str == 't') return $lang['strtrue'];
+ elseif ($str == 'f') return $lang['strfalse'];
+ else return nl2br(htmlspecialchars($str));
+ break;
+ default:
+ if (strstr($str, ' ') || strstr($str, "\t") || strstr($str, "\n ") || ereg('^[ ]', $str)) {
+ $str = str_replace(' ', ' ', htmlspecialchars($str));
+ // Replace tabs with 8 spaces
+ $str = str_replace("\t", ' ', $str);
+ return nl2br($str);
+ }
+ else
+ return nl2br(htmlspecialchars($str));
+ }
}
- else
- return nl2br(htmlspecialchars($str));
}
/**
* @param $return_desc The return link name
* @param $page The current page
*
- * $Id: display.php,v 1.20 2003/05/31 07:23:24 chriskl Exp $
+ * $Id: display.php,v 1.21 2003/08/05 06:04:36 chriskl Exp $
*/
// Include application functions
$id = (($i % 2) == 0 ? '1' : '2');
echo "<tr>\n";
foreach ($rs->f as $k => $v) {
- echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($v, true), "</td>";
+ $finfo = $rs->fetchField($k);
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($v, true, $finfo->type), "</td>";
}
echo "</tr>\n";
$rs->moveNext();
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.90 2003/08/01 01:45:30 chriskl Exp $
+ * $Id: english.php,v 1.91 2003/08/05 06:04:36 chriskl Exp $
*/
// Language and character set
$lang['strreferences'] = 'References';
$lang['stryes'] = 'Yes';
$lang['strno'] = 'No';
- $lang['strtrue'] = 'True';
- $lang['strfalse'] = 'False';
+ $lang['strtrue'] = 'TRUE';
+ $lang['strfalse'] = 'FALSE';
$lang['stredit'] = 'Edit';
$lang['strcolumns'] = 'Columns';
$lang['strrows'] = 'row(s)';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.42 2003/08/01 01:45:30 chriskl Exp $
+ * $Id: english.php,v 1.43 2003/08/05 06:04:36 chriskl Exp $
*/
// Language and character set
$lang['strreferences'] = 'References';
$lang['stryes'] = 'Yes';
$lang['strno'] = 'No';
- $lang['strtrue'] = 'True';
- $lang['strfalse'] = 'False';
+ $lang['strtrue'] = 'TRUE';
+ $lang['strfalse'] = 'FALSE';
$lang['stredit'] = 'Edit';
$lang['strcolumns'] = 'Columns';
$lang['strrows'] = 'row(s)';
/**
* Function library read in upon startup
*
- * $Id: lib.inc.php,v 1.54 2003/06/23 06:08:51 chriskl Exp $
+ * $Id: lib.inc.php,v 1.55 2003/08/05 06:04:36 chriskl Exp $
*/
// Set error reporting level to max
$appName = 'phpPgAdmin';
// Application version
- $appVersion = '3.0';
+ $appVersion = '3.1-dev';
// Check to see if the configuration file exists, if not, explain
* @param $return_url The return URL
* @param $return_desc The return link name
*
- * $Id: sql.php,v 1.7 2003/07/31 08:39:03 chriskl Exp $
+ * $Id: sql.php,v 1.8 2003/08/05 06:04:36 chriskl Exp $
*/
// Include application functions
$id = (($i % 2) == 0 ? '1' : '2');
echo "<tr>\n";
foreach ($rs->f as $k => $v) {
- echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($v, true), "</td>";
+ $finfo = $rs->fetchField($k);
+ echo "<td class=\"data{$id}\" nowrap=\"nowrap\">", $misc->printVal($v, true, $finfo->type), "</td>";
}
echo "</tr>\n";
$rs->moveNext();