version 1.49.2.18, 2015/05/22 16:39:43
|
version 1.49.2.26, 2021/12/12 21:52:15
|
Line 137 whether Domain coordinators who are curr
|
Line 137 whether Domain coordinators who are curr
|
advanced course user .db file for a course are to be hidden (e.g., |
advanced course user .db file for a course are to be hidden (e.g., |
in syllabus, or from course user lists). |
in syllabus, or from course user lists). |
|
|
Inputs: $cdom,$item,$settings,$crstype |
Inputs: $cdom,$item,$settings,$crstype,$noedit |
where $cdom is course domain, item is nothideprivileged, $settings is |
where $cdom is course domain, item is nothideprivileged, $settings is |
HASH ref of the current values for nothideprivileged, $crstype is |
HASH ref of the current values for nothideprivileged, $crstype is |
course type (Course or Community). |
course type (Course or Community). |
Line 235 sub handler {
|
Line 235 sub handler {
|
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my ($cnum,$cdom,$chome) = &get_course($cid); |
my ($cnum,$cdom,$chome) = &get_course($cid); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $parm_permission = &Apache::lonnet::allowed('opa',$cid); |
my ($parm_permission,$allowed) = &get_permission($cid); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
if ($parm_permission && $navmap) { |
if ($allowed && $navmap) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
} else { |
} else { |
Line 344 sub handler {
|
Line 344 sub handler {
|
$phase = $env{'form.phase'}; |
$phase = $env{'form.phase'}; |
} |
} |
|
|
if ($phase eq 'categorizecourse') { |
if (($phase eq 'categorizecourse') && ($parm_permission->{'categorizecourse'})) { |
&assign_course_categories($r,$crstype); |
&assign_course_categories($r,$crstype); |
return OK; |
return OK; |
} |
} |
|
|
if ($phase eq 'releaseinfo') { |
if (($phase eq 'releaseinfo') && ($parm_permission->{'releaseinfo'})) { |
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
if ($loncaparev) { |
if ($loncaparev) { |
if (&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype)) { |
if (&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype)) { |
Line 375 sub handler {
|
Line 375 sub handler {
|
help => 'Course_Prefs_General', |
help => 'Course_Prefs_General', |
ordered => ['owner','co-owners','loncaparev','description', |
ordered => ['owner','co-owners','loncaparev','description', |
'clonedfrom','courseid','uniquecode','categories', |
'clonedfrom','courseid','uniquecode','categories', |
'hidefromcat','externalsyllabus','cloners','url', |
'hidefromcat','syllabus','cloners','url', |
'rolenames'], |
'rolenames'], |
itemtext => { |
itemtext => { |
'owner' => $lt{'ownr'}, |
'owner' => $lt{'ownr'}, |
Line 386 sub handler {
|
Line 386 sub handler {
|
'categories' => $lt{'catg'}, |
'categories' => $lt{'catg'}, |
'hidefromcat' => $lt{'excc'}, |
'hidefromcat' => $lt{'excc'}, |
'cloners' => $lt{'clon'}, |
'cloners' => $lt{'clon'}, |
'externalsyllabus' => 'Syllabus status', |
'syllabus' => 'Syllabus status', |
'url' => 'Top Level Map', |
'url' => 'Top Level Map', |
'rolenames' => $lt{'rept'}, |
'rolenames' => $lt{'rept'}, |
'loncaparev' => $lt{'lcrv'}, |
'loncaparev' => $lt{'lcrv'}, |
Line 535 sub handler {
|
Line 535 sub handler {
|
}], |
}], |
}, |
}, |
); |
); |
if ($phase eq 'process') { |
if (($phase eq 'process') && ($parm_permission->{'process'})) { |
my @allitems = &get_allitems(%prefs); |
my @allitems = &get_allitems(%prefs); |
&Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context, |
&Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context, |
\@prefs_order,\%prefs,\%values, |
\@prefs_order,\%prefs,\%values, |
$cnum,undef,\@allitems,'coursepref'); |
$cnum,undef,\@allitems, |
} elsif ($phase eq 'display') { |
'coursepref',$parm_permission); |
|
} elsif (($phase eq 'display') && ($parm_permission->{'display'})) { |
my $jscript = &get_jscript($cid,$cdom,$phase,$crstype,\%values); |
my $jscript = &get_jscript($cid,$cdom,$phase,$crstype,\%values); |
my @allitems = &get_allitems(%prefs); |
my @allitems = &get_allitems(%prefs); |
&Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context, |
&Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context, |
\@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref'); |
\@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype, |
|
'coursepref',$parm_permission); |
} else { |
} else { |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
\@prefs_order,\%prefs,'coursepref'); |
\@prefs_order,\%prefs, |
|
'coursepref',$parm_permission); |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
|
sub get_permission { |
|
my ($cid) = @_; |
|
my %permission; |
|
my $allowed = 0; |
|
return (\%permission,$allowed) unless ($cid); |
|
if (&Apache::lonnet::allowed('opa',$cid)) { |
|
%permission= ( |
|
'pickactions' => 1, |
|
'categorizecourse' => 1, |
|
'releaseinfo' => 1, |
|
'process' => 1, |
|
'display' => 1, |
|
); |
|
} elsif (&Apache::lonnet::allowed('vpa',$env{'request.course.id'})) { |
|
%permission = ( |
|
'pickactions' => 1, |
|
'releaseinfo' => 1, |
|
'display' => 1, |
|
); |
|
} |
|
foreach my $perm (values(%permission)) { |
|
if ($perm) { $allowed=1; last; } |
|
} |
|
return (\%permission,$allowed); |
|
} |
|
|
sub get_allitems { |
sub get_allitems { |
my (%prefs) = @_; |
my (%prefs) = @_; |
my @allitems; |
my @allitems; |
Line 569 sub get_allitems {
|
Line 598 sub get_allitems {
|
} |
} |
|
|
sub print_config_box { |
sub print_config_box { |
my ($r,$cdom,$phase,$action,$item,$settings,$allitems,$crstype) = @_; |
my ($r,$cdom,$phase,$action,$item,$settings,$allitems,$crstype,$parm_permission) = @_; |
my $ordered = $item->{'ordered'}; |
my $ordered = $item->{'ordered'}; |
my $itemtext = $item->{'itemtext'}; |
my $itemtext = $item->{'itemtext'}; |
|
my $noedit; |
|
if (ref($parm_permission) eq 'HASH') { |
|
unless ($parm_permission->{'process'}) { |
|
$noedit = 1; |
|
} |
|
} |
my $rowtotal = 0; |
my $rowtotal = 0; |
my $output = |
my $output = |
'<table class="LC_nested_outer"> |
'<table class="LC_nested_outer"> |
Line 606 sub print_config_box {
|
Line 641 sub print_config_box {
|
} |
} |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'feedback') { |
if ($action eq 'feedback') { |
$output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'classlists') { |
} elsif ($action eq 'classlists') { |
$output .= &print_classlists('top',$cdom,$settings,$itemtext,\$rowtotal,$crstype); |
$output .= &print_classlists('top',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 629 sub print_config_box {
|
Line 664 sub print_config_box {
|
$output .= &mt($item->{'header'}->[1]->{'col2'}).'</td> |
$output .= &mt($item->{'header'}->[1]->{'col2'}).'</td> |
</tr>'; |
</tr>'; |
if ($action eq 'classlists') { |
if ($action eq 'classlists') { |
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). |
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit). |
' |
' |
</table> |
</table> |
</td> |
</td> |
Line 668 sub print_config_box {
|
Line 703 sub print_config_box {
|
} |
} |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'courseinfo') { |
if ($action eq 'courseinfo') { |
$output .= &print_courseinfo($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_courseinfo($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'localization') { |
} elsif ($action eq 'localization') { |
$output .= &print_localization($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_localization($cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'feedback') { |
} elsif ($action eq 'feedback') { |
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'discussion') { |
} elsif ($action eq 'discussion') { |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif (($action eq 'classlists') || ($action eq 'viewableroster')) { |
} elsif (($action eq 'classlists') || ($action eq 'viewableroster')) { |
$output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype); |
$output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'appearance') { |
} elsif ($action eq 'appearance') { |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'grading') { |
} elsif ($action eq 'grading') { |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'printouts') { |
} elsif ($action eq 'printouts') { |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'spreadsheet') { |
} elsif ($action eq 'spreadsheet') { |
$output .= &print_spreadsheet($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_spreadsheet($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'bridgetasks') { |
} elsif ($action eq 'bridgetasks') { |
$output .= &print_bridgetasks($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_bridgetasks($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'other') { |
} elsif ($action eq 'other') { |
$output .= &print_other($cdom,$settings,$allitems,\$rowtotal,$crstype); |
$output .= &print_other($cdom,$settings,$allitems,\$rowtotal,$crstype,$noedit); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 728 sub process_changes {
|
Line 763 sub process_changes {
|
(!$can_categorize)); |
(!$can_categorize)); |
next if (($entry eq 'loncaparev') || |
next if (($entry eq 'loncaparev') || |
($entry eq 'owner') || |
($entry eq 'owner') || |
($entry eq 'clonedfrom')); |
($entry eq 'clonedfrom') || |
|
($entry eq 'syllabus')); |
push(@ordered,$entry); |
push(@ordered,$entry); |
} |
} |
} elsif ($action eq 'classlists') { |
} elsif ($action eq 'classlists') { |
Line 931 sub process_changes {
|
Line 967 sub process_changes {
|
my $udom = $env{'user.domain'}; |
my $udom = $env{'user.domain'}; |
my $pendingcoowners = $values->{'internal.pendingco-owners'}; |
my $pendingcoowners = $values->{'internal.pendingco-owners'}; |
my @pendingcoown = split(',',$pendingcoowners); |
my @pendingcoown = split(',',$pendingcoowners); |
if ($env{'form.pending_coowoner'}) { |
if ($env{'form.pending_coowner'}) { |
foreach my $item (@pendingcoown) { |
foreach my $item (@pendingcoown) { |
unless ($item eq $uname.':'.$udom) { |
unless ($item eq $uname.':'.$udom) { |
push(@newpending,$item); |
push(@newpending,$item); |
} |
} |
} |
} |
@newcoown = @currcoown; |
@newcoown = @currcoown; |
if ($env{'form.pending_coowoner'} eq 'accept') { |
if ($env{'form.pending_coowner'} eq 'accept') { |
unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) { |
unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) { |
push(@newcoown,$uname.':'.$udom); |
push(@newcoown,$uname.':'.$udom); |
} |
} |
} |
} |
} elsif ($env{'form.remove_coowoner'}) { |
} elsif ($env{'form.remove_coowner'}) { |
foreach my $item (@currcoown) { |
foreach my $item (@currcoown) { |
unless ($item eq $uname.':'.$udom) { |
unless ($item eq $uname.':'.$udom) { |
push(@newcoown,$item); |
push(@newcoown,$item); |
Line 1471 sub store_changes {
|
Line 1507 sub store_changes {
|
} |
} |
} |
} |
unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) { |
unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) { |
if ($env{'form.pending_coowoner'} eq 'accept') { |
if ($env{'form.pending_coowner'} eq 'accept') { |
$displayval = &mt('on'); |
$displayval = &mt('on'); |
} elsif ($env{'form.pending_coowoner'} eq 'decline') { |
} elsif ($env{'form.pending_coowner'} eq 'decline') { |
$displayval = ''; |
$displayval = ''; |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>'; |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>'; |
} elsif ($env{'form.remove_coowoner'}) { |
} elsif ($env{'form.remove_coowner'}) { |
$displayval = &mt('off'); |
$displayval = &mt('off'); |
} |
} |
if ($displayval) { |
if ($displayval) { |
Line 1934 ENDSCRIPT
|
Line 1970 ENDSCRIPT
|
|
|
|
|
sub print_courseinfo { |
sub print_courseinfo { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
my ($cathash,$categoriesform,$autocoowner,$clonedefaults); |
my ($cathash,$categoriesform,$autocoowner,$clonedefaults,$disabled); |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my %domconf = |
my %domconf = |
&Apache::lonnet::get_dom('configuration', |
&Apache::lonnet::get_dom('configuration', |
['coursecategories','autoenroll','coursedefaults'],$cdom); |
['coursecategories','autoenroll','coursedefaults'],$cdom); |
Line 1947 sub print_courseinfo {
|
Line 1986 sub print_courseinfo {
|
if (ref($cathash) eq 'HASH') { |
if (ref($cathash) eq 'HASH') { |
$categoriesform = |
$categoriesform = |
&Apache::loncommon::assign_categories_table($cathash, |
&Apache::loncommon::assign_categories_table($cathash, |
$settings->{'categories'},$crstype)."\n"; |
$settings->{'categories'},$crstype,$disabled)."\n"; |
} |
} |
} |
} |
if (ref($domconf{'autoenroll'}) eq 'HASH') { |
if (ref($domconf{'autoenroll'}) eq 'HASH') { |
Line 2014 sub print_courseinfo {
|
Line 2053 sub print_courseinfo {
|
} else { |
} else { |
$replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank'); |
$replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank'); |
} |
} |
|
my ($editmap,$editsyllabus); |
|
unless ($noedit) { |
|
$editmap = (' 'x2). |
|
'<a href="javascript:openbrowser'. |
|
"('display','url','sequence')\">". |
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
|
&mt('Modification may make assessment data inaccessible!'). |
|
'</span>'; |
|
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
|
'</a>'); |
|
} |
my %items = ( |
my %items = ( |
'url' => { |
'url' => { |
text => '<b>'.&mt($itemtext->{'url'}).'</b>'.(' 'x2). |
text => '<b>'.&mt($itemtext->{'url'}).'</b>'.$editmap, |
'<a href="javascript:openbrowser'. |
|
"('display','url','sequence')\">". |
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
|
&mt('Modification may make assessment data inaccessible!'). |
|
'</span>', |
|
input => 'textbox', |
input => 'textbox', |
size => '55', |
size => '55', |
advanced => 1 |
advanced => 1 |
Line 2063 sub print_courseinfo {
|
Line 2108 sub print_courseinfo {
|
size => '20', |
size => '20', |
advanced => 1 |
advanced => 1 |
}, |
}, |
'externalsyllabus' => { |
'syllabus' => { |
text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'syllabus'}).'</b><br />'. |
&mt('(Syllabus type in use)').(' ' x2). |
&mt('(Syllabus type in use)').(' ' x2). |
&mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
$editsyllabus, |
'</a>'), |
|
}, |
}, |
'hidefromcat' => { |
'hidefromcat' => { |
text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'. |
Line 2108 sub print_courseinfo {
|
Line 2152 sub print_courseinfo {
|
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
} |
} |
if ($items{$item}{input} eq 'radio') { |
if ($items{$item}{input} eq 'radio') { |
$datatable .= &yesno_radio($item,$settings); |
$datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit); |
} elsif ($item eq 'cloners') { |
} elsif ($item eq 'cloners') { |
my $includeempty = 1; |
my $includeempty = 1; |
my $num = 0; |
my $num = 0; |
Line 2122 sub print_courseinfo {
|
Line 2166 sub print_courseinfo {
|
$datatable .= ' checked="checked" '; |
$datatable .= ' checked="checked" '; |
} |
} |
$datatable .= 'onchange="javascript:update_cloners('. |
$datatable .= 'onchange="javascript:update_cloners('. |
"'cloners_all'".');" />'.&mt('Yes').'</label>'. |
"'cloners_all'".');"'.$disabled.' />'.&mt('Yes').'</label>'. |
(' 'x2).'<label>'. |
(' 'x2).'<label>'. |
'<input type="radio" name="cloners_all" value="0" '; |
'<input type="radio" name="cloners_all" value="0" '; |
if ($settings->{$item} ne '*') { |
if ($settings->{$item} ne '*') { |
$datatable .= ' checked="checked" '; |
$datatable .= ' checked="checked" '; |
} |
} |
$datatable .= ' onchange="javascript:update_cloners('. |
$datatable .= ' onchange="javascript:update_cloners('. |
"'cloners_all'".');" />'.&mt('No').'</label></td>'. |
"'cloners_all'".');"'.$disabled.' />'.&mt('No').'</label></td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
'<table><tr><td align="left"><b>'.&mt('Or'). |
'<table><tr><td align="left"><b>'.&mt('Or'). |
Line 2137 sub print_courseinfo {
|
Line 2181 sub print_courseinfo {
|
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
my @cloners; |
my @cloners; |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
my $default; |
unless ($noedit) { |
if ($currcanclone eq 'domain') { |
my $default; |
$default = '0'; |
if ($currcanclone eq 'domain') { |
} |
$default = '0'; |
$datatable .= &new_cloners_dom_row($cdom,'0',$default); |
} |
|
$datatable .= &new_cloners_dom_row($cdom,'0',$default); |
|
} |
} elsif ($settings->{$item} ne '*') { |
} elsif ($settings->{$item} ne '*') { |
my @entries = split(/,/,$settings->{$item}); |
my @entries = split(/,/,$settings->{$item}); |
if (@entries > 0) { |
if (@entries > 0) { |
Line 2162 sub print_courseinfo {
|
Line 2208 sub print_courseinfo {
|
'</b><input type="hidden" name="cloners_dom_'.$num. |
'</b><input type="hidden" name="cloners_dom_'.$num. |
'" value="'.$udom.'" /></span><br />'. |
'" value="'.$udom.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="cloners_delete" value="'.$num.'" onchange="javascript:update_cloners('."'cloners_delete','$num'".');" />'. |
'name="cloners_delete" value="'.$num.'" onchange="javascript:update_cloners('."'cloners_delete','$num'".');"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
Line 2185 sub print_courseinfo {
|
Line 2231 sub print_courseinfo {
|
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
$add_domtitle.'</span><br />'. |
$add_domtitle.'</span><br />'. |
&Apache::loncommon::select_dom_form('','cloners_newdom', |
&Apache::loncommon::select_dom_form('','cloners_newdom', |
$includeempty). |
$includeempty,undef,undef, |
|
undef,undef,$noedit). |
'<input type="hidden" name="cloners_total" value="'.$num.'" />'. |
'<input type="hidden" name="cloners_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
Line 2197 sub print_courseinfo {
|
Line 2244 sub print_courseinfo {
|
&mt('Specific users').' (<tt>'. |
&mt('Specific users').' (<tt>'. |
&mt('user:domain,user:domain').'</tt>)<br />'. |
&mt('user:domain,user:domain').'</tt>)<br />'. |
&Apache::lonhtmlcommon::textbox($item,$cloners_str, |
&Apache::lonhtmlcommon::textbox($item,$cloners_str, |
$items{$item}{'size'}). |
$items{$item}{'size'},$disabled). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
if (@code_order > 0) { |
if (@code_order > 0) { |
Line 2221 sub print_courseinfo {
|
Line 2268 sub print_courseinfo {
|
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Cloning by official course(s) based on course category').(' 'x2). |
&mt('Cloning by official course(s) based on course category').(' 'x2). |
'<label>'. |
'<label>'. |
'<input type="radio" name="cloners_instcode" value="1" onclick="toggleCloners(this);"'.$checkedon.' />'.&mt('Yes').'</label>'. |
'<input type="radio" name="cloners_instcode" value="1" onclick="toggleCloners(this);"'.$checkedon.$disabled.' />'.&mt('Yes').'</label>'. |
(' '). |
(' '). |
'<label>'. |
'<label>'. |
'<input type="radio" name="cloners_instcode" value="0" onclick="toggleCloners(this);"'.$checkedoff.' />'.&mt('No').'</label>'. |
'<input type="radio" name="cloners_instcode" value="0" onclick="toggleCloners(this);"'.$checkedoff.$disabled.' />'.&mt('No').'</label>'. |
&Apache::courseclassifier::build_instcode_selectors($numtitles, |
&Apache::courseclassifier::build_instcode_selectors($numtitles, |
$lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order, |
$lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order, |
$showncodes,'LC_cloners_instcodes','LC_cloners_instcode'). |
$showncodes,'LC_cloners_instcodes','LC_cloners_instcode',$noedit). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
} |
} |
Line 2248 sub print_courseinfo {
|
Line 2295 sub print_courseinfo {
|
'</span></td><td align="left">'. |
'</span></td><td align="left">'. |
&Apache::lonhtmlcommon::textbox('rolenames_'.$role, |
&Apache::lonhtmlcommon::textbox('rolenames_'.$role, |
$settings->{$role.'.plaintext'}, |
$settings->{$role.'.plaintext'}, |
$items{$item}{size}).'</td>'. |
$items{$item}{size},$disabled).'</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table().'</td>'; |
$datatable .= &Apache::loncommon::end_data_table().'</td>'; |
} elsif ($item eq 'categories') { |
} elsif ($item eq 'categories') { |
my $launcher = 'onfocus="this.blur();javascript:catsbrowser();"'; |
my $launcher; |
|
if ($noedit) { |
|
$launcher = $disabled; |
|
} else { |
|
$launcher = 'onfocus="this.blur();javascript:catsbrowser();"'; |
|
} |
$datatable .= '<input type="hidden" name="categories" value="'.$settings->{$item}.'" />'. |
$datatable .= '<input type="hidden" name="categories" value="'.$settings->{$item}.'" />'. |
&Apache::lonhtmlcommon::textbox($item.'_display',$settings->{$item}, |
&Apache::lonhtmlcommon::textbox($item.'_display',$settings->{$item}, |
$items{$item}{size},$launcher); |
$items{$item}{size},$launcher); |
Line 2293 sub print_courseinfo {
|
Line 2345 sub print_courseinfo {
|
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
$datatable .= &show_autocoowners(@currcoown); |
$datatable .= &show_autocoowners(@currcoown); |
} else { |
} else { |
$datatable .= &coowner_invitations($cnum,$cdom,@currcoown); |
$datatable .= &coowner_invitations($cnum,$cdom,\@currcoown,$noedit); |
} |
} |
} else { |
} else { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
$datatable .= &show_autocoowners(@currcoown); |
$datatable .= &show_autocoowners(@currcoown); |
} else { |
} else { |
$datatable .= &manage_coownership($cnum,$cdom,@currcoown); |
$datatable .= &manage_coownership($cnum,$cdom,\@currcoown,$noedit); |
} |
} |
} |
} |
} elsif ($item eq 'externalsyllabus') { |
} elsif ($item eq 'syllabus') { |
my $external = $env{'course.'.$env{'request.course.id'}.'.externalsyllabus'}; |
my $external = $env{'course.'.$env{'request.course.id'}.'.externalsyllabus'}; |
my $uploaded = $env{'course.'.$env{'request.course.id'}.'.uploadedsyllabus'}; |
my $uploaded = $env{'course.'.$env{'request.course.id'}.'.uploadedsyllabus'}; |
my $minimal = $env{'course.'.$env{'request.course.id'}.'.minimalsyllabus'}; |
my $minimal = $env{'course.'.$env{'request.course.id'}.'.minimalsyllabus'}; |
Line 2343 sub print_courseinfo {
|
Line 2395 sub print_courseinfo {
|
} |
} |
$datatable .= $showreqd; |
$datatable .= $showreqd; |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size}); |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size},$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 2430 sub assign_course_categories {
|
Line 2482 sub assign_course_categories {
|
} else { |
} else { |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
} |
} |
|
&js_escape(\$alert); |
$catwin_js = <<ENDSCRIPT; |
$catwin_js = <<ENDSCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
|
Line 3025 sub show_contents_view {
|
Line 3078 sub show_contents_view {
|
sub releases_by_map { |
sub releases_by_map { |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
|
my $newrow = 0; |
if (ref($bymap->{$url}) eq 'HASH') { |
if (ref($bymap->{$url}) eq 'HASH') { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::continue_data_table_row()); |
|
} |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
$r->print('<table border="0">'); |
$r->print('<table border="0">'); |
Line 3048 sub releases_by_map {
|
Line 3106 sub releases_by_map {
|
$r->print('</table>'); |
$r->print('</table>'); |
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
|
$newrow = 1; |
} |
} |
} else { |
} else { |
$r->print('<td colspan="2"> </td>'); |
$r->print('<td colspan="2"> </td>'); |
Line 3104 sub show_autocoowners {
|
Line 3163 sub show_autocoowners {
|
} |
} |
|
|
sub coowner_invitations { |
sub coowner_invitations { |
my ($cnum,$cdom,@currcoown) = @_; |
my ($cnum,$cdom,$currcoownref,$noedit) = @_; |
my ($output,@pendingcoown,@othercoords); |
my ($output,@pendingcoown,@othercoords,@currcoown); |
my $pendingcoowners = |
my $pendingcoowners = |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
if ($pendingcoowners) { |
if ($pendingcoowners) { |
@pendingcoown = split(',',$pendingcoowners); |
@pendingcoown = split(',',$pendingcoowners); |
} |
} |
|
if (ref($currcoownref) eq 'ARRAY') { |
|
@currcoown == @{$currcoownref}; |
|
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my $ccrole = 'cc'; |
my $ccrole = 'cc'; |
my %ccroles = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,undef,[$ccrole]); |
my %ccroles = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,undef,[$ccrole]); |
foreach my $key (sort(keys(%ccroles))) { |
foreach my $key (sort(keys(%ccroles))) { |
Line 3128 sub coowner_invitations {
|
Line 3194 sub coowner_invitations {
|
'<td><i>'.&mt('Current co-owners').'</i></td><td>'; |
'<td><i>'.&mt('Current co-owners').'</i></td><td>'; |
foreach my $person (@currcoown) { |
foreach my $person (@currcoown) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="coowners" checked="checked" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="coowners" checked="checked" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 3138 sub coowner_invitations {
|
Line 3204 sub coowner_invitations {
|
'<td><i>'.&mt('Invited as co-owners [_1](agreement pending)','<br />').'</i></td><td>'; |
'<td><i>'.&mt('Invited as co-owners [_1](agreement pending)','<br />').'</i></td><td>'; |
foreach my $person (@pendingcoown) { |
foreach my $person (@pendingcoown) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="pendingcoowners" checked="checked" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="pendingcoowners" checked="checked" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 3148 sub coowner_invitations {
|
Line 3214 sub coowner_invitations {
|
'<td><i>'.&mt('Invite other Coordinators [_1]to become co-owners','<br />').'</i></td><td>'; |
'<td><i>'.&mt('Invite other Coordinators [_1]to become co-owners','<br />').'</i></td><td>'; |
foreach my $person (@othercoords) { |
foreach my $person (@othercoords) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="invitecoowners" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="invitecoowners" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 3161 sub coowner_invitations {
|
Line 3227 sub coowner_invitations {
|
} |
} |
|
|
sub manage_coownership { |
sub manage_coownership { |
my ($cnum,$cdom,@currcoown) = @_; |
my ($cnum,$cdom,$currcoownref,$noedit) = @_; |
my (@pendingcoown); |
my (@pendingcoown,@currcoown); |
my $pendingcoowners = |
my $pendingcoowners = |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
if ($pendingcoowners) { |
if ($pendingcoowners) { |
@pendingcoown = split(',',$pendingcoowners); |
@pendingcoown = split(',',$pendingcoowners); |
} |
} |
|
if (ref($currcoownref) eq 'ARRAY') { |
|
@currcoown == @{$currcoownref}; |
|
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my ($is_coowner,$is_pending,$output); |
my ($is_coowner,$is_pending,$output); |
my $uname = $env{'user.name'}; |
my $uname = $env{'user.name'}; |
my $udom = $env{'user.domain'}; |
my $udom = $env{'user.domain'}; |
Line 3197 sub manage_coownership {
|
Line 3270 sub manage_coownership {
|
} |
} |
$output .= '<span class="LC_nobreak">'; |
$output .= '<span class="LC_nobreak">'; |
if ($is_coowner) { |
if ($is_coowner) { |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowoner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
} else { |
} else { |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowoner" value="accept" />'.&mt('Accept?').'</label>'.(' 'x2). |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.(' 'x2). |
'<label><input type="radio" name=pending_coowoner" value="decline" />'.&mt('Decline?').'</label>'; |
'<label><input type="radio" name=pending_coowner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>'; |
} |
} |
$output .= '</span>'; |
$output .= '</span>'; |
if (@currcoown) { |
if (@currcoown) { |
Line 3214 sub manage_coownership {
|
Line 3287 sub manage_coownership {
|
} |
} |
|
|
sub print_localization { |
sub print_localization { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3233 sub print_localization {
|
Line 3306 sub print_localization {
|
input => 'selectbox', |
input => 'selectbox', |
}, |
}, |
); |
); |
my $datatable; |
my ($datatable,$disabled); |
my $count = 0; |
my $count = 0; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $item (@{$ordered}) { |
foreach my $item (@{$ordered}) { |
$count ++; |
$count ++; |
my $colspan; |
my $colspan; |
Line 3247 sub print_localization {
|
Line 3323 sub print_localization {
|
my $timezone = &Apache::lonlocal::gettimezone(); |
my $timezone = &Apache::lonlocal::gettimezone(); |
$datatable .= |
$datatable .= |
&Apache::loncommon::select_timezone($item,$timezone,undef, |
&Apache::loncommon::select_timezone($item,$timezone,undef, |
$includeempty); |
$includeempty,$disabled); |
} elsif ($item eq 'datelocale') { |
} elsif ($item eq 'datelocale') { |
my $includeempty = 1; |
my $includeempty = 1; |
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
Line 3257 sub print_localization {
|
Line 3333 sub print_localization {
|
} |
} |
$datatable .= |
$datatable .= |
&Apache::loncommon::select_datelocale($item,$currdatelocale, |
&Apache::loncommon::select_datelocale($item,$currdatelocale, |
undef,$includeempty); |
undef,$includeempty,$disabled); |
} else { |
} else { |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
$datatable .= '</td><td align="right">'. |
unless ($noedit) { |
&Apache::loncommon::select_language('languages_0','',1); |
$datatable .= '</td><td align="right">'. |
|
&Apache::loncommon::select_language('languages_0','',1); |
|
} |
} else { |
} else { |
my $num = 0; |
my $num = 0; |
my @languages = split(/\s*[,;:]\s*/,$settings->{$item}); |
my @languages = split(/\s*[,;:]\s*/,$settings->{$item}); |
Line 3281 sub print_localization {
|
Line 3359 sub print_localization {
|
'</b><input type="hidden" name="languages_'.$num. |
'</b><input type="hidden" name="languages_'.$num. |
'" value="'.$lang.'" /></span><br />'. |
'" value="'.$lang.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="languages_delete" value="'.$num.'" />'. |
'name="languages_delete" value="'.$num.'"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
} |
} |
} |
} |
$datatable .= &Apache::loncommon::start_data_table_row(). |
unless ($noedit) { |
|
$datatable .= |
|
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional language:'). '</span><br />'. |
&mt('Additional language:'). '</span><br />'. |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table().'<br />'; |
} |
|
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
} |
} |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 3314 sub get_lang_choices {
|
Line 3395 sub get_lang_choices {
|
} |
} |
|
|
sub print_feedback { |
sub print_feedback { |
my ($position,$cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($position,$cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3349 sub print_feedback {
|
Line 3430 sub print_feedback {
|
del => 'Delete?', |
del => 'Delete?', |
sec => 'Sections:', |
sec => 'Sections:', |
); |
); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $item (@{$ordered}) { |
foreach my $item (@{$ordered}) { |
$count ++; |
$count ++; |
if ($position eq 'top') { |
if ($position eq 'top') { |
Line 3361 sub print_feedback {
|
Line 3445 sub print_feedback {
|
my $includeempty = 0; |
my $includeempty = 0; |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,\@sections, |
&user_table($cdom,$item,\@sections, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$settings->{$item.'.text'},$items{$item}{size}); |
$settings->{$item.'.text'},$items{$item}{size},$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 3373 sub print_feedback {
|
Line 3457 sub print_feedback {
|
} |
} |
|
|
sub user_table { |
sub user_table { |
my ($cdom,$item,$sections,$currvalue,$lt) = @_; |
my ($cdom,$item,$sections,$currvalue,$lt,$noedit) = @_; |
my $output; |
my $output; |
if ($currvalue eq '') { |
if ($currvalue eq '') { |
$output .= &select_recipient($item,'0',$cdom,$sections); |
unless ($noedit) { |
|
$output .= &select_recipient($item,'0',$cdom,$sections); |
|
} |
} else { |
} else { |
my $num = 0; |
my $num = 0; |
my @curr = split(/,/,$currvalue); |
my @curr = split(/,/,$currvalue); |
$output .= '<table class="LC_data_table">'; |
$output .= '<table class="LC_data_table">'; |
my ($currusers); |
my ($currusers); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $val (@curr) { |
foreach my $val (@curr) { |
next if ($val eq ''); |
next if ($val eq ''); |
my ($uname,$udom,$seclist) = ($val =~ /^($match_username):($match_domain)(\(?[^\)]*\)?)$/); |
my ($uname,$udom,$seclist) = ($val =~ /^($match_username):($match_domain)(\(?[^\)]*\)?)$/); |
Line 3393 sub user_table {
|
Line 3483 sub user_table {
|
$currusers .= '<tr>'. |
$currusers .= '<tr>'. |
'<td valign="top"><span class="LC_nobreak">'. |
'<td valign="top"><span class="LC_nobreak">'. |
'<label><input type="checkbox" '. |
'<label><input type="checkbox" '. |
'name="'.$item.'_delete" value="'.$num.'" />'. |
'name="'.$item.'_delete" value="'.$num.'"'.$disabled.' />'. |
$lt->{'del'}.'</label>'. |
$lt->{'del'}.'</label>'. |
'<input type="hidden" name="'.$item.'_user_'. |
'<input type="hidden" name="'.$item.'_user_'. |
$num.'" value="'.$uname.':'.$udom.'" />'.(' 'x2). |
$num.'" value="'.$uname.':'.$udom.'" />'.(' 'x2). |
Line 3404 sub user_table {
|
Line 3494 sub user_table {
|
if (@{$sections}) { |
if (@{$sections}) { |
$currusers.= (' 'x3).$lt->{'sec'}.' '. |
$currusers.= (' 'x3).$lt->{'sec'}.' '. |
&select_sections($item,$num,$sections, |
&select_sections($item,$num,$sections, |
\@selsec); |
\@selsec,$noedit); |
} |
} |
} |
} |
$currusers .= '</span></td></tr>'; |
$currusers .= '</span></td></tr>'; |
Line 3422 sub user_table {
|
Line 3512 sub user_table {
|
'<table>'.$currusers.'</table></td>'. |
'<table>'.$currusers.'</table></td>'. |
'</tr>'; |
'</tr>'; |
} |
} |
$output .= '<tr>'. |
unless ($noedit) { |
|
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak"><i>'. |
'<td align="left"><span class="LC_nobreak"><i>'. |
$lt->{'add'}.'</i></span><br />'. |
$lt->{'add'}.'</i></span><br />'. |
&select_recipient($item,$num,$cdom,$sections). |
&select_recipient($item,$num,$cdom,$sections). |
'<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'. |
'<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'. |
'</td></tr></table>'; |
'</td></tr>'; |
|
} |
|
$output .= '</table>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 3437 sub select_recipient {
|
Line 3531 sub select_recipient {
|
my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty); |
my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty); |
my $selectlink = |
my $selectlink = |
&Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num, |
&Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num, |
$item.'_udom_'.$num,1); |
$item.'_udom_'.$num,'only'); |
my $output = |
my $output = |
'<table><tr><td align="center">'.&mt('Username').'<br />'. |
'<table><tr><td align="center">'.&mt('Username').'<br />'. |
'<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'. |
'<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'. |
Line 3454 sub select_recipient {
|
Line 3548 sub select_recipient {
|
} |
} |
|
|
sub select_sections { |
sub select_sections { |
my ($item,$num,$sections,$selected) = @_; |
my ($item,$num,$sections,$selected,$noedit) = @_; |
my ($output,@currsecs,$allsec); |
my ($output,@currsecs,$allsec,$disabled); |
if (ref($selected) eq 'ARRAY') { |
if (ref($selected) eq 'ARRAY') { |
@currsecs = @{$selected}; |
@currsecs = @{$selected}; |
} |
} |
if (!@currsecs) { |
if (!@currsecs) { |
$allsec = ' selected="selected"'; |
$allsec = ' selected="selected"'; |
} |
} |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (ref($sections) eq 'ARRAY') { |
if (ref($sections) eq 'ARRAY') { |
if (@{$sections}) { |
if (@{$sections}) { |
my $mult; |
my $mult; |
Line 3471 sub select_sections {
|
Line 3568 sub select_sections {
|
$mult .= ' size="4"'; |
$mult .= ' size="4"'; |
} |
} |
} |
} |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.'>'. |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.$disabled.'>'. |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
my $is_sel; |
my $is_sel; |
Line 3487 sub select_sections {
|
Line 3584 sub select_sections {
|
} |
} |
|
|
sub print_discussion { |
sub print_discussion { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3553 sub print_discussion {
|
Line 3650 sub print_discussion {
|
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
if ($item eq 'plc.roles.denied') { |
if ($item eq 'plc.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'</table>'; |
'</table>'; |
} elsif ($item eq 'plc.users.denied') { |
} elsif ($item eq 'plc.users.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'pch.roles.denied') { |
} elsif ($item eq 'pch.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'</table>'; |
'</table>'; |
} elsif ($item eq 'pch.users.denied') { |
} elsif ($item eq 'pch.users.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'allow_limited_html_in_feedback') { |
} elsif ($item eq 'allow_limited_html_in_feedback') { |
$datatable .= &yesno_radio($item,$settings); |
$datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit); |
} elsif ($item eq 'allow_discussion_post_editing') { |
} elsif ($item eq 'allow_discussion_post_editing') { |
$datatable .= '</td><td align="right"><br />'. |
$datatable .= '</td><td align="right"><br />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 3576 sub print_discussion {
|
Line 3673 sub print_discussion {
|
'<th align="left">'.&mt('Role').'</th><th>'. |
'<th align="left">'.&mt('Role').'</th><th>'. |
&mt('Sections').'</th>'. |
&mt('Sections').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&role_checkboxes($cdom,$cnum,$item,$settings,1). |
&role_checkboxes($cdom,$cnum,$item,$settings,1,undef,$noedit). |
&Apache::loncommon::end_data_table().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
} elsif ($item eq 'discussion_post_fonts') { |
} elsif ($item eq 'discussion_post_fonts') { |
$datatable .= '</td><td align="right"><br />'. |
$datatable .= '</td><td align="right"><br />'. |
Line 3588 sub print_discussion {
|
Line 3685 sub print_discussion {
|
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&set_discussion_fonts($cdom,$cnum,$item,$settings). |
&set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit). |
&Apache::loncommon::end_data_table().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 3598 sub print_discussion {
|
Line 3695 sub print_discussion {
|
} |
} |
|
|
sub role_checkboxes { |
sub role_checkboxes { |
my ($cdom,$cnum,$item,$settings,$showsections,$crstype) = @_; |
my ($cdom,$cnum,$item,$settings,$showsections,$crstype,$noedit) = @_; |
my @roles = ('st','ad','ta','ep','in'); |
my @roles = ('st','ad','ta','ep','in'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
push(@roles,'co'); |
push(@roles,'co'); |
Line 3636 sub role_checkboxes {
|
Line 3733 sub role_checkboxes {
|
} |
} |
my $numinrow = 3; |
my $numinrow = 3; |
my $count = 0; |
my $count = 0; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $checked = ''; |
my $checked = ''; |
if (grep(/^\Q$role\E$/,@current)) { |
if (grep(/^\Q$role\E$/,@current)) { |
Line 3654 sub role_checkboxes {
|
Line 3755 sub role_checkboxes {
|
} |
} |
} |
} |
$output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$item.'" value="'.$role.'"'.$checked.'/> '. |
$item.'" value="'.$role.'"'.$checked.$disabled.'/> '. |
$plrole.'</label></span></td>'; |
$plrole.'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
$output .= '<td align="left">'. |
$output .= '<td align="left">'. |
&select_sections($item,$role,\@sections,$currsec{$role}). |
&select_sections($item,$role,\@sections,$currsec{$role},$noedit). |
'</td></tr>'; |
'</td></tr>'; |
} |
} |
$count ++; |
$count ++; |
Line 3686 sub role_checkboxes {
|
Line 3787 sub role_checkboxes {
|
} |
} |
} |
} |
$output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$item.'" value="'.$value.'"'.$checked.' /> '.$rolename. |
$item.'" value="'.$value.'"'.$checked.$disabled.' /> '.$rolename. |
'</label></span></td>'; |
'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
$output .= '<td>'. |
$output .= '<td>'. |
&select_sections($item,$role,\@sections,$currsec{$role}). |
&select_sections($item,$role,\@sections,$currsec{$role},$noedit). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$total ++; |
$total ++; |
Line 3712 sub role_checkboxes {
|
Line 3813 sub role_checkboxes {
|
} |
} |
|
|
sub set_discussion_fonts { |
sub set_discussion_fonts { |
my ($cdom,$cnum,$item,$settings) = @_; |
my ($cdom,$cnum,$item,$settings,$noedit) = @_; |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($styleorder,$styleitems) = &discussion_vote_styles(); |
my ($styleorder,$styleitems) = &discussion_vote_styles(); |
my $output; |
my $output; |
if (ref($classorder) eq 'ARRAY') { |
if (ref($classorder) eq 'ARRAY') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $cat (@{$classorder}) { |
foreach my $cat (@{$classorder}) { |
my %curr = (); |
my %curr = (); |
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) = |
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) = |
Line 3733 sub set_discussion_fonts {
|
Line 3838 sub set_discussion_fonts {
|
($currsize,$currunit) = ($1,$2); |
($currsize,$currunit) = ($1,$2); |
$curr{'size'} = $currunit; |
$curr{'size'} = $currunit; |
} |
} |
$output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5">'. |
$output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5"'.$disabled.' />'. |
' '; |
' '; |
$selitem = 'unit'; |
$selitem = 'unit'; |
} |
} |
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) { |
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) { |
$output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'">'; |
$output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'"'.$disabled.'>'; |
foreach my $val (@{$styleitems->{$item}}) { |
foreach my $val (@{$styleitems->{$item}}) { |
my $sel; |
my $sel; |
if ($val eq $curr{$item}) { |
if ($val eq $curr{$item}) { |
Line 3749 sub set_discussion_fonts {
|
Line 3854 sub set_discussion_fonts {
|
} |
} |
} |
} |
} |
} |
$output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'" /></td>'; |
$output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'"'.$disabled.' /></td>'; |
} |
} |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
Line 3781 sub discussion_vote_styles {
|
Line 3886 sub discussion_vote_styles {
|
} |
} |
|
|
sub print_classlists { |
sub print_classlists { |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_; |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
my @ordered; |
my @ordered; |
if ($position eq 'top') { |
if ($position eq 'top') { |
@ordered = ('default_enrollment_start_date', |
@ordered = ('default_enrollment_start_date', |
Line 3855 sub print_classlists {
|
Line 3960 sub print_classlists {
|
($settings->{'student_classlist_view'} eq 'section')) { |
($settings->{'student_classlist_view'} eq 'section')) { |
$settings->{'student_classlist_view'} = 'disabled'; |
$settings->{'student_classlist_view'} = 'disabled'; |
} |
} |
return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'classlists'); |
return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'classlists',$noedit); |
} |
} |
|
|
sub print_appearance { |
sub print_appearance { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3892 sub print_appearance {
|
Line 3997 sub print_appearance {
|
input => 'selectbox', |
input => 'selectbox', |
options => { |
options => { |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
jsMath => 'jsMath', |
|
mimetex => &mt('Convert to Images'), |
mimetex => &mt('Convert to Images'), |
tth => &mt('TeX to HTML'), |
tth => &mt('TeX to HTML'), |
}, |
}, |
order => ['MathJax','jsMath','mimetex','tth'], |
order => ['MathJax','mimetex','tth'], |
nullval => $mathdef, |
nullval => $mathdef, |
}, |
}, |
'tthoptions' => { |
'tthoptions' => { |
Line 3913 sub print_appearance {
|
Line 4017 sub print_appearance {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
} |
} |
|
|
sub print_grading { |
sub print_grading { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3968 sub print_grading {
|
Line 4072 sub print_grading {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit); |
} |
} |
|
|
sub print_printouts { |
sub print_printouts { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 4021 sub print_printouts {
|
Line 4125 sub print_printouts {
|
nullval => &mt('None specified - use domain default'), |
nullval => &mt('None specified - use domain default'), |
} |
} |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'printouts'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'printouts',$noedit); |
} |
} |
|
|
sub print_spreadsheet { |
sub print_spreadsheet { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 4057 sub print_spreadsheet {
|
Line 4161 sub print_spreadsheet {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'spreadsheet'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'spreadsheet',$noedit); |
} |
} |
|
|
sub print_bridgetasks { |
sub print_bridgetasks { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 4099 sub print_bridgetasks {
|
Line 4203 sub print_bridgetasks {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'bridgetasks'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'bridgetasks',$noedit); |
} |
} |
|
|
sub print_other { |
sub print_other { |
my ($cdom,$settings,$allitems,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$allitems,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
return; |
return; |
} |
} |
Line 4124 sub print_other {
|
Line 4228 sub print_other {
|
input => 'textbox', |
input => 'textbox', |
size => '30', |
size => '30', |
}; |
}; |
my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other'); |
my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit); |
} |
} |
|
|
sub get_other_items { |
sub get_other_items { |
Line 4173 sub item_table_row_end {
|
Line 4277 sub item_table_row_end {
|
} |
} |
|
|
sub yesno_radio { |
sub yesno_radio { |
my ($item,$settings,$unsetdefault,$valueyes,$valueno) = @_; |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit) = @_; |
my $itemon = ' '; |
my $itemon = ' '; |
my $itemoff = ' checked="checked" '; |
my $itemoff = ' checked="checked" '; |
if (($valueyes eq '') && ($valueno eq '')) { |
if (($valueyes eq '') && ($valueno eq '')) { |
Line 4192 sub yesno_radio {
|
Line 4296 sub yesno_radio {
|
} |
} |
} |
} |
} |
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
return '<span class="LC_nobreak"><label>'. |
return '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="'.$item.'"'. |
'<input type="radio" name="'.$item.'"'. |
$itemon.' value="'.$valueyes.'" />'.&mt('Yes').'</label> '. |
$itemon.' value="'.$valueyes.'"'.$disabled.' />'.&mt('Yes').'</label> '. |
'<label><input type="radio" name="'.$item.'"'. |
'<label><input type="radio" name="'.$item.'"'. |
$itemoff.' value="'.$valueno.'" />'.&mt('No').'</label></span>'; |
$itemoff.' value="'.$valueno.'"'.$disabled.' />'.&mt('No').'</label></span>'; |
} |
} |
|
|
sub select_from_options { |
sub select_from_options { |
my ($item,$order,$options,$curr,$nullval,$multiple,$maxsize,$onchange) = @_; |
my ($item,$order,$options,$curr,$nullval,$multiple,$maxsize,$onchange,$noedit) = @_; |
my $output; |
my $output; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled=disabled"'; |
|
} |
if ((ref($order) eq 'ARRAY') && (ref($options) eq 'HASH')) { |
if ((ref($order) eq 'ARRAY') && (ref($options) eq 'HASH')) { |
$output='<select name="'.$item.'" '.$onchange; |
$output='<select name="'.$item.'" '.$onchange; |
if ($multiple) { |
if ($multiple) { |
Line 4212 sub select_from_options {
|
Line 4324 sub select_from_options {
|
$output .= ' size="'.$maxsize.'"'; |
$output .= ' size="'.$maxsize.'"'; |
} |
} |
} |
} |
$output .= '>'."\n"; |
$output .= $disabled.'>'."\n"; |
if ($nullval ne '') { |
if ($nullval ne '') { |
$output .= '<option value=""'; |
$output .= '<option value=""'; |
if (ref($curr) eq 'ARRAY') { |
if (ref($curr) eq 'ARRAY') { |
Line 4245 sub select_from_options {
|
Line 4357 sub select_from_options {
|
} |
} |
|
|
sub make_item_rows { |
sub make_item_rows { |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller) = @_; |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit) = @_; |
my $datatable; |
my $datatable; |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
my $count = 0; |
my $count = 0; |
Line 4271 sub make_item_rows {
|
Line 4383 sub make_item_rows {
|
} |
} |
$datatable .= $showcredits; |
$datatable .= $showcredits; |
} elsif ($item eq 'nothideprivileged') { |
} elsif ($item eq 'nothideprivileged') { |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype); |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype,$noedit); |
} elsif ($item eq 'checkforpriv') { |
} elsif ($item eq 'checkforpriv') { |
$datatable .= &checkforpriv_row($cdom,$item,$settings,$crstype); |
$datatable .= &checkforpriv_row($cdom,$item,$settings,$crstype,$noedit); |
} elsif ($item eq 'print_header_format') { |
} elsif ($item eq 'print_header_format') { |
$datatable .= &print_hdrfmt_row($item,$settings); |
$datatable .= &print_hdrfmt_row($item,$settings,$noedit); |
} elsif ($items->{$item}{input} eq 'dates') { |
} elsif ($items->{$item}{input} eq 'dates') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$datatable .= |
$datatable .= |
&Apache::lonhtmlcommon::date_setter('display',$item, |
&Apache::lonhtmlcommon::date_setter('display',$item, |
$settings->{$item}); |
$settings->{$item},$disabled); |
} elsif ($items->{$item}{input} eq 'radio') { |
} elsif ($items->{$item}{input} eq 'radio') { |
my ($unsetdefault,$valueyes,$valueno); |
my ($unsetdefault,$valueyes,$valueno); |
if (($item eq 'usejsme') || ($item eq 'uselcmath')) { |
if (($item eq 'usejsme') || ($item eq 'uselcmath')) { |
Line 4290 sub make_item_rows {
|
Line 4406 sub make_item_rows {
|
$valueyes = "1"; |
$valueyes = "1"; |
$valueno = "0"; |
$valueno = "0"; |
} |
} |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno); |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
} elsif ($items->{$item}{input} eq 'selectbox') { |
} elsif ($items->{$item}{input} eq 'selectbox') { |
my $curr = $settings->{$item}; |
my $curr = $settings->{$item}; |
$datatable .= |
$datatable .= |
&select_from_options($item,$items->{$item}{'order'}, |
&select_from_options($item,$items->{$item}{'order'}, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'nullval'}); |
$items->{$item}{'nullval'}, |
|
undef,undef,undef,$noedit); |
} elsif ($items->{$item}{input} eq 'textbox') { |
} elsif ($items->{$item}{input} eq 'textbox') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled=disabled"'; |
|
} |
$datatable .= |
$datatable .= |
&Apache::lonhtmlcommon::textbox($item,$settings->{$item}, |
&Apache::lonhtmlcommon::textbox($item,$settings->{$item}, |
$items->{$item}{size}); |
$items->{$item}{size}, |
|
$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 4312 sub make_item_rows {
|
Line 4434 sub make_item_rows {
|
} |
} |
|
|
sub nothidepriv_row { |
sub nothidepriv_row { |
my ($cdom,$item,$settings,$crstype) = @_; |
my ($cdom,$item,$settings,$crstype,$noedit) = @_; |
my ($cnum) = &get_course(); |
my ($cnum) = &get_course(); |
my ($datatable,%nothide,@checkdoms); |
my ($datatable,%nothide,@checkdoms); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
Line 4349 sub nothidepriv_row {
|
Line 4471 sub nothidepriv_row {
|
} |
} |
} |
} |
if (@privusers > 0) { |
if (@privusers > 0) { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$datatable .= '<table align="right">'; |
$datatable .= '<table align="right">'; |
foreach my $user (sort(@privusers)) { |
foreach my $user (sort(@privusers)) { |
my $hideon = ' checked="checked" '; |
my $hideon = ' checked="checked" '; |
Line 4365 sub nothidepriv_row {
|
Line 4491 sub nothidepriv_row {
|
'</td><td align="left">'. |
'</td><td align="left">'. |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="radio" name="'.$item.'_'.$user.'"'. |
'<input type="radio" name="'.$item.'_'.$user.'"'. |
$hideon.' value="" />'.&mt('Hidden').'</label> '. |
$hideon.' value=""'.$disabled.' />'.&mt('Hidden').'</label> '. |
'<label><input type="radio" name="'.$item.'_'.$user.'"'. |
'<label><input type="radio" name="'.$item.'_'.$user.'"'. |
$hideoff.' value="yes" />'.&mt('Shown').'</label></span></td>'. |
$hideoff.' value="yes"'.$disabled.' />'.&mt('Shown').'</label></span></td>'. |
'</tr>'; |
'</tr>'; |
} |
} |
$datatable .= '</table>'; |
$datatable .= '</table>'; |
Line 4382 sub nothidepriv_row {
|
Line 4508 sub nothidepriv_row {
|
} |
} |
|
|
sub checkforpriv_row { |
sub checkforpriv_row { |
my ($cdom,$item,$settings,$crstype) = @_; |
my ($cdom,$item,$settings,$crstype,$noedit) = @_; |
my $datatable; |
my $datatable; |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
if (keys(%domains) == 1) { |
if (keys(%domains) == 1) { |
Line 4395 sub checkforpriv_row {
|
Line 4521 sub checkforpriv_row {
|
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
$datatable = '</td><td align="right">'. |
$datatable = '</td><td align="right">'. |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num, |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num, |
1,1,undef,undef,\@excdoms); |
1,1,undef,undef,\@excdoms, |
|
$noedit); |
} else { |
} else { |
my @privdoms = split(/,/,$settings->{$item}); |
my @privdoms = split(/,/,$settings->{$item}); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
$datatable = '</td><td align="right"><br />'. |
$datatable = '</td><td align="right"><br />'. |
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (@privdoms > 0) { |
if (@privdoms > 0) { |
foreach my $currdom (@privdoms) { |
foreach my $currdom (@privdoms) { |
next unless ($domains{$currdom}); |
next unless ($domains{$currdom}); |
Line 4415 sub checkforpriv_row {
|
Line 4546 sub checkforpriv_row {
|
'</b><input type="hidden" name="checkforpriv_'.$num. |
'</b><input type="hidden" name="checkforpriv_'.$num. |
'" value="'.$currdom.'" /></span><br />'. |
'" value="'.$currdom.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="checkforpriv_delete" value="'.$num.'" />'. |
'name="checkforpriv_delete" value="'.$num.'"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
Line 4430 sub checkforpriv_row {
|
Line 4561 sub checkforpriv_row {
|
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional domain:'). '</span><br />'. |
&mt('Additional domain:'). '</span><br />'. |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num,1, |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num,1, |
1,undef,undef,\@excdoms). |
1,undef,undef,\@excdoms,$noedit). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table(). |
$datatable .= &Apache::loncommon::end_data_table(). |
Line 4441 sub checkforpriv_row {
|
Line 4572 sub checkforpriv_row {
|
} |
} |
|
|
sub print_hdrfmt_row { |
sub print_hdrfmt_row { |
my ($item,$settings) = @_; |
my ($item,$settings,$noedit) = @_; |
my @curr; |
my @curr; |
my $currnum = 0; |
my $currnum = 0; |
my $maxnum = 2; |
my $maxnum = 2; |
Line 4514 function getIndexByName(item) {
|
Line 4645 function getIndexByName(item) {
|
ENDJS |
ENDJS |
$output .= '</td><td align="right"><br />'. |
$output .= '</td><td align="right"><br />'. |
$currstr.'<table class="LC_data_table">'; |
$currstr.'<table class="LC_data_table">'; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (@curr > 0) { |
if (@curr > 0) { |
for (my $i=0; $i<@curr; $i++) { |
for (my $i=0; $i<@curr; $i++) { |
my $pos = $i+1; |
my $pos = $i+1; |
$output .= '<tr>'. |
$output .= '<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$i,$maxnum).&mt('Delete:'). |
&position_selector($pos,$i,$maxnum,$disabled).&mt('Delete:'). |
'<input type="checkbox" name="printfmthdr_del_'.$i. |
'<input type="checkbox" name="printfmthdr_del_'.$i. |
'" /></span></td>'; |
'"'.$disabled.' /></span></td>'; |
if ($curr[$i] =~ /^%\d*[nca]$/) { |
if ($curr[$i] =~ /^%\d*[nca]$/) { |
my ($limit,$subst) = ($curr[$i] =~ /^%(\d*)([nca])$/); |
my ($limit,$subst) = ($curr[$i] =~ /^%(\d*)([nca])$/); |
$output .= '<td align="left">'. |
$output .= '<td align="left">'. |
&substitution_selector($i,$subst,$limit).'</td>'; |
&substitution_selector($i,$subst,$limit,$disabled).'</td>'; |
} else { |
} else { |
$output .= '<td colspan="2" align="left">'.&mt('Text').'<br />'. |
$output .= '<td colspan="2" align="left">'.&mt('Text').'<br />'. |
'<input type="textbox" name="printfmthdr_text_'.$i.'"'. |
'<input type="textbox" name="printfmthdr_text_'.$i.'"'. |
' value="'.$curr[$i].'" size="25" /></td>'; |
' value="'.$curr[$i].'" size="25"'.$disabled.' /></td>'; |
} |
} |
$output .= '</tr>'; |
$output .= '</tr>'; |
} |
} |
} |
} |
my $pos = $currnum+1; |
my $pos = $currnum+1; |
$output .= '<tr>'. |
unless ($noedit) { |
|
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$currnum,$maxnum). |
&position_selector($pos,$currnum,$maxnum). |
'<b>'.&mt('New').'</b></span></td><td align="left">'. |
'<b>'.&mt('New').'</b></span></td><td align="left">'. |
&substitution_selector($currnum).'</td>'. |
&substitution_selector($currnum).'</td>'. |
'</tr>'; |
'</tr>'; |
$pos ++; |
$pos ++; |
$currnum ++; |
$currnum ++; |
$output .= '<tr>'. |
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$currnum,$maxnum). |
&position_selector($pos,$currnum,$maxnum). |
'<b>'.&mt('New').'</b></span></td>'. |
'<b>'.&mt('New').'</b></span></td>'. |
Line 4552 ENDJS
|
Line 4690 ENDJS
|
'" value="" size ="25" />'. |
'" value="" size ="25" />'. |
'<input type="hidden" name="printfmthdr_maxnum" value="'. |
'<input type="hidden" name="printfmthdr_maxnum" value="'. |
$maxnum.'" /></td>'. |
$maxnum.'" /></td>'. |
'</tr>'. |
'</tr>'; |
'</table><br />'; |
} |
|
$output .= '</table><br />'; |
return $output; |
return $output; |
} |
} |
|
|
sub position_selector { |
sub position_selector { |
my ($pos,$num,$maxnum) = @_; |
my ($pos,$num,$maxnum,$disabled) = @_; |
my $output = '<select name="printfmthdr_pos_'.$num.'" onchange="reOrder('."'$num'".');">'; |
my $output = '<select name="printfmthdr_pos_'.$num.'" onchange="reOrder('."'$num'".');"'.$disabled.'>'; |
for (my $j=1; $j<=$maxnum; $j++) { |
for (my $j=1; $j<=$maxnum; $j++) { |
my $sel = ''; |
my $sel = ''; |
if ($pos == $j) { |
if ($pos == $j) { |
Line 4573 sub position_selector {
|
Line 4712 sub position_selector {
|
} |
} |
|
|
sub substitution_selector { |
sub substitution_selector { |
my ($num,$subst,$limit,$crstype) = @_; |
my ($num,$subst,$limit,$crstype,$disabled) = @_; |
my ($stunametxt,$crsidtxt); |
my ($stunametxt,$crsidtxt); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$stunametxt = 'member name'; |
$stunametxt = 'member name'; |
Line 4588 sub substitution_selector {
|
Line 4727 sub substitution_selector {
|
a => 'assignment note', |
a => 'assignment note', |
); |
); |
my $output .= &mt('Substitution').'<br />'. |
my $output .= &mt('Substitution').'<br />'. |
'<select name="printfmthdr_sub_'.$num.'">'; |
'<select name="printfmthdr_sub_'.$num.'"'.$disabled.'>'; |
if ($subst eq '') { |
if ($subst eq '') { |
$output .= '<option value="" selected="selected"> </option>'; |
$output .= '<option value="" selected="selected"> </option>'; |
} |
} |
Line 4602 sub substitution_selector {
|
Line 4741 sub substitution_selector {
|
} |
} |
$output .= '</select></td><td align="left">'.&mt('Size limit').'<br />'. |
$output .= '</select></td><td align="left">'.&mt('Size limit').'<br />'. |
'<input type="textbox" name="printfmthdr_limit_'.$num. |
'<input type="textbox" name="printfmthdr_limit_'.$num. |
'" value="'.$limit.'" size="5" /></span>'; |
'" value="'.$limit.'" size="5"'.$disabled.' /></span>'; |
return $output; |
return $output; |
} |
} |
|
|