- $title:
+ $title
|
ENDONE
@@ -1418,7 +1529,7 @@ ENDTWO
}
sub role_select_row {
- my ($roles,$title,$css_class) = @_;
+ my ($roles,$title,$css_class,$show_separate_custom,$cdom,$cnum) = @_;
my $output;
if (defined($title)) {
$output = &row_title($title,$css_class);
@@ -1429,10 +1540,25 @@ sub role_select_row {
my $plrole;
if ($role eq 'ow') {
$plrole = &mt('Course Owner');
+ } elsif ($role eq 'cr') {
+ if ($show_separate_custom) {
+ if ($cdom ne '' && $cnum ne '') {
+ my %course_customroles = &course_custom_roles($cdom,$cnum);
+ foreach my $crrole (sort(keys(%course_customroles))) {
+ my ($plcrrole) = ($crrole =~ m|^cr/[^/]+/[^/]+/(.+)$|);
+ $output .= ' ';
+ }
+ }
+ } else {
+ $plrole = &mt('Custom Role');
+ }
} else {
$plrole=&Apache::lonnet::plaintext($role);
}
- $output .= ' ';
+ if (($role ne 'cr') || (!$show_separate_custom)) {
+ $output .= ' ';
+ }
}
$output .= qq| \n|;
if (defined($title)) {
@@ -1445,7 +1571,14 @@ sub course_select_row {
my ($title,$formname,$totcodes,$codetitles,$idlist,$idlist_titles,
$css_class) = @_;
my $output = &row_title($title,$css_class);
- $output .= qq|
+ $output .= &course_selection($formname,$totcodes,$codetitles,$idlist,$idlist_titles);
+ $output .= &row_closure();
+ return $output;
+}
+
+sub course_selection {
+ my ($formname,$totcodes,$codetitles,$idlist,$idlist_titles) = @_;
+ my $output = qq|
|