Move function def out of switch statement,
authorjollytoad <jollytoad>
Mon, 14 Mar 2005 11:03:14 +0000 (11:03 +0000)
committerjollytoad <jollytoad>
Mon, 14 Mar 2005 11:03:14 +0000 (11:03 +0000)
to work around PHP 5 bug: http://bugs.php.net/bug.php?id=28487

types.php

index 61d3bb80c440106a59488c469800095f12442e3e..adb8ae37cdf7aff0b8a0cf810f78b07078c16103 100644 (file)
--- a/types.php
+++ b/types.php
@@ -3,7 +3,7 @@
        /**
         * Manage types in a database
         *
-        * $Id: types.php,v 1.25.4.2 2005/03/14 09:58:01 jollytoad Exp $
+        * $Id: types.php,v 1.25.4.3 2005/03/14 11:03:14 jollytoad Exp $
         */
 
        // Include application functions
                $misc->printTitle($lang['strproperties'], 'pg.type');
                $misc->printMsg($msg);
                
+               function attPre(&$rowdata) {
+                       global $data;
+                       $rowdata->f['+type'] = $data->formatType($rowdata->f['type'], $rowdata->f['atttypmod']);
+               }
+               
                if ($typedata->recordCount() > 0) {
                        switch ($typedata->f['typtype']) {
                        case 'c':
-                               function attPre(&$rowdata) {
-                                       global $data;
-                                       $rowdata->f['+type'] = $data->formatType($rowdata->f['type'], $rowdata->f['atttypmod']);
-                               }
-                               
                                $attrs = &$data->getTableAttributes($_REQUEST['type']);
                                
                                $columns = array(
@@ -76,8 +76,8 @@
                                echo "</table>\n";
                        }
 
-                       echo "<p><a class=\"navlink\" href=\"$PHP_SELF?{$misc->href}\">{$lang['strshowalltypes']}</a></p>\n";           }
-               else
+                       echo "<p><a class=\"navlink\" href=\"$PHP_SELF?{$misc->href}\">{$lang['strshowalltypes']}</a></p>\n";
+               else
                        doDefault($lang['strinvalidparam']);
        }