version 1.109, 2006/06/22 15:33:35
|
version 1.112, 2006/06/22 15:56:03
|
Line 261 sub display_directory {
|
Line 261 sub display_directory {
|
$filename.'</a></td>'); |
$filename.'</a></td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
$r->print('<td><nobr>'.&mt($curr_access).' '. |
$r->print('<td><span style="white-space: nowrap">'.&mt($curr_access).' '. |
'<a href="'.$url.'?access='.$filename. |
'<a href="'.$url.'?access='.$filename. |
'&currentpath='.$current_path.$groupecho. |
'&currentpath='.$current_path.$groupecho. |
'">'.&mt('View/Change').'</a></nobr></td>'); |
'">'.&mt('View/Change').'</a></span></td>'); |
$r->print('</tr>'); |
$r->print('</tr>'); |
} |
} |
} |
} |
Line 316 sub close_form {
|
Line 316 sub close_form {
|
$group.'" />'); |
$group.'" />'); |
} |
} |
$r->print('</p></form>'); |
$r->print('</p></form>'); |
$r->print('<form action="'.$url.'" method="POST"> |
$r->print('<form action="'.$url.'" method="post"> |
<p> |
<p> |
<input type="hidden" name="currentpath" value="'. |
<input type="hidden" name="currentpath" value="'. |
$env{'form.currentpath'}.'" />'); |
$env{'form.currentpath'}.'" />'); |
Line 547 sub update_access {
|
Line 547 sub update_access {
|
my $updated_controls = $access_controls{$file_name}; |
my $updated_controls = $access_controls{$file_name}; |
my ($showstart,$showend); |
my ($showstart,$showend); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
'</th><th>'.&mt('Additional information').'</th>'); |
'</th><th>'.&mt('Additional information').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
foreach my $chg (sort(keys(%processing))) { |
foreach my $chg (sort(keys(%processing))) { |
if (@{$processing{$chg}} > 0) { |
if (@{$processing{$chg}} > 0) { |
if ($chg eq 'delete') { |
if ($chg eq 'delete') { |
Line 830 sub access_setting_table {
|
Line 830 sub access_setting_table {
|
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
if ($public) { |
if ($public) { |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
Line 846 sub access_setting_table {
|
Line 846 sub access_setting_table {
|
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
'</th><th>'. &mt('Password').'</th>'); |
'</th><th>'. &mt('Password').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
my $passwd; |
my $passwd; |
if ($guest) { |
if ($guest) { |
Line 926 sub display_access_row {
|
Line 926 sub display_access_row {
|
my $uctype = $type; |
my $uctype = $type; |
$uctype =~ s/^(\w)/uc($1)/e; |
$uctype =~ s/^(\w)/uc($1)/e; |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</td><th>'. |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</th><th>'. |
&mt('Dates available').'</th>'); |
&mt('Dates available').'</th>'); |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
Line 938 sub display_access_row {
|
Line 938 sub display_access_row {
|
} elsif ($type eq 'domains') { |
} elsif ($type eq 'domains') { |
@all_doms = &Apache::loncommon::get_domains(); |
@all_doms = &Apache::loncommon::get_domains(); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
foreach my $key (@{$items}) { |
foreach my $key (@{$items}) { |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
&course_row($r,$status,$type,$key,$access_controls, |
&course_row($r,$status,$type,$key,$access_controls, |
Line 951 sub display_access_row {
|
Line 952 sub display_access_row {
|
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
if ($status eq 'old') { |
if ($status eq 'old') { |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
'</td>'); |
'</td>'); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} else { |
} else { |
Line 964 sub display_access_row {
|
Line 966 sub display_access_row {
|
return; |
return; |
} |
} |
|
|
sub course_row { |
sub course_js { |
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
return qq| |
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
$defdom = $$access_controls{$item}{'domain'}; |
|
} |
|
$r->print(&Apache::loncommon::coursebrowser_javascript($defdom)); |
|
$r->print(qq| |
|
<script type="text/javascript"> |
<script type="text/javascript"> |
function setRoleOptions(caller,num,cdom,cnum,type) { |
function setRoleOptions(caller,num,cdom,cnum,type) { |
addIndexnum = getCallerIndex(caller); |
addIndexnum = getCallerIndex(caller); |
Line 1011 function getIndex(name,value) {
|
Line 1006 function getIndex(name,value) {
|
} |
} |
|
|
</script> |
</script> |
|); |
|; |
$r->print(&Apache::loncommon::start_data_table_row()); |
} |
|
|
|
sub course_row { |
|
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
|
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
$defdom = $$access_controls{$item}{'domain'}; |
|
} |
|
my $js = &Apache::loncommon::coursebrowser_javascript($defdom) |
|
.&course_js(); |
my $crsgrptext = 'Groups'; |
my $crsgrptext = 'Groups'; |
if ($type eq 'group') { |
if ($type eq 'group') { |
$crsgrptext = 'Teams'; |
$crsgrptext = 'Teams'; |
} |
} |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
$type); |
$type); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td>'); |
$r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>'); |
if ($status eq 'old') { |
if ($status eq 'old') { |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my %course_description = &Apache::lonnet::coursedescription($cid); |
my %course_description = &Apache::lonnet::coursedescription($cid); |
Line 1042 function getIndex(name,value) {
|
Line 1047 function getIndex(name,value) {
|
} |
} |
$max_id ++; |
$max_id ++; |
my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display'); |
my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display'); |
$r->print('<tr><td><nobr><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></nobr><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); |
$r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); |
} |
} |
$r->print('</table><br />'.&mt('Add a roles-based condition').' <input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content{domain}','$content{number}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>'); |
$r->print('</table><br />'.&mt('Add a roles-based condition').' <input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content{domain}','$content{number}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>'); |
} elsif ($status eq 'new') { |
} elsif ($status eq 'new') { |
Line 1051 function getIndex(name,value) {
|
Line 1056 function getIndex(name,value) {
|
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('</tr></table></td>'); |
$r->print('</tr></table></td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
return; |
return; |
} |
} |
|
|
sub domains_row { |
sub domains_row { |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'domains'); |
'domains'); |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true"/>'. |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true">'. |
' <option value="">'.&mt('Please select').'</option>'; |
' <option value="">'.&mt('Please select').'</option>'; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
if ($status eq 'old') { |
if ($status eq 'old') { |
my $content = $$access_controls{$item}; |
my $content = $$access_controls{$item}; |
foreach my $dom (@{$all_doms}) { |
foreach my $dom (@{$all_doms}) { |
Line 1079 sub domains_row {
|
Line 1081 sub domains_row {
|
$dom_select .= '<option value="'.$dom.'">'.$dom.'</option>'; |
$dom_select .= '<option value="'.$dom.'">'.$dom.'</option>'; |
} |
} |
} |
} |
|
$dom_select .= '</select>'; |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
} |
} |
|
|
sub users_row { |
sub users_row { |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'users'); |
'users'); |
my $curr_user_list; |
my $curr_user_list; |
Line 1096 sub users_row {
|
Line 1096 sub users_row {
|
$curr_user_list = &sort_users($content->{'users'}); |
$curr_user_list = &sort_users($content->{'users'}); |
} |
} |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
} |
|
|
sub additional_item { |
sub additional_item { |
Line 1107 sub additional_item {
|
Line 1106 sub additional_item {
|
|
|
sub actionbox { |
sub actionbox { |
my ($status,$num,$scope) = @_; |
my ($status,$num,$scope) = @_; |
my $output = '<nobr><label>'; |
my $output = '<span style="white-space: nowrap"><label>'; |
if ($status eq 'new') { |
if ($status eq 'new') { |
$output .= '<input type="checkbox" name="activate" value="'.$num.'" />'. |
$output .= '<input type="checkbox" name="activate" value="'.$num.'" />'. |
&mt('Activate'); |
&mt('Activate'); |
} else { |
} else { |
$output .= '<input type="checkbox" name="delete" value="'.$num. |
$output .= '<input type="checkbox" name="delete" value="'.$num. |
'" />'.&mt('Delete').'</label><br /><nobr>'. |
'" />'.&mt('Delete').'</label></span><br /><span style="white-space: nowrap">'. |
'<label><input type="checkbox" name="update" value="'. |
'<label><input type="checkbox" name="update" value="'. |
$num.'" />'.&mt('Update'); |
$num.'" />'.&mt('Update'); |
} |
} |
$output .= '</label></nobr><input type="hidden" name="scope_'.$num. '" value="'.$scope.'" />'; |
$output .= '</label></span><input type="hidden" name="scope_'.$num. '" value="'.$scope.'" />'; |
return $output; |
return $output; |
} |
} |
|
|
Line 1132 sub dateboxes {
|
Line 1131 sub dateboxes {
|
undef,undef,1); |
undef,undef,1); |
my $enddate = &Apache::lonhtmlcommon::date_setter('portform', |
my $enddate = &Apache::lonhtmlcommon::date_setter('portform', |
'enddate_'.$num,$end,undef,undef,undef,1,undef, |
'enddate_'.$num,$end,undef,undef,undef,1,undef, |
undef,undef,1). ' <nobr><label>'. |
undef,undef,1). ' <span style="white-space: nowrap"><label>'. |
'<input type="checkbox" name="noend_'. |
'<input type="checkbox" name="noend_'. |
$num.'" '.$noend.' />'.&mt('No end date'). |
$num.'" '.$noend.' />'.&mt('No end date'). |
'</label></nobr>'; |
'</label></span>'; |
|
|
my $output = &mt('Start: ').$startdate.'<br />'.&mt('End: ').$enddate; |
my $output = &mt('Start: ').$startdate.'<br />'.&mt('End: ').$enddate; |
return $output; |
return $output; |