--- loncom/interface/loncommon.pm 2007/09/27 15:36:23 1.590 +++ loncom/interface/loncommon.pm 2007/10/22 22:16:38 1.594 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.590 2007/09/27 15:36:23 raeburn Exp $ +# $Id: loncommon.pm,v 1.594 2007/10/22 22:16:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -407,7 +407,7 @@ sub coursebrowser_javascript { '&cdomelement='+udom+ '&cnameelement='+desc; if (extra_element !=null && extra_element != '') { - if (formname == 'rolechoice') { + if (formname == 'rolechoice' || formname == 'studentform') { url += '&roleelement='+extra_element; if (domainfilter == null || domainfilter == '') { url += '&domainfilter='+extra_element; @@ -1593,7 +1593,7 @@ input: 4 arguments (two required, two op option, and selected by default. $hide - Value of 'hide' causes hiding of the name of the server, if 1 server found, or default, if 0 found. -output: returns 1 items: +output: returns 2 items: (a) form element which contains either: (i) '; @@ -2018,11 +2016,11 @@ sub authform_internal{ ); my ($intcheck,$intarg,$result,$authtype,$autharg,$jscall); my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'}); - if (grep(/^curr_authtype$/,(keys(%in)))) { - if ($in{'curr_authtype'} eq 'internal:') { + if (defined($in{'curr_authtype'})) { + if ($in{'curr_authtype'} eq 'int') { if ($can_assign{'int'}) { $intcheck = 'checked="on" '; - if (grep(/^curr_autharg$/,(keys(%in)))) { + if (defined($in{'curr_autharg'})) { $intarg = $in{'curr_autharg'}; } } else { @@ -2038,7 +2036,7 @@ sub authform_internal{ if (!$can_assign{'int'}) { return; } elsif ($authtype eq '') { - if (grep(/^mode$/,(keys(%in)))) { + if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { $authtype = ''; @@ -2067,11 +2065,11 @@ sub authform_local{ ); my ($loccheck,$locarg,$result,$authtype,$autharg,$jscall); my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'}); - if (grep(/^curr_authtype$/,(keys(%in)))) { - if ($in{'curr_authtype'} eq 'localauth:') { + if (defined($in{'curr_authtype'})) { + if ($in{'curr_authtype'} eq 'loc') { if ($can_assign{'loc'}) { $loccheck = 'checked="on" '; - if (grep(/^curr_autharg$/,(keys(%in)))) { + if (defined($in{'curr_autharg'})) { $locarg = $in{'curr_autharg'}; } } else { @@ -2087,7 +2085,7 @@ sub authform_local{ if (!$can_assign{'loc'}) { return; } elsif ($authtype eq '') { - if (grep(/^mode$/,(keys(%in)))) { + if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { $authtype = ''; @@ -2116,8 +2114,8 @@ sub authform_filesystem{ ); my ($fsyscheck,$result,$authtype,$autharg,$jscall); my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'}); - if (grep(/^curr_authtype$/,(keys(%in)))) { - if ($in{'curr_authtype'} eq 'unix:') { + if (defined($in{'curr_authtype'})) { + if ($in{'curr_authtype'} eq 'fsys') { if ($can_assign{'fsys'}) { $fsyscheck = 'checked="on" '; } else { @@ -2133,7 +2131,7 @@ sub authform_filesystem{ if (!$can_assign{'fsys'}) { return; } elsif ($authtype eq '') { - if (grep(/^mode$/,(keys(%in)))) { + if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { $authtype = ''; @@ -4131,7 +4129,7 @@ table.thinborder tr td { form, .inline { display: inline; } .center { text-align: center; } -.LC_filename {font-family: $mono;} +.LC_filename {font-family: $mono; white-space:pre;} .LC_error { color: red; font-size: larger; @@ -4981,6 +4979,25 @@ table.LC_double_column tr td.LC_right_co vertical-align: top; } +span.LC_role_level { + font-weight: bold; +} + +div.LC_left_float { + float: left; + padding-right: 5%; + padding:bottom: 4px; +} + +div.LC_clear_float_header { + padding:bottom: 2px; +} + +div.LC_clear_float_footer { + padding:top: 10px; + clear: both; +} + END } @@ -5097,7 +5114,9 @@ Inputs: none sub xml_begin { my $output=''; - &Apache::lonhtmlcommon::init_htmlareafields(); + if ($env{'internal.start_page'}==1) { + &Apache::lonhtmlcommon::init_htmlareafields(); + } if ($env{'browser.mathml'}) { $output='' @@ -6659,20 +6678,21 @@ sub csv_print_samples { my ($r,$records) = @_; my $samples = &get_samples($records,3); - $r->print(&mt('Samples').'
'); + $r->print(&mt('Samples').'
'.&start_data_table(). + &start_data_table_header_row()); foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) { $r->print(''); } - $r->print(''); + $r->print(&end_data_table_header_row()); foreach my $hash (@$samples) { - $r->print(''); + $r->print(&start_data_table_row()); foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) { $r->print(''); } - $r->print(''); + $r->print(&end_data_table_row()); } - $r->print('
'.&mt('Column [_1]',($sample+1)).'
'); if (defined($$hash{$sample})) { $r->print($$hash{$sample}); } $r->print('

'."\n"); + $r->print(&end_data_table().'
'."\n"); } ###################################################### @@ -6697,12 +6717,13 @@ sub csv_print_select_table { my $i=0; my $samples = &get_samples($records,1); $r->print(&mt('Associate columns with student attributes.')."\n". - ''. + &start_data_table().&start_data_table_header_row(). ''. - ''."\n"); + ''. + &end_data_table_header_row()."\n"); foreach my $array_ref (@$d) { my ($value,$display,$defaultcol)=@{ $array_ref }; - $r->print(''); + $r->print(&start_data_table_row().''); $r->print(''."\n"); + $r->print(''.&end_data_table_row()."\n"); $i++; } + $r->print(&end_data_table()); $i--; return $i; } @@ -6741,11 +6763,13 @@ sub csv_samples_select_table { my $i=0; # my $samples = &get_samples($records,3); - $r->print('
'.&mt('Attribute').''.&mt('Column').'
'.&mt('Column').'
'.$display.'
'.$display.'
'); + $r->print(&start_data_table(). + &start_data_table_header_row().''. + &end_data_table_header_row()); foreach my $key (sort(keys(%{ $samples->[0] }))) { - $r->print(''); + $r->print(''.&end_data_table_row()); $i++; } + $r->print(&end_data_table()); $i--; return($i); }
'. - &mt('Field').''.&mt('Samples').'
'. + &mt('Field').''.&mt('Samples').'