Added an optional map parameter for printVal().
authorjollytoad <jollytoad>
Thu, 22 Jul 2004 12:47:38 +0000 (12:47 +0000)
committerjollytoad <jollytoad>
Thu, 22 Jul 2004 12:47:38 +0000 (12:47 +0000)
Fixed schema nav bar 'privileges' tab for non-schema postgres.

classes/Misc.php

index 609829678a77ad8c83dabf70ff17319a1e8f6f09..fc2f901854969f128a297b5344db4244b41b80de 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.82 2004/07/22 08:49:03 jollytoad Exp $
+        * $Id: Misc.php,v 1.83 2004/07/22 12:47:38 jollytoad Exp $
         */
         
        class Misc {
                 *                      false    - (type='bool') the representation of false.
                 *                      function - (type='callback') a function name, accepts args ($str, $params) and returns a rendering.
                 *                      lineno   - prefix each line with a line number.
+                *                      map      - an associative array.
                 *
                 * @return The HTML rendered value
                 */
                                                ? ($params['null'] === true ? '<i>NULL</i>' : $params['null'])
                                                : '';
                        
+                       if (isset($params['map']) && isset($params['map'][$str])) $str = $params['map'][$str];
+                       
                        // Clip the value if the 'clip' parameter is true.
                        if (isset($params['clip']) && $params['clip'] === true) {
                                $maxlen = isset($params['cliplen']) && is_integer($params['cliplen']) ? $params['cliplen'] : $conf['max_chars'];
                                                ),
                                                'privileges' => array (
                                                        'title' => $lang['strprivileges'],
-                                                       'url'   => "privileges.php?{$vars}&type=schema&object=" . urlencode($_REQUEST['schema']),
+                                                       'url'   => "privileges.php?{$vars}&type=schema&object=" . (isset($_REQUEST['schema']) ? urlencode($_REQUEST['schema']) : ''),
                                                        'hide'  => (!$data->hasSchemas()),
                                                ),
                                        );