lib/CGI/OptimalQuery/InteractiveQuery2Tools.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 16 / 16 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/CGI/OptimalQuery/InteractiveQuery2.pm ↑ Summary lib/CGI/OptimalQuery/JSON.pm »
1 package CGI::OptimalQuery::InteractiveQuery2Tools;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶no warnings qw( uninitialized );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base 'CGI::OptimalQuery::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub output {
9 my $o = shift;
10  
11 # if request to open tool panel, execute tool on_open function
12 if ($$o{q}->param('tool') ne '') {
13 my $openedtool = $$o{q}->param('tool');
14 my $tool = $$o{schema}{tools}{$openedtool};
15 if (! $tool || ! $$tool{on_open}) {
16 $$o{output_handler}->($$o{httpHeader}->('text/html')."<!DOCTYPE html>\n<html><body>could not find tool</body></html>");
17 } else {
18 my $buf = $$tool{on_open}->($o);
19 $$o{output_handler}->($$o{httpHeader}->('text/html')."<!DOCTYPE html>\n<html><body>$buf</body></html>") if $buf;
20 }
21 }
22  
23 # else noop, trust that a tool on_init function has already responded
24  
25 return undef;
26 }
27  
28 1;
« lib/CGI/OptimalQuery/InteractiveQuery2.pm ↑ Summary lib/CGI/OptimalQuery/JSON.pm »