--- loncom/interface/loncommon.pm 2009/07/27 20:35:40 1.870 +++ loncom/interface/loncommon.pm 2009/08/03 16:47:53 1.875 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.870 2009/07/27 20:35:40 tempelho Exp $ +# $Id: loncommon.pm,v 1.875 2009/08/03 16:47:53 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -529,6 +529,11 @@ sub coursebrowser_javascript { } } } + if (formname == 'ccrs') { + var ownername = document.forms[formid].ccuname.value; + var ownerdom = document.forms[formid].ccdomain.options[document.forms[formid].ccdomain.selectedIndex].value; + url += '&cloner='+ownername+':'+ownerdom; + } if (multflag !=null && multflag != '') { url += '&multiple='+multflag; } @@ -620,12 +625,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.'' .''; } @@ -1787,7 +1796,7 @@ sub select_level_form { =pod -=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$autosubmit) +=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange) Returns a string containing a form to allow a user to select the domain to preform an operation in. @@ -1798,16 +1807,15 @@ selected"); If the $showdomdesc flag is set, the domain name is followed by the domain description. -If the $autosubmit flag is set, the form containing the domain selector will be auto-submitted by an onchange action. +The optional $onchange argumnet specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted. =cut #------------------------------------------- sub select_dom_form { - my ($defdom,$name,$includeempty,$showdomdesc,$autosubmit) = @_; - my $onchange; - if ($autosubmit) { - $onchange = ' onchange="this.form.submit()"'; + my ($defdom,$name,$includeempty,$showdomdesc,$onchange) = @_; + if ($onchange) { + $onchange = ' onchange="'.$onchange.'"'; } my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains()); if ($includeempty) { @domains=('',@domains); } @@ -5563,10 +5571,6 @@ 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%; @@ -8549,7 +8553,7 @@ sub csv_print_select_table { my ($value,$display,$defaultcol)=@{ $array_ref }; $r->print(&start_data_table_row().''.$display.''); - $r->print('print(''); $r->print(''); foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {