4 use vars qw(@EXPORT_OK @ISA);
8 use CGI::Carp qw(fatalsToBrowser);
12 @EXPORT_OK = qw(header menubar idiot eidiot popurl table itable ntable);
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="#e8e8e8">
61 $x .= $menubar. "<BR><BR>" if $menubar;
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 This is depriciated. Don't use it.
84 Sends headers and an HTML error message.
89 #warn "idiot depriciated";
91 my($cgi)=FS::UID::cgi;
92 if ( $cgi->isa('CGI::Base') ) {
94 &CGI::Base::SendHeaders;
96 print $cgi->header( '-expires' => 'now' );
101 <TITLE>Error processing your request</TITLE>
105 <H4>Error processing your request</H4>
107 Your request could not be processed because of the following error:
117 This is depriciated. Don't use it.
119 Sends headers and an HTML error message, then exits.
124 #warn "eidiot depriciated";
131 Returns current URL with LEVEL levels of path removed from the end (default 0).
137 my($cgi)=&FS::UID::cgi;
138 my($url)=new URI::URL $cgi->url;
139 my(@path)=$url->path_components;
141 $url->path_components(@path);
142 my $x = $url->as_string;
143 $x .= '/' unless $x =~ /\/$/;
149 Returns HTML tag for beginning a table.
156 qq!<TABLE BGCOLOR="$col" BORDER=1 WIDTH="100%">!;
164 Returns HTML tag for beginning an (invisible) table.
170 my $cellspacing = shift || 0;
172 qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing WIDTH="100%">!;
174 qq!<TABLE BORDER=0 CELLSPACING=$cellspacing WIDTH="100%">!;
180 This is getting silly.
186 my $cellspacing = shift || 0;
188 qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing>!;
209 subroutines for the HTML/CGI GUI, not properly OO. :(
211 ivan@sisd.com 98-apr-16
212 ivan@sisd.com 98-jun-22
214 lose the background, eidiot ivan@sisd.com 98-sep-2
216 pod ivan@sisd.com 98-sep-12
219 Revision 1.17 1999-02-07 09:59:43 ivan
220 more mod_perl fixes, and bugfixes Peter Wemm sent via email
222 Revision 1.16 1999/01/25 12:26:05 ivan
223 yet more mod_perl stuff
225 Revision 1.15 1999/01/18 09:41:48 ivan
226 all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
229 Revision 1.14 1999/01/18 09:22:37 ivan
230 changes to track email addresses for email invoicing
232 Revision 1.12 1998/12/23 02:23:16 ivan
233 popurl always has trailing slash
235 Revision 1.11 1998/11/12 07:43:54 ivan
236 *** empty log message ***
238 Revision 1.10 1998/11/12 01:53:47 ivan
241 Revision 1.9 1998/11/09 08:51:49 ivan
244 Revision 1.7 1998/11/09 06:10:59 ivan
247 Revision 1.6 1998/11/09 05:44:20 ivan
248 *** empty log message ***
250 Revision 1.4 1998/11/09 04:55:42 ivan
251 support depriciated CGI::Base as well as CGI.pm (for now)
253 Revision 1.3 1998/11/08 10:50:19 ivan
254 s/CGI::Base/CGI/; etc.