user pref to enable mobile menu, #11630
authormark <mark>
Thu, 19 May 2011 23:25:37 +0000 (23:25 +0000)
committermark <mark>
Thu, 19 May 2011 23:25:37 +0000 (23:25 +0000)
httemplate/elements/header.html
httemplate/pref/pref-process.html
httemplate/pref/pref.html

index 432e9c6..61d0313 100644 (file)
@@ -190,13 +190,6 @@ if ( ref($_[0]) ) {
   $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;
@@ -204,6 +197,13 @@ my $curuser = $FS::CurrentUser::CurrentUser;
 my $menu_position = $curuser->option('menu_position')
                     || 'top'; #new default for 1.9
 
+if ( !defined($mobile) ) {
+  $mobile = $curuser->option('mobile_menu',1) && FS::UI::Web::is_mobile();
+}
+if ( $cgi->param('mobile') =~ /^(\d)$/ ) { # allow client to override
+  $mobile = $1;
+}
+
 my $company_name;
 my @agentnums = $curuser->agentnums;
 if ( scalar(@agentnums) == 1 ) {
index 0ee48fd..6f35185 100644 (file)
@@ -48,7 +48,7 @@ unless ( $error ) { # if ($access_user) {
   my %param = $access_user->options;
 
   #XXX autogen
-  my @paramlist = qw( locale menu_position default_customer_view
+  my @paramlist = qw( locale menu_position default_customer_view mobile_menu
                       disable_html_editor
                       email_address
                       snom-ip snom-username snom-password
index da8b428..8fd1eaa 100644 (file)
@@ -54,6 +54,14 @@ Interface
   </TR>
 
   <TR>
+    <TH ALIGN="right">Enable mobile-friendly menu: </TH>
+    <TD COLSPAN=2>
+      <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
+<% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
+    </TD>
+  </TR>
+  <TR>
     <TH ALIGN="right">Default customer view: </TH>
     <TD COLSPAN=2>
       <SELECT NAME="default_customer_view">
@@ -67,7 +75,7 @@ Interface
       </SELECT>
     </TD>
   </TR>
-  
   <TR>
     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
     <TD ALIGN="left" COLSPAN=2>