margin and padding css defined properly in px
[freeside.git] / httemplate / elements / header.html
1 <%doc>
2
3 Example:
4
5   include( '/elements/header.html',
6            {
7              'title'   => 'Title',
8              'menubar' => \@menubar,
9              'etc'     => '', #included in <BODY> tag, for things like onLoad=
10              'head'    => '', #included before closing </HEAD> tag
11              'nobr'    => 0,  #1 for no <BR><BR> after the title
12            }
13          );
14
15   #old-style
16   include( '/elements/header.html', 'Title', $menubar, $etc, $head);
17
18 </%doc>
19 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
20 %#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
21 %# above is what RT declares, should we switch now? hopefully no glitches result
22 %# or just fuck it, XHTML died anyway, HTML 5 or bust?
23 <HTML>
24   <HEAD>
25     <TITLE>
26       <% $title |h %>
27     </TITLE>
28     <META HTTP-Equiv="Cache-Control" Content="no-cache">
29     <META HTTP-Equiv="Pragma" Content="no-cache">
30     <META HTTP-Equiv="Expires" Content="0"> 
31
32     <% include('menu.html', 'freeside_baseurl' => $fsurl,
33                             'position'         => $menu_position,
34                             'nocss'            => $nocss,
35               ) |n
36     %>
37
38     <% include('init_overlib.html') |n %>
39     <% include('rs_init_object.html') |n %>
40     <% include('logout.html') |n %>
41
42     <% $head |n %>
43
44   </HEAD>
45   <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
46     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px">
47       <tr>
48         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"></td>
49         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
50           <font size=6><% $company_name || 'ExampleCo' %></font>
51         </td>
52         <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b><% getotaker %>&nbsp;</b> <FONT SIZE="-2"><a href="javascript:void(0);" onClick="logout();">logout</a></FONT><br></FONT><FONT SIZE="-2"><a href="<%$fsurl%>pref/pref.html" STYLE="color: #000000">Preferences</a>
53 %         if ( $conf->config("ticket_system")
54 %              && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) {
55             | <a href="<%$fsurl%>rt/Prefs/Other.html" STYLE="color: #000000">Ticketing preferences</a>
56 %         }
57           <BR></FONT>
58         </td>
59       </tr>
60     </table>
61
62     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
63
64 <link href="<%$fsurl%>elements/freeside-menu.css" type="text/css" rel="stylesheet">
65
66 % if ( $menu_position eq 'top' ) {
67
68       <TR>
69
70         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
71           <SCRIPT TYPE="text/javascript">
72             document.write(myBar);
73           </SCRIPT>
74         </TD>
75
76       </TR>
77
78       <TR>
79
80         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
81           <% include('searchbar-prospect.html') |n %>
82         </TD>
83
84         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
85           <% include('searchbar-cust_main.html') |n %>
86         </TD>
87
88         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
89           <% include('searchbar-address2.html') |n %>
90         </TD>
91
92         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
93           <% include('searchbar-cust_bill.html') |n %>
94         </TD>
95
96         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
97           <% include('searchbar-cust_svc.html') |n %>
98         </TD>
99
100         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
101           <% include('searchbar-ticket.html') |n %>
102         </TD>
103
104       </TR>
105     </TABLE>
106
107 % } else { #$menu_position eq 'left'
108
109       <TR>
110
111         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
112         </TD>
113
114       </TR>
115
116 % }
117
118
119     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
120
121       <TR HEIGHT="100%">
122
123 % if ( $menu_position eq 'left' ) {
124
125         <TD BGCOLOR="#cccccc" ALIGN="left" HEIGHT="100%" WIDTH="154" VALIGN="top" ALIGN="right">
126           <SCRIPT TYPE="text/javascript">
127             document.write(myBar);
128           </SCRIPT>
129
130           <BR>
131           <% include('searchbar-prospect.html') |n %>
132           <% include('searchbar-cust_main.html') |n %>
133           <% include('searchbar-address2.html') |n %>
134           <% include('searchbar-cust_bill.html') |n %>
135           <% include('searchbar-cust_svc.html') |n %>
136           <% include('searchbar-ticket.html') |n %>
137
138         </TD>
139
140 % }
141
142         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
143
144           <FONT SIZE=6>
145             <% $title |h %>
146           </FONT>
147
148 % unless ( $nobr ) {
149           <BR><BR>
150 % }
151
152           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
153 <%init>
154
155 my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
156 my( $nobr, $nocss ) = ( 0, 0 );
157 if ( ref($_[0]) ) {
158   my $opt = shift;
159   $title   = $opt->{title};
160   $menubar = $opt->{menubar};
161   $etc     = $opt->{etc};
162   $head    = $opt->{head};
163   $nobr    = $opt->{nobr};
164   $nocss   = $opt->{nocss};
165 } else {
166   ($title, $menubar) = ( shift, shift );
167   $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc.
168   $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section
169 }
170
171 my $conf = new FS::Conf;
172
173 my $curuser = $FS::CurrentUser::CurrentUser;
174
175 my $menu_position = $curuser->option('menu_position')
176                     || 'top'; #new default for 1.9
177
178 my $company_name;
179 my @agentnums = $curuser->agentnums;
180 if ( scalar(@agentnums) == 1 ) {
181   $company_name = $conf->config('company_name', $agentnums[0] );
182 } else {
183   $company_name = $conf->config('company_name');
184 }
185
186 </%init>