--- loncom/interface/lonsimplepage.pm 2009/12/08 12:20:49 1.88 +++ loncom/interface/lonsimplepage.pm 2010/02/23 14:18:12 1.94 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.88 2009/12/08 12:20:49 amueller Exp $ +# $Id: lonsimplepage.pm,v 1.94 2010/02/23 14:18:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,6 +39,7 @@ use Apache::lonlocal; use Apache::lonprintout; use Apache::lonxml; use Apache::longroup; +use Apache::lonnavmaps(); use HTML::Entities(); use LONCAPA; @@ -257,19 +258,28 @@ sub handler { if ($target ne 'tex') { if ($allowed || $privileged) { my $functions=&Apache::lonhtmlcommon::start_funclist(); + my $url = $r->uri; + if ($group ne '') { + my $navmap=Apache::lonnavmaps::navmap->new(); + if (ref($navmap)) { + $url = &Apache::longroup::get_group_link($dom,$crs,$group,$navmap); + } + } if ($allowed) { + $url .= (($url=~/\?/)?'&':'?').'forcestudent=1'; $functions.=&Apache::lonhtmlcommon::add_item_funclist( - '' + '' .&mt('Show Student View').'' .&Apache::loncommon::help_open_topic( 'Uploaded_Templates_PublicView')); } elsif ($privileged) { my $edittext = &mt('Edit'); - if ($group ne '') { + $url .= (($url=~/\?/)?'&':'?').'forceedit=edit'.$refarg; + if ($group ne '') { $edittext = &mt('Edit Group Homepage'); } $functions.=&Apache::lonhtmlcommon::add_item_funclist( - '' + '' .$edittext.''); if ($group ne '') { if ($group_edit_perm) { @@ -300,10 +310,9 @@ sub handler { (($group ne '' && ($group_home_view || $group_edit_perm || $group_view_perm)) || ($group eq ''))) || ($allowed)) { #Print the title - my $titletext=$syllabus{'aaa_title'}; + my $titletext=&HTML::Entities::encode($syllabus{'aaa_title'},'<>&"'); if ($target ne 'tex') { if ($allowed) { - $r->print('
'); } $r->print('