Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.158 and 1.163

version 1.158, 2007/05/07 14:02:45 version 1.163, 2007/09/26 12:42:32
Line 140  sub select_recent { Line 140  sub select_recent {
     foreach my $value (sort(keys(%recent))) {      foreach my $value (sort(keys(%recent))) {
  unless ($value =~/^error\:/) {   unless ($value =~/^error\:/) {
     my $escaped = &Apache::loncommon::escape_url($value);      my $escaped = &Apache::loncommon::escape_url($value);
       &Apache::loncommon::inhibit_menu_check(\$escaped);
     $return.="\n<option value='$escaped'>".      $return.="\n<option value='$escaped'>".
  &unescape((split(/\&/,$recent{$value}))[1]).   &unescape((split(/\&/,$recent{$value}))[1]).
  '</option>';   '</option>';
Line 852  sub Create_PrgWin { Line 853  sub Create_PrgWin {
          popwin=open(\'\',\'popwin\',\'width=400,height=100\');".           popwin=open(\'\',\'popwin\',\'width=400,height=100\');".
         "popwin.document.writeln(\'".$start_page.          "popwin.document.writeln(\'".$start_page.
               "<h4>$heading<\/h4>".                "<h4>$heading<\/h4>".
               "<form name=\"popremain\" method=\"post\">".                "<form action= \"\" name=\"popremain\" method=\"post\">".
               '<input type="text" size="'.$width.'" name="remaining" value="'.                '<input type="text" size="'.$width.'" name="remaining" value="'.
       &mt('Starting').'" /><\\/form>'.$end_page.        &mt('Starting').'" /><\\/form>'.$end_page.
               "\');".                "\');".
Line 864  sub Create_PrgWin { Line 865  sub Create_PrgWin {
  $prog_state{'window'}='window';   $prog_state{'window'}='window';
  if (!$formname) {   if (!$formname) {
     $prog_state{'formname'}=&get_uniq_name();      $prog_state{'formname'}=&get_uniq_name();
     &r_print($r,'<form name="'.$prog_state{'formname'}.'">');      &r_print($r,'<form action="" name="'.$prog_state{'formname'}.'">');
  } else {   } else {
     $prog_state{'formname'}=$formname;      $prog_state{'formname'}=$formname;
  }   }
Line 891  sub Create_PrgWin { Line 892  sub Create_PrgWin {
 # update progress  # update progress
 sub Update_PrgWin {  sub Update_PrgWin {
     my ($r,$prog_state,$displayString)=@_;      my ($r,$prog_state,$displayString)=@_;
     &r_print($r,'<script>'.$$prog_state{'window'}.'.document.'.      &r_print($r,'<script type="text/javascript">'.$$prog_state{'window'}.'.document.'.
      $$prog_state{'formname'}.'.'.       $$prog_state{'formname'}.'.'.
      $$prog_state{'inputname'}.'.value="'.       $$prog_state{'inputname'}.'.value="'.
      $displayString.'";</script>');       $displayString.'";</script>');
Line 1003  sub crumbs { Line 1004  sub crumbs {
     } else {      } else {
  $path.='/';    $path.='/'; 
     }          }    
             my $linkpath = &Apache::loncommon::escape_single($path);  
             if ($form) {  
  $linkpath=  
                     qq{javascript:$form.action='$linkpath';$form.submit();};  
             }  
             my $href_path = &HTML::Entities::encode($path,'<>&"');              my $href_path = &HTML::Entities::encode($path,'<>&"');
     $output.=qq{<a href="$path" $target>$dir</a>/};      &Apache::loncommon::inhibit_menu_check(\$href_path);
       if ($form) {
           my $href = 'javascript:'.$form.".action='".$href_path."';".$form.'.submit();';
           $output.=qq{<a href="$href" $target>$dir</a>/};
       } else {
           $output.=qq{<a href="$href_path" $target>$dir</a>/};
       }
  }   }
     } else {      } else {
  foreach my $dir (split('/',$uri)) {   foreach my $dir (split('/',$uri)) {
Line 1332  returns: nothing Line 1334  returns: nothing
 # row2  # row2
 # row3   ... etc.  # row3   ... etc.
 # &submit_row(0  # &submit_row(0
 # &end_pickbox()  # &end_pick_box()
 #  #
 # where row1, row 2 etc. are chosen from &role_select_row,&course_select_row,  # where row1, row 2 etc. are chosen from &role_select_row,&course_select_row,
 # &status_select_row and &email_default_row  # &status_select_row and &email_default_row
Line 1570  sub status_select_row { Line 1572  sub status_select_row {
 sub email_default_row {  sub email_default_row {
     my ($authtypes,$title,$descrip,$css_class) = @_;      my ($authtypes,$title,$descrip,$css_class) = @_;
     my $output = &row_title($title,$css_class);      my $output = &row_title($title,$css_class);
     my @rowcols = ('#eeeeee','#dddddd');  
     $output .= $descrip.      $output .= $descrip.
  &Apache::loncommon::start_data_table().   &Apache::loncommon::start_data_table().
  &Apache::loncommon::start_data_table_header_row().   &Apache::loncommon::start_data_table_header_row().
Line 1878  END Line 1879  END
     return $scripttag;      return $scripttag;
 }  }
   
   ##############################################
   ##############################################
   
   # javascript_window_dims
   #
   # Generates javascript to get the dimensions of the user's browser window.
   
   sub javascript_window_dims {
       my $scripttag .= <<'END';
   function getDimensions(width,height) {
       width.value = getWindowWidth();
       height.value = getWindowHeight();
       return;
   }
    
   function getWindowWidth() {
     var width = 0;
     if( document.documentElement && document.documentElement.clientWidth ) {
       width = document.documentElement.clientWidth;
     }
     else if( document.body && document.body.clientWidth ) {
       width = document.body.clientWidth;
     }
     else if( window.innerWidth ) {
       width = window.innerWidth - 18;
     }
     return width;
   }
   
   function getWindowHeight() {
     var height = 0;
     if( document.documentElement && document.documentElement.clientHeight ) {
       height = document.documentElement.clientHeight;
     }
     else if( document.body && document.body.clientHeight ) {
       height = document.body.clientHeight;
     }
     else if( window.innerHeight ) {
       height = window.innerHeight - 18;
     }
     return height;
   }
   
   END
       return $scripttag;
   }
 1;  1;
   
 __END__  __END__

Removed from v.1.158  
changed lines
  Added in v.1.163


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