version 1.29, 2005/11/16 12:47:59
|
version 1.35, 2006/03/23 22:32:11
|
Line 45 sub handler {
|
Line 45 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
my $target=$env{'form.grade_target'}; |
my $target=$env{'form.grade_target'}; |
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
if ($target ne 'tex') { |
if ($target eq 'tex') { |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDDOCUMENT); |
|
$html |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
ENDDOCUMENT |
|
} else { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
} |
} |
my (undef,undef,undef,undef,$marker,$caller)=split(/\//,$r->uri); |
my (undef,undef,undef,undef,$marker,$caller)=split(/\//,$r->uri); |
# Is this even in a course? |
# Is this even in a course? |
unless ($env{'request.course.id'}) { |
unless ($env{'request.course.id'}) { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('</head><body>Not in a course</body></html>'); |
return &Apache::loncommon::simple_error_page($r,'', |
return OK; |
'Not in a course'); |
} else { |
} else { |
$r->print('\textbf{Not in a course}\end{document}'); |
$r->print('\textbf{Not in a course}\end{document}'); |
} |
} |
Line 77 ENDDOCUMENT
|
Line 70 ENDDOCUMENT
|
if ($caller eq 'grppg') { |
if ($caller eq 'grppg') { |
$marker =~ s/\W//g; |
$marker =~ s/\W//g; |
$namespace = 'grppage_'.$marker; |
$namespace = 'grppage_'.$marker; |
unless(&Apache::lonnet::get_coursegroups($dom,$crs,\%curr_group, |
my %curr_groups; |
$marker)) { |
if (!&Apache::loncommon::coursegroups(\%curr_groups,$dom,$crs,$marker)) { |
$r->print('<body>Invalid group name</body>'); |
return &Apache::loncommon::simple_error_page($r,'', |
return OK; |
'Invalid group name'); |
} |
} |
%groupinfo = &Apache::loncommon::get_group_settings($curr_group{$marker}); |
%groupinfo = |
|
&Apache::loncommon::get_group_settings($curr_groups{$marker}); |
} else { |
} else { |
$marker=~s/\D//g; |
$marker=~s/\D//g; |
$namespace = 'smppage_'.$marker; |
$namespace = 'smppage_'.$marker; |
} |
} |
|
|
unless ($marker) { |
if (!$marker) { |
$r->print('<body>Invalid call</body>'); |
return &Apache::loncommon::simple_error_page($r,'','Invalid call'); |
return OK; |
|
} |
} |
|
|
# --------------------------------------------------------- The syllabus fields |
# --------------------------------------------------------- The syllabus fields |
Line 111 ENDDOCUMENT
|
Line 104 ENDDOCUMENT
|
if ($env{'form.register'}) { |
if ($env{'form.register'}) { |
$addentries=' onLoad="'.&Apache::lonmenu::loadevents(). |
$addentries=' onLoad="'.&Apache::lonmenu::loadevents(). |
'" onUnload="'.&Apache::lonmenu::unloadevents().'"'; |
'" onUnload="'.&Apache::lonmenu::unloadevents().'"'; |
$r->print(&Apache::lonmenu::registerurl(1)); |
|
} |
} |
# --------------------------------------------------------------- Force Student |
# --------------------------------------------------------------- Force Student |
my $forcestudent=''; |
my $forcestudent=''; |
Line 129 ENDDOCUMENT
|
Line 121 ENDDOCUMENT
|
if ($caller eq 'grppg') { |
if ($caller eq 'grppg') { |
$title = 'Group Page'; |
$title = 'Group Page'; |
} |
} |
$r->print(&Apache::lonhtmlcommon::htmlareaheaders(). |
my $start_page = |
'</head>'.&Apache::loncommon::bodytag |
&Apache::loncommon::start_page($title,undef, |
($title,$forcestudent,$addentries,'',$dom,$env{'form.register'})); |
{'function' => $forcestudent, |
|
'add_entries' => $addentries, |
|
'domain' => $dom, |
|
'force_register' => |
|
$env{'form.register'},}); |
|
$r->print($start_page); |
} |
} |
|
|
if ($caller eq 'grppg') { |
if ($caller eq 'grppg') { |
Line 139 ENDDOCUMENT
|
Line 136 ENDDOCUMENT
|
(&Apache::loncommon::check_group_access($caller))) { |
(&Apache::loncommon::check_group_access($caller))) { |
unless(&Apache::lonnet::allowed('vgh', |
unless(&Apache::lonnet::allowed('vgh', |
$env{'request.course.id'}.'/'.$marker)) { |
$env{'request.course.id'}.'/'.$marker)) { |
&display_group_links($r,$target,$marker,%groupinfo,'view'); |
&display_group_links($r,$target,$marker,'view',%groupinfo); |
return OK; |
return OK; |
} |
} |
} else { |
} else { |
|
my $msg = |
|
&mt('You do not currently have rights to view this group.'); |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('</head><body>You do not currently have rights to |
$r->print("<p>$msg</p>". |
view this group. |
&Apache::loncommon::end_page()); |
</body></html>'); |
|
return OK; |
|
} else { |
} else { |
$r->print('\textbf{You do not currently have rights to view this group}\end{document}'); |
$r->print('\textbf{'.$msg.'}\end{document}'); |
} |
} |
|
return OK; |
} |
} |
} |
} |
|
|
Line 193 ENDDOCUMENT
|
Line 191 ENDDOCUMENT
|
} |
} |
} |
} |
$syllabus{'uploaded.lastmodified'}=time; |
$syllabus{'uploaded.lastmodified'}=time; |
&Apache::lonnet::put($caller.'_'.$marker,\%syllabus,$dom,$crs); |
&Apache::lonnet::put($namespace,\%syllabus,$dom,$crs); |
} |
} |
if (($allowed) && ($env{'form.storesyl'})) { |
if (($allowed) && ($env{'form.storesyl'})) { |
foreach (keys %syllabusfields) { |
foreach (keys %syllabusfields) { |
Line 206 ENDDOCUMENT
|
Line 204 ENDDOCUMENT
|
$syllabus{$_}=$field; |
$syllabus{$_}=$field; |
} |
} |
$syllabus{'uploaded.lastmodified'}=time; |
$syllabus{'uploaded.lastmodified'}=time; |
&Apache::lonnet::put($caller.'_'.$marker,\%syllabus,$dom,$crs); |
&Apache::lonnet::put($namespace,\%syllabus,$dom,$crs); |
} |
} |
|
|
# ---------------------------------------------------------------- Get syllabus |
# ---------------------------------------------------------------- Get syllabus |
Line 244 ENDDOCUMENT
|
Line 242 ENDDOCUMENT
|
if ($_ eq 'abb_links' && $caller eq 'grppg') { |
if ($_ eq 'abb_links' && $caller eq 'grppg') { |
$r->print('<br /><input type="hidden" name="'.$_. |
$r->print('<br /><input type="hidden" name="'.$_. |
'" value="'.$syllabus{$_}.'" />'); |
'" value="'.$syllabus{$_}.'" />'); |
&display_group_links($r,$target,$marker,%groupinfo,'edit'); |
&display_group_links($r,$target,$marker,'edit',%groupinfo); |
$r->print('<br />'); |
$r->print('<br />'); |
} elsif ($_ eq 'aaa_title') { |
} elsif ($_ eq 'aaa_title') { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
Line 302 ENDDOCUMENT
|
Line 300 ENDDOCUMENT
|
$r->print('<p>No page information provided.</p>'); |
$r->print('<p>No page information provided.</p>'); |
} |
} |
if ($env{'form.grade_target'} ne 'tex') { |
if ($env{'form.grade_target'} ne 'tex') { |
$r->print('</body></html>'); |
$r->print(&Apache::loncommon::end_page()); |
} else { |
} else { |
$r->print('\end{document}'); |
$r->print('\end{document}'); |
} |
} |
Line 310 ENDDOCUMENT
|
Line 308 ENDDOCUMENT
|
} |
} |
|
|
sub display_group_links { |
sub display_group_links { |
my ($r,$target,$marker,%groupinfo,$context) = @_; |
my ($r,$target,$marker,$context,%groupinfo) = @_; |
my @available = (); |
my @available = (); |
|
|
my %menu = (); |
my %menu = (); |
%{$menu{'email'}} = ( |
%{$menu{'email'}} = ( |
text => 'Group e-mail', |
text => 'Group e-mail', |
Line 360 sub display_group_links {
|
Line 357 sub display_group_links {
|
if ($context eq 'edit') { |
if ($context eq 'edit') { |
$output = 'No group functionality'; |
$output = 'No group functionality'; |
} else { |
} else { |
$output = 'No group functionality (e.g., e-mail, discussion,chat or file upload) is currently available to you in this group: '.$marker; |
$output = 'No group functionality (e.g., e-mail, discussion, chat or file upload) is currently available to you in this group: '.$marker; |
} |
} |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$r->print(&Apache::lonxml::xmlparse($r,'tex',$output)); |
$r->print(&Apache::lonxml::xmlparse($r,'tex',$output)); |