4 use vars qw(@EXPORT_OK @ISA);
8 use CGI::Carp qw(fatalsToBrowser);
12 @EXPORT_OK = qw(header menubar idiot eidiot popurl);
16 FS::CGI - Subroutines for the web interface
20 use FS::CGI qw(header menubar idiot eidiot popurl);
22 print header( 'Title', '' );
23 print header( 'Title', menubar('item', 'URL', ... ) );
25 idiot "error message";
26 eidiot "error message";
28 $url = popurl; #returns current url
29 $url = popurl(3); #three levels up
33 Provides a few common subroutines for the web interface.
39 =item header TITLE, MENUBAR
41 Returns an HTML header.
46 my($title,$menubar)=@_;
55 <BODY BGCOLOR="#ffffff">
56 <FONT COLOR="#FF0000" SIZE=7>
65 =item menubar ITEM, URL, ...
67 Returns an HTML menubar.
71 sub menubar { #$menubar=menubar('Main Menu', '../', 'Item', 'url', ... );
74 ($item,$url)=splice(@_,0,2);
75 push @html, qq!<A HREF="$url">$item</A>!;
82 Sends headers and an HTML error message.
88 my($cgi)=FS::UID::cgi;
89 if ( $cgi->isa('CGI::Base') ) {
91 &CGI::Base::SendHeaders;
98 <TITLE>Error processing your request</TITLE>
102 <H4>Error processing your request</H4>
104 Your request could not be processed because of the following error:
106 <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and try again.
115 Sends headers and an HTML error message, then exits.
126 Returns current URL with LEVEL levels of path removed from the end (default 0).
132 my($cgi)=&FS::UID::cgi;
133 my($url)=new URI::URL $cgi->url;
134 my(@path)=$url->path_components;
136 $url->path_components(@path);
154 subroutines for the HTML/CGI GUI, not properly OO. :(
156 ivan@sisd.com 98-apr-16
157 ivan@sisd.com 98-jun-22
159 lose the background, eidiot ivan@sisd.com 98-sep-2
161 pod ivan@sisd.com 98-sep-12
164 Revision 1.9 1998-11-09 08:51:49 ivan
167 Revision 1.7 1998/11/09 06:10:59 ivan
170 Revision 1.6 1998/11/09 05:44:20 ivan
171 *** empty log message ***
173 Revision 1.4 1998/11/09 04:55:42 ivan
174 support depriciated CGI::Base as well as CGI.pm (for now)
176 Revision 1.3 1998/11/08 10:50:19 ivan
177 s/CGI::Base/CGI/; etc.