From: ioguix
href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreateindex']}
\n"; } + function doTree() { + global $misc, $data; + + $indexes = $data->getIndexes($_REQUEST['table']); + + $reqvars = $misc->getRequestVars('table'); + + function getIcon($f) { + if ($f['indisprimary'] == 't') + return 'PrimaryKey'; + if ($f['indisunique'] == 't') + return 'UniqueConstraint'; + return 'Index'; + } + + $attrs = array( + 'text' => field('indname'), + 'icon' => callback('getIcon'), + ); + + $misc->printTreeXML($indexes, $attrs); + exit; + } + + if ($action == 'tree') doTree(); + $misc->printHeader($lang['strindexes'], ""); if ($action == 'create_index' || $action == 'save_create_index') diff --git a/rules.php b/rules.php index 7d6abb3f..b0602de0 100644 --- a/rules.php +++ b/rules.php @@ -3,7 +3,7 @@ /** * List rules on a table OR view * - * $Id: rules.php,v 1.27 2006/06/17 23:50:19 xzilla Exp $ + * $Id: rules.php,v 1.28 2007/05/02 16:12:07 ioguix Exp $ */ // Include application functions @@ -165,6 +165,24 @@ echo "href}&{$subject}={$object}&subject={$subject}\">{$lang['strcreaterule']}
\n"; } + function doTree() { + global $misc, $data; + + $rules = $data->getRules($_REQUEST[$_REQUEST['subject']]); + + $reqvars = $misc->getRequestVars($_REQUEST['subject']); + + $attrs = array( + 'text' => field('rulename'), + 'icon' => 'Rule', + ); + + $misc->printTreeXML($rules, $attrs); + exit; + } + + if ($action == 'tree') doTree(); + // Different header if we're view rules or table rules $misc->printHeader($_REQUEST[$_REQUEST['subject']] . ' - ' . $lang['strrules']); $misc->printBody(); diff --git a/tables.php b/tables.php index b096c341..576e6176 100644 --- a/tables.php +++ b/tables.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tables.php,v 1.93 2007/04/24 14:49:00 soranzo Exp $ + * $Id: tables.php,v 1.94 2007/05/02 16:12:07 ioguix Exp $ */ // Include application functions @@ -909,10 +909,10 @@ $reqvars, array('table' => field('relname')) ), - 'branch' => url('tblproperties.php', + 'branch' => url('tables.php', $reqvars, array ( - 'action' => 'tree', + 'action' => 'subtree', 'table' => field('relname') ) ) @@ -922,7 +922,39 @@ exit; } + function doSubTree() { + global $misc, $data; + + $tabs = $misc->getNavTabs('table'); + $items = $misc->adjustTabsForTree($tabs); + $reqvars = $misc->getRequestVars('table'); + + $attrs = array( + 'text' => noEscape(field('title')), + 'icon' => field('icon'), + 'action' => url( + field('url'), + $reqvars, + array('table' => $_REQUEST['table']) + ), + 'branch' => ifempty( + field('branch'), '', url( + field('url'), + $reqvars, + array( + 'action' => 'tree', + 'table' => $_REQUEST['table'] + ) + ) + ), + ); + + $misc->printTreeXML($items, $attrs); + exit; + } + if ($action == 'tree') doTree(); + if ($action == 'subtree') dosubTree(); $misc->printHeader($lang['strtables']); $misc->printBody(); diff --git a/triggers.php b/triggers.php index 47f3686b..e81bdfae 100644 --- a/triggers.php +++ b/triggers.php @@ -3,7 +3,7 @@ /** * List triggers on a table * - * $Id: triggers.php,v 1.31 2007/01/15 15:48:17 soranzo Exp $ + * $Id: triggers.php,v 1.32 2007/05/02 16:12:07 ioguix Exp $ */ // Include application functions @@ -329,6 +329,25 @@ echo "href}&table=", urlencode($_REQUEST['table']), "\">{$lang['strcreatetrigger']}
\n"; } + function doTree() { + + global $misc, $data; + + $triggers = $data->getTriggers($_REQUEST['table']); + + $reqvars = $misc->getRequestVars('table'); + + $attrs = array( + 'text' => field('tgname'), + 'icon' => 'Trigger', + ); + + $misc->printTreeXML($triggers, $attrs); + exit; + } + + if ($action == 'tree') doTree(); + $misc->printHeader($lang['strtables'] . ' - ' . $_REQUEST['table'] . ' - ' . $lang['strtriggers']); $misc->printBody(); diff --git a/views.php b/views.php index 8ae4d521..39d6f32e 100644 --- a/views.php +++ b/views.php @@ -3,7 +3,7 @@ /** * Manage views in a database * - * $Id: views.php,v 1.67 2007/04/24 14:49:00 soranzo Exp $ + * $Id: views.php,v 1.68 2007/05/02 16:12:07 ioguix Exp $ */ // Include application functions @@ -545,7 +545,7 @@ $misc->printMsg($msg); $views = $data->getViews(); - + $columns = array( 'view' => array( 'title' => $lang['strview'], @@ -615,29 +615,48 @@ $attrs = array( 'text' => field('relname'), 'icon' => 'View', - 'iconAction' => url('display.php', - $reqvars, - array('view' => field('relname')) - ), + 'iconAction' => url('display.php', $reqvars, array('view' => field('relname'))), 'toolTip'=> field('relcomment'), - 'action' => url('redirect.php', - $reqvars, - array('view' => field('relname')) - ), - 'branch' => url('viewproperties.php', - $reqvars, - array ( - 'action' => 'tree', - 'view' => field('relname') - ) - ) + 'action' => url('redirect.php', $reqvars, array('view' => field('relname'))), + 'branch' => url('views.php', $reqvars, + array ( + 'action' => 'subtree', + 'view' => field('relname') + ) + ) ); $misc->printTreeXML($views, $attrs); exit; } + function doSubTree() { + global $misc, $data; + + $tabs = $misc->getNavTabs('view'); + $items = $misc->adjustTabsForTree($tabs); + $reqvars = $misc->getRequestVars('view'); + + $attrs = array( + 'text' => noEscape(field('title')), + 'icon' => field('icon'), + 'action' => url(field('url'), $reqvars, field('urlvars'), array('view' => $_REQUEST['view'])), + 'branch' => ifempty( + field('branch'), '', url(field('url'), field('urlvars'), $reqvars, + array( + 'action' => 'tree', + 'view' => $_REQUEST['view'] + ) + ) + ), + ); + + $misc->printTreeXML($items, $attrs); + exit; + } + if ($action == 'tree') doTree(); + if ($action == 'subtree') dosubTree(); $misc->printHeader($lang['strviews']); $misc->printBody();