From b3be0d9a14584dd418a1b64aaf1d28e09feb06c4 Mon Sep 17 00:00:00 2001 From: xzilla Date: Thu, 29 Jun 2006 18:22:33 +0000 Subject: [PATCH] Add columns into the tree for tables and views. --- tables.php | 11 +++++++++-- tblproperties.php | 21 ++++++++++++++++++++- viewproperties.php | 23 +++++++++++++++++++++-- views.php | 9 ++++++++- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/tables.php b/tables.php index 05b2f2b2..b7314b8b 100644 --- a/tables.php +++ b/tables.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tables.php,v 1.79 2006/06/23 00:57:37 xzilla Exp $ + * $Id: tables.php,v 1.80 2006/06/29 18:22:33 xzilla Exp $ */ // Include application functions @@ -646,7 +646,14 @@ 'action' => url('redirect.php', $reqvars, array('table' => field('relname')) - ) + ), + 'branch' => url('tblproperties.php', + $reqvars, + array ( + 'action' => 'tree', + 'table' => field('relname') + ) + ) ); $misc->printTreeXML($tables, $attrs); diff --git a/tblproperties.php b/tblproperties.php index 205e6cae..bba9e943 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tblproperties.php,v 1.69 2006/06/17 12:57:36 xzilla Exp $ + * $Id: tblproperties.php,v 1.70 2006/06/29 18:22:34 xzilla Exp $ */ // Include application functions @@ -520,6 +520,25 @@ } + function doTree() { + global $misc, $data; + + $columns = $data->getTableAttributes($_REQUEST['table']); + $reqvars = $misc->getRequestVars('table'); + + $attrs = array ( + 'text' => field('attname'), + 'icon' => 'Column', + 'toolTip'=> field('comment') + ); + + $misc->printTreeXML($columns, $attrs); + + exit; + } + + if ($action == 'tree') doTree(); + /** * Show default list of columns in the table */ diff --git a/viewproperties.php b/viewproperties.php index 3f76efe3..2b23bcf2 100755 --- a/viewproperties.php +++ b/viewproperties.php @@ -3,7 +3,7 @@ /** * List views in a database * - * $Id: viewproperties.php,v 1.19 2006/06/23 00:31:44 xzilla Exp $ + * $Id: viewproperties.php,v 1.20 2006/06/29 18:22:34 xzilla Exp $ */ // Include application functions @@ -242,7 +242,26 @@ echo "

{$lang['strinvalidparam']}

\n"; } } - + + function doTree () { + global $misc, $data; + + $columns = $data->getTableAttributes($_REQUEST['view']); + $reqvars = $misc->getRequestVars('view'); + + $attrs = array ( + 'text' => field('attname'), + 'icon' => 'Column', + 'toolTip'=> field('comment') + ); + + $misc->printTreeXML($columns, $attrs); + + exit; + } + + if ($action == 'tree') doTree(); + /** * Show view definition and virtual columns */ diff --git a/views.php b/views.php index 74412a6b..cfb9c4d7 100644 --- a/views.php +++ b/views.php @@ -3,7 +3,7 @@ /** * Manage views in a database * - * $Id: views.php,v 1.57 2006/06/23 00:57:37 xzilla Exp $ + * $Id: views.php,v 1.58 2006/06/29 18:22:34 xzilla Exp $ */ // Include application functions @@ -604,6 +604,13 @@ 'action' => url('redirect.php', $reqvars, array('view' => field('relname')) + ), + 'branch' => url('viewproperties.php', + $reqvars, + array ( + 'action' => 'tree', + 'view' => field('relname') + ) ) ); -- 2.39.5