* @param array
* @param array
* @param array returned by referencable_primary()
+* @param array extra types to prepend
* @return null
*/
-function edit_type($key, $field, $collations, $foreign_keys = array()) {
+function edit_type($key, $field, $collations, $foreign_keys = array(), $extra_types = array()) {
global $structured_types, $types, $unsigned, $on_actions;
$type = $field["type"];
?>
<td><select name="<?php echo h($key); ?>[type]" class="type" aria-labelledby="label-type"><?php
-if ($type && !isset($types[$type]) && !isset($foreign_keys[$type])) {
- array_unshift($structured_types, $type);
+if ($type && !isset($types[$type], $foreign_keys[$type]) && !in_array($type, $extra_types)) {
+ $extra_types[] = $type;
}
if ($foreign_keys) {
$structured_types[lang('Foreign keys')] = $foreign_keys;
}
-echo optionlist($structured_types, $type);
+echo optionlist(array_merge($extra_types, $structured_types), $type);
?></select>
<?php echo on_help("getTarget(event).value", 1); ?>
<?php echo script("mixin(qsl('select'), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});", ""); ?>
edit_fields($row["fields"], $collations, $routine);
if (isset($_GET["function"])) {
echo "<tr><td>" . lang('Return type');
- edit_type("returns", $row["returns"], $collations);
+ edit_type("returns", $row["returns"], $collations, array(), ($jush == "pgsql" ? array("void", "trigger") : array()));
}
?>
</table>