Diff for /loncom/interface/lontemplate.pm between versions 1.24 and 1.36

version 1.24, 2009/03/21 21:58:32 version 1.36, 2009/06/08 18:04:46
Line 44  use Apache::lonmsgdisplay(); Line 44  use Apache::lonmsgdisplay();
 use HTML::Entities();  use HTML::Entities();
   
   
 sub start_columnSection{  sub start_columnSection {
  my ($r) = @_;   my ($r) = @_;
  $r->print('<div class="LC_columnSection">');   $r->print('<div class="LC_columnSection">');
 }  }
   
 sub end_columnSection{  sub end_columnSection {
  my ($r) = @_;   my ($r) = @_;
  $r->print('</div>');   $r->print('</div>');
 }  }
   
 sub print_aboutme_content_template{  sub print_aboutme_content_template {
  my ($r,$allowed,$target,$syllabusfields_ref,$syllabus_ref) = @_;   my ($r,$allowed,$target,$syllabusfields_ref,$syllabus_ref) = @_;
  my %syllabusfields = %{$syllabusfields_ref};   my %syllabusfields = %{$syllabusfields_ref};
  my %syllabus = %{$syllabus_ref};   my %syllabus = %{$syllabus_ref};
   
        foreach my $field (sort(keys(%syllabusfields))) {         foreach my $field (sort(keys(%syllabusfields))) {
           if (($syllabus{$field}) || ($allowed)) {            if (($syllabus{$field}) || ($allowed)) {
               my $message=$syllabus{$field};                my $message=$syllabus{$field};
Line 70  sub print_aboutme_content_template{ Line 70  sub print_aboutme_content_template{
               }                }
               $message=&Apache::lontexconvert::msgtexconverted($message);                $message=&Apache::lontexconvert::msgtexconverted($message);
               if ($target ne 'tex') {                if ($target ne 'tex') {
      if($allowed){       if ($allowed) {
  $r->print('<p>');   $r->print('<p>');
      }          }
   
     if($field eq 'aaa_contactinfo') {      if($field eq 'aaa_contactinfo') {
  if($allowed){  
  $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');   $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');
  }   &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
  &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecialContactInfo');      } else {
  $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');    &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_Box');
     }      }
      else{  
   &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecial');  
     }  
     
               } else {                } else {
                      $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.                       $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.
                                &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');                                 &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');
               }                }
               if ($allowed) {                if ($allowed) {
                &print_editbox_template($r,$syllabus{$field},$field);                 &print_editbox_template($r,$syllabus{$field},$field);
  if($target ne 'tex'){   if ($target ne 'tex') {
  $r->print('</p>');   $r->print('</p>');
  }   }
               }                }
           }            }
        }         }
   
 }  
   
 sub start_ContentBox{  
  my ($r,$allowed) = @_;  
  $r->print('<div class="LC_ContentBox">');  
   
 }  
   
 sub end_ContentBox{  
  my ($r) = @_;  
  $r->print('</div>');  
 }  }
   
 sub send_message{  sub send_message {
  my ($r,$cnum,$cdom) = @_;   my ($r,$cnum,$cdom) = @_;
  my $s;   my $s;
  my $image = qq{<img name="Send message" src="/res/adm/pages/com.png" border="none" />};   my $image = qq{<img name="Send message" src="/res/adm/pages/mail-message-new.png" border="none" align="middle" />};
  $s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);   $s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);
  return $s;   return $s;
 }  }
   
 sub print_template  sub print_template {
 {   my ($r,$topic,$content, $allowed,$boxclass) = @_;
  my ($r,$topic,$content, $allowed,$boxclass) = @_;   $r->print('<div class="'.$boxclass.'">');
  $r->print('<div class="'.$boxclass.'">');  
  $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');   $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
  $r->print('<p>' .$content . '</p>');   $r->print($content);
  $r->print('</div>');   $r->print('</div>');
 }  }
 sub print_start_template  
 {  sub print_start_template {
  my ($r,$topic,$boxclass) = @_;   my ($r,$topic,$boxclass) = @_;
  $r->print('<div class="'.$boxclass.'">');   $r->print('<div class="'.$boxclass.'">');
  $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');   $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
 }  }
 sub print_end_template  
 {  sub print_end_template {
  my ($r) = @_;   my ($r) = @_;
  $r->print('</div>');   $r->print('</div>');
 }  }
 sub print_editbox_template  
 {  sub print_editbox_template {
  my ($r,$content,$field) = @_;   my ($r,$content,$field) = @_;
  $r->print('<textarea cols="81" rows="6" name="'.$field.'">'.   $r->print('<textarea cols="81" rows="6" name="'.$field.'">'.
                            &HTML::Entities::encode($content,'"&<>').                             &HTML::Entities::encode($content,'"&<>').
            '</textarea><br /><input type="submit" name="storesyl" value="'.             '</textarea><br /><input type="submit" name="storesyl" value="'.
                            &mt('Save All').'" />');                             &mt('Save All').'" />');
 }  }
 sub print_start_page_functions  
 {  # Functionslist: List of functions
  my($r)=@_;  # Typically used to display a list of available functions at top of page
  $r->print('<fieldset><legend>'. &mt('Functions') . '</legend>');  sub start_functionslist {
 }      my($legendtext)=@_;
 sub print_functions_content      $legendtext=&mt('Functions') if !$legendtext;
 {      return '<fieldset><legend>'.$legendtext.'</legend>'
  my($r,$content) = @_;            .'<ul class="LC_functionslist">';
  $r->print('<span class="LC_nobreak">&bull; '.$content.'</span> ');  }
 }  
 sub print_end_page_functions  sub item_functionslist {
 {      my($content) = @_;
  my($r)=@_;      return '<li>'.$content.'</li>';
  $r->print('</fieldset>');  }
   
   sub end_functionslist {
       my($r)=@_;
       return '</ul></fieldset>';
 }  }
   
 1;  1;

Removed from v.1.24  
changed lines
  Added in v.1.36


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