--- loncom/interface/lonsimplepage.pm 2009/12/07 19:47:56 1.87 +++ loncom/interface/lonsimplepage.pm 2009/12/08 12:20:49 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.87 2009/12/07 19:47:56 amueller Exp $ +# $Id: lonsimplepage.pm,v 1.88 2009/12/08 12:20:49 amueller Exp $ # # Copyright Michigan State University Board of Trustees # @@ -299,6 +299,31 @@ sub handler { if ((($syllabus{'uploaded.lastmodified'}) && (($group ne '' && ($group_home_view || $group_edit_perm || $group_view_perm)) || ($group eq ''))) || ($allowed)) { + #Print the title + my $titletext=$syllabus{'aaa_title'}; + if ($target ne 'tex') { + if ($allowed) { + $r->print('

'); + } + $r->print('

'.$titletext.'

'); + } else { + my $safeinit; + $r->print(&Apache::lonxml::xmlparse($r,'tex','

'.$titletext.'

')); + } + if ($allowed) { + if ($env{'form.grade_target'} ne 'tex') { + #editbox for title + $r->print('
'); + &Apache::lontemplate::print_template($r, &mt('Title'), $titletext, $allowed, 'LC_Box'); + &Apache::lontemplate::print_editbox_template($r,$syllabus{'aaa_title'},'aaa_title'); + $r->print('

'); + } else { + my $safeinit; + $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{'aaa_title'},$safeinit)); + } + } + + #print the image my $image; if ($syllabus{'uploaded.photourl'}) { &Apache::lonnet::allowuploaded('/adm/smppg', @@ -313,12 +338,10 @@ sub handler { if ($allowed) { $r->print( - ''. ''. '

'.&mt('Upload a Photo').'

'. ''. ''. - '
'. ''); # if ($syllabus{'uploaded.photourl'}) { # $r->print('print($image.''); } + if (!$allowed) {$r->print($image); } foreach my $field (sort(keys(%syllabusfields))) { if (($syllabus{$field}) || ($allowed) || @@ -350,26 +374,7 @@ sub handler { %groupinfo); $r->print('
'); } elsif ($field eq 'aaa_title') { - if ($target ne 'tex') { - if ($allowed) { - $r->print('

'); - } - $r->print('

'.$message.'

'); - } else { - my $safeinit; - $r->print(&Apache::lonxml::xmlparse($r,'tex','

'.$message.'

')); - } - if ($allowed) { - if ($env{'form.grade_target'} ne 'tex') { - &Apache::lontemplate::print_template($r, &mt('Title'), $message, $allowed, 'LC_Box'); - &Apache::lontemplate::print_editbox_template($r,$syllabus{$field},$field); - $r->print('

'); - } else { - my $safeinit; - $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit)); - } - } - if (!$allowed) {$r->print($image); } + next; } else { if ($target ne 'tex') { if ($allowed) {