--- loncom/interface/loncommon.pm 2009/05/21 15:43:52 1.692.4.3 +++ loncom/interface/loncommon.pm 2009/08/14 07:40:50 1.692.4.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.692.4.3 2009/05/21 15:43:52 raeburn Exp $ +# $Id: loncommon.pm,v 1.692.4.6 2009/08/14 07:40:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -407,6 +407,7 @@ sub studentbrowser_javascript { ) { return ''; } return (<<'ENDSTDBRW'); ENDSTDBRW } @@ -461,6 +463,7 @@ sub selectstudent_link { sub authorbrowser_javascript { return <<"ENDAUTHORBRW"; ENDAUTHORBRW } sub coursebrowser_javascript { my ($domainfilter,$sec_element,$formname)=@_; - my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role'); + my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role'); my $output = ' '; return $output; } @@ -610,12 +615,16 @@ function setSect(sectionlist) { sub selectcourse_link { my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_; + my $linktext = &mt('Select Course'); + if ($selecttype eq 'Community') { + $linktext = &mt('Select Community'); + } return '' ."".&mt('Select Course').'' + ."'>".$linktext.'' .''; } @@ -825,6 +834,7 @@ sub linked_select_forms { # output the javascript to do the changing my $result = ''; $result.=' END # output the initial values for the selection lists @@ -1023,7 +1034,9 @@ sub update_help_link { my $banner_link = "/adm/helpmenu?page=banner&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage"; my $output .= <<"ENDOUTPUT"; ENDOUTPUT return $output; @@ -1395,6 +1408,7 @@ sub resize_textarea_js { my $geometry = &viewport_geometry_js(); return <<"RESIZE"; RESIZE @@ -2300,7 +2315,7 @@ sub authform_internal{ $result = &mt ('[_1] Internally authenticated (with initial password [_2])', ''.$autharg); - $result.="'; + $result.="'; return $result; } @@ -4537,9 +4552,9 @@ sub standard_css { my $sans = 'Verdana,Arial,Helvetica,sans-serif'; my $mono = 'monospace'; - my $data_table_head = $tabbg; - my $data_table_light = '#EEEEEE'; - my $data_table_dark = '#DDDDDD'; + my $data_table_head = $sidebg; + my $data_table_light = '#FAFAFA'; + my $data_table_dark = '#F0F0F0'; my $data_table_darker = '#CCCCCC'; my $data_table_highlight = '#FFFF00'; my $mail_new = '#FFBB77'; @@ -4562,6 +4577,15 @@ sub standard_css { return <'; } else { - $output=''; + $output=''. + ''; } return $output; } @@ -6156,7 +6181,7 @@ sub get_users_function { if ($env{'request.role'}=~/^(su|dc|ad|li)/) { $function='admin'; } - if (($env{'request.role'}=~/^(au|ca)/) || + if (($env{'request.role'}=~/^(au|ca|aa)/) || ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { $function='author'; } @@ -6936,6 +6961,7 @@ ENDSCRIPT my $output = <<"END_BLOCK"; $new_user_create @@ -7899,7 +7926,8 @@ sub csv_print_samples { $r->print(&mt('Samples').'
'.&start_data_table(). &start_data_table_header_row()); foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) { - $r->print(''.&mt('Column [_1]',($sample+1)).''); } + $r->print(''.&mt('Column [_1]',($sample+1)).''); + } $r->print(&end_data_table_header_row()); foreach my $hash (@$samples) { $r->print(&start_data_table_row()); @@ -9547,8 +9575,8 @@ sub course_type { sub group_term { my $crstype = &course_type(); my %names = ( - 'Course' => 'group', - 'Group' => 'team', + 'Course' => 'group', + 'Community' => 'group', ); return $names{$crstype}; } @@ -9763,7 +9791,7 @@ sub init_user_environment { &Apache::lonnet::usertools_access($username,$domain,$tool,'reload'); } - foreach my $crstype ('official','unofficial') { + foreach my $crstype ('official','unofficial','community') { $userenv{'canrequest.'.$crstype} = &Apache::lonnet::usertools_access($username,$domain,$crstype, 'reload','requestcourses');