Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.253.2.3 and 1.253.2.7

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

Removed from v.1.253.2.3  
changed lines
  Added in v.1.253.2.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>