Diff for /loncom/xml/londefdef.pm between versions 1.403.4.4 and 1.415.4.1

version 1.403.4.4, 2010/11/18 18:07:02 version 1.415.4.1, 2010/08/16 16:14:32
Line 538  sub start_body { Line 538  sub start_body {
   
  my $extra_head = &generate_css_links();   my $extra_head = &generate_css_links();
   
       # Breadcrumbs
       &Apache::lonhtmlcommon::clear_breadcrumbs();
       if ($env{'request.state'} eq 'construct') {
           &Apache::lonhtmlcommon::add_breadcrumb({
               'text'  => 'Construction Space',
               'href'  => &Apache::loncommon::authorspace(),
           });
           &Apache::lonhtmlcommon::add_breadcrumb({
               'text'  => 'HTML Editor',
               'href'  => '',
           });
           # breadcrumbs (and tools) will be created 
           # in start_page->bodytag->innerregister
       } else {
           # FIXME Where are we?
       }
   
  $currentstring =    $currentstring = 
     &Apache::loncommon::start_page($Apache::londefdef::title,      &Apache::loncommon::start_page($Apache::londefdef::title,
    $Apache::londefdef::head     $Apache::londefdef::head
       .$extra_head,        .$extra_head,
    {'add_entries'    => $token->[2],     {'add_entries'    => $token->[2],
     'no_title'       => 1,  #    'no_title'       => 1,
     'force_register' => 1});      'force_register' => 1});
   
  if ($env{'request.state'} ne 'published') {          my $header = '';
     $currentstring.=&Apache::lonmenu::constspaceform();          if ($env{'request.state'} ne 'published' &&
     $currentstring.=&Apache::londefdef::edit_controls();              $env{'request.state'} ne 'construct') {
  }              $header=&Apache::lonmenu::constspaceform();
  $currentstring.=&Apache::lonxml::message_location();          }
           if ($env{'request.state'} ne 'published') {
               $header.=&Apache::londefdef::edit_controls();
           }
           if ($env{'request.state'} eq 'construct') {
               $currentstring.=&Apache::loncommon::head_subbox(
                                   &Apache::loncommon::CSTR_pageheader()
                                  .$header);
           } elsif ($env{'request.state'} eq 'edit') {
               $currentstring.=&Apache::loncommon::head_subbox($header);
           }
           $currentstring.=&Apache::lonxml::message_location();
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '';   #  '\begin{document}' is in header.          $currentstring = '';   #  '\begin{document}' is in header.
     }       }
   
     return $currentstring;      return $currentstring;
 }  }
   
Line 570  sub edit_controls { Line 599  sub edit_controls {
 </div>';  </div>';
     }      }
     $result .= '      $result .= '
 <div class="LC_edit_problem_header_edit_row"><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" /></div></div>  <div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
       if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
           $result .= ('&nbsp;' x 3).'<input type="button" value="'.&mt('Course View').'" onclick="javascript:location.href=currentURL" />';
       }
       $result .= '</div>
   </div>
 </form>  </form>
 <br />';  ';
     return $result;      return $result;
 }  }
   
Line 1349  sub start_font { Line 1383  sub start_font {
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);   my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
  if ($face!~/symbol/i) {  
     if (($env{'browser.fontenhance'} eq 'on') ||   
  ($env{'browser.blackwhite'} eq 'on')) { return ''; }  
  }  
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     }  elsif ($target eq 'tex') {      }  elsif ($target eq 'tex') {
  my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);   my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
Line 2036  sub start_table { Line 2066  sub start_table {
   
         if ((defined $cell_border) && ($cell_border ne 'none')) {          if ((defined $cell_border) && ($cell_border ne 'none')) {
         #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");          #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");
             $table->cell_border(1);      $table->cell_border(1);
         }   }
  if (defined $theme) {          if (defined $theme) {
     $table->theme($theme);      $table->theme($theme);
  }   }
  if (defined $align) {   if (defined $align) {
Line 2050  sub start_table { Line 2080  sub start_table {
  if (!(defined $width)) {   if (!(defined $width)) {
     $width = '70%';      $width = '70%';
  }   }
   
  # If a percentage, need to calculate what this means in terms of   # If a percentage, need to calculate what this means in terms of
  # page width:   # page width:
   
Line 2702  sub tag_check { Line 2732  sub tag_check {
 #  #
   
 sub cell_config_hash {  sub cell_config_hash {
     my ($align, $rowspan, $colspan, $width) = @_;      my ($align, $rowspan, $colspan) = @_;
     if ($rowspan ne '') {  
         $rowspan =~ s/^\s+|\s+$//g;  
     }  
     if ($colspan ne '') {  
         $colspan =~ s/^\s+|\s+$//g;  
     }  
     my %config;      my %config;
     if ($align ne '') {      if ($align ne '') {
  $config{'halign'} = $align;   $config{'halign'} = $align;
     }      }
     if (($colspan =~ /^\d+$/) && ($colspan > 0)) {      if ($colspan ne "") {
  $config{'colspan'} = $colspan;   $config{'colspan'} = $colspan;
     }      }
     if (($rowspan =~ /^\d+$/) && ($rowspan > 0)) {      if ($rowspan ne '') {
  $config{'rowspan'} = $rowspan;   $config{'rowspan'} = $rowspan;
     }      }
     if ($width ne '') {  
         $config{'width'} = $width;  
     }  
     return \%config;      return \%config;
 }  }
     
Line 2733  sub start_td_tex { Line 2754  sub start_td_tex {
     # attributes, but empty of text.  end_td_tex will      # attributes, but empty of text.  end_td_tex will
     # fetch the contents from the recursive parse and      # fetch the contents from the recursive parse and
     # fill the cell with them:      # fill the cell with them:
     my $align   = &Apache::lonxml::get_param('align', $parstack, $safeeval);      my $align   = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 1);
     my $rowspan = &Apache::lonxml::get_param('rowspan', $parstack, $safeeval);      my $rowspan = &Apache::lonxml::get_param('rowspan', $parstack, $safeeval, undef, 1);
     my $colspan = &Apache::lonxml::get_param('colspan', $parstack, $safeeval);      my $colspan = &Apache::lonxml::get_param('colspan', $parstack, $safeeval, undef, 1);
     my $width   = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval);  
     my $config = &cell_config_hash($align, $rowspan, $colspan, $width);      my $config = &cell_config_hash($align, $rowspan, $colspan);
   
     my $table = $Apache::londefdef::table[-1];      my $table = $Apache::londefdef::table[-1];
     $table->add_cell('', $config);      $table->add_cell('', $config);
Line 3280  sub start_img { Line 3301  sub start_img {
         if ($token->[2]{'src'}=~/\$/) {          if ($token->[2]{'src'}=~/\$/) {
            $currentstring.=&mt('Variable image source');             $currentstring.=&mt('Variable image source');
         } elsif ($token->[2]{'src'}=~/\S/) {          } elsif ($token->[2]{'src'}=~/\S/) {
    $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';             $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
    if ($width) { $currentstring.=' width="'.$width.'" '; }             if ($width) { $currentstring.=' width="'.$width.'" '; }
    if ($height) { $currentstring.=' height="'.$height.'" '; }             if ($height) { $currentstring.=' height="'.$height.'" '; }
    $currentstring .= ' />';             $currentstring .= ' />';
         } else {          } else {
            $currentstring.=&mt("No image source specified");             $currentstring.=&mt("No image source specified");
         }          }
Line 3534  sub start_frameset { Line 3555  sub start_frameset {
     &Apache::loncommon::start_page($Apache::londefdef::title,      &Apache::loncommon::start_page($Apache::londefdef::title,
    $Apache::londefdef::head,     $Apache::londefdef::head,
    {'add_entries'    => $token->[2],     {'add_entries'    => $token->[2],
     'no_title'       => 1,  #    'no_title'       => 1,
     'force_register' => 1,      'force_register' => 1,
     'frameset'       => 1,});      'frameset'       => 1,});
   

Removed from v.1.403.4.4  
changed lines
  Added in v.1.415.4.1


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