line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::OptimalQuery::InteractiveQuery2Tools; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
770
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
4
|
no warnings qw( uninitialized ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
6
|
1
|
|
|
1
|
|
9
|
use base 'CGI::OptimalQuery::Base'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
212
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub output { |
9
|
0
|
|
|
0
|
0
|
|
my $o = shift; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# if request to open tool panel, execute tool on_open function |
12
|
0
|
0
|
|
|
|
|
if ($$o{q}->param('tool') ne '') { |
13
|
0
|
|
|
|
|
|
my $openedtool = $$o{q}->param('tool'); |
14
|
0
|
|
|
|
|
|
my $tool = $$o{schema}{tools}{$openedtool}; |
15
|
0
|
0
|
0
|
|
|
|
if (! $tool || ! $$tool{on_open}) { |
16
|
0
|
|
|
|
|
|
$$o{output_handler}->(CGI::header('text/html')."\ncould not find tool"); |
17
|
|
|
|
|
|
|
} else { |
18
|
0
|
|
|
|
|
|
my $buf = $$tool{on_open}->($o); |
19
|
0
|
0
|
|
|
|
|
$$o{output_handler}->(CGI::header('text/html')."\n$buf") if $buf; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# else noop, trust that a tool on_init function has already responded |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return undef; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |