Parent Directory
|
Revision Log
Modified links subroutine so that it returns a string rather than an array.
1 package WeBWorK::ContentGenerator::Instructor; 2 use base qw(WeBWorK::ContentGenerator); 3 4 =head1 NAME 5 6 WeBWorK::ContentGenerator::Instructor - Abstract superclass for the Instructor pages 7 8 =cut 9 10 use strict; 11 use warnings; 12 use CGI qw(); 13 14 sub links { 15 my $self = shift; 16 17 # keep the links from the parent 18 my $pathString = ""; 19 20 21 my $ce = $self->{ce}; 22 my $db = $self->{db}; 23 my $userName = $self->{r}->param("user"); 24 my $courseName = $ce->{courseName}; 25 my $root = $ce->{webworkURLs}->{root}; 26 my $permLevel = $db->getPermissionLevel($userName)->permission(); 27 my $key = $db->getKey($userName)->key(); 28 return "" unless defined $key; 29 30 # new URLS 31 my $classList = "$root/$courseName/instructor/userList/?". $self->url_authen_args(); 32 my $problemSetList = "$root/$courseName/instructor/problemSetList/?". $self->url_authen_args(); 33 34 $pathString .="<hr>"; 35 $pathString .= ($permLevel > 0 36 ? CGI::a({-href=>$classList}, "Class List editor") . CGI::br() 37 : ""); 38 $pathString .= ($permLevel > 0 39 ? CGI::a({-href=>$problemSetList}, "Problem Set editor") . CGI::br() 40 : ""); 41 return $self->SUPER::links(), $pathString; 42 } 43 44 1;
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |