version 1.395, 2008/05/28 23:05:07
|
version 1.413.2.2, 2009/03/19 17:05:52
|
Line 325 sub date_sanity_info {
|
Line 325 sub date_sanity_info {
|
my $crsprefix='course.'.$env{'request.course.id'}.'.'; |
my $crsprefix='course.'.$env{'request.course.id'}.'.'; |
if ($env{$crsprefix.'default_enrollment_end_date'}) { |
if ($env{$crsprefix.'default_enrollment_end_date'}) { |
if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { |
if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { |
$result.='<br />'.&mt('After course enrollment end!'); |
$result.='<div class="LC_warning">' |
|
.&mt('After course enrollment end!') |
|
.'</div>'; |
} |
} |
} |
} |
if ($env{$crsprefix.'default_enrollment_start_date'}) { |
if ($env{$crsprefix.'default_enrollment_start_date'}) { |
if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { |
if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { |
$result.='<br />'.&mt('Before course enrollment start!'); |
$result.='<div class="LC_warning">' |
|
.&mt('Before course enrollment start!') |
|
.'</div>'; |
} |
} |
} |
} |
|
# Preparation for additional warnings about dates in the past/future. |
|
# An improved, more context sensitive version is recommended, |
|
# e.g. warn for due and answer dates which are defined before the corresponding open date, etc. |
|
# if ($checkdate<time) { |
|
# $result.='<div class="LC_info">' |
|
# .'('.&mt('in the past').')' |
|
# .'</div>'; |
|
# } |
|
# if ($checkdate>time) { |
|
# $result.='<div class="LC_info">' |
|
# .'('.&mt('in the future').')' |
|
# .'</div>'; |
|
# } |
return $result; |
return $result; |
} |
} |
################################################## |
################################################## |
Line 551 sub valout {
|
Line 568 sub valout {
|
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
|
my @timer; |
$year=$year-70; |
$year=$year-70; |
$mday--; |
$mday--; |
if ($year) { |
if ($year) { |
$result.=$year.' yrs '; |
# $result.=&mt('[quant,_1,yr]',$year).' '; |
|
push(@timer,&mt('[quant,_1,yr]',$year)); |
} |
} |
if ($mon) { |
if ($mon) { |
$result.=$mon.' mths '; |
# $result.=&mt('[quant,_1,mth]',$mon).' '; |
|
push(@timer,&mt('[quant,_1,mth]',$mon)); |
} |
} |
if ($mday) { |
if ($mday) { |
$result.=$mday.' days '; |
# $result.=&mt('[quant,_1,day]',$mday).' '; |
|
push(@timer,&mt('[quant,_1,day]',$mday)); |
} |
} |
if ($hour) { |
if ($hour) { |
$result.=$hour.' hrs '; |
# $result.=&mt('[quant,_1,hr]',$hour).' '; |
|
push(@timer,&mt('[quant,_1,hr]',$hour)); |
} |
} |
if ($min) { |
if ($min) { |
$result.=$min.' mins '; |
# $result.=&mt('[quant,_1,min]',$min).' '; |
|
push(@timer,&mt('[quant,_1,min]',$min)); |
} |
} |
if ($sec) { |
if ($sec) { |
$result.=$sec.' secs '; |
# $result.=&mt('[quant,_1,sec]',$sec).' '; |
|
push(@timer,&mt('[quant,_1,sec]',$sec)); |
} |
} |
$result=~s/\s+$//; |
# $result=~s/\s+$//; |
|
if (!@timer) { # Special case: all entries 0 -> display "0 secs" intead of empty field to keep this field editable |
|
push(@timer,&mt('[quant,_1,sec]',0)); |
|
} |
|
$result.=join(", ",@timer); |
} elsif (&isdateparm($type)) { |
} elsif (&isdateparm($type)) { |
$result = &Apache::lonlocal::locallocaltime($value). |
$result = &Apache::lonlocal::locallocaltime($value). |
&date_sanity_info($value); |
&date_sanity_info($value); |
Line 615 sub plink {
|
Line 643 sub plink {
|
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
unless (defined($winvalue)) { $winvalue=$val; } |
unless (defined($winvalue)) { $winvalue=$val; } |
my $valout = &valout($value,$type,1); |
my $valout = &valout($value,$type,1); |
|
my $unencmarker = $marker; |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
\$hour, \$min, \$sec) { |
\$hour, \$min, \$sec) { |
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item =~ s/\'/\\\'/g; |
$$item =~ s/\'/\\\'/g; |
} |
} |
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$marker.'" /></td></tr><tr><td align="center">'. |
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$unencmarker.'" /></td></tr><tr><td align="center">'. |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
$valout.'</a></td></tr></table>'; |
$valout.'</a></td></tr></table>'; |
Line 971 sub extractResourceInformation {
|
Line 1000 sub extractResourceInformation {
|
# |
# |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
my ($display,$parmdis); |
my $parmdis = $display; |
$display = &standard_parameter_names($name); |
$parmdis =~ s/\[Part.*$//g; |
if ($display eq '') { |
|
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
|
$parmdis = $display; |
|
$parmdis =~ s/\s*\[Part.*$//g; |
|
} else { |
|
$parmdis = $display; |
|
} |
$$allparms{$name}=$parmdis; |
$$allparms{$name}=$parmdis; |
if (ref($defkeytype)) { |
if (ref($defkeytype)) { |
$$defkeytype{$name}= |
$$defkeytype{$name}= |
Line 985 sub extractResourceInformation {
|
Line 1020 sub extractResourceInformation {
|
# allparts is a hash of all parts |
# allparts is a hash of all parts |
# |
# |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
$$allparts{$part} = "Part: $part"; |
$$allparts{$part} = &mt('Part: [_1]',$part); |
# |
# |
# Remember all keys going with this resource |
# Remember all keys going with this resource |
# |
# |
Line 1010 sub extractResourceInformation {
|
Line 1045 sub extractResourceInformation {
|
$$mapp{$mapid}=$$mapp{$id}; |
$$mapp{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
if ($mapid eq '1') { |
if ($mapid eq '1') { |
$$maptitles{$mapid}='Main Course Documents'; |
$$maptitles{$mapid}=&mt('Main Course Documents'); |
} else { |
} else { |
$$maptitles{$mapid}= |
$$maptitles{$mapid}= |
&Apache::lonnet::gettitle($$mapp{$id}); |
&Apache::lonnet::gettitle($$mapp{$id}); |
Line 1099 sub parmmenu {
|
Line 1134 sub parmmenu {
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
$r->print(); |
$r->print(); |
$r->print("\n<table id=\"LC_parm_overview_parm_menu\"><tr>"); |
$r->print("\n".'<table id="LC_parm_overview_parm_menu"><tr>'); |
my $cnt=0; |
my $cnt=0; |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
$r->print("\n<td><label><input type='checkbox' name='pscat' "); |
$r->print("\n<td><label><input type='checkbox' name='pscat' "); |
$r->print('value="'.$tempkey.'"'); |
$r->print('value="'.$tempkey.'"'); |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print(' checked'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print('>'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: $tempkey) |
: $tempkey) |
.'</label></td>'); |
.'</label></td>'); |
$cnt++; |
$cnt++; |
Line 1116 ENDSCRIPT
|
Line 1151 ENDSCRIPT
|
$cnt=0; |
$cnt=0; |
} |
} |
} |
} |
$r->print(' |
$r->print('</tr>' |
</tr><tr id=\"LC_parm_overview_parm_menu_selectors\"><td> |
.'<tr id="LC_parm_overview_parm_menu_selectors">' |
<a href="javascript:checkall(true, \'pscat\')">Select All</a><br /> |
.'<td valign="top">' |
<a href="javascript:checkstandard()">Select Common Only</a> |
.'<fieldset><legend><b>'.&mt('Parameter Selection').'</b></legend>' |
</td><td> |
.'<span class="LC_nobreak">' |
<a href="javascript:checkdates()">Add Problem Dates</a> |
.'• <a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>' |
<a href="javascript:checkcontdates()">Add Content Dates</a><br /> |
.'</span>' |
<a href="javascript:checkdisset()">Add Discussion Settings</a> |
.'<br />' |
<a href="javascript:checkvisi()">Add Visibilities</a><br /> |
.'<span class="LC_nobreak">' |
<a href="javascript:checkparts()">Add Part Parameters</a> |
.'• <a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>' |
</td><td> |
.'</span>' |
<a href="javascript:checkall(false, \'pscat\')">Unselect All</a> |
.'<br />' |
</td> |
.'<span class="LC_nobreak">' |
'); |
.'• <a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>' |
$r->print('</tr></table>'); |
.'</span>' |
|
.'</fieldset>' |
|
.'</td>' |
|
.'<td colspan="2" valign="top">' |
|
.'<fieldset><legend><b>'.&mt('Add Selection for...').'</b></legend>' |
|
.'<span class="LC_nobreak">' |
|
.'• <a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>' |
|
.'</span>' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>' |
|
.'</span>' |
|
# .'<br />' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkdisset()">'.&mt('Discussion Settings').'</a>' |
|
.'</span>' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkvisi()">'.&mt('Visibilities').'</a>' |
|
.'</span>' |
|
# .'<br />' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkparts()">'.&mt('Part Parameters').'</a>' |
|
.'</span>' |
|
.'</fieldset>' |
|
.'</td>' |
|
.'</tr></table>' |
|
); |
} |
} |
|
|
sub partmenu { |
sub partmenu { |
my ($r,$allparts,$psprt)=@_; |
my ($r,$allparts,$psprt)=@_; |
$r->print('<select multiple name="psprt" size="8">'); |
$r->print('<select multiple="multiple" name="psprt" size="8">'); |
$r->print('<option value="all"'); |
$r->print('<option value="all"'); |
$r->print(' selected') unless (@{$psprt}); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print('>'.&mt('All Parts').'</option>'); |
$r->print('>'.&mt('All Parts').'</option>'); |
my %temphash=(); |
my %temphash=(); |
foreach (@{$psprt}) { $temphash{$_}=1; } |
foreach (@{$psprt}) { $temphash{$_}=1; } |
Line 1147 sub partmenu {
|
Line 1207 sub partmenu {
|
unless ($tempkey =~ /\./) { |
unless ($tempkey =~ /\./) { |
$r->print('<option value="'.$tempkey.'"'); |
$r->print('<option value="'.$tempkey.'"'); |
if ($$psprt[0] eq "all" || $temphash{$tempkey}) { |
if ($$psprt[0] eq "all" || $temphash{$tempkey}) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
} |
} |
$r->print('>'.$$allparts{$tempkey}.'</option>'); |
$r->print('>'.$$allparts{$tempkey}.'</option>'); |
} |
} |
Line 1160 sub usermenu {
|
Line 1220 sub usermenu {
|
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my %lt=&Apache::lonlocal::texthash( |
|
'se' => "Section", |
|
'gr' => "Group", |
|
'fu' => "For User", |
|
'oi' => "or ID", |
|
'ad' => "at Domain" |
|
); |
|
my $sections=''; |
my $sections=''; |
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
|
|
my $groups; |
my $groups; |
my %grouphash = &Apache::longroup::coursegroups(); |
my %grouphash = &Apache::longroup::coursegroups(); |
|
|
|
my $g_s_header=''; |
|
my $g_s_footer=''; |
|
|
if (%sectionhash) { |
if (%sectionhash) { |
$sections=$lt{'se'}.': <select name="csec"'; |
$sections=&mt('Section:').' <select name="csec"'; |
if (%grouphash && $parmlev ne 'full') { |
if (%grouphash && $parmlev ne 'full') { |
$sections .= qq| onchange="group_or_section('csec')" |; |
$sections .= qq| onchange="group_or_section('csec')" |; |
} |
} |
Line 1186 sub usermenu {
|
Line 1243 sub usermenu {
|
} |
} |
$sections.='</select>'; |
$sections.='</select>'; |
} |
} |
|
|
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
$sections .= ' or '; |
$sections .= ' '.&mt('or').' '; |
$sections .= qq| |
$sections .= qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
function group_or_section(caller) { |
function group_or_section(caller) { |
Line 1214 function group_or_section(caller) {
|
Line 1272 function group_or_section(caller) {
|
} |
} |
|
|
if (%grouphash) { |
if (%grouphash) { |
$groups=$lt{'gr'}.': <select name="cgroup"'; |
$groups=&mt('Group:').' <select name="cgroup"'; |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
} |
} |
Line 1236 function group_or_section(caller) {
|
Line 1294 function group_or_section(caller) {
|
} |
} |
$groups.='</select>'; |
$groups.='</select>'; |
} |
} |
$r->print(<<ENDMENU); |
|
<b> |
if (%sectionhash || %grouphash) { |
$sections |
$g_s_header='<fieldset><legend>'.&mt('Group/Section').'</legend><div>'; |
$groups |
$g_s_footer='</div></fieldset>'; |
<br /> |
} |
$lt{'fu'} |
|
<input type="text" value="$uname" size="12" name="uname" /> |
$r->print('<b>' |
$lt{'oi'} |
.$g_s_header |
<input type="text" value="$id" size="12" name="id" /> |
.$sections |
$lt{'ad'} |
.$groups |
$chooseopt |
.$g_s_footer |
</b> |
.'<fieldset><legend>'.&mt('User').'</legend><div>' |
ENDMENU |
.&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' |
|
,'<input type="text" value="'.$uname.'" size="12" name="uname" />' |
|
,'<input type="text" value="'.$id.'" size="12" name="id" /> ' |
|
,$chooseopt) |
|
.'</div></fieldset>' |
|
.'</b>' |
|
); |
} |
} |
|
|
sub displaymenu { |
sub displaymenu { |
Line 1256 sub displaymenu {
|
Line 1320 sub displaymenu {
|
$r->print('<table border="1"><tr><th>'.&mt('Select Parameters to View').'</th><th>'. |
$r->print('<table border="1"><tr><th>'.&mt('Select Parameters to View').'</th><th>'. |
&mt('Select Parts to View').'</th></tr><tr><td>'); |
&mt('Select Parts to View').'</th></tr><tr><td>'); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print('</td><td>'); |
$r->print('</td><td valign="top" align="center">'); |
&partmenu($r,$allparts,$psprt); |
&partmenu($r,$allparts,$psprt); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
} |
} |
Line 1268 sub mapmenu {
|
Line 1332 sub mapmenu {
|
$r->print('<option value="all">'.&mt('All Maps or Folders').'</option>'); |
$r->print('<option value="all">'.&mt('All Maps or Folders').'</option>'); |
foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) { |
foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) { |
$r->print('<option value="'.$_.'"'); |
$r->print('<option value="'.$_.'"'); |
if (($pschp eq $_)) { $r->print(' selected'); } |
if (($pschp eq $_)) { $r->print(' selected="selected"'); } |
$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>'); |
$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>'); |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
Line 1282 sub levelmenu {
|
Line 1346 sub levelmenu {
|
foreach (reverse sort keys %{$alllevs}) { |
foreach (reverse sort keys %{$alllevs}) { |
$r->print('<option value="'.$$alllevs{$_}.'"'); |
$r->print('<option value="'.$$alllevs{$_}.'"'); |
if ($parmlev eq $$alllevs{$_}) { |
if ($parmlev eq $$alllevs{$_}) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
} |
} |
$r->print('>'.$_.'</option>'); |
$r->print('>'.&mt($_).'</option>'); |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
} |
} |
Line 1295 sub sectionmenu {
|
Line 1359 sub sectionmenu {
|
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
return if (!%sectionhash); |
return if (!%sectionhash); |
|
|
$r->print('<select name="Section" multiple="true" size="8" >'); |
$r->print('<select name="Section" multiple="multiple" size="8">'); |
foreach my $s ('all',sort keys %sectionhash) { |
foreach my $s ('all',sort keys %sectionhash) { |
$r->print(' <option value="'.$s.'"'); |
$r->print(' <option value="'.$s.'"'); |
foreach (@{$selectedsections}) { |
foreach (@{$selectedsections}) { |
if ($s eq $_) { |
if ($s eq $_) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
last; |
last; |
} |
} |
} |
} |
Line 1314 sub groupmenu {
|
Line 1378 sub groupmenu {
|
my %grouphash = &Apache::longroup::coursegroups(); |
my %grouphash = &Apache::longroup::coursegroups(); |
return if (!%grouphash); |
return if (!%grouphash); |
|
|
$r->print('<select name="Group" multiple="true" size="8" >'); |
$r->print('<select name="Group" multiple="multiple" size="8">'); |
foreach my $group (sort(keys(%grouphash))) { |
foreach my $group (sort(keys(%grouphash))) { |
$r->print(' <option value="'.$group.'"'); |
$r->print(' <option value="'.$group.'"'); |
foreach (@{$selectedgroups}) { |
foreach (@{$selectedgroups}) { |
if ($group eq $_) { |
if ($group eq $_) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
last; |
last; |
} |
} |
} |
} |
Line 1369 sub sortmenu {
|
Line 1433 sub sortmenu {
|
$r->print(' />'.&mt('Sort by realm first, then student (group/section)')); |
$r->print(' />'.&mt('Sort by realm first, then student (group/section)')); |
$r->print('</label><br /><label><input type="radio" name="sortorder" value="studentrealm"'); |
$r->print('</label><br /><label><input type="radio" name="sortorder" value="studentrealm"'); |
if ($sortorder eq 'studentrealm') { |
if ($sortorder eq 'studentrealm') { |
$r->print(' checked="on"'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print(' />'.&mt('Sort by student (group/section) first, then realm'). |
$r->print(' />'.&mt('Sort by student (group/section) first, then realm'). |
'</label>'); |
'</label>'); |
Line 1608 sub assessparms {
|
Line 1672 sub assessparms {
|
if (!$pssymb) { |
if (!$pssymb) { |
$r->print('<table border="1"><tr><td>'); |
$r->print('<table border="1"><tr><td>'); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
|
$r->print('</td>'); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print('<td>'); |
$r->print('<td>'); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
$r->print('</td></tr></table>'); |
$r->print('</tr></table>'); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
} else { |
} else { |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb); |
Line 1760 ENDTABLEHEADFOUR
|
Line 1825 ENDTABLEHEADFOUR
|
if (grep $_ eq $tempkeyp, @catmarker) { |
if (grep $_ eq $tempkeyp, @catmarker) { |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name'); |
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name'); |
$display{$_}=&Apache::lonnet::metadata($uri,$_.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
|
if ($allparms{$name{$_}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$_} = $allparms{$name{$_}}.$identifier; |
|
} else { |
|
$display{$_} = $parmdis; |
|
} |
unless ($display{$_}) { $display{$_}=''; } |
unless ($display{$_}) { $display{$_}=''; } |
$display{$_}.=' ('.$name{$_}.')'; |
$display{$_}.=' ('.$name{$_}.')'; |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
Line 1867 ENDTABLEHEADFOUR
|
Line 1941 ENDTABLEHEADFOUR
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
|
if ($allparms{$name{$tempkeyp}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier; |
|
} else { |
|
$display{$tempkeyp} = $parmdis; |
|
} |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
Line 1881 ENDTABLEHEADFOUR
|
Line 1964 ENDTABLEHEADFOUR
|
#---------------------------------------------------- print header information |
#---------------------------------------------------- print header information |
my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map'); |
my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map'); |
my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); |
my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); |
$r->print(<<ENDMAPONE); |
my $tmp=""; |
<center><h4> |
|
Set Defaults for All Resources in $foldermap<br /> |
|
<font color="red"><i>$showtitle</i></font><br /> |
|
Specifically for |
|
ENDMAPONE |
|
if ($uname) { |
if ($uname) { |
my $person=&Apache::loncommon::plainname($uname,$udom); |
my $person=&Apache::loncommon::plainname($uname,$udom); |
$r->print(&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ". |
$tmp.=&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ". |
&mt('in')." \n"); |
&mt('in')." \n"; |
} else { |
} else { |
$r->print("<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n"); |
$tmp.="<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n"; |
} |
} |
if ($cgroup) { |
if ($cgroup) { |
$r->print(&mt("Group")." <font color=\"red\"><i>$cgroup". |
$tmp.=&mt("Group")." <font color=\"red\"><i>$cgroup". |
"</i></font> ".&mt('of')." \n"); |
"</i></font> ".&mt('of')." \n"; |
$csec = ''; |
$csec = ''; |
} elsif ($csec) { |
} elsif ($csec) { |
$r->print(&mt("Section")." <font color=\"red\"><i>$csec". |
$tmp.=&mt("Section")." <font color=\"red\"><i>$csec". |
"</i></font> ".&mt('of')." \n"); |
"</i></font> ".&mt('of')." \n"; |
} |
} |
$r->print("<font color=\"red\"><i>$coursename</i></font><br />"); |
$r->print('<div align="center"><h4>' |
$r->print("</h4>\n"); |
.&mt('Set Defaults for All Resources in [_1]Specifically for [_2][_3]' |
|
,$foldermap.'<br /><font color="red"><i>'.$showtitle.'</i></font><br />' |
|
,$tmp |
|
,'<font color="red"><i>'.$coursename.'</i></font>' |
|
) |
|
."<br /></h4>\n" |
|
); |
#---------------------------------------------------------------- print table |
#---------------------------------------------------------------- print table |
$r->print('<p><table border="2">'); |
$r->print('<p><table border="2">'); |
$r->print('<tr><th>'.&mt('Parameter Name').'</th>'); |
$r->print('<tr><th>'.&mt('Parameter Name').'</th>'); |
Line 1916 ENDMAPONE
|
Line 2000 ENDMAPONE
|
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
$parmlev,$uname,$udom,$csec,$cgroup); |
$parmlev,$uname,$udom,$csec,$cgroup); |
} |
} |
$r->print("</table></center>"); |
$r->print("</table></div>"); |
} # end each map |
} # end each map |
} # end of $parmlev eq map |
} # end of $parmlev eq map |
#--------------------------------- Entry for parm level general (Course level) |
#--------------------------------- Entry for parm level general (Course level) |
Line 1954 ENDMAPONE
|
Line 2038 ENDMAPONE
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
|
if ($allparms{$name{$tempkeyp}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier; |
|
} else { |
|
$display{$tempkeyp} = $parmdis; |
|
} |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
Line 2125 sub crsenv {
|
Line 2218 sub crsenv {
|
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
|
} elsif ($name eq 'categories') { |
|
$setoutput .= $env{'form.categories_display'}; |
} else { |
} else { |
$setoutput .= $value; |
$setoutput .= $value; |
} |
} |
Line 2133 sub crsenv {
|
Line 2228 sub crsenv {
|
&change_clone($value,\@oldcloner); |
&change_clone($value,\@oldcloner); |
} |
} |
# Update environment and nohist_courseids.db |
# Update environment and nohist_courseids.db |
if ($name eq 'description' || $name eq 'cloners') { |
if (($name eq 'description') || ($name eq 'cloners') || |
|
($name eq 'hidefromcat') || ($name eq 'categories')) { |
if ($chome eq '') { |
if ($chome eq '') { |
%crsinfo = |
%crsinfo = |
&Apache::lonnet::courseiddump($dom,'.',1,'.','.', |
&Apache::lonnet::courseiddump($dom,'.',1,'.','.', |
$crs,undef,undef,'Course'); |
$crs,undef,undef,'.'); |
$chome = &Apache::lonnet::homeserver($crs,$dom); |
$chome = &Apache::lonnet::homeserver($crs,$dom); |
} |
} |
} |
} |
Line 2150 sub crsenv {
|
Line 2246 sub crsenv {
|
$chome,'notime'); |
$chome,'notime'); |
} |
} |
} |
} |
if ($name eq 'cloners') { |
if (($name eq 'cloners') || ($name eq 'hidefromcat') || ($name eq 'categories')) { |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
$crsinfo{$env{'request.course.id'}}{'cloners'} = $value; |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.'.$name => $value}); |
|
$crsinfo{$env{'request.course.id'}}{$name} = $value; |
my $putresult = |
my $putresult = |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
$chome,'notime'); |
$chome,'notime'); |
Line 2208 sub crsenv {
|
Line 2305 sub crsenv {
|
my $SelectStyleFile=&mt('Select Style File'); |
my $SelectStyleFile=&mt('Select Style File'); |
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
my $output=''; |
my $output=''; |
|
my $can_categorize; |
if (! exists($values{'con_lost'})) { |
if (! exists($values{'con_lost'})) { |
my %descriptions= |
my %descriptions= |
('url' => '<b>'.&mt('Top Level Map').'</b><br />'. |
('url' => '<b>'.&mt('Top Level Map').'</b><br />'. |
Line 2251 sub crsenv {
|
Line 2349 sub crsenv {
|
'student_classlist_view' => '<b>'.&mt('Allow students to view classlist.').'</b><br />' |
'student_classlist_view' => '<b>'.&mt('Allow students to view classlist.').'</b><br />' |
.'('.&mt('[_1]: students can view all sections. [_2]: students can only view their own section. blank or [_3] prevents student view.','"<tt>all</tt>"','"<tt>section</tt>"','"<tt>disabled</tt>"').')', |
.'('.&mt('[_1]: students can view all sections. [_2]: students can only view their own section. blank or [_3] prevents student view.','"<tt>all</tt>"','"<tt>section</tt>"','"<tt>disabled</tt>"').')', |
'student_classlist_portfiles' => '<b>'.&mt('Include link to accessible portfolio files').'</b><br />' |
'student_classlist_portfiles' => '<b>'.&mt('Include link to accessible portfolio files').'</b><br />' |
.'('.&mt('[_1] for link to each a listing of each student\'s files.','"<tt>yes</tt>"').')', |
.'('.&mt("[_1] for link to each a listing of each student's files.",'"<tt>yes</tt>"').')', |
'student_classlist_opt_in' => '<b>'.&mt("Student's agreement needed for listing in student-viewable roster").'</b><br />' |
'student_classlist_opt_in' => '<b>'.&mt("Student's agreement needed for listing in student-viewable roster").'</b><br />' |
.'('.&mt('[_1] to require students to opt-in to listing in the roster (on the roster page).','"<tt>yes</tt>"').')', |
.'('.&mt('[_1] to require students to opt-in to listing in the roster (on the roster page).','"<tt>yes</tt>"').')', |
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles').'</b><br />' |
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles').'</b><br />' |
Line 2338 sub crsenv {
|
Line 2436 sub crsenv {
|
|
|
'texengine' |
'texengine' |
=> '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />' |
=> '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />' |
.'('.&mt('[_1], [_2] (Convert to Images), [_3] (Tex-to-HTML), or blank for student\'s preference','"<tt>jsMath</tt>"','"<tt>mimetex</tt>"','"<tt>tth</tt>"').')', |
.'('.&mt("[_1], [_2] (Convert to Images), [_3] (TeX to HTML), or blank for student's preference",'"<tt>jsMath</tt>"','"<tt>mimetex</tt>"','"<tt>tth</tt>"').')', |
|
'timezone' |
|
=> '<b>'.&mt('Timezone in which the course takes place').'</b>', |
|
|
); |
'suppress_embed_prompt' |
my @Display_Order = ('url','description','courseid','cloners','grading', |
=> '<b>'.&mt('Suppress prompt to upload items referenced in a web page being uploaded to portfolio, when current role is student.').'</b><br />'. |
|
' ('.&mt('[_1] to suppress, anything else to not suppress','"<tt>yes</tt>"').')', |
|
'hidefromcat' |
|
=> '<b>'.&mt('Exclude from course catalog').'</b><br />'. |
|
' ('.&mt('[_1] to exclude, anything else to include - included if assigned an institutional code, or manually catagorized','"<tt>yes</tt>"').')', |
|
'categories' |
|
=> '<b>'.&mt('Categorize course').'</b> <a href="javascript:catsbrowser()">'. |
|
&mt('Display Categories').'</a>', |
|
'datelocale' |
|
=> '<b>'.&mt('Locale used for course calendar').'</b>', |
|
); |
|
my @Display_Order = ('url','description','courseid','cloners'); |
|
(my $can_toggle_cat,$can_categorize) = &can_modify_catsettings($dom); |
|
if ($can_toggle_cat) { |
|
push(@Display_Order,'hidefromcat'); |
|
} |
|
if ($can_categorize) { |
|
push(@Display_Order,'categories'); |
|
} |
|
push (@Display_Order,('grading', |
'externalsyllabus', |
'externalsyllabus', |
'default_xml_style','pageseparators', |
'default_xml_style','pageseparators', |
'question.email','question.email.text','comment.email','comment.email.text','policy.email','policy.email.text', |
'question.email','question.email.text','comment.email', |
|
'comment.email.text','policy.email','policy.email.text', |
'student_classlist_view', |
'student_classlist_view', |
'student_classlist_opt_in', |
'student_classlist_opt_in', |
'student_classlist_portfiles', |
'student_classlist_portfiles', |
Line 2353 sub crsenv {
|
Line 2473 sub crsenv {
|
'allow_limited_html_in_feedback', |
'allow_limited_html_in_feedback', |
'allow_discussion_post_editing', |
'allow_discussion_post_editing', |
'languages', |
'languages', |
|
'timezone', |
|
'datelocale', |
'nothideprivileged', |
'nothideprivileged', |
'rndseed', |
'rndseed', |
'receiptalg', |
'receiptalg', |
'problem_stream_switch', |
'problem_stream_switch', |
'suppress_tries', |
'suppress_tries', |
|
'suppress_embed_prompt', |
'default_paper_size', |
'default_paper_size', |
'print_header_format', |
'print_header_format', |
'disable_receipt_display', |
'disable_receipt_display', |
Line 2371 sub crsenv {
|
Line 2494 sub crsenv {
|
'texengine', |
'texengine', |
'disablesigfigs', |
'disablesigfigs', |
'disableexampointprint', |
'disableexampointprint', |
'task_messages','task_grading', |
'task_messages','task_grading')); |
); |
|
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) || |
|
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/) |
|
|| ($parameter eq 'type')) { |
if (! $descriptions{$parameter}) { |
if (! $descriptions{$parameter}) { |
$descriptions{$parameter}=$parameter; |
$descriptions{$parameter}=$parameter; |
push(@Display_Order,$parameter); |
push(@Display_Order,$parameter); |
Line 2397 sub crsenv {
|
Line 2521 sub crsenv {
|
$values{$parameter}, |
$values{$parameter}, |
$onchange). |
$onchange). |
'</td>'; |
'</td>'; |
|
} elsif ($parameter eq 'timezone') { |
|
my $includeempty = 1; |
|
my $timezone = &Apache::lonlocal::gettimezone(); |
|
$output .= '<td>'. |
|
&Apache::loncommon::select_timezone($parameter.'_value', |
|
$timezone, |
|
$onchange,$includeempty).'</td>'; |
|
} elsif ($parameter eq 'datelocale') { |
|
my $includeempty = 1; |
|
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
|
my $currdatelocale; |
|
if (ref($locale_obj)) { |
|
$currdatelocale = $locale_obj->id(); |
|
} |
|
$output .= '<td>'. |
|
&Apache::loncommon::select_datelocale($parameter.'_value', |
|
$currdatelocale, |
|
$onchange,$includeempty).'</td>'; |
|
} elsif ($parameter eq 'categories') { |
|
my $catdisplay; |
|
if ($values{'categories'} ne '') { |
|
my @curritems = split(/\&/,$values{'categories'}); |
|
foreach my $item (@curritems) { |
|
my ($name,$parent,$pos) = split(/:/,$item); |
|
$catdisplay .= &unescape($name).'&'; |
|
} |
|
$catdisplay =~ s/\&$//; |
|
} |
|
$output .= '<td>'. |
|
'<input type="hidden" name="categories_value" value="'. |
|
$values{'categories'}.'" />'. |
|
'<input type="textbox" name="categories_display" value="'. |
|
$catdisplay.'" readonly="readonly" size="40" /></td>'; |
} else { |
} else { |
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
Line 2430 sub crsenv {
|
Line 2587 sub crsenv {
|
my $Parameter=&mt('Parameter'); |
my $Parameter=&mt('Parameter'); |
my $Value=&mt('Value'); |
my $Value=&mt('Value'); |
my $Set=&mt('Set'); |
my $Set=&mt('Set'); |
my $browse_js= |
my ($jscript,$categorize_js); |
'<script type="text/javascript" language="Javascript">'. |
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
&Apache::loncommon::browser_and_searcher_javascript('parmset'). |
if ($can_categorize) { |
'</script>'; |
$categorize_js = <<ENDSCRIPT; |
|
function catsbrowser() { |
|
var catswin = null; |
|
var url = '/adm/parmset?action=categorizecourse'; |
|
if (!catswin || catswin.closed) { |
|
catswin=window.open(url,'categorieswin','height=480,width=600,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); |
|
} else { |
|
catswin.focus(); |
|
} |
|
} |
|
ENDSCRIPT |
|
} |
|
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
|
$browse_js."\n".$categorize_js."\n".'</script>'; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set Course Environment', |
&Apache::loncommon::start_page('Set Course Environment', |
$browse_js); |
$jscript); |
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
my $end_table=&Apache::loncommon::end_data_table(); |
my $end_table=&Apache::loncommon::end_data_table(); |
Line 2458 $end_table
|
Line 2627 $end_table
|
$end_page |
$end_page |
ENDENV |
ENDENV |
} |
} |
|
|
|
sub can_modify_catsettings { |
|
my ($dom) = @_; |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); |
|
my ($can_toggle_cat,$can_categorize); |
|
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
|
if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') { |
|
$can_toggle_cat = 1; |
|
} |
|
if ($domconf{'coursecategories'}{'categorize'} eq 'crs') { |
|
$can_categorize = 1; |
|
} |
|
} |
|
return ($can_toggle_cat,$can_categorize); |
|
} |
|
|
|
sub assign_course_categories { |
|
my ($r) = @_; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $hascats = 0; |
|
my $cathash; |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); |
|
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
|
$cathash = $domconf{'coursecategories'}{'cats'}; |
|
if (ref($cathash) eq 'HASH') { |
|
$hascats = 1; |
|
} |
|
} |
|
my $catwin_js; |
|
if ($hascats) { |
|
my $alert = &mt('Use \"Save\" in the main window to save course categories'); |
|
$catwin_js = <<ENDSCRIPT; |
|
<script type="text/javascript"> |
|
|
|
function updateCategories() { |
|
var newcategories = ''; |
|
var unescapedcats = ''; |
|
if (document.chgcats.usecategory.length) { |
|
for (var i=0; i<document.chgcats.usecategory.length; i++) { |
|
if (document.chgcats.usecategory[i].checked == true) { |
|
newcategories = newcategories + document.chgcats.usecategory[i].value + '&'; |
|
unescapedcats = unescapedcats + document.chgcats.catname[i].value + ' & '; |
|
} |
|
} |
|
if (newcategories.length > 0) { |
|
newcategories = newcategories.slice(0,-1); |
|
} |
|
if (unescapedcats.length > 0) { |
|
unescapedcats = unescapedcats.slice(0,-3); |
|
} |
|
} else { |
|
if (document.chgcats.usecategory.checked == true) { |
|
newcategories = document.chgcats.usecategory.value; |
|
unescapedcats = document.chgcats.catname.value; |
|
} |
|
} |
|
opener.document.envform.categories_value.value = newcategories; |
|
opener.document.envform.categories_display.value = unescapedcats; |
|
opener.document.envform.categories_setparmval.checked = true; |
|
alert("$alert"); |
|
self.close(); |
|
return; |
|
} |
|
|
|
</script> |
|
ENDSCRIPT |
|
} else { |
|
my $onload; |
|
} |
|
my $start_page = |
|
&Apache::loncommon::start_page('Course Categories',$catwin_js, |
|
{'only_body' => 1,}); |
|
my $end_page = &Apache::loncommon::end_page(); |
|
my $categoriesform = '<h3>'.&mt('Categorize Course').'</h3>'; |
|
if ($hascats) { |
|
my %currsettings = |
|
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
|
$categoriesform .= &mt('Assign one or more categories to this course.').'<br /><br />'. |
|
'<form name="chgcats" action="/adm/parmset" method="post">'."\n" |
|
.&Apache::loncommon::assign_categories_table($cathash, |
|
$currsettings{'categories'})."\n" |
|
.'<br /><input type="button" name="changes" value="' |
|
.&mt('Copy to main window').'" ' |
|
.'onclick="javascript:updateCategories()" /></form><br />'; |
|
} else { |
|
$categoriesform .= &mt('No categories defined for this domain'); |
|
} |
|
$r->print($start_page.$categoriesform.$end_page); |
|
return; |
|
} |
|
|
################################################## |
################################################## |
# Overview mode |
# Overview mode |
################################################## |
################################################## |
Line 2731 sub listdata {
|
Line 2992 sub listdata {
|
} |
} |
if ($part ne $oldpart) { |
if ($part ne $oldpart) { |
$r->print(&tableend(). |
$r->print(&tableend(). |
"\n<span class=\"LC_parm_part\">".&mt('Part').": $part</span>"); |
"\n".'<span class="LC_parm_part">'.&mt('Part').": $part</span>"); |
$oldpart=$part; |
$oldpart=$part; |
} |
} |
# |
# |
Line 2752 sub listdata {
|
Line 3013 sub listdata {
|
$$resourcedata{$thiskey}, |
$$resourcedata{$thiskey}, |
'',1,'',''). |
'',1,'',''). |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
(($$resourcedata{$thiskey}!=0)?'<a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
&mt('Shift all dates based on this date').'</a>':''). |
&mt('Shift all dates based on this date').'</a></span>':''). |
&date_sanity_info($$resourcedata{$thiskey}) |
&date_sanity_info($$resourcedata{$thiskey}) |
); |
); |
} elsif ($thistype eq 'date_interval') { |
} elsif ($thistype eq 'date_interval') { |
Line 2766 sub listdata {
|
Line 3027 sub listdata {
|
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
} |
} |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$thistype.'">'); |
$thistype.'" />'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
Line 3103 ENDOVER
|
Line 3364 ENDOVER
|
$r->print('<h3>'. |
$r->print('<h3>'. |
&mt('These parameters refer to resources that do not exist.'). |
&mt('These parameters refer to resources that do not exist.'). |
'</h3>'. |
'</h3>'. |
'<input type="submit" value="'.&mt('Delete Checked Parameters').'" />'.'<br />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'.'<br />'. |
'<br />'); |
'<br />'); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
'<tr>'. |
'<tr>'. |
Line 3156 ENDOVER
|
Line 3417 ENDOVER
|
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
'<input type="submit" value="'.&mt('Delete Checked Parameters').'" />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'</p></form>'. |
'</p></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
Line 3542 sub output_row {
|
Line 3803 sub output_row {
|
my $multiple_checked; |
my $multiple_checked; |
my $single_checked; |
my $single_checked; |
if ($options =~ m/onlyone/) { |
if ($options =~ m/onlyone/) { |
$multiple_checked = ""; |
$multiple_checked = ''; |
$single_checked = " CHECKED "; |
$single_checked = ' checked="checked"'; |
} else { |
} else { |
$multiple_checked = " CHECKED "; |
$multiple_checked = ' checked="checked"'; |
$single_checked = ""; |
$single_checked = ''; |
} |
} |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
<input type="radio" name="'.$field_name.'_onlyone" value="multiple" '.$multiple_checked .'/> |
<input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked .' /> |
Student may select multiple choices from list</span></td>'; |
'.&mt('Student may select multiple choices from list').'</span></td>'; |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
<input type="radio" name="'.$field_name.'_onlyone" value="single" '.$single_checked.'/> |
<input type="radio" name="'.$field_name.'_onlyone" value="single" '.$single_checked.'/> |
Student may select only one choice from list</span></td>'; |
'.&mt('Student may select only one choice from list').'</span></td>'; |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
return ($output); |
return ($output); |
Line 4319 sub handler {
|
Line 4580 sub handler {
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
text=>"Shifting Dates"}); |
text=>"Shifting Dates"}); |
&date_shift_two($r); |
&date_shift_two($r); |
} |
} elsif ($env{'form.action'} eq 'categorizecourse' && $parm_permission) { |
|
&assign_course_categories($r); |
|
} |
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |
if ($exists) { |
if ($exists) { |