';
foreach my $item (@{$links}) {
- my $color = $designs->{'links'}{$item} ? $designs->{'links'}{$item} : $defaults->{'links'}{$item};
+ my $color = $designs->{'link'}{$item} ? $designs->{'link'}{$item} : $defaults->{'links'}{$item};
$datatable .= '
'.$choices->{$item}."\n";
if ($designs->{'links'}{$item}) {
$datatable.=' ';
@@ -2137,6 +2033,7 @@ sub print_requestmail {
$datatable .= &mt('There are no active Domain Coordinators');
}
$datatable .='
';
+ $$rowtotal += $rows;
return $datatable;
}
@@ -2145,11 +2042,9 @@ sub print_studentcode {
my $rownum = 0;
my ($output,%current);
my @crstypes = ('official','unofficial','community','textbook');
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'uniquecode'}) eq 'HASH') {
- foreach my $type (@crstypes) {
- $current{$type} = $settings->{'uniquecode'}{$type};
- }
+ if (ref($settings->{'uniquecode'}) eq 'HASH') {
+ foreach my $type (@crstypes) {
+ $current{$type} = $settings->{'uniquecode'}{$type};
}
}
$output .= '
'.
@@ -2170,14 +2065,14 @@ sub print_studentcode {
}
sub print_textbookcourses {
- my ($dom,$type,$settings,$rowtotal) = @_;
+ my ($dom,$settings,$rowtotal) = @_;
my $rownum = 0;
my $css_class;
my $itemcount = 1;
my $maxnum = 0;
my $bookshash;
if (ref($settings) eq 'HASH') {
- $bookshash = $settings->{$type};
+ $bookshash = $settings->{'textbooks'};
}
my %ordered;
if (ref($bookshash) eq 'HASH') {
@@ -2191,7 +2086,7 @@ sub print_textbookcourses {
my $confname = $dom.'-domainconfig';
my $switchserver = &check_switchserver($dom,$confname);
my $maxnum = scalar(keys(%ordered));
- my $datatable;
+ my $datatable = &textbookcourses_javascript(\%ordered);
if (keys(%ordered)) {
my @items = sort { $a <=> $b } keys(%ordered);
for (my $i=0; $i<@items; $i++) {
@@ -2199,24 +2094,21 @@ sub print_textbookcourses {
my $key = $ordered{$items[$i]};
my %coursehash=&Apache::lonnet::coursedescription($key);
my $coursetitle = $coursehash{'description'};
- my ($subject,$title,$author,$publisher,$image,$imgsrc,$cdom,$cnum);
+ my ($subject,$title,$author,$image,$imgsrc,$cdom,$cnum);
if (ref($bookshash->{$key}) eq 'HASH') {
$subject = $bookshash->{$key}->{'subject'};
$title = $bookshash->{$key}->{'title'};
- if ($type eq 'textbooks') {
- $publisher = $bookshash->{$key}->{'publisher'};
- $author = $bookshash->{$key}->{'author'};
- $image = $bookshash->{$key}->{'image'};
- if ($image ne '') {
- my ($path,$imagefile) = ($image =~ m{^(.+)/([^/]+)$});
- my $imagethumb = "$path/tn-".$imagefile;
- $imgsrc = '';
- }
+ $author = $bookshash->{$key}->{'author'};
+ $image = $bookshash->{$key}->{'image'};
+ if ($image ne '') {
+ my ($path,$imagefile) = ($image =~ m{^(.+)/([^/]+)$});
+ my $imagethumb = "$path/tn-".$imagefile;
+ $imgsrc = '';
}
}
- my $chgstr = ' onchange="javascript:reorderBooks(this.form,'."'$type".'_'."$key','$type'".');"';
+ my $chgstr = ' onchange="javascript:reorderBooks(this.form,'."'$key'".');"';
$datatable .= '
'."\n";
$itemcount ++;
@@ -2303,42 +2187,23 @@ sub print_textbookcourses {
}
sub textbookcourses_javascript {
- my ($settings) = @_;
- return unless(ref($settings) eq 'HASH');
- my (%ordered,%total,%jstext);
- foreach my $type ('textbooks','templates') {
- $total{$type} = 0;
- if (ref($settings->{$type}) eq 'HASH') {
- foreach my $item (keys(%{$settings->{$type}})) {
- if (ref($settings->{$type}->{$item}) eq 'HASH') {
- my $num = $settings->{$type}->{$item}{'order'};
- $ordered{$type}{$num} = $item;
- }
- }
- $total{$type} = scalar(keys(%{$settings->{$type}}));
- }
- my @jsarray = ();
- foreach my $item (sort {$a <=> $b } (keys(%{$ordered{$type}}))) {
- push(@jsarray,$ordered{$type}{$item});
- }
- $jstext{$type} = ' var '.$type.' = Array('."'".join("','",@jsarray)."'".');'."\n";
+ my ($textbooks) = @_;
+ return unless(ref($textbooks) eq 'HASH');
+ my $num = scalar(keys(%{$textbooks}));
+ my @jsarray;
+ foreach my $item (sort {$a <=> $b } (keys(%{$textbooks}))) {
+ push(@jsarray,$textbooks->{$item});
}
+ my $jstext = ' var textbooks = Array('."'".join("','",@jsarray)."'".');'."\n";
return <<"ENDSCRIPT";
-
-ENDSCRIPT
- }
+ 'uniquecodes','diskusage');
}
sub coursecategories_javascript {
@@ -5464,9 +4843,9 @@ sub coursecategories_javascript {
$jstext = ' var categories = Array(1);'."\n".
' categories[0] = Array("instcode_pos");'."\n";
}
- my $instcode_reserved = &mt('The name: [_1] is a reserved category.','"instcode"');
- my $communities_reserved = &mt('The name: [_1] is a reserved category.','"communities"');
- my $choose_again = '\\n'.&mt('Please use a different name for the new top level category.');
+ my $instcode_reserved = &mt('The name: "instcode" is a reserved category');
+ my $communities_reserved = &mt('The name: "communities" is a reserved category');
+ my $choose_again = '\\n'.&mt('Please use a different name for the new top level category');
$output = <<"ENDSCRIPT";