From f1cfd3ba31c346283520ea88ad3b8b265559db02 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 19 May 2011 23:25:37 +0000 Subject: [PATCH] user pref to enable mobile menu, #11630 --- httemplate/elements/header.html | 14 +++++++------- httemplate/pref/pref-process.html | 2 +- httemplate/pref/pref.html | 10 +++++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 432e9c6af..61d031376 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -190,13 +190,6 @@ if ( ref($_[0]) ) { $head = @_ ? shift : ''; #$head is for things that go in the 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 ) { diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 0ee48fd9e..6f3518561 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -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 diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index da8b42867..8fd1eaa73 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -54,6 +54,14 @@ Interface + Enable mobile-friendly menu: + + option('mobile_menu') ? 'CHECKED' : '' %>> + + + + Default customer view: - + Disable HTML editor for customer notes: -- 2.11.0