--- loncom/interface/lonsimplepage.pm 2006/08/16 19:40:46 1.47 +++ loncom/interface/lonsimplepage.pm 2006/10/23 18:48:47 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.47 2006/08/16 19:40:46 albertel Exp $ +# $Id: lonsimplepage.pm,v 1.48 2006/10/23 18:48:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -221,14 +221,14 @@ sub handler { &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs); } if (($allowed) && ($env{'form.storesyl'})) { - foreach (keys %syllabusfields) { - my $field=$env{'form.'.$_}; + foreach my $syl_field (keys(%syllabusfields)) { + my $field=$env{'form.'.$syl_field}; chomp($field); $field=~s/\s+$//s; $field=~s/^\s+//s; $field=~s/\$//s; $field=&Apache::lonfeedback::clear_out_html($field,1); - $syllabus{$_}=$field; + $syllabus{$syl_field}=$field; } $syllabus{'uploaded.lastmodified'}=time; &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs); @@ -258,10 +258,10 @@ sub handler { ''. '
'); } - foreach (sort keys %syllabusfields) { - if (($syllabus{$_}) || ($allowed) || - ($_ eq 'abb_links' && $group ne '')) { - my $message=$syllabus{$_}; + foreach my $field (sort(keys(%syllabusfields))) { + if (($syllabus{$field}) || ($allowed) || + ($field eq 'abb_links' && $group ne '')) { + my $message=$syllabus{$field}; &Apache::lonfeedback::newline_to_br(\$message); $message =~s/(https*\:\/\/[^\s]+)/\\$1\<\/tt\>\<\/a\>/g; @@ -269,13 +269,13 @@ sub handler { $message=&Apache::lonspeller::markeduptext($message); } $message=&Apache::lontexconvert::msgtexconverted($message); - if ($_ eq 'abb_links' && $group ne '') { - $r->print('
'); + if ($field eq 'abb_links' && $group ne '') { + $r->print('
'); &display_group_links($r,$target,$group,'edit',$refarg, %groupinfo); $r->print('
'); - } elsif ($_ eq 'aaa_title') { + } elsif ($field eq 'aaa_title') { if ($target ne 'tex') { $r->print('

'.$message.'

'); } else { @@ -285,21 +285,21 @@ sub handler { if ($allowed) { if ($env{'form.grade_target'} ne 'tex') { $r->print( - '
Title
'); } else { my $safeinit; - $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit)); + $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit)); } } } else { - if (($_ ne 'bbb_content') || ($allowed)) { + if (($field ne 'bbb_content') || ($allowed)) { if ($target ne 'tex') { - $r->print('

'.$syllabusfields{$_}.'

'); + $r->print('

'.$syllabusfields{$field}.'

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

'.$syllabusfields{$_}.'

')); + $r->print(&Apache::lonxml::xmlparse($r,'tex','

'.$syllabusfields{$field}.'

')); } } if ($target ne 'tex') { @@ -311,12 +311,12 @@ sub handler { } if ($allowed) { if ($target ne 'tex') { - $r->print('
'); } else { my $safeinit; - $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit)); + $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$field},$safeinit)); } } }