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

version 1.12, 2008/12/17 13:00:36 version 1.17, 2009/02/19 17:32:39
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);   #&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 72  sub print_content_template{ Line 72  sub print_content_template{
               if ($target ne 'tex') {                if ($target ne 'tex') {
      if($allowed){       if($allowed){
  $r->print('<p>');   $r->print('<p>');
      }       }   
      &print_template($r,$syllabusfields{$field},$message,$allowed);  
       if($field eq 'aaa_contactinfo') {
    if($allowed){
    $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');
    }
    &print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecialContactInfo');
    $r->print('<div class="LC_Clear_AboutMe_Image" >&nbsp;</div>');
       }
        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 97  sub print_content_template{
               }                }
           }            }
        }         }
  &end_ContentBox($r);   #&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 113  sub end_ContentBox{
   
 sub send_message{  sub send_message{
  my ($r,$cnum,$cdom) = @_;   my ($r,$cnum,$cdom) = @_;
    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/com.png" border="none" />};
  $r->print('<div>');   #$r->print('<div>');
  $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>');   #$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="ContentBoxSpecial">');  
  }  
  $r->print('<h4 class="hcell">'.$topic.'</h4>');  
  $r->print('<blockquote>'.$content.'</blockquote>');   $r->print('<blockquote>'.$content.'</blockquote>');
  $r->print('</div>');   $r->print('</div>');
 }  }
Line 129  sub print_editbox_template Line 135  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').'" />');
 }  }
   sub print_start_page_functions
   {
    my($r)=@_;
    #TODO add translation for Functions
    $r->print('<fieldset><legend>Functions</legend>');
   }
   sub print_functions_content
   {
    my($r,$content) = @_;
    $r->print($content.'&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp');
   }
   sub print_end_page_functions
   {
    my($r)=@_;
    $r->print('</fieldset>');
   }
 1;  1;

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


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