Promote the use of decorators for URL's in tree generation, greatly simplifying
authorjollytoad <jollytoad>
Mon, 14 Mar 2005 09:57:58 +0000 (09:57 +0000)
committerjollytoad <jollytoad>
Mon, 14 Mar 2005 09:57:58 +0000 (09:57 +0000)
printTreeXML and node definitions.

14 files changed:
aggregates.php
all_db.php
classes/Misc.php
conversions.php
database.php
domains.php
functions.php
opclasses.php
operators.php
sequences.php
servers.php
tables.php
types.php
views.php

index 11296a40ec08a57f5a5c4dcd46db60027b5dca3b..5e9f5f3013aa19c221a0f06ecaaaf65dd89b0c23 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage aggregates in a database
         *
-        * $Id: aggregates.php,v 1.10.4.2 2005/03/09 12:29:01 jollytoad Exp $
+        * $Id: aggregates.php,v 1.10.4.3 2005/03/14 09:57:59 jollytoad Exp $
         */
 
        // Include application functions
                
                $proto = concat(field('proname'), ' (', field('proargtypes'), ')');
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => $proto,
-                               'icon'    => 'functions',
-                               'toolTip' => field('aggcomment'),
-                       ),
+               $attrs = array(
+                       'text'   => $proto,
+                       'icon'   => 'functions',
+                       'toolTip'=> field('aggcomment'),
                );
                
-               $misc->printTreeXML($aggregates, $actions);
+               $misc->printTreeXML($aggregates, $attrs);
                exit;
        }
        
index 775994cca9895b4c4a13d997045a4df6c3cce4a6..0e3035f908e286e2ce7f8c35e5bf7e4c2261c766 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage databases within a server
         *
-        * $Id: all_db.php,v 1.35.4.2 2005/03/08 09:56:37 jollytoad Exp $
+        * $Id: all_db.php,v 1.35.4.3 2005/03/14 09:57:59 jollytoad Exp $
         */
 
        // Include application functions
                
                $databases = &$data->getDatabases();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('datname'),
-                               'icon'    => 'database',
-                               'url'     => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject'  => 'database',
-                                               'database' => field('datname'),
-                                       ),
-                       ),
-                       'expand' => array(
-                               'url'     => 'database.php',
-                               'urlvars' => array(
-                                               'subject'  => 'database',
-                                               'action'   => 'tree',
-                                               'database' => field('datname'),
-                                       ),
-                       ),
-               );
+               $reqvars = $misc->getRequestVars('database');
                
-               $opts = array(
-                       'postxml' =>
-                               "<tree text=\"{$lang['strusers']}\" action=\"users.php?{$misc->href}\" target=\"detail\"/>".
-                               "<tree text=\"{$lang['strgroups']}\" action=\"groups.php?{$misc->href}\" target=\"detail\"/>".
-                               "<tree text=\"{$lang['strreports']}\" action=\"reports.php?{$misc->href}\" target=\"detail\"/>"
+               $attrs = array(
+                       'text'   => field('datname'),
+                       'icon'   => 'database',
+                       'toolTip'=> field('datcomment'),
+                       'action' => url('redirect.php',
+                                                       $reqvars,
+                                                       array('database' => field('datname'))
+                                               ),
+                       'branch' => url('database.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action' => 'tree',
+                                                               'database' => field('datname')
+                                                       )
+                                               ),
                );
                
-               $misc->printTreeXML($databases, $actions, $opts);
+               $misc->printTreeXML($databases, $attrs);
                exit;
        }
 
index 031a0acf5202f9b3d19a09a71d3610ccf4ab55d4..7f2d9a811fb815d2c513ca1025f4260a83480cbc 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.98.2.10 2005/03/09 12:23:00 jollytoad Exp $
+        * $Id: Misc.php,v 1.98.2.11 2005/03/14 09:57:58 jollytoad Exp $
         */
         
        class Misc {
                 *                              '$attr='.
                 */
                function printActionUrl(&$action, &$fields, $attr = null) {
+                       $url = value($action['url'], $fields);
+                       
+                       if ($url === false) return '';
+                       
                        if (!empty($action['urlvars'])) {
                                $urlvars = value($action['urlvars'], $fields);
                        } else {
                                        }
                                }
                        }
-
-                       $url = value($action['url'], $fields);
                        
                        $sep = '?';
                        foreach ($urlvars as $var => $varfield) {
                                $url .= $sep . value_url($var, $fields) . '=' . value_url($varfield, $fields);
                                $sep = '&';
                        }
-                       if (!empty($action['urlfn'])) {
-                               $fn = value($action['urlfn'], $fields);
-                               $url = $fn($url, $action, $fields);
-                       }
+                       
                        $url = htmlentities($url);
                        
                        if ($attr !== null && $url != '')
                        else
                                return $url;
                }
+
+               function getRequestVars($subject = '') {
+                       $v = array();
+                       if (!empty($subject))
+                               $v['subject'] = $subject;
+                       if (isset($_REQUEST['server']) && $subject != 'root') {
+                               $v['server'] = $_REQUEST['server'];
+                               if (isset($_REQUEST['database']) && $subject != 'server') {
+                                       $v['database'] = $_REQUEST['database'];
+                                       if (isset($_REQUEST['schema']) && $subject != 'database') {
+                                               $v['schema'] = $_REQUEST['schema'];
+                                       }
+                               }
+                       }
+                       return $v;
+               }
                
                function printUrlVars(&$vars, &$fields) {
                        foreach ($vars as $var => $varfield) {
                
                /** Produce XML data for the browser tree
                 * @param $treedata A set of records to populate the tree.
-                * @param $actions The actions to perform for the items,
-                *        similar to the $actions array given to printTable.
-                *        Two actions may be specified:
-                *        'item' - the action from clicking the item,
-                *        'expand' - the action to return XML for the subtree.
-                * @param $opts Associative array of optional arguments:
-                *        'prexml' - static XML to place before items.
-                *        'postxml' - static XML to place after items.
-                *        'nodata' - message to display for no records.
+                * @param $attrs Attributes for tree items
+                *        'text' - the text for the tree node
+                *        'icon' - an icon for node
+                *        'openIcon' - an alternative icon when the node is expanded
+                *        'toolTip' - tool tip text for the node
+                *        'action' - URL to visit when single clicking the node
+                *        'branch' - URL for child nodes (tree XML)
+                *        'expand' - the action to return XML for the subtree
+                *        'nodata' - message to display when node has no children
                 */
-               function printTreeXML(&$treedata, &$actions, $opts = array()) {
+               function printTreeXML(&$treedata, &$attrs) {
                        global $conf, $lang;
                        header("Content-Type: text/xml");
                        header("Cache-Control: no-cache");
                        
                        echo "<?xml version=\"1.0\"?>\n";
-                       echo "<tree>\n";
                        
-                       if (!empty($opts['prexml'])) echo $opts['prexml'];
+                       echo "<tree>\n";
                        
                        if ($treedata->recordCount() > 0) {
                                while (!$treedata->EOF) {
-                                       echo "<tree", value_xml_attr('text', $actions['item']['text'], $treedata->f);
+                                       $rec =& $treedata->f;
                                        
-                                       echo $this->printActionUrl($actions['item'], $treedata->f, 'action');
+                                       echo "<tree";
+                                       echo value_xml_attr('text', $attrs['text'], $rec);
+                                       echo value_xml_attr('action', $attrs['action'], $rec);
+                                       echo value_xml_attr('src', $attrs['branch'], $rec);
                                        
-                                       if (!empty($actions['expand'])) {
-                                               echo $this->printActionUrl($actions['expand'], $treedata->f, 'src');
-                                       }
+                                       $icon = $this->icon(value($attrs['icon'], $rec));
+                                       echo value_xml_attr('icon', $icon, $rec);
                                        
-                                       if (!empty($actions['item']['icon'])) {
-                                               $icon = $this->icon(value_xml($actions['item']['icon'], $treedata->f));
-                                               echo " icon=\"{$icon}\"";
-                                       }
-                                       if (!empty($actions['item']['openIcon'])) {
-                                               $icon = $this->icon(value_xml($actions['item']['openIcon'], $treedata->f));
+                                       if (!empty($attrs['openIcon'])) {
+                                               $icon = $this->icon(value($attrs['openIcon'], $rec));
                                        }
-                                       if (isset($icon))
-                                               echo " openIcon=\"{$icon}\"";
+                                       echo value_xml_attr('openIcon', $icon, $rec);
                                        
-                                       if (!empty($actions['item']['toolTip'])) {
-                                               echo value_xml_attr('toolTip', $actions['item']['toolTip'], $treedata->f);
-                                       }
+                                       echo value_xml_attr('toolTip', $attrs['toolTip'], $rec);
                                        
                                        echo "/>\n";
                                        
                                        $treedata->moveNext();
                                }
                        } else {
-                               $msg = isset($opts['nodata']) ? $opts['nodata'] : $lang['strnoobjects'];
+                               $msg = isset($attrs['nodata']) ? $attrs['nodata'] : $lang['strnoobjects'];
                                echo "<tree text=\"{$msg}\" onaction=\"this.parentNode.reload()\" icon=\"", $this->icon('error'), "\"/>\n";
                        }
                        
-                       if (!empty($opts['postxml'])) echo $opts['postxml'];
-                       
                        echo "</tree>\n";
                }
                
index 617d5bc1c4565e9575cbab9488c2af565d48cf72..7cd0ad9c7bb61d8d02f7996a1e5c1ab8c1ab5660 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage conversions in a database
         *
-        * $Id: conversions.php,v 1.9.4.1 2005/03/01 10:47:03 jollytoad Exp $
+        * $Id: conversions.php,v 1.9.4.2 2005/03/14 09:58:00 jollytoad Exp $
         */
 
        // Include application functions
                
                $conversions = &$data->getconversions();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('conname'),
-                               'icon'    => 'conversions',
-                       ),
+               $attrs = array(
+                       'text'   => field('conname'),
+                       'icon'   => 'conversions',
+                       'toolTip'=> field('concomment')
                );
                
-               $misc->printTreeXML($conversions, $actions);
+               $misc->printTreeXML($conversions, $attrs);
                exit;
        }
        
index 01a79ec790ebb3e5c569f885452733378a7de5f3..3e47e33e1039204bdf0d1113c71fe2c64851c1fa 100755 (executable)
@@ -3,7 +3,7 @@
        /**
         * Manage schemas within a database
         *
-        * $Id: database.php,v 1.65.2.3 2005/03/08 12:27:06 jollytoad Exp $
+        * $Id: database.php,v 1.65.2.4 2005/03/14 09:58:00 jollytoad Exp $
         */
 
        // Include application functions
                
                $schemas = &$data->getSchemas();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('nspname'),
-                               'icon'    => 'folder',
-                               'url'     => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject' => 'schema',
-                                               'schema'  => field('nspname')
-                                       ),
-                       ),
-                       'expand' => array(
-                               'url'   => 'database.php',
-                               'urlvars' => array(
-                                               'subject' => 'schema',
-                                               'action'  => 'subtree',
-                                               'schema'  => field('nspname')
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('schema');
+               
+               $attrs = array(
+                       'text'   => field('nspname'),
+                       'icon'   => 'folder',
+                       'toolTip'=> field('nspcomment'),
+                       'action' => url('redirect.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'subject' => 'schema',
+                                                               'schema'  => field('nspname')
+                                                       )
+                                               ),
+                       'branch' => url('database.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action'  => 'subtree',
+                                                               'schema'  => field('nspname')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($schemas, $actions);
+               $misc->printTreeXML($schemas, $attrs);
                exit;
        }
        
                }
                $items =& new ArrayRecordSet($tabs);
                
-               $actions = array(
-                       'item' => array(
-                               'text' => noEscape(field('title')),
-                               'icon' => field('icon', 'folder'),
-                               'url'  => field('url'),
-                               'urlvars' => field('urlvars', array()),
-                       ),
-                       'expand' => array(
-                               'url'     => field('url'),
-                               'urlvars' => merge(field('urlvars'), array('action' => 'tree')),
-                       ),
+               $reqvars = $misc->getRequestVars('schema');
+               
+               $attrs = array(
+                       'text'   => noEscape(field('title')),
+                       'icon'   => field('icon', 'folder'),
+                       'action' => url(field('url'),
+                                                       $reqvars,
+                                                       field('urlvars', array())
+                                               ),
+                       'branch' => url(field('url'),
+                                                       $reqvars,
+                                                       field('urlvars'),
+                                                       array('action' => 'tree')
+                                               )
                );
                
-               $misc->printTreeXML($items, $actions);
+               $misc->printTreeXML($items, $attrs);
                exit;
        }
        
index 1812cda97565c7776dc3991c627f473535215d90..63476dc4c7fcc96b66a93a9634567a04baccb5a8 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage domains in a database
         *
-        * $Id: domains.php,v 1.19.4.1 2005/03/01 10:47:03 jollytoad Exp $
+        * $Id: domains.php,v 1.19.4.2 2005/03/14 09:58:00 jollytoad Exp $
         */
 
        // Include application functions
                
                $domains = &$data->getDomains();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('domname'),
-                               'icon'    => 'domains',
-                               'url'     => 'domains.php',
-                               'urlvars' => array(
-                                               'subject' => 'domain',
-                                               'action' => 'properties',
-                                               'domain' => field('domname'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('domain');
+               
+               $attrs = array(
+                       'text'   => field('domname'),
+                       'icon'   => 'domains',
+                       'toolTip'=> field('domcomment'),
+                       'action' => url('domains.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action' => 'properties',
+                                                               'domain' => field('domname')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($domains, $actions);
+               $misc->printTreeXML($domains, $attrs);
                exit;
        }
        
index d2f892779170c1852a1ca581388c6b79ecff379f..54b0496432c18022cac1c3cae9c4b32aaf077d0f 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage functions in a database
         *
-        * $Id: functions.php,v 1.47.4.2 2005/03/09 12:29:01 jollytoad Exp $
+        * $Id: functions.php,v 1.47.4.3 2005/03/14 09:58:00 jollytoad Exp $
         */
 
        // Include application functions
                
                $proto = concat(field('proname'),' (',field('proarguments'),')');
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => $proto,
-                               'icon'    => 'functions',
-                               'toolTip' => field('procomment'),
-                               'url'     => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject' => 'function',
-                                               'action' => 'properties',
-                                               'function' => $proto,
-                                               'function_oid' => field('prooid'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('function');
+               
+               $attrs = array(
+                       'text'    => $proto,
+                       'icon'    => 'functions',
+                       'toolTip' => field('procomment'),
+                       'action'  => url('redirect.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action' => 'properties',
+                                                               'function' => $proto,
+                                                               'function_oid' => field('prooid')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($funcs, $actions);
+               $misc->printTreeXML($funcs, $attrs);
                exit;
        }
        
index 0845886a6867d2240a5cdc5f87932c5a38931b25..ad4ac730bb6f19b7fbd3291562f25bbbee4137e3 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage opclasss in a database
         *
-        * $Id: opclasses.php,v 1.6.4.2 2005/03/09 12:29:01 jollytoad Exp $
+        * $Id: opclasses.php,v 1.6.4.3 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
                // OpClass prototype: "op_class/access_method"
                $proto = concat(field('opcname'),'/',field('amname'));
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => $proto,
-                               'icon'    => 'operators',
-                               'toolTip' => field('opccomment'),
-                       ),
+               $attrs = array(
+                       'text'   => $proto,
+                       'icon'   => 'operators',
+                       'toolTip'=> field('opccomment'),
                );
                
-               $misc->printTreeXML($opclasses, $actions);
+               $misc->printTreeXML($opclasses, $attrs);
                exit;
        }
        
index cd09fbb16570099a22cee70a02b43f829fa6c168..8ac6465d62037c04188b0b81f3ac542fd5e7a2d8 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage operators in a database
         *
-        * $Id: operators.php,v 1.17.4.2 2005/03/09 12:29:01 jollytoad Exp $
+        * $Id: operators.php,v 1.17.4.3 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
                // Alternative prototype: "operator (type,type)"
                #$proto = concat(field('oprname'), ' (', field('oprleftname','NONE'), ',', field('oprrightname','NONE'), ')');
                
-               $actions = array(
-                       'item' => array(
-                               'text' => $proto,
-                               'icon'    => 'operators',
-                               'toolTip' => field('oprcomment'),
-                               'url'     => 'operators.php',
-                               'urlvars' => array(
-                                               'subject' => 'operator',
-                                               'action'  => 'properties',
-                                               'operator' => $proto,
-                                               'operator_oid' => field('oid'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('operator');
+               
+               $attrs = array(
+                       'text'   => $proto,
+                       'icon'   => 'operators',
+                       'toolTip'=> field('oprcomment'),
+                       'action' => url('operators.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action'  => 'properties',
+                                                               'operator' => $proto,
+                                                               'operator_oid' => field('oid')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($operators, $actions);
+               $misc->printTreeXML($operators, $attrs);
                exit;
        }
        
index f89ff0aa1fd5fab750983786edd7efc354cd4138..184ccaada5139639a44385a8676026cc587a079e 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage sequences in a database
         *
-        * $Id: sequences.php,v 1.27.4.1 2005/03/01 10:47:03 jollytoad Exp $
+        * $Id: sequences.php,v 1.27.4.2 2005/03/14 09:58:01 jollytoad Exp $
         */
        
        // Include application functions
                
                $sequences = &$data->getSequences();
                
-               $actions = array(
-                       'item' => array(
-                               'text'  => field('seqname'),
-                               'icon'  => 'sequences',
-                               'url'   => 'sequences.php',
-                               'urlvars' => array(
-                                               'subject' => 'sequence',
-                                               'action' => 'properties',
-                                               'sequence' => field('seqname'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('sequence');
+               
+               $attrs = array(
+                       'text'   => field('seqname'),
+                       'icon'   => 'sequences',
+                       'toolTip'=> field('seqcomment'),
+                       'action' => url('sequences.php',
+                                                       $reqvars,
+                                                       array (
+                                                               'action' => 'properties',
+                                                               'sequence' => field('seqname')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($sequences, $actions);
+               $misc->printTreeXML($sequences, $attrs);
                exit;
        }
        
index 980b4e029b8955c5f5f98d06235f9d98badf8ce9..bda8990af2c30e837e676dff8260577d0a7d24a9 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Manage servers
         *
-        * $Id: servers.php,v 1.1.2.2 2005/03/08 09:45:22 jollytoad Exp $
+        * $Id: servers.php,v 1.1.2.3 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
        $PHP_SELF = $_SERVER['PHP_SELF'];
        
        function doLogout() {
-               global $misc, $lang;
+               global $misc, $lang, $_reload_browser;
                
                $server_info = $misc->getServerInfo($_REQUEST['logoutServer']);
                $misc->setServerInfo(null,null,$_REQUEST['logoutServer']);
                doDefault(sprintf($lang['strlogoutmsg'], $server_info['desc']));
+               
+               $_reload_browser = true;
        }
 
        function doDefault($msg = '') {
                
                $servers =& $misc->getServers(true);
                
-               function notLoggedIn($url, $action, $fields) {
-                       if (empty($fields['username']))
-                               return '';
-                       return $url;
-               }
+               $reqvars = $misc->getRequestVars('server');
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('desc'),
-                               'icon'    => 'folder',
-                               'url'     => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject' => 'server',
-                                               'server' => field('id'),
-                                       ),
-                       ),
-                       'expand' => array(
-                               'url'     => 'all_db.php',
-                               'urlvars' => array(
-                                                       'subject' => 'server',
-                                                       'action' => 'tree',
-                                                       'server' => field('id')
-                                       ),
-                               'urlfn'   => 'notLoggedIn',
-                       ),
+               $attrs = array(
+                       'text'   => field('desc'),
+                       
+                       // Show different icons for logged in/out
+                       'icon'   => ifempty(field('username'), 'serverOut', 'server'),
+                       
+                       'toolTip'=> field('id'),
+                       
+                       'action' => url('redirect.php',
+                                                       $reqvars,
+                                                       array('server' => field('id'))
+                                               ),
+                       
+                       // Only create a branch url if the user has
+                       // logged into the server.
+                       'branch' => ifempty(field('username'), false,
+                                                       url('all_db.php',
+                                                               $reqvars,
+                                                               array(
+                                                                       'action' => 'tree',
+                                                                       'server' => field('id')
+                                                               )
+                                                       )
+                                               ),
                );
                
-               $misc->printTreeXML($servers, $actions);
+               $misc->printTreeXML($servers, $attrs);
                exit;
        }
        
index e52cc4ecb3721f6f104f20eefff38a01f124631e..ed81d57d4608e7e0dc03599fb33a87d122d1520c 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List tables in a database
         *
-        * $Id: tables.php,v 1.69.2.1 2005/03/01 10:47:04 jollytoad Exp $
+        * $Id: tables.php,v 1.69.2.2 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
                
                $tables = &$data->getTables();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('relname'),
-                               'icon'    => 'tables',
-                               'url'     => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject' => 'table',
-                                               'table'   => field('relname'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('table');
+               
+               $attrs = array(
+                       'text'   => field('relname'),
+                       'icon'   => 'tables',
+                       'toolTip'=> field('relcomment'),
+                       'action' => url('redirect.php',
+                                                       $reqvars,
+                                                       array('table' => field('relname'))
+                                               )
                );
                
-               $misc->printTreeXML($tables, $actions);
+               $misc->printTreeXML($tables, $attrs);
                exit;
        }
        
index 25cd90c1a1cf57c710d1e6924179aedf6b79d2d2..61d3bb80c440106a59488c469800095f12442e3e 100644 (file)
--- a/types.php
+++ b/types.php
@@ -3,7 +3,7 @@
        /**
         * Manage types in a database
         *
-        * $Id: types.php,v 1.25.4.1 2005/03/01 10:47:04 jollytoad Exp $
+        * $Id: types.php,v 1.25.4.2 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
                
                $types = &$data->getTypes();
                
-               $actions = array(
-                       'item' => array(
-                               'text'    => field('basename'),
-                               'icon'    => 'types',
-                               'url'     => 'types.php',
-                               'urlvars' => array(
-                                               'subject' => 'type',
-                                               'action'  => 'properties',
-                                               'type'    => field('basename'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('type');
+               
+               $attrs = array(
+                       'text'   => field('basename'),
+                       'icon'   => 'types',
+                       'toolTip'=> field('typcomment'),
+                       'action' => url('types.php',
+                                                       $reqvars,
+                                                       array(
+                                                               'action' => 'properties',
+                                                               'type'   => field('basename')
+                                                       )
+                                               )
                );
                
-               $misc->printTreeXML($types, $actions);
+               $misc->printTreeXML($types, $attrs);
                exit;
        }
        
index b522c5285e406abdfc2763c9e10eeacf36be2ee5..d81aca8a0382c7b2f57819d09504ebc25dc679e3 100644 (file)
--- a/views.php
+++ b/views.php
@@ -3,7 +3,7 @@
        /**
         * Manage views in a database
         *
-        * $Id: views.php,v 1.52.2.1 2005/03/01 10:47:04 jollytoad Exp $
+        * $Id: views.php,v 1.52.2.2 2005/03/14 09:58:01 jollytoad Exp $
         */
 
        // Include application functions
                
                $views = &$data->getViews();
                
-               $actions = array(
-                       'item' => array(
-                               'text'  => field('relname'),
-                               'icon'  => 'views',
-                               'url'   => 'redirect.php',
-                               'urlvars' => array(
-                                               'subject' => 'view',
-                                               'view'    => field('relname'),
-                                       ),
-                       ),
+               $reqvars = $misc->getRequestVars('view');
+               
+               $attrs = array(
+                       'text'   => field('relname'),
+                       'icon'   => 'views',
+                       'toolTip'=> field('relcomment'),
+                       'action' => url('redirect.php',
+                                                       $reqvars,
+                                                       array('view' => field('relname'))
+                                               )
                );
                
-               $misc->printTreeXML($views, $actions);
+               $misc->printTreeXML($views, $attrs);
                exit;
        }