4 use vars qw(@EXPORT_OK @ISA);
8 use CGI::Carp qw(fatalsToBrowser);
12 @EXPORT_OK = qw(header menubar idiot eidiot popurl table);
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);
137 my $x = $url->as_string;
138 $x .= '/' unless $x =~ /\/$/;
144 Returns HTML tag for beginning a table.
166 subroutines for the HTML/CGI GUI, not properly OO. :(
168 ivan@sisd.com 98-apr-16
169 ivan@sisd.com 98-jun-22
171 lose the background, eidiot ivan@sisd.com 98-sep-2
173 pod ivan@sisd.com 98-sep-12
176 Revision 1.12 1998-12-23 02:23:16 ivan
177 popurl always has trailing slash
179 Revision 1.11 1998/11/12 07:43:54 ivan
180 *** empty log message ***
182 Revision 1.10 1998/11/12 01:53:47 ivan
185 Revision 1.9 1998/11/09 08:51:49 ivan
188 Revision 1.7 1998/11/09 06:10:59 ivan
191 Revision 1.6 1998/11/09 05:44:20 ivan
192 *** empty log message ***
194 Revision 1.4 1998/11/09 04:55:42 ivan
195 support depriciated CGI::Base as well as CGI.pm (for now)
197 Revision 1.3 1998/11/08 10:50:19 ivan
198 s/CGI::Base/CGI/; etc.