version 1.483, 2009/11/14 17:47:18
|
version 1.501, 2010/08/16 16:02:09
|
Line 248 Variables used (guessed by Jeremy):
|
Line 248 Variables used (guessed by Jeremy):
|
|
|
=item parse_key() |
=item parse_key() |
|
|
=item check_cloners() : |
|
|
|
Checks if new users included in list of allowed cloners |
|
are valid users. Replaces supplied list with |
|
cleaned list containing only users with valid usernames |
|
and domains. |
|
|
|
Inputs: $clonelist, $oldcloner |
|
where $clonelist is ref to array of requested cloners, |
|
and $oldcloner is ref to array of currently allowed |
|
cloners. |
|
|
|
Returns: string - comma separated list of requested |
|
cloners (username:domain) who do not exist in system. |
|
|
|
=item change_clone() : |
|
|
|
Modifies the list of courses a user can clone (stored |
|
in the user's environment.db file), called when a |
|
change is made to the list of users allowed to clone |
|
a course. |
|
|
|
Inputs: $action,$cloner |
|
where $action is add or drop, and $cloner is identity of |
|
user for whom cloning ability is to be changed in course. |
|
|
|
|
|
=item check_cloners() |
|
|
|
=item change_clone() |
|
|
|
=item header() |
=item header() |
|
|
Output html header for page |
Output html header for page |
Line 903 sub startpage {
|
Line 872 sub startpage {
|
my ($r) = @_; |
my ($r) = @_; |
|
|
my %loaditems = ('onunload' => "pclose()", |
my %loaditems = ('onunload' => "pclose()", |
'onload' => "group_or_section('cgroup')", |
'onload' => "showHide_courseContent(); group_or_section('cgroup')", |
'onload' => "showHide_courseContent()", |
|
); |
); |
|
|
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
Line 1246 sub isdateparm {
|
Line 1214 sub isdateparm {
|
} |
} |
|
|
# |
# |
# This function prints a list of parameters, which were selected. It also display a link from which you can |
# parmmenu displays a list of the selected parameters. |
# hide or show the complete parameter list, from which you can choose your parameters. |
# It also offers a link to show/hide the complete parameter list |
|
# from which you can select all desired parameters. |
# |
# |
sub parmmenu { |
sub parmmenu { |
my ($r,$allparms,$pscat,$keyorder)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
Line 1322 sub parmmenu {
|
Line 1291 sub parmmenu {
|
checkdates(); |
checkdates(); |
checkthis('weight','pscat'); |
checkthis('weight','pscat'); |
checkthis('maxtries','pscat'); |
checkthis('maxtries','pscat'); |
|
checkthis('type','pscat'); |
|
checkthis('problemstatus','pscat'); |
} |
} |
|
|
function hideParms() { |
function hideParms() { |
Line 1351 ENDSCRIPT
|
Line 1322 ENDSCRIPT
|
$r->print(&mt('Selected Parameters:').'<br />'); |
$r->print(&mt('Selected Parameters:').'<br />'); |
|
|
#print out all possible parms and hide them by default |
#print out all possible parms and hide them by default |
$r->print('<ul>'); |
$r->print('<ul class="LC_parm_parmlist">'); |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
$r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"'); |
$r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"'); |
if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) { |
if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) { |
Line 1362 ENDSCRIPT
|
Line 1333 ENDSCRIPT
|
.'</li>' |
.'</li>' |
); |
); |
} |
} |
$r->print('</ul>' |
$r->print('</ul>'); |
.'<p><a href="javascript:showParms()">' |
|
.&mt('Show detailed Parameter Selection') |
|
.'</a></p>' |
|
); |
|
|
|
|
$r->print('<hr />'); |
&shortCuts($r,$allparms,$pscat,$keyorder); |
&shortCuts($r,$allparms,$pscat,$keyorder); |
|
$r->print('<hr />'); |
|
|
|
$r->print( |
|
'<p><a href="javascript:showParms()">' |
|
.&mt('Show detailed Parameter Selection') |
|
.'</a></p>' |
|
); |
|
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
} |
} |
Line 1494 sub parmboxes {
|
Line 1469 sub parmboxes {
|
'slots' => [], |
'slots' => [], |
'file_submission' => [], |
'file_submission' => [], |
'misc' => [], |
'misc' => [], |
); |
); |
|
my $hidelink = |
|
'<p>' |
|
.'<a href="javascript:hideParms()">' |
|
.&mt('Hide detailed Parameter Selection') |
|
.'</a>' |
|
.'</p>' |
|
."\n"; |
|
; |
foreach $tempparameter (keys %$allparms) { |
foreach $tempparameter (keys %$allparms) { |
&whatIsMyCategory($tempparameter, \%categoryList); |
&whatIsMyCategory($tempparameter, \%categoryList); |
} |
} |
#part to print the parm-list |
#part to print the parm-list |
$r->print('<fieldset id="LC_parm_overview_parm_menu" style="display:none">' |
$r->print( |
.'<legend>'.&mt('Parameter').'</legend>'."\n" |
'<div id="LC_parm_overview_parm_menu" class="LC_Box" style="display:none">'."\n" |
|
.'<h3>'.&mt('Parameter').'</h3>'."\n" |
|
.$hidelink |
|
.'<div class="LC_columnSection">'."\n" |
); |
); |
|
|
#Print parameters |
#Print parameters |
Line 1508 sub parmboxes {
|
Line 1494 sub parmboxes {
|
if(@{$categoryList{$key}} == 0) { |
if(@{$categoryList{$key}} == 0) { |
next; |
next; |
} else { |
} else { |
$r->print('<fieldset>' |
$r->print('<div class="LC_Box LC_400Box">' |
.'<legend>' |
.'<h4 class="LC_hcell">' |
.&mt($categories{$key}) |
.&mt($categories{$key}) |
.'</legend>'."\n"); |
.'</h4>'."\n"); |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
$r->print('<span class="LC_nobreak">' |
$r->print('<span class="LC_nobreak">' |
.'<label><input type="checkbox" name="pscat" '); |
.'<label><input type="checkbox" name="pscat" '); |
Line 1522 sub parmboxes {
|
Line 1508 sub parmboxes {
|
} |
} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: $tempkey) |
: $tempkey) |
.'</label></span> '); |
.'</label></span><br />'."\n"); |
} |
} |
$r->print('</fieldset>'); |
$r->print("</div>\n"); |
} |
} |
} |
} |
$r->print('<hr />' |
|
.'<a href="javascript:hideParms()">' |
|
.&mt('Hide') |
|
.'</a>' |
|
); |
|
|
|
#&shortCuts($r,$allparms,$pscat,$keyorder); |
#&shortCuts($r,$allparms,$pscat,$keyorder); |
$r->print('</fieldset>'); |
$r->print( |
|
"</div>\n" |
|
.$hidelink |
|
."</div>\n" |
|
); |
} |
} |
# |
# |
# This function offers some links on the parameter section to get with one click a group a parameters |
# This function offers some links on the parameter section to get with one click a group a parameters |
Line 1542 sub parmboxes {
|
Line 1527 sub parmboxes {
|
sub shortCuts { |
sub shortCuts { |
my ($r,$allparms,$pscat,$keyorder)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
|
|
#part to print out the shortcuts for parmselection |
# Parameter Selection |
$r->print('<table><tr id="LC_parm_overview_parm_menu_selectors">' |
$r->print( |
.'<td valign="top">' |
&Apache::lonhtmlcommon::start_funclist(&mt('Parameter Selection')) |
.'<fieldset><legend>'.&mt('Parameter Selection').'</legend>' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'<span class="LC_nobreak">' |
'<a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>') |
.'• <a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'</span>' |
'<a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>') |
.'<br />' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'<span class="LC_nobreak">' |
'<a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>') |
.'• <a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>' |
.&Apache::lonhtmlcommon::end_funclist() |
.'</span>' |
); |
.'<br />' |
|
.'<span class="LC_nobreak">' |
# Add Selection for... |
.'• <a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>' |
$r->print( |
.'</span>' |
&Apache::lonhtmlcommon::start_funclist(&mt('Add Selection for...')) |
.'</fieldset>' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'</td>' |
'<a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>') |
.'<td colspan="2" valign="top">' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'<fieldset><legend>'.&mt('Add Selection for...').'</legend>' |
'<a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>') |
.'<span class="LC_nobreak">' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'• <a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>' |
'<a href="javascript:checkdisset()">'.&mt('Discussion Settings').'</a>') |
.'</span>' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'<span class="LC_nobreak">' |
'<a href="javascript:checkvisi()">'.&mt('Visibilities').'</a>') |
.' • <a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>' |
.&Apache::lonhtmlcommon::add_item_funclist( |
.'</span>' |
'<a href="javascript:checkparts()">'.&mt('Part Parameters').'</a>') |
# .'<br />' |
.&Apache::lonhtmlcommon::end_funclist() |
.'<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 { |
Line 1712 sub displaymenu {
|
Line 1685 sub displaymenu {
|
&parmmenu($r,$allparms,$pscat,$keyorder); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
|
&partmenu($r,$allparts,$psprt); |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles, $symbp)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $tree=[]; |
my $tree=[]; |
my $treeinfo={}; |
my $treeinfo={}; |
if (defined($navmap)) { |
if (defined($navmap)) { |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
my $curRes; |
my $curRes; |
my $depth = 0; |
my $depth = 0; |
my %parent = (); |
my %parent = (); |
Line 1768 sub mapmenu {
|
Line 1736 sub mapmenu {
|
} |
} |
} |
} |
# Show it ... |
# Show it ... |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
$r->print(&Apache::loncommon::start_data_table() |
my $whitespace = |
.&Apache::loncommon::start_data_table_row() |
'<img src="' |
.'<td>'.$icon |
.&Apache::loncommon::lonhttpdurl('/adm/lonIcons/whitespace_21.gif') |
.'<label> ' |
.'" alt="" />'; |
.'<input type="radio" name="pschp" checked="checked" value="all" />' |
|
.&mt('All Maps or Folders') |
# Info about selectable folders/maps |
.'</label></td>' |
$r->print( |
.&Apache::loncommon::end_data_table_row() |
'<div class="LC_info">' |
|
.&mt('You can only select those maps and folders which can be currently parameterized.') |
|
# .' '.&Apache::loncommon::help_open_topic('...') # Later: Add further help |
|
.'</div>' |
|
); |
|
|
|
|
|
$r->print(&Apache::loncommon::start_data_table()); |
|
|
|
# Display row: "All Maps or Folders" |
|
$r->print( |
|
&Apache::loncommon::start_data_table_row() |
|
.'<td>' |
|
.'<label>' |
|
.'<input type="radio" name="pschp"' |
|
); |
|
$r->print(' checked="checked"') if ($pschp eq 'all' || !$pschp); |
|
$r->print( |
|
' value="all" /> '.$icon.' ' |
|
.&mt('All Maps or Folders') |
|
.'</label>' |
|
.'<hr /></td>' |
|
.&Apache::loncommon::end_data_table_row() |
); |
); |
my $whitespace = '<img src="' |
|
.&Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif") |
# Display row: "Main Course Documents" |
.'" alt="" />'; |
|
if (exists($$allmaps{1})) { |
if (exists($$allmaps{1})) { |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type="radio" name="pschp" value="1"' |
.'<label>' |
|
.'<input type="radio" name="pschp" value="1"' |
); |
); |
if ($pschp eq 1) { |
$r->print(' checked="checked"') if ($pschp eq '1'); |
$r->print(' checked="checked"'); |
$r->print( |
} |
'/> '.$icon.' ' |
$r->print('/>' |
.$$maptitles{1} |
.$$maptitles{1} |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.'</label>' |
.'</label>' |
.'</td>' |
.'</td>' |
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
|
); |
); |
} |
} |
|
|
|
# Display rows for all course maps and folders |
foreach my $id (@{$tree}) { |
foreach my $id (@{$tree}) { |
my ($mapid,$resid)=split(/\./,$id); |
my ($mapid,$resid)=split(/\./,$id); |
# Indentation |
# Indentation |
Line 1815 sub mapmenu {
|
Line 1806 sub mapmenu {
|
my $symb_name = $$symbp{$id}; |
my $symb_name = $$symbp{$id}; |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
$symb_name = $tail; |
$symb_name = $tail; |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$indent.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type ="radio" name="pschp" value="'.$allmaps_inverted{$symb_name}.'"' |
.'<label>' |
); |
); |
if ($pschp eq $allmaps_inverted{$symb_name}) { |
# Only offer radio button for folders/maps which can be parameterized |
$r->print(' checked="checked"'); |
if ($allmaps_inverted{$symb_name}) { |
|
$r->print( |
|
'<input type ="radio" name="pschp"' |
|
.' value="'.$allmaps_inverted{$symb_name}.'"' |
|
); |
|
$r->print(' checked="checked"') if ($allmaps_inverted{$symb_name} eq $pschp); |
|
$r->print('/>'); |
|
} else { |
|
$r->print($whitespace); |
} |
} |
$r->print('/>' |
$r->print( |
.$treeinfo->{$id}->{name} |
$indent.$icon.' ' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.$treeinfo->{$id}->{name} |
.'</label>' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.'</td>' |
.'</label>' |
.&Apache::loncommon::end_data_table_row() |
.'</td>' |
|
.&Apache::loncommon::end_data_table_row() |
); |
); |
} |
} |
|
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} |
} |
} |
} |
Line 2087 sub assessparms {
|
Line 2088 sub assessparms {
|
$message="\n<p>\n".&mt("Full Name").": ". |
$message="\n<p>\n".&mt("Full Name").": ". |
$name{'firstname'}.' '.$name{'middlename'}.' ' |
$name{'firstname'}.' '.$name{'middlename'}.' ' |
.$name{'lastname'}.' '.$name{'generation'}. |
.$name{'lastname'}.' '.$name{'generation'}. |
"<br />\n".&mt('ID').": ".$name{'id'}.'<p>'; |
"<br />\n".&mt('Student/Employee ID').": ".$name{'id'}.'<p>'; |
} |
} |
@usersgroups = &Apache::lonnet::get_users_groups( |
@usersgroups = &Apache::lonnet::get_users_groups( |
$udom,$uname,$env{'request.course.id'}); |
$udom,$uname,$env{'request.course.id'}); |
Line 2115 sub assessparms {
|
Line 2116 sub assessparms {
|
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my (@ok_slots,@fail_slots,@del_slots); |
my (@ok_slots,@fail_slots,@del_slots); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my ($level,@all) = |
my ($level,@all) = |
Line 2148 sub assessparms {
|
Line 2149 sub assessparms {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($markers[$i] =~ /_type\&\d+$/) { |
|
if (($values[$i] eq 'anonsurvey') || ($values[$i] eq 'anonsurveycred')) { |
|
&Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$values[$i]}); |
|
} |
} |
} |
$message.=&storeparm(split(/\&/,$markers[$i]), |
$message.=&storeparm(split(/\&/,$markers[$i]), |
$values[$i], |
$values[$i], |
Line 2162 sub assessparms {
|
Line 2167 sub assessparms {
|
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries','type','problemstatus') }; |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
Line 2188 function parmsel_show() {
|
Line 2193 function parmsel_show() {
|
// ]]> |
// ]]> |
</script> |
</script> |
ENDPARMSELSCRIPT |
ENDPARMSELSCRIPT |
my $parmselhiddenstyle=' style="display:none"'; |
|
if($env{'form.hideparmsel'} eq 'hidden') { |
|
$r->print('<div id="parmsel"'.$parmselhiddenstyle.'>'); |
|
} else { |
|
$r->print('<div id="parmsel">'); |
|
} |
|
|
|
|
|
# Display Unit 1 "General Parameters" |
|
if (!$pssymb) { |
if (!$pssymb) { |
|
my $parmselhiddenstyle=' style="display:none"'; |
|
if($env{'form.hideparmsel'} eq 'hidden') { |
|
$r->print('<div id="parmsel"'.$parmselhiddenstyle.'>'); |
|
} else { |
|
$r->print('<div id="parmsel">'); |
|
} |
|
|
|
# Step 1 |
$r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification'))); |
$r->print(<<COURSECONTENTSCRIPT); |
$r->print(<<COURSECONTENTSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 2220 COURSECONTENTSCRIPT
|
Line 2225 COURSECONTENTSCRIPT
|
|
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('<div id="mapmenu">'); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
|
$r->print(&Apache::lonhtmlcommon::row_closure()); |
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
|
&partmenu($r,\%allparts,\@psprt); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div>'); |
|
#Display Unit 2 "Select Parameter" |
# Step 2 |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
|
|
|
# Step 3 |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'))); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
|
|
# Update Display Button |
|
$r->print('<p>' |
|
.'<input type="submit" name="dis"' |
|
.' value="'.&mt('Update Parameter Display').'" />' |
|
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
|
.'</p>'); |
|
$r->print('</div>'); |
|
|
|
# Offer link to display parameter selection again |
|
$r->print('<p id="parmsellink"'); |
|
if ($env{'form.hideparmsel'} ne 'hidden') { |
|
$r->print($parmselhiddenstyle); |
|
} |
|
$r->print('>' |
|
.'<a href="javascript:parmsel_show()">' |
|
.&mt('Change Parameter Selection') |
|
.'</a>' |
|
.'</p>'); |
} else { |
} else { |
# parameter screen for a single resource. |
# parameter screen for a single resource. |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
$r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource). |
$r->print(&mt('Specific Resource: [_1] ([_2])', |
|
$title,'<span class="LC_filename">'.$resource.'</span>'). |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
'<br />'); |
($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />'); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('User Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
} |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
'<label>'. |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
'<input type="checkbox" name="psprt" value="all"'. |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
($env{'form.psprt'}?' checked="checked"':'').' />'. |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
&mt('Show all parts'). |
|
'</label></td></tr>'); |
# parm selection is shown: display parm update button |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$r->print('<p>' |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('<p>' |
.'<input type="submit" name="dis"' |
.'<input type="submit" name="dis"' |
.' value="'.&mt('Update Parameter Display').'" />' |
.' value="'.&mt('Update Parameter Display').'" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'</p>' |
.'</p>'); |
); |
|
|
|
$r->print('</div>'); |
|
# ----- End Parameter Selection |
|
|
|
# Offer link to display parameter selection again |
|
$r->print('<p id="parmsellink"'); |
|
if($env{'form.hideparmsel'} ne 'hidden') { |
|
$r->print($parmselhiddenstyle); |
|
} |
} |
$r->print('>' |
|
.'<a href="javascript:parmsel_show()">' |
|
.&mt('Change Parameter Selection') |
|
.'</a>' |
|
.'</p>' |
|
); |
|
|
|
|
# ----- End Parameter Selection |
|
|
# Display Messages |
# Display Messages |
$r->print('<div>'.$message.'</div>'); |
$r->print('<div>'.$message.'</div>'); |
Line 2309 COURSECONTENTSCRIPT
|
Line 2328 COURSECONTENTSCRIPT
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'pie' => "Parameter in Effect", |
'pie' => "Parameter in Effect", |
'csv' => "Current Session Value", |
'csv' => "Current Session Value", |
'at' => 'at', |
|
'rl' => "Resource Level", |
'rl' => "Resource Level", |
'ic' => 'in Course', |
'ic' => 'in Course', |
'aut' => "Assessment URL and Title", |
'aut' => "Assessment URL and Title", |
Line 2325 COURSECONTENTSCRIPT
|
Line 2343 COURSECONTENTSCRIPT
|
); |
); |
$r->print(<<ENDTABLETWO); |
$r->print(<<ENDTABLETWO); |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname:$csudom)</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
<th colspan="1">$lt{'ic'}</th> |
<th colspan="1">$lt{'ic'}</th> |
|
|
Line 3014 sub date_interval_selector {
|
Line 3032 sub date_interval_selector {
|
my %select = ((map {$_ => $_} (0..$max)), |
my %select = ((map {$_ => $_} (0..$max)), |
'select_form_order' => [0..$max]); |
'select_form_order' => [0..$max]); |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
%select); |
\%select); |
$result .= ' '.&mt($name); |
$result .= ' '.&mt($name); |
} |
} |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
Line 3180 ENDOVER
|
Line 3198 ENDOVER
|
} |
} |
# Menu to select levels, etc |
# Menu to select levels, etc |
|
|
#$r->print('<table id="LC_parm_overview_scope"> |
|
# <tr><td class="LC_parm_overview_level_menu">'); |
|
$r->print('<div class="LC_Box">'); |
$r->print('<div class="LC_Box">'); |
#$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
#$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
#$r->print('<td class="LC_parm_overview_map_menu">'); |
|
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp); |
#$r->print('</td>'); |
|
} |
} |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
#$r->print('</td></tr></table>'); |
|
|
|
#$r->print('<table id="LC_parm_overview_controls"> |
|
# <tr><td class="LC_parm_overview_parm_selectors">'); |
|
$r->print('<div class="LC_Box">'); |
$r->print('<div class="LC_Box">'); |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
Line 3208 ENDOVER
|
Line 3219 ENDOVER
|
&parmboxes($r,\%allparms,\@pscat,\%keyorder); |
&parmboxes($r,\%allparms,\@pscat,\%keyorder); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
#$r->print('</td><td class="LC_parm_overview_restrictions">'. |
|
$r->print('<table>'. |
$r->print('<table>'. |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
Line 3505 sub parse_key {
|
Line 3515 sub parse_key {
|
} |
} |
|
|
|
|
|
|
sub extract_cloners { |
|
my ($clonelist,$allowclone) = @_; |
|
if ($clonelist =~ /,/) { |
|
@{$allowclone} = split(/,/,$clonelist); |
|
} else { |
|
$$allowclone[0] = $clonelist; |
|
} |
|
} |
|
|
|
sub check_cloners { |
|
my ($clonelist,$oldcloner) = @_; |
|
my ($clean_clonelist,%disallowed); |
|
my @allowclone = (); |
|
&extract_cloners($$clonelist,\@allowclone); |
|
foreach my $currclone (@allowclone) { |
|
if (!grep(/^\Q$currclone\E$/,@$oldcloner)) { |
|
if ($currclone eq '*') { |
|
$clean_clonelist .= $currclone.','; |
|
} else { |
|
my ($uname,$udom) = split(/:/,$currclone); |
|
if ($uname eq '*') { |
|
if ($udom =~ /^$match_domain$/) { |
|
if (!&Apache::lonnet::domain($udom)) { |
|
$disallowed{'domain'} .= $currclone.','; |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} else { |
|
$disallowed{'format'} .= $currclone.','; |
|
} |
|
} elsif ($currclone !~/^($match_username)\:($match_domain)$/) { |
|
$disallowed{'format'} .= $currclone.','; |
|
} else { |
|
if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
$disallowed{'newuser'} .= $currclone.','; |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} |
|
} |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} |
|
foreach my $key (keys(%disallowed)) { |
|
$disallowed{$key} =~ s/,$//; |
|
} |
|
if ($clean_clonelist) { |
|
$clean_clonelist =~ s/,$//; |
|
} |
|
$$clonelist = $clean_clonelist; |
|
return %disallowed; |
|
} |
|
|
|
sub change_clone { |
|
my ($clonelist,$oldcloner) = @_; |
|
my ($uname,$udom); |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $clone_crs = $cnum.':'.$cdom; |
|
|
|
if ($cnum && $cdom) { |
|
my @allowclone; |
|
&extract_cloners($clonelist,\@allowclone); |
|
foreach my $currclone (@allowclone) { |
|
if (!grep(/^$currclone$/,@$oldcloner)) { |
|
if ($currclone ne '*') { |
|
($uname,$udom) = split(/:/,$currclone); |
|
if ($uname && $udom && $uname ne '*') { |
|
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} eq '') { |
|
$currclonecrs{'cloneable'} = $clone_crs; |
|
} else { |
|
$currclonecrs{'cloneable'} .= ','.$clone_crs; |
|
} |
|
&Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
foreach my $oldclone (@$oldcloner) { |
|
if (!grep(/^\Q$oldclone\E$/,@allowclone)) { |
|
if ($oldclone ne '*') { |
|
($uname,$udom) = split(/:/,$oldclone); |
|
if ($uname && $udom && $uname ne '*' ) { |
|
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
my %newclonecrs = (); |
|
if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} =~ /,/) { |
|
my @currclonecrs = split/,/,$currclonecrs{'cloneable'}; |
|
foreach my $crs (@currclonecrs) { |
|
if ($crs ne $clone_crs) { |
|
$newclonecrs{'cloneable'} .= $crs.','; |
|
} |
|
} |
|
$newclonecrs{'cloneable'} =~ s/,$//; |
|
} else { |
|
$newclonecrs{'cloneable'} = ''; |
|
} |
|
&Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Parameter Manager'); |
return &Apache::loncommon::start_page('Parameter Manager'); |
} |
} |
Line 3649 ENDMAINFORMHEAD
|
Line 3542 ENDMAINFORMHEAD
|
my @menu = |
my @menu = |
( { categorytitle=>"Settings for this $crstype", |
( { categorytitle=>"Settings for this $crstype", |
items => [ |
items => [ |
{ linktext => "$crstype Configuration", |
|
url => '/adm/courseprefs?origin=params', |
|
permission => $parm_permission, |
|
linktitle => "Edit $lc_crstype configuration." , |
|
icon => 'preferences-desktop-remote-desktop.png' , |
|
#help => 'Course_Environment', |
|
}, |
|
{ linktext => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
permission => $parm_permission, |
permission => $parm_permission, |
linktitle => "Restrict metadata for this $lc_crstype." , |
linktitle => "Restrict metadata for this $lc_crstype." , |
icon =>'contact-new.png' , |
icon =>'contact-new.png' , |
}, |
}, |
{ linktext => "Manage $crstype Slots", |
|
url => '/adm/slotrequest?command=showslots', |
|
permission => $vgr, |
|
linktitle => "Manage slots for this $lc_crstype." , |
|
icon => 'format-justify-fill.png' , |
|
}, |
|
{ linktext => 'Reset Student Access Times', |
{ linktext => 'Reset Student Access Times', |
url => '/adm/helper/resettimes.helper', |
url => '/adm/helper/resettimes.helper', |
permission => $mgr, |
permission => $mgr, |
Line 3717 ENDMAINFORMHEAD
|
Line 3597 ENDMAINFORMHEAD
|
url => '/adm/parmset?action=parameterchangelog', |
url => '/adm/parmset?action=parameterchangelog', |
permission => $parm_permission, |
permission => $parm_permission, |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
icon => 'emblem-system.png' , |
icon => 'document-properties.png', |
}]} |
}]} |
); |
); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
Line 4627 sub handler {
|
Line 4507 sub handler {
|
&date_shift_one($r); |
&date_shift_one($r); |
} elsif ($env{'form.action'} eq 'dateshift2') { |
} elsif ($env{'form.action'} eq 'dateshift2') { |
&date_shift_two($r); |
&date_shift_two($r); |
} elsif ($env{'form.action'} eq 'categorizecourse') { |
|
&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 |