(eg. constraints can only be btree indexes)
re-enable help system
all DROP and ALTER commands MUST be fully schema-qualified otherwise you can accidentally drop stuff in pg_catalog :(
-need icons for Casts and Conversions
+need icons for Casts and Conversions and Languages
* Removed any trace of MySQL support
* Show casts
* Show conversions
+* Show languages
Bugs
* Added legal DOCTYPE
Languages
---------
-* Unimplemented
+* -Display (chriskl)
+* Drop
+* Create
Domains (7.3)
-------------
* if you click on a database it shows a list of database objects in that
* database.
*
- * $Id: browser.php,v 1.21 2003/10/27 03:49:19 chriskl Exp $
+ * $Id: browser.php,v 1.22 2003/10/27 05:43:18 chriskl Exp $
*/
// Include application functions
addNodes($db_node, $querystr);
}
+ // Languages
+ if ($data->hasLanguages()) {
+ $lang_node = &new HTML_TreeNode(array(
+ 'text' => addslashes($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(
/**
* Manage casts in a database
*
- * $Id: casts.php,v 1.1 2003/10/26 12:12:28 chriskl Exp $
+ * $Id: casts.php,v 1.2 2003/10/27 05:43:18 chriskl Exp $
*/
// Include application functions
else {
echo "<p>{$lang['strnocasts']}</p>\n";
}
-
-// echo "<p><a class=\"navlink\" href=\"$PHP_SELF?action=create&{$misc->href}\">{$lang['strcreatecast']}</a></p>\n";
}
$misc->printHeader($lang['strcasts']);
$misc->printBody();
switch ($action) {
- case 'save_create':
- if (isset($_POST['cancel'])) doDefault();
- else doSaveCreate();
- break;
- case 'create':
- doCreate();
- break;
- case 'drop':
- if (isset($_POST['cancel'])) doDefault();
- else doDrop(false);
- break;
- case 'confirm_drop':
- doDrop(true);
- break;
- case 'properties':
- doProperties();
- break;
default:
doDefault();
break;
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.159 2003/10/26 10:59:16 chriskl Exp $
+ * $Id: Postgres.php,v 1.160 2003/10/27 05:43:18 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
}
}
- /**
- * Return all database available on the server
- * @return A list of databases, sorted alphabetically
- */
- function &getLanguages() {
- $sql = "SELECT lanname, lanispl, lanpltrusted FROM pg_language ORDER BY lanname";
- return $this->selectSet($sql);
- }
-
- /**
- * Return all information about a particular database
- * @param $database The name of the database to retrieve
- * @return The database info
- */
- function &getLanguage($database) {
- $this->clean($database);
- $sql = "SELECT * FROM pg_database WHERE datname='{$database}'";
- return $this->selectRow($sql);
- }
-
/**
* Creates a database
* @param $database The name of the database to create
return $this->selectSet($sql);
}
+ // Language functions
+
+ /**
+ * Gets all languages
+ * @param $all True to get all languages, regardless of show_system
+ * @return A recordset
+ */
+ function &getLanguages($all = false) {
+ global $conf;
+
+ if ($conf['show_system'] || $all)
+ $where = '';
+ else
+ $where = 'AND lanispl';
+
+ $sql = "
+ SELECT
+ pl.lanname,
+ pl.lanpltrusted,
+ pp.proname AS lanplcallf
+ FROM
+ pg_language pl, pg_proc pp
+ WHERE
+ pl.lanplcallfoid = pp.oid
+ {$where}
+ ORDER BY
+ lanname
+ ";
+
+ return $this->selectSet($sql);
+ }
+
// Type conversion routines
/**
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.74 2003/10/27 03:49:19 chriskl Exp $
+ * $Id: Postgres73.php,v 1.75 2003/10/27 05:43:18 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
ORDER BY 1;\r
";
+ return $this->selectSet($sql);
+ }
+
+ // Language functions
+
+ /**
+ * Gets all languages
+ * @param $all True to get all languages, regardless of show_system
+ * @return A recordset
+ */
+ function &getLanguages($all = false) {
+ global $conf;
+
+ if ($conf['show_system'] || $all)
+ $where = '';
+ else
+ $where = 'WHERE lanispl';
+
+ $sql = "
+ SELECT
+ lanname,
+ lanpltrusted,
+ lanplcallfoid::pg_catalog.regproc AS lanplcallf
+ FROM
+ pg_catalog.pg_language
+ {$where}
+ ORDER BY
+ lanname
+ ";
+
return $this->selectSet($sql);
}
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.21 2003/09/17 17:04:11 soranzo Exp $
+ * $Id: functions.php,v 1.22 2003/10/27 05:43:18 chriskl Exp $
*/
// Include application functions
if (!isset($_POST['formSetOf'])) $_POST['formSetOf'] = '';
$types = &$localData->getTypes(true);
- $langs = &$localData->getLanguages();
+ $langs = &$localData->getLanguages(true);
echo "<h2>", $misc->printVal($_REQUEST['database']), ": {$lang['strfunctions']}: {$lang['strcreatefunction']}</h2>\n";
$misc->printMsg($msg);
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.118 2003/10/27 03:49:19 chriskl Exp $
+ * $Id: english.php,v 1.119 2003/10/27 05:43:18 chriskl Exp $
*/
// Language and character set
$lang['strsourceencoding'] = 'Source encoding';
$lang['strtargetencoding'] = 'Target encoding';
+ // Languages
+ $lang['strlanguages'] = 'Languages';
+ $lang['strnolanguages'] = 'No languages found.';
+ $lang['strtrusted'] = 'Trusted';
+
// Info
$lang['strnoinfo'] = 'No information available.';
$lang['strreferringtables'] = 'Referring tables';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.70 2003/10/27 03:49:20 chriskl Exp $
+ * $Id: english.php,v 1.71 2003/10/27 05:43:18 chriskl Exp $
*/
// Language and character set
$lang['strsourceencoding'] = 'Source encoding';
$lang['strtargetencoding'] = 'Target encoding';
+ // Languages
+ $lang['strlanguages'] = 'Languages';
+ $lang['strnolanguages'] = 'No languages found.';
+ $lang['strtrusted'] = 'Trusted';
+
// Info
$lang['strnoinfo'] = 'No information available.';
$lang['strreferringtables'] = 'Referring tables';
/**
* Display properties of a schema
*
- * $Id: schema.php,v 1.8 2003/10/26 10:59:16 chriskl Exp $
+ * $Id: schema.php,v 1.9 2003/10/27 05:43:18 chriskl Exp $
*/
// Include application functions
echo "<ul>\n";
echo "<li><a href=\"types.php?{$misc->href}\">{$lang['strtypes']}</a></li>\n";
echo "<li><a href=\"operators.php?{$misc->href}\">{$lang['stroperators']}</a></li>\n";
+ echo "<li><a href=\"conversions.php?{$misc->href}\">{$lang['strconversions']}</a></li>\n";
echo "</ul>\n";
echo "</ul>\n";
}