diff options
author | mark <mark> | 2011-04-27 08:31:03 +0000 |
---|---|---|
committer | mark <mark> | 2011-04-27 08:31:03 +0000 |
commit | 68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 (patch) | |
tree | 77e67410169c23cfa4499d9bbf779b0005a045fd /httemplate/elements/header.html | |
parent | 9d5ada5763fdeca4f90a7357ab7c384b52c1c41c (diff) |
RT mobile UI, #11630
Diffstat (limited to 'httemplate/elements/header.html')
-rw-r--r-- | httemplate/elements/header.html | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index c83529e2b..432e9c6af 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -28,10 +28,14 @@ Example: <META HTTP-Equiv="Cache-Control" Content="no-cache"> <META HTTP-Equiv="Pragma" Content="no-cache"> <META HTTP-Equiv="Expires" Content="0"> +% if ( $mobile ) { + <META NAME="viewport" content="width=device-width height=device-height user-scalable=yes"> +% } <% include('menu.html', 'freeside_baseurl' => $fsurl, 'position' => $menu_position, 'nocss' => $nocss, + 'mobile' => $mobile, ) |n %> @@ -67,6 +71,19 @@ Example: <TR> +% if ( $mobile ) { + + <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc"> + <SCRIPT TYPE="text/javascript"> + document.write(myBar.toString()); + </SCRIPT> + </TD> + <TD STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079;width:auto" BGCOLOR="#cccccc"> + <% include('searchbar-combined.html') |n %> + </TD> + +% } else { + <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc"> <SCRIPT TYPE="text/javascript"> document.write(myBar); @@ -100,6 +117,7 @@ Example: <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px"> <% include('searchbar-ticket.html') |n %> </TD> +% } </TR> </TABLE> @@ -154,6 +172,9 @@ Example: my( $title, $menubar, $etc, $head ) = ( '', '', '', '' ); my( $nobr, $nocss ) = ( 0, 0 ); + +my $mobile; + if ( ref($_[0]) ) { my $opt = shift; $title = $opt->{title}; @@ -162,12 +183,20 @@ if ( ref($_[0]) ) { $head = $opt->{head}; $nobr = $opt->{nobr}; $nocss = $opt->{nocss}; + $mobile = $opt->{mobile}; } else { ($title, $menubar) = ( shift, shift ); $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. $head = @_ ? shift : ''; #$head is for things that go in the <HEAD> section } +if ( !defined($mobile) ) { + $mobile = FS::UI::Web::is_mobile(); +} +if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override + $mobile = $1; +} + my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; @@ -182,5 +211,4 @@ if ( scalar(@agentnums) == 1 ) { } else { $company_name = $conf->config('company_name'); } - </%init> |