-
-
-
- '.$lt{'grna'}.' |
- '.$lt{'desc'}.' |
- '.$lt{'grfn'}.' |
- '.$lt{'gran'}.' |
- '.$lt{'quot'}.' |
- '.$lt{'dfac'}.' |
-
-
- '.$groupname.' |
- '.$description.' |
+ '.$groupname.' |
+ '.$description.' |
');
if (@{$available} > 0) {
- $r->print('Available:
- ');
+ $r->print('Available:
+ ');
my $rowcell = int(@{$available}/2) + @{$available}%2;
for (my $i=0; $i<@{$available}; $i++) {
if (@{$available} > 3) {
@@ -1662,8 +1580,8 @@ sub print_current_settings {
$r->print(' ');
}
}
- $r->print(''.$$functions{$$available[$i]}.
- ' | | ');
+ $r->print(''.$$functions{$$available[$i]}.
+ ' | | ');
}
if ((@{$available} > 3) && (@{$available}%2)) {
$r->print(' | | ');
@@ -1671,8 +1589,8 @@ sub print_current_settings {
$r->print('
');
}
if (@{$unavailable} > 0) {
- $r->print('Unavailable:
- ');
+ $r->print('Unavailable:
+ ');
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2;
for (my $j=0; $j<@{$unavailable}; $j++) {
if (@{$unavailable} > 3) {
@@ -1680,8 +1598,8 @@ sub print_current_settings {
$r->print(' ');
}
}
- $r->print(''.$$functions{$$unavailable[$j]}.
- ' | | ');
+ $r->print(''.$$functions{$$unavailable[$j]}.
+ ' | | ');
}
if ((@{$unavailable} > 3) && (@{$unavailable}%2)) {
$r->print(' | | ');
@@ -1690,26 +1608,20 @@ sub print_current_settings {
}
$r->print(<<"END");
- $lt{'difn'}
- $granularity |
- $quota Mb |
- $lt{'stda'} $showstart
- $lt{'enda'} $showend
+ | $lt{'difn'} $granularity |
+ $quota Mb |
+ $lt{'stda'} $showstart
+ $lt{'enda'} $showend
|
-
-
-
-
END
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
- $r->print('
');
+ $r->print(&Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table());
return;
}
sub pick_new_members {
- my ($r,$action,$formname,$tabcol,$rowColor1,$rowColor2,$available,$idx,
- $stored,$img,$users,$userdata,$granularity,$origmembers,$gpterm,
- $ucgpterm) = @_;
+ my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata,
+ $granularity,$origmembers,$gpterm,$ucgpterm) = @_;
my %lt = &Apache::lonlocal::texthash(
'gpme' => "$ucgpterm membership",
'addm' => 'Add members',
@@ -1745,62 +1657,51 @@ sub pick_new_members {
$r->print(&check_uncheck_tools($r,$available));
}
}
- &topic_bar($r,$tabcol,$img,$lt{'gpme'});
+ &topic_bar($r,$img,$lt{'gpme'});
if (keys(%members) > 0) {
$r->print('
-
- |
-
- |
-
-
- |
-
-
- |
-
');
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row());
$r->print('
-
-
- '.&mt('Add?').' |
- '.&mt('Name').' |
- '.&mt('Username').'
- |
- '.&mt('Domain').' |
- ID |
- Section |
+ '.&mt('Add?').'
+ | '.&mt('Name').'
+ | '.&mt('Username').'
+ | '.&mt('Domain').'
+ | '.&mt('ID').'
+ | '.&mt('Section').'
');
if (@{$available} > 0) {
- $r->print(' | '.$lt{'func'}.' | ');
+ $r->print(''.$lt{'func'}.' | ');
}
- $r->print(' ');
+ $r->print(&Apache::loncommon::end_data_table_header_row());
if (@{$available} > 0) {
if ($granularity eq 'Yes') {
- $r->print('
+ $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'
|
- '.&mt('All:').' ');
+ '.&mt('All:').' ');
foreach my $tool (@{$available}) {
$r->print(' ');
}
- $r->print(' | | ');
+ $r->print('');
}
}
my %Sortby = ();
@@ -1819,27 +1720,22 @@ sub pick_new_members {
push(@{$Sortby{$members{$user}[$$idx{fullname}]}},$user);
}
}
- my $rowNum = 0;
- my $rowColor;
foreach my $key (sort(keys(%Sortby))) {
foreach my $user (@{$Sortby{$key}}) {
- if ($rowNum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
- }
my $id = $members{$user}[$$idx{id}];
my $fullname = $members{$user}[$$idx{fullname}];
my $udom = $members{$user}[$$idx{udom}];
my $uname = $members{$user}[$$idx{uname}];
my $section = $members{$user}[$$idx{section}];
- $r->print('
- | '.
- $fullname.' | '.$uname.' | '.
- $udom.' | '.$id.' | '.
- ''.$section.' | ');
+ $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').
+ ' | '.
+ ''.$fullname.' | '.
+ ''.$uname.' | '.
+ ''.$udom.' | '.
+ ''.$id.' | '.
+ ''.$section.' | ');
if (@{$available} > 0) {
- $r->print(''.
+ $r->print(''.
' ');
foreach my $tool (@{$available}) {
if ($granularity eq 'Yes') {
@@ -1850,37 +1746,25 @@ sub pick_new_members {
$tool.'" value="'.$user.'" />'.$tool.' ');
}
}
- $r->print(' | ');
+ $r->print(' | ');
}
- $r->print(' '."\n");
- $rowNum ++;
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
}
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
- $r->print('
-
- ');
+ $r->print(&Apache::loncommon::end_data_table());
} else {
- $r->print('
-
- |
-
-');
if ($totalusers > 0) {
$r->print($lt{'nnew'}.'
'.$lt{'yoma'});
} else {
$r->print($lt{'nome'});
}
- $r->print('
- |
- ');
}
return $newusers;
}
sub privilege_specificity {
- my ($r,$tabcol,$rowColor1,$rowColor2,$action,$img,$tools,$stored,
- $toolprivs,$fixedprivs,$available,$formname,$gpterm,$ucgpterm) = @_;
+ my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available,
+ $formname,$gpterm,$ucgpterm) = @_;
my %lt = &Apache::lonlocal::texthash (
'uprv' => 'User privileges',
'frty' => 'For each type of functionality you have chosen to include, '.
@@ -1921,12 +1805,7 @@ sub privilege_specificity {
}
}
}
- &topic_bar($r,$tabcol,$img,$lt{'uprv'});
- $r->print('
-
- |
-
- ');
+ &topic_bar($r,$img,$lt{'uprv'});
if ((($action eq 'create') && (@{$available} > 0)) ||
(($action eq 'modify') && ($formname eq 'change_settings'))) {
my %specific = (
@@ -1952,21 +1831,14 @@ sub privilege_specificity {
}
if ($totaloptionalprivs) {
$r->print('
-
-
- |
-
-
- |
- ');
+
+
+');
} else {
$r->print('');
}
if ($totaloptionalprivs) {
- $r->print('
-
- |
- '.$lt{'plin'});
+ $r->print($lt{'plin'});
if ($action eq 'create') {
$r->print(' '.$lt{'thwi'});
}
@@ -1977,27 +1849,18 @@ sub privilege_specificity {
$r->print('('.&mt('if enabled below').').');
}
$r->print('
- |
-
-
- |
- ');
+ ');
&check_uncheck_buttons($r,$formname,'defpriv',$lt{'oppr'});
$r->print('
-
- |
-
- |
-
');
} else {
- $r->print(' | | '.$lt{'algm'}.'
');
+ $r->print($lt{'algm'}.'
');
}
- &default_privileges($r,$action,$tabcol,$rowColor1,$rowColor2,
- $tools,$toolprivs,$fixedprivs,$available);
+ &default_privileges($r,$action,$tools,$toolprivs,$fixedprivs,
+ $available);
} else {
if ($action eq 'create') {
$r->print($lt{'asyo'});
@@ -2013,95 +1876,85 @@ sub privilege_specificity {
$r->print($lt{'sall'});
}
$r->print(' '.$lt{'defp'}.'
');
- &display_defprivs($r,$tabcol,$rowColor1,$rowColor2,$tools,
- $toolprivs,\@defprivs);
+ &display_defprivs($r,$tools,$toolprivs,\@defprivs);
}
}
- $r->print('
- |
-
-');
return;
}
sub default_privileges {
- my ($r,$action,$tabcol,$rowColor1,$rowColor2,$tools,$toolprivs,
- $fixedprivs,$available) = @_;
+ my ($r,$action,$tools,$toolprivs,$fixedprivs,$available) = @_;
my %lt = &Apache::lonlocal::texthash(
'addp' => 'Additional privileges',
'fixp' => 'Fixed privileges',
'oppr' => 'Optional privileges',
'func' => 'Function',
);
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
- $r->print('
-
-
-
- '.$lt{'func'}.' |
-
-
- '.$lt{'fixp'}.' |
-
-
- '.$lt{'oppr'}.' |
-
-
- |
- ');
+ $r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box').
+ &Apache::lonhtmlcommon::row_title($lt{'func'},undef,
+ 'LC_groups_functionality'));
+ $r->print(join('',@{$tools}));
+ $r->print(&Apache::lonhtmlcommon::row_closure(1));
+ my $fixed = '';
+ my $dynamic = '';
foreach my $tool (@{$tools}) {
- $r->print(' |
-
-
- '.$tool.' |
-
- ');
my $privcount = 0;
- my $fixed = '';
- my $dynamic = '';
+ if ($dynamic ne '') {
+ $dynamic .= '';
+ }
+ $dynamic .= ''."\n".' |
- ');
+ $dynamic .= ' ';
}
- $r->print(' | '."\n");
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{'fixp'},undef,
+ 'LC_groups_fixed').
+ $fixed.
+ &Apache::lonhtmlcommon::row_closure(1));
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{'oppr'},undef,
+ 'LC_groups_optional').
+ $dynamic.
+ &Apache::lonhtmlcommon::end_pick_box());
$r->print(' ');
return;
+
}
sub display_defprivs {
- my ($r,$tabcol,$rowColor1,$rowColor2,$tools,$toolprivs,$defprivs) = @_;
+ my ($r,$tools,$toolprivs,$defprivs) = @_;
+ my $function = &Apache::loncommon::get_users_function();
+ my $tabcol = &Apache::loncommon::designparm($function.'.tabbg');
+ my $rowColor1 = "#dddddd";
+ my $rowColor2 = "#eeeeee";
my %lt = &Apache::lonlocal::texthash(
'priv' => 'Privileges',
'func' => 'Function',
@@ -2114,7 +1967,7 @@ sub display_defprivs {
@{$currprivs{$tool}} = ();
foreach my $priv (sort(keys(%{$$toolprivs{$tool}}))) {
if (ref($defprivs) eq 'ARRAY') {
- if (grep/^\Q$priv\E$/,@{$defprivs}) {
+ if (grep(/^\Q$priv\E$/,@{$defprivs})) {
push(@{$currprivs{$tool}},$priv);
}
}
@@ -2170,10 +2023,10 @@ sub display_defprivs {
sub change_members_form {
- my ($r,$cdom,$cnum,$tabcol,$action,$formname,$page,$groupname,$description,
+ my ($r,$cdom,$cnum,$action,$formname,$page,$groupname,$description,
$startdate,$enddate,$tools,$fixedprivs,$functions,$users,$userdata,
- $granularity,$quota,$specificity,$idx,$states,$navbuttons,$rowColor1,
- $rowColor2,$gpterm,$ucgpterm) = @_;
+ $granularity,$quota,$specificity,$idx,$states,$navbuttons,$gpterm,
+ $ucgpterm) = @_;
my %lt = &Apache::lonlocal::texthash(
grse => "$ucgpterm settings",
mogm => "Modify $gpterm membership",
@@ -2191,39 +2044,22 @@ sub change_members_form {
my $prevtext = $$navbuttons{'gtpp'};
$r->print('
-
-');
- &topic_bar($r,$tabcol,1,$lt{'grse'});
- $r->print('
-
- |
-
');
- &print_current_settings($r,$action,$tabcol,$rowColor1,$rowColor2,
- $functions,$startdate,$enddate,$groupname,
- $description,$granularity,$quota,\@available,
- \@unavailable,$gpterm,$ucgpterm);
-$r->print('
- | | ');
- &topic_bar($r,$tabcol,2,$lt{'mogm'});
- $r->print('
-
- |
-
-');
- ¤t_membership($r,$cdom,$cnum,$formname,$tabcol,$rowColor1,
- $rowColor2,$groupname,\@available,\@unavailable,
- $fixedprivs,$granularity,$specificity);
- $r->print(' | ');
+ &topic_bar($r,1,$lt{'grse'});
+ &print_current_settings($r,$action,$functions,$startdate,$enddate,
+ $groupname,$description,$granularity,$quota,
+ \@available,\@unavailable,$gpterm,$ucgpterm);
+ &topic_bar($r,2,$lt{'mogm'});
+ ¤t_membership($r,$cdom,$cnum,$formname,$groupname,\@available,
+ \@unavailable,$fixedprivs,$granularity,$specificity);
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
$$states{$action}[$page+1],$nexttext);
- $r->print(' ');
return;
}
sub current_membership {
- my ($r,$cdom,$cnum,$formname,$tabcol,$rowColor1,$rowColor2,$groupname,
- $available,$unavailable,$fixedprivs,$granularity,$specificity) = @_;
+ my ($r,$cdom,$cnum,$formname,$groupname,$available,$unavailable,
+ $fixedprivs,$granularity,$specificity) = @_;
my %membership = &Apache::lonnet::get_group_membership($cdom,$cnum,
$groupname);
my %lt = &Apache::lonlocal::texthash(
@@ -2245,9 +2081,6 @@ sub current_membership {
$available);
if (keys(%{$current}) > 0) {
$r->print('
-
- |
-
');
if ($num_expire) {
@@ -2284,51 +2117,41 @@ sub current_membership {
$r->print(<<"END");
- |
- |
-
-
- |
-
-
- |
-
+
END
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row());
$r->print(<<"END");
-
-
- $lt{'actn'} |
- $lt{'name'} |
- $lt{'usnm'}
- |
- $lt{'doma'} |
- ID |
- $lt{'stda'} |
- $lt{'enda'} |
+ $lt{'actn'} |
+ $lt{'name'} |
+ $lt{'usnm'} |
+ $lt{'doma'} |
+ ID |
+ $lt{'stda'} |
+ $lt{'enda'} |
END
my $colspan = 0;
if ($hastools) {
- $r->print(''.$lt{'curf'}.' | ');
- $colspan ++;
+ $r->print(''.$lt{'curf'}.' | ');
+ $colspan++;
}
if ($addtools) {
- $r->print('Additional Functionality | ');
- $colspan ++;
+ $r->print(''.&mt('Additional Functionality').' | ');
+ $colspan++;
}
- $r->print(' ');
+ $r->print(&Apache::loncommon::end_data_table_header_row());
if ($colspan) {
if ($granularity eq 'Yes') {
- $r->print('
+ $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'
|
- '.&mt('All:').
+ '.&mt('All:').
' ');
foreach my $tool (@{$available}) {
$r->print(' ');
+ ' value="'.$tool.'" />'.''.$tool.' ');
}
- $r->print(' | | ');
+ $r->print('');
}
}
my %Sortby = ();
@@ -2345,23 +2168,16 @@ END
push(@{$Sortby{$$current{$user}{fullname}}},$user);
}
}
- my $rowNum = 0;
- my $rowColor;
foreach my $key (sort(keys(%Sortby))) {
foreach my $user (@{$Sortby{$key}}) {
- if ($rowNum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
- }
my $id = $$current{$user}{id};
my $fullname = $$current{$user}{fullname};
my $udom = $$current{$user}{udom};
my $uname = $$current{$user}{uname};
my $start = $$current{$user}{start};
my $end = $$current{$user}{end};
- $r->print('
- ');
+ $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').'
+ ');
if ($$current{$user}{changestate} eq 'reenable') {
$r->print('');
}
$r->print('
- |
- '.
- $fullname.' | '.$uname.' | '.
- $udom.' | '.$id.' | '.$start.
- ' | '.$end.' | ');
+ | '.
+ ''.$fullname.' | '.
+ ''.$uname.' | '.
+ ''. $udom.' | '.
+ ''.$id.' | '.
+ ''.$start.' | '.
+ ''.$end.' | ');
if ($hastools) {
- $r->print(''.
+ $r->print(''.
' ');
foreach my $tool (@{$$current{$user}{currtools}}) {
if ($granularity eq 'Yes') {
@@ -2406,10 +2224,10 @@ END
}
$r->print(' ');
}
- $r->print(' | ');
+ $r->print(' | ');
}
if ($addtools) {
- $r->print('');
+ $r->print('');
if ($granularity eq 'Yes') {
foreach my $tool (@{$$current{$user}{newtools}}) {
$r->print(' | ');
+ $r->print(' | ');
}
- $r->print(' '."\n");
- $rowNum ++;
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
}
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
- $r->print('
-
- ');
+ $r->print(&Apache::loncommon::end_data_table());
}
return;
}
@@ -2443,26 +2257,26 @@ sub check_uncheck_buttons {
my ($r,$formname,$field,$title,$colspan) = @_;
$r->print('
-
+
|
');
}
sub change_privs_form {
- my ($r,$cdom,$cnum,$tabcol,$action,$formname,$page,$startdate,$enddate,
- $tools,$functions,$toolprivs,$fixedprivs,$userdata,$usertools,
- $memchg,$idx,$states,$stored,$sectioncount,$navbuttons,$rowColor1,
- $rowColor2,$gpterm,$ucgpterm) = @_;
+ my ($r,$cdom,$cnum,$action,$formname,$page,$startdate,$enddate,
+ $tools,$functions,$toolprivs,$fixedprivs,$userdata,$usertools,
+ $memchg,$idx,$states,$stored,$sectioncount,$navbuttons,$gpterm,
+ $ucgpterm) = @_;
my @regexps = ('userpriv_');
my $nexttext;
my %lt = &Apache::lonlocal::texthash(
@@ -2477,8 +2291,7 @@ sub change_privs_form {
} else {
$nexttext = $$navbuttons{'mose'};
}
- $r->print('
');
- &topic_bar($r,$tabcol,3,&mt('Members to delete or expire'));
+ &topic_bar($r,3,&mt('Members to delete or expire'));
my $exp_or_del = 0;
if (ref($$memchg{'deletion'}) eq 'ARRAY') {
if (@{$$memchg{'deletion'}} > 0) {
@@ -2487,7 +2300,7 @@ sub change_privs_form {
$r->print(''.$$userdata{$user}[$$idx{fullname}].
' ('.$user.')');
}
- $r->print(' | ');
+ $r->print('');
$exp_or_del += @{$$memchg{'deletion'}};
}
}
@@ -2498,23 +2311,20 @@ sub change_privs_form {
$r->print(''.$$userdata{$user}[$$idx{fullname}].
' ('.$user.')');
}
- $r->print(' | ');
+ $r->print('');
$exp_or_del += @{$$memchg{'expire'}};
}
}
if (!$exp_or_del) {
- $r->print(' | '.$lt{'nome'}.
- ' | | ');
+ $r->print($lt{'nome'}.' ');
}
- &topic_bar($r,$tabcol,4,&mt('[_1] member privileges',$ucgpterm));
+ &topic_bar($r,4,&mt('[_1] member privileges',$ucgpterm));
- my $numchgs = &member_privileges_form($r,$tabcol,$action,$formname,$tools,
+ my $numchgs = &member_privileges_form($r,$action,$formname,$tools,
$toolprivs,$fixedprivs,$userdata,
$usertools,$idx,$memchg,$states,
- $stored,$rowColor1,$rowColor2,
- $gpterm);
- $r->print(' | ');
+ $stored,$gpterm);
my $prevtext = $$navbuttons{'gtps'};
if ($numchgs || $exp_or_del) {
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
@@ -2522,50 +2332,33 @@ sub change_privs_form {
} else {
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext);
}
- $r->print(' ');
return;
}
sub add_members_form {
- my ($r,$tabcol,$action,$formname,$page,$startdate,$enddate,$groupname,
+ my ($r,$action,$formname,$page,$startdate,$enddate,$groupname,
$description,$granularity,$quota,$sectioncount,$tools,$functions,
- $stored,$states,$navbuttons,$rowColor1,$rowColor2,$gpterm,$ucgpterm)=@_;
- $r->print('
-
-
- |
-
-');
+ $stored,$states,$navbuttons,$gpterm,$ucgpterm)=@_;
+ $r->print(' ');
my @available = ();
my @unavailable = ();
&check_tools($functions,$tools,\@available,\@unavailable);
- &print_current_settings($r,$action,$tabcol,$rowColor1,$rowColor2,
- $functions,$startdate,$enddate,$groupname,
- $description,$granularity,$quota,\@available,
- \@unavailable,$gpterm,$ucgpterm);
- $r->print('
- |
-
-
- |
- ');
-
- &membership_options($r,$action,$formname,$tabcol,$sectioncount,1,$gpterm,
- $ucgpterm);
+ &print_current_settings($r,$action,$functions,$startdate,$enddate,
+ $groupname,$description,$granularity,$quota,
+ \@available,\@unavailable,$gpterm,$ucgpterm);
+ &membership_options($r,$action,$formname,$sectioncount,1,$gpterm,$ucgpterm);
my $nexttext = $$navbuttons{'gtns'};
my $prevtext = $$navbuttons{'gtpp'};
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
$$states{$action}[$page+1],$nexttext);
- $r->print('
- ');
return;
}
sub choose_privs_form {
- my ($r,$cdom,$cnum,$tabcol,$action,$formname,$page,$startdate,$enddate,
- $tools,$functions,$toolprivs,$fixedprivs,$userdata,$usertools,$idx,
- $states,$stored,$sectioncount,$navbuttons,$rowColor1,$rowColor2,
- $gpterm,$ucgpterm,$crstype) = @_;
+ my ($r,$cdom,$cnum,$action,$formname,$page,$startdate,$enddate,
+ $tools,$functions,$toolprivs,$fixedprivs,$userdata,$usertools,$idx,
+ $states,$stored,$sectioncount,$navbuttons,$gpterm,$ucgpterm,
+ $crstype) = @_;
my @regexps = ('userpriv_');
my $nexttext;
@@ -2582,27 +2375,24 @@ sub choose_privs_form {
$nexttext = $$navbuttons{'adme'};
}
- $r->print('
');
- &topic_bar($r,$tabcol,6,&mt('[_1] member privileges',$ucgpterm));
+ &topic_bar($r,6,&mt('[_1] member privileges',$ucgpterm));
- &member_privileges_form($r,$tabcol,$action,$formname,$tools,$toolprivs,
+ &member_privileges_form($r,$action,$formname,$tools,$toolprivs,
$fixedprivs,$userdata,$usertools,$idx,undef,
- $states,$stored,$rowColor1,$rowColor2,$gpterm);
+ $states,$stored,$gpterm);
- $r->print(' | ');
if ($action eq 'create') {
if (keys(%{$sectioncount}) > 0) {
my $img1 = 7;
my $img2 = 8;
- &mapping_options($r,$action,$formname,$page,$tabcol,$sectioncount,
+ &mapping_options($r,$action,$formname,$page,$sectioncount,
$states,$stored,$navbuttons,$img1,$img2,
- $rowColor1,$rowColor2,$gpterm,$ucgpterm,$crstype);
+ $gpterm,$ucgpterm,$crstype);
}
}
my $prevtext = $$navbuttons{'gtps'};
&display_navbuttons($r,$formname,$$states{$action}[$page-1],$prevtext,
$$states{$action}[$page+1],$nexttext);
- $r->print(' ');
return;
}
@@ -2665,9 +2455,8 @@ function uncheckAllTools(formname) {
}
sub member_privileges_form {
- my ($r,$tabcol,$action,$formname,$tools,$toolprivs,$fixedprivs,$userdata,
- $usertools,$idx,$memchg,$states,$stored,$rowColor1,$rowColor2,
- $gpterm) = @_;
+ my ($r,$action,$formname,$tools,$toolprivs,$fixedprivs,$userdata,
+ $usertools,$idx,$memchg,$states,$stored,$gpterm) = @_;
my %lt = &Apache::lonlocal::texthash(
'addp' => 'Additional privileges',
'fixp' => 'Fixed privileges',
@@ -2728,7 +2517,7 @@ sub member_privileges_form {
}
$numchgs = @currmembers;
if (!$numchgs) {
- $r->print(' | '.$lt{'nogm'});
+ $r->print($lt{'nogm'});
return $numchgs;
}
}
@@ -2744,17 +2533,14 @@ sub member_privileges_form {
my %total;
if (keys(%{$usertools}) > 1) {
$r->print('
- |
- |
-
-
+
');
foreach my $tool (@{$tools}) {
if (@{$showboxes{$tool}} > 0) {
$r->print('');
- $r->print(''.
+ $r->print(''.
+ ''.
$tool.' | ');
my $privcount = 0;
foreach my $priv (@{$showboxes{$tool}}) {
@@ -2792,59 +2578,44 @@ sub member_privileges_form {
$r->print('
| | ');
}
}
- $r->print('
---|
| ');
- $r->print(' | ');
+ $r->print(' ');
}
- $r->print(' | ');
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row());
$r->print(<<"END");
- |
- $lt{'full'} |
- $lt{'user'} |
+ $lt{'full'} |
+ $lt{'user'} |
$lt{'doma'} |
$lt{'addp'} |
-
END
- &member_privs_entries($r,$tabcol,$rowColor1,$rowColor2,
- $usertools,$toolprivs,$fixedprivs,
+ $r->print(&Apache::loncommon::end_data_table_header_row());
+ &member_privs_entries($r,$usertools,$toolprivs,$fixedprivs,
$userdata,$idx,\@showtools,\@defprivs,
\@excluded);
- $r->print('');
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
- $r->print('
-
- |
-
-');
+ $r->print(&Apache::loncommon::end_data_table());
} else {
- $r->print(' | '.$lt{'forf'}.
- ' ');
- &display_defprivs($r,$tabcol,$rowColor1,$rowColor2,$tools,
- $toolprivs,\@defprivs);
+ $r->print($lt{'forf'}.' ');
+ &display_defprivs($r,$tools,$toolprivs,\@defprivs);
}
} else {
if (keys(%{$usertools}) > 0) {
- $r->print(' | | '.$lt{'algr'}.
- '
');
- &display_defprivs($r,$tabcol,$rowColor1,$rowColor2,$tools,
- $toolprivs,\@defprivs);
+ $r->print($lt{'algr'}.'
');
+ &display_defprivs($r,$tools,$toolprivs,\@defprivs);
} else {
- $r->print(' | | '.$lt{'asno'}.
- ' ');
+ $r->print($lt{'asno'}.' ');
}
}
} else {
- $r->print(' | | '.$lt{'asng'});
+ $r->print($lt{'asng'});
}
return $numchgs;
}
sub process_request {
- my ($r,$cdom,$cnum,$tabcol,$action,$state,$page,$groupname,$description,
+ my ($r,$cdom,$cnum,$action,$state,$page,$groupname,$description,
$specificity,$userdata,$startdate,$enddate,$tools,$functions,$toolprivs,
$usertools,$idx,$types,$roles,$sections,$states,$navbuttons,$memchg,
- $sectioncount,$stored,$rowColor1,$rowColor2,$gpterm,$ucgpterm,
- $crstype) = @_;
+ $sectioncount,$stored,$gpterm,$ucgpterm,$crstype) = @_;
$r->print(&Apache::lonhtmlcommon::echo_form_input(
['origin','action','state','page','sortby']));
@@ -3237,9 +3008,8 @@ sub process_membership {
}
sub mapping_options {
- my ($r,$action,$formname,$page,$tabcol,$sectioncount,$states,$stored,
- $navbuttons,$img1,$img2,$rowColor1,$rowColor2,$gpterm,$ucgpterm,
- $crstype) = @_;
+ my ($r,$action,$formname,$page,$sectioncount,$states,$stored,
+ $navbuttons,$img1,$img2,$gpterm,$ucgpterm,$crstype) = @_;
my %lt = &Apache::lonlocal::texthash(
'auto' => "Settings for automatic $gpterm enrollment",
'gmma' => "$ucgpterm membership mapping to specific sections/roles",
@@ -3255,18 +3025,13 @@ sub mapping_options {
'auex' => "Automatically expire $gpterm membership when roles are removed?",
'mapr' => "Mapping of roles and sections affected by automatic $gpterm enrollment/disenrollment follows scheme chosen below.",
);
- &automapping($r,$action,$tabcol,$stored,\%lt,$img1);
- $r->print('
- |
- |
- ');
- &mapping_settings($r,$tabcol,$rowColor1,$rowColor2,$sectioncount,\%lt,
- $stored,$img2,$crstype);
+ &automapping($r,$action,$stored,\%lt,$img1);
+ &mapping_settings($r,$sectioncount,\%lt,$stored,$img2,$crstype);
return;
}
sub automapping {
- my ($r,$action,$tabcol,$stored,$lt,$image) = @_;
+ my ($r,$action,$stored,$lt,$image) = @_;
my $add = 'off';
my $drop = 'off';
if (exists($$stored{'autoadd'})) {
@@ -3275,78 +3040,44 @@ sub automapping {
if (exists($$stored{'autodrop'})) {
$drop = $$stored{'autodrop'};
}
- &topic_bar($r,$tabcol,$image,$$lt{'endi'});
+ &topic_bar($r,$image,$$lt{'endi'});
$r->print('
-
- |
-
- '.$$lt{'gmma'}.': '.$$lt{'adds'}.' '.$$lt{'drops'}.'
- |
-
-
- |
-
-
- |
-
+ '.$$lt{'gmma'}.': '.$$lt{'adds'}.' '.$$lt{'drops'}.'
'.$$lt{'auad'}.':
');
if ($action eq 'modify') {
$r->print(' ('.$$lt{'curr'}.' '.$$lt{$add}.')');
}
$r->print('
-
- |
-
-
- |
-
+
'.$$lt{'auex'}.':
');
if ($action eq 'modify') {
$r->print(' ('.$$lt{'curr'}.' '.$$lt{$drop}.')');
}
- $r->print('
- |
-
-
- |
-
-
- |
- '.$$lt{'mapr'}.'
- |
-
-');
+ $r->print('
'.$$lt{'mapr'});
}
sub mapping_settings {
- my ($r,$tabcol,$rowColor1,$rowColor2,$sectioncount,$lt,$stored,$image,
- $crstype) = @_;
+ my ($r,$sectioncount,$lt,$stored,$image,$crstype) = @_;
my @sections = keys(%{$sectioncount});
if (@sections > 0) {
@sections = sort {$a cmp $b} @sections;
unshift(@sections,'none'); # Put 'no sections' next
unshift(@sections,'all'); # Put 'all' at the front of the list
}
- &topic_bar($r,$tabcol,$image,$$lt{'pirs'});
- $r->print('
-
- |
-
-');
+ &topic_bar($r,$image,$$lt{'pirs'});
my @roles = &standard_roles();
my %customroles = &my_custom_roles();
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+ $r->print(&Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_header_row());
$r->print('
- |
'.&mt('Active?').' |
'.&mt('Role').' | ');
if (@sections > 0) {
- $r->print(''.&mt('Sections').' | '."\n");
+ $r->print(''.&mt('Sections').' | ');
}
- my $rowNum = 0;
- my $rowColor;
+ $r->print(&Apache::loncommon::end_data_table_header_row()."\n");
foreach my $role (@roles) {
my $plrole=&Apache::lonnet::plaintext($role,$crstype);
my $sections_sel;
@@ -3361,33 +3092,25 @@ sub mapping_settings {
'';
}
}
- if ($rowNum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
- }
- $r->print(' | '.$plrole.
- ' | '.$sections_sel.' ');
- $rowNum ++;
+ $r->print(&Apache::loncommon::start_data_table_row().
+ ' | '.$plrole.
+ ' | '.$sections_sel.
+ &Apache::loncommon::end_data_table_row());
}
foreach my $role (sort(keys(%customroles))) {
my $sections_sel;
if (@sections > 0) {
- $sections_sel = ''.§ions_selection(\@sections,'sec_'.$role).
- ' | ';
- }
- if ($rowNum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
+ $sections_sel =
+ ''.§ions_selection(\@sections,'sec_'.$role).' | ';
}
- $r->print(' | '.$role.' | '.
- $sections_sel.' ');
- $rowNum ++;
+ $r->print(&Apache::loncommon::start_data_table_row().
+ ' | '.$role.' | '.
+ $sections_sel.
+ &Apache::loncommon::end_data_table_row());
}
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
+ $r->print(&Apache::loncommon::end_data_table());
return;
}
@@ -3444,10 +3167,8 @@ sub modify_menu {
}
sub member_privs_entries {
- my ($r,$tabcol,$rowColor1,$rowColor2,$usertools,$toolprivs,
- $fixedprivs,$userdata,$idx,$showtools,$defprivs,$excluded) = @_;
- my $rowColor;
- my $rowNum = 0;
+ my ($r,$usertools,$toolprivs,$fixedprivs,$userdata,$idx,$showtools,
+ $defprivs,$excluded) = @_;
foreach my $user (sort(keys(%{$usertools}))) {
if (defined($excluded)) {
if (ref($excluded) eq 'ARRAY') {
@@ -3457,19 +3178,14 @@ sub member_privs_entries {
}
}
my ($uname,$udom) = split(/:/,$user);
- if ($rowNum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
- }
- $r->print('
+ $r->print(&Apache::loncommon::start_data_table_row().'
'.$$userdata{$user}[$$idx{fullname}].' |
'.$uname.' |
'.$udom.' |
| ');
foreach my $tool (@{$showtools}) {
if (exists($$usertools{$user}{$tool})) {
- $r->print(''.$tool.' | ');
+ $r->print(''.$tool.' | ');
my $privcount = 0;
my $fixed = '';
my $dynamic = '';
@@ -3492,10 +3208,10 @@ sub member_privs_entries {
}
$r->print(''.$fixed.' | '.$dynamic.'
| ');
} else {
- $r->print(' | ');
+ $r->print(' | ');
}
}
- $rowNum ++;
+ $r->print(&Apache::loncommon::end_data_table_row());
}
}
@@ -3516,23 +3232,18 @@ sub date_setting_table {
'startdate',$starttime);
my $endform = &Apache::lonhtmlcommon::date_setter($formname,
'enddate',$endtime);
- my $perpetual = '';
- my $start_table = '';
- $start_table .= "\n";
+ return $table;
}
sub add_group_folder {
@@ -3544,23 +3255,23 @@ sub add_group_folder {
my ($outcome,$allgrpsmap,$grpmap,$boardsmap,$grppage);
my $navmap = Apache::lonnavmaps::navmap->new();
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/';
- $allgrpsmap = $crspath.'default_0.sequence';
+ $allgrpsmap = $crspath.'group_allfolders.sequence';
my $topmap = $navmap->getResourceByUrl($allgrpsmap);
undef($navmap);
if ($action eq 'create') {
- # check if default_0.sequence exists.
+ # check if group_allfolders.sequence exists.
if (!$topmap) {
my $grpstitle = &mt('[_1] [_2]',$crstype,$ucgpterm);
my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'};
$topmap_url =~ s|/+|/|g;
if ($topmap_url =~ m|^/uploaded|) {
- $outcome = &map_updater($cdom,$cnum,'default_0.sequence',
+ $outcome = &map_updater($cdom,$cnum,'group_allfolders.sequence',
'toplevelgroup',$grpstitle,$topmap_url);
if ($outcome ne 'ok') {
return $outcome;
}
} else {
- $outcome = &mt('Non-standard course - group folder not added.');
+ $outcome = &mt('Non-standard course - folder for all groups not added.');
return $outcome;
}
}
@@ -3568,7 +3279,7 @@ sub add_group_folder {
$grppage='/adm/'.$cdom.'/'.$cnum.'/'.$groupname.'/grppg';
my $grptitle = &mt('Group homepage').' - '.$description;
my ($seqid,$discussions,$disctitle);
- my $outcome = &map_updater($cdom,$cnum,'default_'.$now.'.sequence',
+ my $outcome = &map_updater($cdom,$cnum,'group_folder_'.$groupname.'.sequence',
'grpseq',$grpfolder,$allgrpsmap,$grppage,
$grptitle);
if ($outcome ne 'ok') {
@@ -3577,16 +3288,16 @@ sub add_group_folder {
my $pageout = &create_homepage($cdom,$cnum,$groupname,$groupinfo,
$tools,$gpterm,$ucgpterm,$now);
# Link to folder for bulletin boards
- $grpmap = $crspath.'default_'.$now.'.sequence';
+ $grpmap = $crspath.'group_folder_'.$groupname.'.sequence';
if (grep/^discussion$/,@{$tools}) {
$seqid = $now + 1;
$disctitle = &mt('Discussion Boards');
- my $outcome = &map_updater($cdom,$cnum,'default_'.$seqid.
+ my $outcome = &map_updater($cdom,$cnum,'group_boards_'.$groupname.
'.sequence','bbseq',$disctitle,$grpmap);
if ($outcome ne 'ok') {
return $outcome;
}
- $boardsmap = $crspath.'default_'.$seqid.'.sequence';
+ $boardsmap = $crspath.'group_boards_'.$groupname.'.sequence';
}
} else {
#modify group folder if status of discussions tools is changed
@@ -3763,8 +3474,8 @@ sub validate_groupname {
"existing $gpterm",
);
- my $exitmsg = ''.$lt{'igna'}.'
'.$lt{'tgne'}.' "'.
- $groupname.'" ';
+ my $exitmsg = ''.$lt{'igna'}.'
'.
+ $lt{'tgne'}.' "'.$groupname.'" ';
my $dupmsg = $lt{'grna'};
my $earlyout;
if (($groupname eq '') || ($groupname =~ /\W/)) {
@@ -3792,22 +3503,13 @@ sub validate_groupname {
}
sub topic_bar {
- my ($r,$tabcol,$imgnum,$title) = @_;
+ my ($r,$imgnum,$title) = @_;
$r->print('
-
- |
-
-
-
-
- |
- '.$title.'
- |
- |
-
-
- |
-
+
+ !['.&mt('Step [_1]',$imgnum).
+ '](/res/adm/pages/bl_step'.$imgnum.'.gif)
+ '.$title.'
+
');
return;
}
| | |
| |
| |