--- loncom/interface/courseprefs.pm 2013/09/01 02:09:23 1.49.2.10
+++ loncom/interface/courseprefs.pm 2014/05/16 19:19:01 1.49.2.13
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.49.2.10 2013/09/01 02:09:23 raeburn Exp $
+# $Id: courseprefs.pm,v 1.49.2.13 2014/05/16 19:19:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -272,6 +272,7 @@ sub handler {
edit => 'Edit Community Settings',
gens => 'General community settings',
idnu => 'Community ID or number',
+ unco => 'Unique code',
desc => 'Community Description',
ownr => 'Community Owner',
cown => 'Community Co-owners',
@@ -299,6 +300,7 @@ sub handler {
edit => 'Edit Course Settings',
gens => 'General course settings',
idnu => 'Course ID or number',
+ unco => 'Unique code',
desc => 'Course Description',
cred => 'Student credits',
ownr => 'Course Owner',
@@ -357,13 +359,15 @@ sub handler {
{ text => $lt{'gens'},
help => 'Course_Prefs_General',
ordered => ['owner','co-owners','loncaparev','description',
- 'courseid','categories','hidefromcat',
- 'externalsyllabus','cloners','url','rolenames'],
+ 'clonedfrom','courseid','uniquecode','categories',
+ 'hidefromcat','externalsyllabus','cloners','url',
+ 'rolenames'],
itemtext => {
'owner' => $lt{'ownr'},
'co-owners' => $lt{'cown'},
'description' => $lt{'desc'},
'courseid' => $lt{'idnu'},
+ 'uniquecode' => $lt{'unco'},
'categories' => $lt{'catg'},
'hidefromcat' => $lt{'excc'},
'cloners' => $lt{'clon'},
@@ -371,6 +375,7 @@ sub handler {
'url' => 'Top Level Map',
'rolenames' => $lt{'rept'},
'loncaparev' => $lt{'lcrv'},
+ 'clonedfrom' => 'Cloned from',
},
},
'localization' =>
@@ -705,7 +710,8 @@ sub process_changes {
next if (($entry eq 'categories') &&
(!$can_categorize));
next if (($entry eq 'loncaparev') ||
- ($entry eq 'owner'));
+ ($entry eq 'owner') ||
+ ($entry eq 'clonedfrom'));
push(@ordered,$entry);
}
} elsif ($action eq 'classlists') {
@@ -1852,12 +1858,18 @@ sub print_courseinfo {
'co-owners' => {
text => ''.&mt($itemtext->{'co-owners'}).'',
},
+ 'clonedfrom' => {
+ text => ''.&mt($itemtext->{'clonedfrom'}).'',
+ },
'courseid' => {
text => ''.&mt($itemtext->{'courseid'}).'
'.'('.
&mt('internal, optional').')',
input => 'textbox',
size => '25',
},
+ 'uniquecode' => {
+ text => ''.&mt($itemtext->{'uniquecode'}).'',
+ },
'cloners' => {
text => ''.&mt($itemtext->{'cloners'}).'
'.
&mt('Owner and Coordinators included automatically'),
@@ -1903,6 +1915,8 @@ sub print_courseinfo {
next if (!$can_toggle_cat);
} elsif ($item eq 'categories') {
next if (!$can_categorize);
+ } elsif ($item eq 'uniquecode') {
+ next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'});
}
unless (($item eq 'cloners') || ($item eq 'rolenames')) {
$colspan = 2;
@@ -2038,6 +2052,21 @@ sub print_courseinfo {
$owner = &mt('None specified');
}
$datatable .= $owner;
+ } elsif ($item eq 'clonedfrom') {
+ my $clonesrc = $env{'course.'.$env{'request.course.id'}.'.clonedfrom'};
+ my $clonedfrom = &mt('None');
+ if ($clonesrc =~ m{/$match_domain/$match_courseid}) {
+ my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc);
+ if ($clonesrcinfo{'description'}) {
+ $clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc);
+ }
+ }
+ $datatable .= $clonedfrom;
+ } elsif ($item eq 'uniquecode') {
+ my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'};
+ if ($code) {
+ $datatable .= $code;
+ }
} elsif ($item eq 'co-owners') {
my $coowners = $env{'course.'.$env{'request.course.id'}.'.internal.co-owners'};
my @currcoown;
@@ -3510,11 +3539,12 @@ sub print_appearance {
text => ''.&mt($itemtext->{'texengine'}).'',
input => 'selectbox',
options => {
+ MathJax => 'MathJax',
jsMath => 'jsMath',
mimetex => &mt('Convert to Images'),
tth => &mt('TeX to HTML'),
},
- order => ['jsMath','mimetex','tth'],
+ order => ['MathJax','jsMath','mimetex','tth'],
nullval => $mathdef,
},
'tthoptions' => {
@@ -3752,7 +3782,9 @@ sub get_other_items {
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/)
|| ($parameter eq 'type') ||
($parameter =~ m/^(cc|co|in|ta|ep|ad|st)\.plaintext$/)
- || ($parameter =~ m/^discussion_post_fonts/)) {
+ || ($parameter =~ m/^discussion_post_fonts/) ||
+ ($parameter =~ m{^(minimal|updated|uploaded|external)syllabus$}) ||
+ ($parameter eq 'clonedfrom')) {
push(@ordered,$parameter);
}
}