--- loncom/interface/lonsimplepage.pm 2009/05/20 02:37:30 1.59.2.1 +++ loncom/interface/lonsimplepage.pm 2009/05/07 16:20:37 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.59.2.1 2009/05/20 02:37:30 raeburn Exp $ +# $Id: lonsimplepage.pm,v 1.79 2009/05/07 16:20:37 amueller Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,6 +31,7 @@ package Apache::lonsimplepage; use strict; use Apache::Constants qw(:common); use Apache::loncommon; +use Apache::lontemplate; use Apache::lonnet; use Apache::lontexconvert; use Apache::lonfeedback; @@ -70,7 +71,7 @@ sub handler { # ------------------------------------------------------------ Print the screen if ($target eq 'tex') { $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); - } + } # Is this even in a course? unless ($env{'request.course.id'}) { @@ -98,7 +99,7 @@ sub handler { &Apache::loncommon::simple_error_page($r,'','Invalid group name'); return OK; } - %groupinfo = + %groupinfo = &Apache::longroup::get_group_settings($curr_groups{$group}); $group_desc = &unescape($groupinfo{'description'}); } @@ -132,17 +133,17 @@ sub handler { if ($env{'form.ref'}) { $refarg = '&ref='.$env{'form.ref'}; } - + my %syllabus=&Apache::lonnet::dump($db_name,$dom,$crs); - + # --------------------------------------- There is such a user, get environment if ($target ne 'tex') { my $title = 'Simple Course Page'; if ($group ne '') { - $title = 'Group Page'; + $title = 'Simple Group Page'; } - my $start_page = + my $start_page = &Apache::loncommon::start_page($title,undef, {'function' => $forcestudent, 'domain' => $dom, @@ -162,12 +163,12 @@ sub handler { $env{'request.course.id'}.'/'.$group); $group_home_edit = &Apache::lonnet::allowed('mgh', $env{'request.course.id'}.'/'.$group); - if ($group_view_perm || $group_edit_perm || $group_home_view || + if ($group_view_perm || $group_edit_perm || $group_home_view || $group_home_edit || &Apache::longroup::check_group_access($group)) { if (($env{'form.ref'} eq 'grouplist') && ($target ne 'tex')) { $r->print(&grouppage_breadcrumbs($dom,$crs,$group,$group_desc)); } - if ((!$group_home_edit) && (!$group_home_view) && + if ((!$group_home_edit) && (!$group_home_view) && (!$group_view_perm) && (!$group_edit_perm)) { &display_group_links($r,$target,$group,'view',$refarg,%groupinfo); if ($env{'form.grade_target'} ne 'tex') { @@ -178,7 +179,7 @@ sub handler { return OK; } } else { - my $msg = + my $msg = &mt('You do not currently have rights to view this group.'); if ($target ne 'tex') { $r->print("
$msg
". @@ -188,7 +189,7 @@ sub handler { } return OK; } - my ($blocked,$blocktext) = + my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('groups'); if ($blocked) { $r->print($blocktext); @@ -198,13 +199,13 @@ sub handler { } my $allowed; - + if ($group ne '') { $allowed = $group_edit_perm; if (!$allowed) { - $allowed = $group_home_edit; + $allowed = $group_home_edit; } - } else { + } else { $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); } my $privileged=$allowed; @@ -214,27 +215,6 @@ sub handler { if ($forcestudent or $target eq 'tex') { $allowed=0; } - if ($allowed) { - $r->print(''.
- &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes'))
- .'
'
- .''.&mt('Show Student View').''.
- &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'