OMatic/help.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
main
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 ##############################################################################
2 # The Faq-O-Matic is Copyright 1997 by Jon Howell, all rights reserved. #
3 # #
4 # This program is free software; you can redistribute it and/or #
5 # modify it under the terms of the GNU General Public License #
6 # as published by the Free Software Foundation; either version 2 #
7 # of the License, or (at your option) any later version. #
8 # #
9 # This program is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU General Public License #
15 # along with this program; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.#
17 # #
18 # Jon Howell can be contacted at: #
19 # 6211 Sudikoff Lab, Dartmouth College #
20 # Hanover, NH 03755-3510 #
21 # jonh@cs.dartmouth.edu #
22 # #
23 # An electronic copy of the GPL is available at: #
24 # http://www.gnu.org/copyleft/gpl.html #
25 # #
26 ##############################################################################
27  
28 use strict;
29  
30 package FAQ::OMatic::help;
31  
32 use CGI;
33  
34 use FAQ::OMatic;
35 use FAQ::OMatic::Item;
36 use FAQ::OMatic::HelpMod;
37  
38 sub main {
39 my $cgi = FAQ::OMatic::dispatch::cgi();
40
41 my $params = FAQ::OMatic::getParams($cgi);
42  
43 my $cmd = $params->{'_onCmd'} || '';
44  
45 my $mainUrl = FAQ::OMatic::makeAref('-command'=>$cmd,
46 '-params'=>$params,
47 '-changedParams'=>{'help'=>1},
48 '-refType'=>'url',
49 '-saveTransients'=>1);
50 $helpUrl = FAQ::OMatic::HelpMod::helpURL($params, $cmd);
51 # my $helpUrl = FAQ::OMatic::makeAref('-command'=>'faq',
52 # '-params'=>$params,
53 # '-changedParams'=>{'file'=>'help000'},
54 # '-refType'=>'url');
55  
56 my $html=<<__EOF__;
57 <HTML>
58 <HEAD>
59 <TITLE>FAQ-O-Matic</TITLE>
60 </HEAD>
61 <FRAMESET ROWS="*,200">
62 <FRAME
63 NAME="main-content"
64 SRC="$mainUrl"
65 MARGINWIDTH=1
66 MARGINHEIGHT=1
67 SCROLLING=yes>
68 <FRAME
69 NAME="help"
70 SRC="$helpUrl"
71 MARGINWIDTH=5
72 MARGINHEIGHT=5
73 SCROLLING=yes>
74 </FRAMESET>
75  
76 <NOFRAMES>
77 <BODY BGCOLOR="#ffffff">
78 FAQ-O-Matic Context-Sensitive Help currently works only with
79 frames. You can navigate the help text independently by following
80 this link, if it were a link.
81 </BODY>
82 </NOFRAMES>
83 </HTML>
84 __EOF__
85  
86 print FAQ::OMatic::header($cgi, '-type'=>'text/html')
87 .$html;
88 }
89  
90 1;