File: acetable

package info (click to toggle)
libace-perl 1.92-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,012 kB
  • sloc: perl: 7,763; ansic: 7,420; makefile: 81
file content (54 lines) | stat: -rwxr-xr-x 1,158 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl

use strict 'vars';
use vars qw/$DB $URL $NAME $CLASS %PAPERS/;

use Ace 1.38;
use CGI 2.42 qw/:standard :html3 escape/;
use CGI::Carp qw/fatalsToBrowser/;
use Ace::Browser::AceSubs;

AceInit();
$NAME  = param('name');
#$PARMS = param('parms');

# fetch database handle
$DB = OpenDatabase() || AceError("Couldn't open database.");

AceHeader();
AceError(<<END) unless $NAME ;
Call this script with URL parameters of
<VAR>name</VAR> and <VAR>parms,</VAR> where
"name" is the name of a table definition in acedb
END

display_table($NAME," ");
exit 0;

sub display_table {
  my ($name,$parms) = @_;
  my $obj = $DB->raw_query("table -title -n $name $parms") || AceMissing($name,$parms);
  my ($n,$c) = (escape($name),escape($parms));


  print
    start_html(-Title=>"$name: $parms",
	       -Style=>STYLE,
	       -Class=>'tree',
	       -Bgcolor=>BGCOLOR_TREE),
    h1("$name: $parms"),
    &show_table($obj),
    #$obj->asHTML() || strong('No more text information about this object in the database'),
    FOOTER,
    end_html;
}


sub show_table {
  my $obj = shift;
  my $dna = "$obj";
  #$dna=~s/(\w{50})/$1/g;
  return (pre($dna),0);
}