default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / elements / header-logo.html
1 <%doc>
2
3 Example:
4
5   <& /elements/header-logo.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          'no_jquery' => #for use from RT, which loads its own
13        }
14   &>
15
16 </%doc>
17 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
18 %#<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19 %# above is what RT declares, should we switch now? hopefully no glitches result
20 %# or just fuck it, XHTML died anyway, HTML 5 or bust?
21 <HTML>
22   <HEAD>
23     <TITLE>
24       <% encode_entities($title) || $title_noescape |n %>
25     </TITLE>
26     <!-- per RT, to prevent IE compatibility mode -->
27     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
28     <!-- The X-UA-Compatible <meta> tag above must be very early in <head> -->
29     <META HTTP-Equiv="Cache-Control" Content="no-cache">
30     <META HTTP-Equiv="Pragma" Content="no-cache">
31     <META HTTP-Equiv="Expires" Content="0"> 
32 % if ( $mobile ) {
33     <META NAME="viewport" content="width=device-width height=device-height user-scalable=yes">
34 % }
35
36 % unless ( $nocss ) {
37   <link href="<%$fsurl%>elements/freeside.css?v=<% $FS::VERSION %>" type="text/css" rel="stylesheet">
38   <link href="<%$fsurl%>elements/freeside-print.css?v=<% $FS::VERSION %>" type="text/css" rel="stylesheet" media="print">
39 % }
40
41 %   unless ( $no_jquery ) {
42       <link rel="stylesheet" href="<% $fsurl %>elements/jquery-ui-1.12.1.min.css">
43       <SCRIPT SRC="<% $fsurl %>elements/jquery-3.3.1.js"></SCRIPT>
44       <SCRIPT SRC="<% $fsurl %>elements/jquery-migrate-3.0.1.min.js"></SCRIPT>
45       <SCRIPT SRC="<% $fsurl %>elements/jquery-ui-1.12.1.min.js"></SCRIPT>
46       <SCRIPT SRC="<% $fsurl %>elements/jquery.validate-1.17.0.min.js"></SCRIPT>
47 %     if ( $FS::CurrentUser::CurrentUser->option('printtofit') ) {
48       <SCRIPT SRC="<% $fsurl %>elements/printtofit.js"></SCRIPT>
49 %     }
50 %   }
51     <% include('init_overlib.html') |n %>
52     <% include('rs_init_object.html') |n %>
53     <script type="text/javascript" src="<% $fsurl %>elements/topreload.js"></script>
54     <% $head |n %>
55
56 %# announce our base path, and the Mason comp path of this page
57   <script type="text/javascript">
58   window.fsurl = <% $fsurl |js_string %>;
59   window.request_comp_path = <% $m->request_comp->path |js_string %>;
60   </script>
61
62   </HEAD>
63   <BODY BGCOLOR="#f8f8f8" <% $etc |n %> STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
64     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px" CLASS="fshead">
65       <tr>
66         <td BGCOLOR="#ffffff"><% $company_url ? qq(<A HREF="$company_url">) : '' |n %><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="<%$fsurl%>view/REAL_logo.cgi"><% $company_url ? '</A>' : '' |n %></td>
67         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
68           <font size=6><% $company_name || 'ExampleCo' %></font>
69         </td>
70       </tr>
71     </table>
72
73 <%init>
74
75 my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
76 my( $nobr, $nocss, $no_jquery ) = ( 0, 0, 0 );
77
78 my $mobile;
79
80 my $opt = shift;
81 $title   = $opt->{title};
82 $title_noescape = $opt->{title_noescape};
83 $menubar    = $opt->{menubar};
84 $etc        = $opt->{etc};
85 $head       = $opt->{head};
86 $nobr       = $opt->{nobr};
87 $nocss      = $opt->{nocss};
88 $mobile     = $opt->{mobile};
89 $no_jquery  = $opt->{no_jquery};
90
91 my $conf = new FS::Conf;
92
93 my $curuser = $FS::CurrentUser::CurrentUser;
94
95 my $menu_position = $curuser->option('menu_position')
96                     || 'top'; #new default for 1.9
97
98 if ( !defined($mobile) ) {
99   $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
100 }
101 if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
102   $mobile = $1;
103 }
104
105 my($company_name, $company_url);
106 my @agentnums = $curuser->agentnums;
107 if ( scalar(@agentnums) == 1 ) {
108   $company_name = $conf->config('company_name', $agentnums[0] );
109   $company_url  = $conf->config('company_url',  $agentnums[0] );
110 } else {
111   $company_name = $conf->config('company_name');
112   $company_url  = $conf->config('company_url');
113 }
114
115 </%init>