Diff for /loncom/interface/lontemplate.pm between versions 1.49 and 1.52

version 1.49, 2013/05/10 23:41:32 version 1.52, 2025/01/28 19:49:20
Line 86  sub print_aboutme_content_template { Line 86  sub print_aboutme_content_template {
   &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');    &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
     }      }
  if($allowed) {   if($allowed) {
                &print_editbox_template($r,$syllabus{$field},$field);                 &print_editbox_template($r,$syllabus{$field},$field,$syllabusfields{$field});
  }   }
   
               } else {                } else {
Line 116  sub print_template { Line 116  sub print_template {
   
 sub print_start_template {  sub print_start_template {
  my ($r,$topic,$boxclass,$id,$display) = @_;   my ($r,$topic,$boxclass,$id,$display) = @_;
         my $idattrib;           my $idattrib;
         if ($id ne '') {          if ($id ne '') {
             $idattrib = ' id="'.$id.'"';              $idattrib = ' id="'.$id.'"';
         }          }
Line 130  sub print_end_template { Line 130  sub print_end_template {
 }  }
   
 sub print_editbox_template {  sub print_editbox_template {
  my ($r,$content,$field) = @_;   my ($r,$content,$field,$fieldname) = @_;
  $r->print('<textarea cols="81" rows="6" name="'.$field.'">'.   my $labeltext = &HTML::Entities::encode(&mt('Edit [_1]',$fieldname),'"&<>');
    $r->print('<textarea cols="81" rows="6" name="'.$field.'" aria-label="'.$labeltext.'">'.
                   &HTML::Entities::encode($content,'"&<>').                    &HTML::Entities::encode($content,'"&<>').
                   '</textarea><br />'."\n");                    '</textarea><br />'."\n");
  &print_saveall_template($r);   &print_saveall_template($r);
 }  }
   
 sub print_textarea_template {  sub print_textarea_template {
  my ($r, $content, $field, $wysiwyg) = @_;   my ($r, $content, $field, $fieldname, $wysiwyg) = @_;
  $r->print('<textarea cols="81" rows="6" class="'.$wysiwyg.'" id="'.$field.'" name="'.$field.'">'.   my $labeltext = &HTML::Entities::encode(&mt('Edit [_1]',$fieldname),'"&<>');
    $r->print('<textarea cols="81" rows="6" class="'.$wysiwyg.'" id="'.$field.'" name="'.$field.'" aria-label="'.$labeltext.'">'.
   &HTML::Entities::encode($content, '"&<>').    &HTML::Entities::encode($content, '"&<>').
  '</textarea><br />');   '</textarea><br />');
 }  }
Line 170  sub print_template_fields { Line 172  sub print_template_fields {
                 unless ($allowed) {                  unless ($allowed) {
                     next if ($noshow{$field});                      next if ($noshow{$field});
                 }                  }
  my $gateway = Apache::lonhtmlgateway->new($target);                  my $gateway = Apache::lonhtmlgateway->new($target);
         $message = &Encode::decode('utf8', $message);                  $message = &Encode::decode('utf8', $message);
         $message = $gateway->process_outgoing_html($message, $legacy);                  $message = $gateway->process_outgoing_html($message, $legacy);
         if ((%custom_handlers) && ($custom_handlers{$field})) {                  if ((%custom_handlers) && ($custom_handlers{$field})) {
  $custom_handlers{$field}->($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed, $display);                      $custom_handlers{$field}->($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed, $display);
  } else {   } else {
  if (($data{$field}=~/\w/) || ($allowed)) {   if (($data{$field}=~/\w/) || ($allowed)) {
  if ($target ne 'tex') {   if ($target ne 'tex') {
Line 183  sub print_template_fields { Line 185  sub print_template_fields {
  $r->print($message);   $r->print($message);
  if ($allowed) {   if ($allowed) {
  $r->print("<br /><div>");   $r->print("<br /><div>");
  &Apache::lontemplate::print_textarea_template($r, $data{$field},   &print_textarea_template($r, $data{$field},
  $field, $default_rich_text);   $field, $fields{$field}, $default_rich_text);
  &print_saveall_template($r);   &print_saveall_template($r);
  $r->print("</div>");   $r->print("</div>");
  }    } 

Removed from v.1.49  
changed lines
  Added in v.1.52


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