[interchange-cvs] interchange - jon modified dist/lib/UI/pages/admin/gentable.html

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sat Sep 18 11:29:30 EDT 2004


User:      jon
Date:      2004-09-18 15:29:29 GMT
Modified:  dist/lib/UI/pages/admin gentable.html
Log:
Don't show any tables that don't exist under "Hidden Admin Tables".
(It happened before this patch if tables that don't exist are listed
in variable UI_ADMIN_TABLES.)

Revision  Changes    Path
2.7       +11 -8     interchange/dist/lib/UI/pages/admin/gentable.html


rev 2.7, prev_rev 2.6
Index: gentable.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/gentable.html,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -u -r2.6 -r2.7
--- gentable.html	14 Nov 2003 18:22:05 -0000	2.6
+++ gentable.html	18 Sep 2004 15:29:29 -0000	2.7
@@ -8,7 +8,17 @@
 <!-- ----- BEGIN REAL STUFF ----- -->
 
 <!-- touch metatable [data __UI_META_TABLE__ test test] -->
+[tmp list_databases][list-databases][/tmp]
 [perl tables="__UI_META_TABLE__"]
+	my %all_tables = map { $_ => 1 }
+		grep /\S/,
+		split /\s+/, $Scratch->{list_databases};
+	# %admin is used throughout this page
+	%admin = map { $_ => 1 }
+		grep { $all_tables{$_} }
+		split /[\s,\0]+/, $Variable->{UI_ADMIN_TABLES};
+	$Tag->tmp(ui_tmp_admin => join ' ', sort keys %admin);
+
 	my $db = $Db{__UI_META_TABLE__};
 	my $q = "select code from __UI_META_TABLE__ where type = 'table'";
 	my $ary = $db->query($q);
@@ -38,7 +48,7 @@
 		<td>
 			<table width="100%" border=0 cellpadding=0 cellspacing=1 class=rseparator>
 			  <tr class=rhead> 
-[loop list="[list-databases]"]
+[loop list="[scratch list_databases]"]
 [loop-sub db_action]
 sub {
 #Log("args=" . $Tag->uneval({ ref => \@_ }));
@@ -46,13 +56,6 @@
 	return if $admin{$name};
 	my $rec = shift;
 	my $tab = $rec->[0];
-	if(! $admin_done++) {
-		# Set up hidden tables
-		%admin = map { ($_, 1) } split /[\s,\0]+/, $Variable->{UI_ADMIN_TABLES};
-		# To build the links to hidden tables
-		$Scratch->{ui_tmp_admin} = join " ", sort keys %admin;
-	}
-
 	return '' if $admin{$tab};
 
 #Log("name=$name tab=$tab");








More information about the interchange-cvs mailing list