put line numbers on funcs in a separate cell. someone probably wants to figure out...
authorchriskl <chriskl>
Tue, 24 Aug 2004 08:59:51 +0000 (08:59 +0000)
committerchriskl <chriskl>
Tue, 24 Aug 2004 08:59:51 +0000 (08:59 +0000)
BUGS
HISTORY
classes/Misc.php
functions.php

diff --git a/BUGS b/BUGS
index cb0a8c095e7bf200436b34d45938f1f479ea910e..4defb003209e2baef305bd04c6d9488ae68cf8e7 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -17,6 +17,7 @@ Need to fix:
 * Report login errors
 * Don't offer owner change feature if user is not superuser
 * check use of apostrophes, etc. in tree menu
+* add different null formats to import and export
 
 NEEDS TESTING
 -------------
diff --git a/HISTORY b/HISTORY
index fb904d8672e8b41080d2df0ee4c83e95eec30022..0c7f719212c9e233ef05aa0c826e3551c014f7dd 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -22,6 +22,7 @@ Features
 * Allow creating and viewing composite types
 * pg_dumpall integration.  Now you can download the entire cluster via
   phpPgAdmin.
+* Show line numbers when viewing functions
 
 Translations
 * Arabic from Zaki
index 553b763cfbeec10807959ac148c4d19748a4f929..b0ee311621309f699f19d12e42cb084fddeba4f4 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.84 2004/08/04 07:44:03 chriskl Exp $
+        * $Id: Misc.php,v 1.85 2004/08/24 08:59:51 chriskl Exp $
         */
         
        class Misc {
                                        $str = substr($str, 0, $maxlen-1) . $ellipsis;
                                }
                        }
-                       
-                       // Add line numbers if 'lineno' param is true
-                       if (isset($params['lineno']) && $params['lineno'] === true) {
-                               $lines = explode("\n", $str);
-                               // Determine max number of digits and create a formatting string
-                               $format = '%' . strlen(count($lines)) . 'u: %s';
-                               $i = 1;
-                               $str = '';
-                               foreach ($lines as $line) {
-                                       $str .= sprintf($format, $i++, $line) . "\n";
-                               }
-                               unset($lines);
-                       }
 
                        $out = '';
                        
                        
                        if (isset($tag)) {
                                $alignattr = isset($align) ? " align=\"{$align}\"" : '';
-                               $classattr = isset($class) ? " class=\"{$class}\"" : '';
-                               return "<{$tag}{$alignattr}{$classattr}>{$out}</{$tag}>";
+                               $classattr = isset($class) ? " class=\"{$class}\"" : '';                                
+                               $out = "<{$tag}{$alignattr}{$classattr}>{$out}</{$tag}>";
                        }
-                       
+
+                       // Add line numbers if 'lineno' param is true
+                       if (isset($params['lineno']) && $params['lineno'] === true) {
+                               $lines = explode("\n", $str);
+                               $num = count($lines);
+                               if ($num > 0) {
+                                       $temp = "<table>\n<tr><td class=\"{$class}\" style=\"vertical-align: top; padding-right: 10px;\"><pre class=\"{$class}\">";
+                                       for ($i = 1; $i <= $num; $i++) {
+                                               $temp .= $i . "\n";
+                                       }
+                                       $temp .= "</pre></td><td class=\"{$class}\" style=\"vertical-align: top;\">{$out}</td></tr></table>\n";
+                                       $out = $temp;
+                               }
+                               unset($lines);
+                       }
+
                        return $out;
                }
 
index 9afaf4325b5f63b2c58c9e40154ef5f0e78a1365..f0fcb002002e1cfa4977ee5a325832b64b89ca8a 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage functions in a database
         *
-        * $Id: functions.php,v 1.40 2004/07/22 08:50:01 jollytoad Exp $
+        * $Id: functions.php,v 1.41 2004/08/24 08:59:51 chriskl Exp $
         */
 
        // Include application functions
                                echo "<tr><td class=\"data1\" colspan=\"4\">", $misc->printVal($funcdata->f['prosrc']), "</td></tr>\n";
                        } else {
                                echo "<tr><th class=\"data\" colspan=\"4\">{$lang['strdefinition']}</th></tr>\n";
-                               echo "<tr><td class=\"data1\" colspan=\"4\">", $misc->printVal($funcdata->f['prosrc'], 'pre', array('lineno' => true)), "</td></tr>\n";
+                               echo "<tr><td class=\"data1\" colspan=\"4\">", $misc->printVal($funcdata->f['prosrc'], 'pre', array('lineno' => true, 'class' => 'data1')), "</td></tr>\n";
                        }
                        
                        // Show flags