--- loncom/interface/lonhtmlcommon.pm 2010/10/04 19:19:15 1.253.2.3 +++ loncom/interface/lonhtmlcommon.pm 2010/12/02 13:47:17 1.253.2.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.253.2.3 2010/10/04 19:19:15 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.253.2.7 2010/12/02 13:47:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -410,7 +410,7 @@ The method used to restrict user input w ############################################## sub date_setter { my ($formname,$dname,$currentvalue,$special,$includeempty,$state, - $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink) = @_; + $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink,$hide_timezone) = @_; my $now = time; my $wasdefined=1; if (! defined($state) || $state ne 'disabled') { @@ -563,7 +563,10 @@ ENDJS $cal_link = qq{}; } # - my $tzone = ' '.$tzname.' '; + my $tzone; + unless ($hide_timezone) { + $tzone = ' '.$tzname.' '; + } if ($no_hh_mm_ss) { $result .= &mt('[_1] [_2] [_3] ', $monthselector,$dayselector,$yearselector). @@ -643,7 +646,7 @@ Returns: Unix time represented in the fo ############################################## ############################################## sub get_date_from_form { - my ($dname) = @_; + my ($dname,$timezone) = @_; my ($sec,$min,$hour,$day,$month,$year); # if (defined($env{'form.'.$dname.'_second'})) { @@ -693,7 +696,13 @@ sub get_date_from_form { if (($year<1970) || ($year>2037)) { return undef; } if (defined($sec) && defined($min) && defined($hour) && defined($day) && defined($month) && defined($year)) { - my $timezone = &Apache::lonlocal::gettimezone(); + if (defined($timezone)) { + if (&Apache::lonlocal::gettimezone($timezone) eq 'local') { + $timezone = &Apache::lonlocal::gettimezone(); + } + } else { + $timezone = &Apache::lonlocal::gettimezone(); + } my $dt = DateTime->new( year => $year, month => $month, day => $day, @@ -1382,20 +1391,33 @@ returns: nothing return unless($last); } else { my $description = 'Menu'; + my $href = '/adm/menu'; + my $tooltip = 'Go to main menu'; my $no_mt_descr = 0; if ((exists($env{'request.course.id'})) && - ($env{'request.course.id'} ne '') && - ($env{'course.'.$env{'request.course.id'}.'.description'} ne '')) { - $description = - $env{'course.'.$env{'request.course.id'}.'.description'}; - $no_mt_descr = 1; + ($env{'request.course.id'} ne '') && + !($env{'form.context'} eq 'requestcrs')) { + if ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) { + if ($env{'environment.remotenavmap'} eq 'on') { + # open link using javascript when remote navmap is activated + $href = "javascript:gonav('/adm/navmaps');"; + } else { + $href = '/adm/navmaps'; + } + $tooltip = 'Contents'; + } + if ($env{'course.'.$env{'request.course.id'}.'.description'} ne '') { + $description = + $env{'course.'.$env{'request.course.id'}.'.description'}; + $no_mt_descr = 1; + } } - $menulink = { href =>'/adm/menu', - title =>'Go to main menu', - target =>'_top', - text =>$description, - no_mt =>$no_mt_descr, }; - if($last) { + $menulink = { href => $href, + title => $tooltip, + target => '_top', + text => $description, + no_mt => $no_mt_descr, }; + if ($last) { #$last set, so we have some crumbs unshift(@Crumbs,$menulink); } else { @@ -1433,7 +1455,7 @@ returns: nothing # last breadcrumb is the first order heading of a page # for course breadcrumbs it's just bold $links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', - $lasttext), {title => $lasttext}); + $lasttext), {title => $lasttext}); my $icons = ''; $faq = $last->{'faq'} if (exists($last->{'faq'})); @@ -1568,7 +1590,7 @@ returns: nothing { listattr => { class=>'LC_breadcrumb_tools_outerlist' } }); } -=item render_advtools(\$breadcrumbs) +=item render_advtools(\$breadcrumbs,$legend) Creates html for advanced tools (category advtools) and inserts \$breadcrumbs at the correct position. @@ -1580,12 +1602,15 @@ returns: nothing =cut sub render_advtools { - my ($breadcrumbs) = @_; + my ($breadcrumbs,$legend) = @_; return unless (defined $tools{'advtools'}) and (scalar(@{$tools{'advtools'}}) > 0); - + my $args; + if ($legend) { + $args = {legend => $legend}; + } $$breadcrumbs .= Apache::loncommon::head_subbox( - funclist_from_array($tools{'advtools'}) ); + funclist_from_array($tools{'advtools'},$args)); } } # End of scope for @Crumbs