Diff for /loncom/interface/lontemplate.pm between versions 1.12 and 1.31

version 1.12, 2008/12/17 13:00:36 version 1.31, 2009/04/15 10:49:30
Line 46  use HTML::Entities(); Line 46  use HTML::Entities();
   
 sub start_columnSection{  sub start_columnSection{
  my ($r) = @_;   my ($r) = @_;
  $r->print('<div class="columnSection">');   $r->print('<div class="LC_columnSection">');
 }  }
   
 sub end_columnSection{  sub end_columnSection{
Line 54  sub end_columnSection{ Line 54  sub end_columnSection{
  $r->print('</div>');   $r->print('</div>');
 }  }
   
 sub print_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};
  &start_ContentBox($r,$allowed);  
        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 73  sub print_content_template{ Line 73  sub print_content_template{
      if($allowed){       if($allowed){
  $r->print('<p>');   $r->print('<p>');
      }       }
      &print_template($r,$syllabusfields{$field},$message,$allowed);  
       if($field eq 'aaa_contactinfo') {
    $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');
    &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecial');
       }
        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).'\\\\');
Line 86  sub print_content_template{ Line 94  sub print_content_template{
               }                }
           }            }
        }         }
  &end_ContentBox($r);  
 }  }
   
 sub start_ContentBox{  sub start_ContentBox{
  my ($r,$allowed) = @_;   my ($r,$allowed) = @_;
  if($allowed){   $r->print('<div class="LC_ContentBox">');
  $r->print('<div class="ContentBoxTemplate">');  
  }else{  
  $r->print('<div class="ContentBox">');  
  }  
 }  }
   
 sub end_ContentBox{  sub end_ContentBox{
Line 105  sub end_ContentBox{ Line 110  sub end_ContentBox{
   
 sub send_message{  sub send_message{
  my ($r,$cnum,$cdom) = @_;   my ($r,$cnum,$cdom) = @_;
  my $image = qq{<img name="Send message" src="/res/adm/pages/com.png" border="none" />};   my $s;
  $r->print('<div>');   my $image = qq{<img name="Send message" src="/res/adm/pages/com.png" border="none" align="middle" />};
  $r->print(&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&mt('Send me a message'));   $s=&Apache::loncommon::messagewrapper($image,$cnum,$cdom).' '.&Apache::loncommon::messagewrapper(&mt('Send me a message'),$cnum,$cdom);
  $r->print('</div>');   return $s;
 }  }
   
 sub print_template  sub print_template
 {  {
  my ($r,$topic,$content, $allowed) = @_;   my ($r,$topic,$content, $allowed,$boxclass) = @_;
  if($allowed){   $r->print('<div class="'.$boxclass.'">');
  $r->print('<div class="ContentBoxSpecialTemplate">');   $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
  }else{   $r->print('<div class="LC_BoxPadding">' .$content . '</div>');
  $r->print('<div class="ContentBoxSpecial">');   $r->print('</div>');
  }  }
  $r->print('<h4 class="hcell">'.$topic.'</h4>');  sub print_start_template
  $r->print('<blockquote>'.$content.'</blockquote>');  {
    my ($r,$topic,$boxclass) = @_;
    $r->print('<div class="'.$boxclass.'">');
    $r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
    $r->print('<div class="LC_BoxPadding">' );
   }
   sub print_end_template
   {
    my ($r) = @_;
    $r->print('</div>');
  $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><input type="submit" name="storesyl" value="'.             '</textarea><br /><input type="submit" name="storesyl" value="'.
                            &mt('Save All').'" />');                             &mt('Save All').'" />');
 }  }
   
   # Functionslist: List of functions
   # Typically used to display a list of available functions at top of page
   sub start_functionslist {
       my($legendtext)=@_;
       $legendtext=&mt('Functions') if !$legendtext;
       return '<fieldset><legend>'.$legendtext.'</legend>'
             .'<ul class="LC_functionslist">';
   }
   
   sub item_functionslist {
       my($content) = @_;
       return '<li>'.$content.'</li>';
   }
   
   sub end_functionslist {
       my($r)=@_;
       return '</ul></fieldset>';
   }
   
 1;  1;

Removed from v.1.12  
changed lines
  Added in v.1.31


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