-$titleinfo $dc_info
+$titleinfo $dc_info $menu
|
$env{'environment.firstname'}
@@ -2928,7 +2936,7 @@ ENDBODY
=back
-=head1 HTTP Helpers
+=head1 HTML Helpers
=over 4
@@ -2936,14 +2944,10 @@ ENDBODY
Returns a uniform footer for LON-CAPA web pages.
-Inputs:
-
-=over 4
+Inputs: none
=back
-Returns: A uniform footer for LON-CAPA web pages.
-
=cut
sub endbodytag {
@@ -2952,10 +2956,143 @@ sub endbodytag {
return $endbodytag;
}
+=pod
+
+=over 4
+
+=item * &headtag()
+
+Returns a uniform footer for LON-CAPA web pages.
+
+Inputs: $title - optional title for the head
+ $head_extra - optional extra HTML to put inside the
+
+=back
+
+=cut
+
+sub headtag {
+ my ($title,$head_extra,$args) = @_;
+
+ my $result =
+ ''.
+ &Apache::lonxml::fontsettings().
+ &Apache::lonhtmlcommon::htmlareaheaders();
+
+ if (ref($args->{'redirect'})) {
+ my ($time,$url) = @{$args->{'redirect'}};
+ $result.=<
+
+ADDMETA
+ }
+ if (!defined($title)) {
+ $title = 'The LearningOnline Network with CAPA';
+ }
+
+ $result .= ''.&mt($title).''.$head_extra;
+
+ return $result;
+}
+
+=pod
+
+=over 4
+
+=item * &endheadtag()
+
+Returns a uniform for LON-CAPA web pages.
+
+Inputs: none
+
+=back
+
+=cut
+
+sub endheadtag {
+ return '';
+}
+
+=pod
+
+=over 4
+
+=item * &head()
+
+Returns a uniform complete .. section for LON-CAPA web pages.
+
+Inputs: $title - optional title for the page
+ $head_extra - optional extra HTML to put inside the
+=back
+
+=cut
+
+sub head {
+ my ($title,$head_extra) = @_;
+ return &headtag($title,$head_extra).&endheadtag();
+}
+
+=pod
+
+=over 4
+
+=item * &start_page()
+
+Returns a complete .. section for LON-CAPA web pages.
+
+Inputs: $title - optional title for the page
+ $head_extra - optional extra HTML to incude inside the
+ %args - additional optional args supported are:
+ only_body -> is true will set &bodytag() onlybodytag arg on
+ no_nav_bar -> is true will set &bodytag() notopbar arg on
+ add_entries -> additional attributes to add to the
+ domain -> force to color decorate a page for a
+ specific domain
+ function -> force usage of a specific rolish color scheme
+ redirect -> ...
+
+=back
+
+=cut
+
+sub start_page {
+ my ($title,$head_extra,$args) = @_;
+ my %head_args;
+ if (defined($args->{'redirect'})) {
+ $head_args{'redirect'} = $args->{'redirect'};
+ }
+
+ return
+ &Apache::lonxml::xmlbegin().
+ &headtag($title,$head_extra,\%head_args).&endheadtag().
+ &bodytag($title, $args->{'function'}, $args->{'add_entries'},
+ $args->{'only_body'},
+ undef,undef,undef,$args->{'no_nav_bar'});
+}
+
+=pod
+
+=over 4
+
+=item * &head()
+
+Returns a complete section for LON-CAPA web pages.
+
+Inputs: None
+
+=back
+
+=cut
+
+sub end_page {
+ return &endbodytag."\n";
+}
###############################################
=pod
+=over 4
+
=item get_users_function
Used by &bodytag to determine the current users primary role.
@@ -3170,7 +3307,7 @@ times for group members.
Outer hash key is functions.
Inner hash keys are chat,discussion,email,files,homepage,roster.
Corresponding values are either on or off, depending on
-whther this type of functionality is available for the group.
+whether this type of functionality is available for the group.
=cut
@@ -3181,13 +3318,18 @@ sub get_group_settings {
my $parser=HTML::TokeParser->new(\$groupinfo);
my $token;
my $tool = '';
+ my $role = '';
my %content=();
while ($token=$parser->get_token) {
if ($token->[0] eq 'S') {
my $entry=$token->[1];
- if ($entry eq 'functions') {
+ if ($entry eq 'functions' || $entry eq 'autosec') {
%{$content{$entry}} = ();
$tool = $entry;
+ } elsif ($entry eq 'role') {
+ if ($tool eq 'autosec') {
+ $role = $token->[2]{id};
+ }
} else {
my $value=$parser->get_text('/'.$entry);
if ($entry eq 'name') {
@@ -3197,14 +3339,24 @@ sub get_group_settings {
}
} elsif ($entry eq 'groupname') {
$content{$entry}=&Apache::lonnet::unescape($value);
+ } elsif (($entry eq 'roles') || ($entry eq 'types') ||
+ ($entry eq 'sectionpick') || ($entry eq 'defpriv')) {
+ push(@{$content{$entry}},$value);
+ } elsif ($entry eq 'section') {
+ if ($tool eq 'autosec' && $role ne '') {
+ push(@{$content{$tool}{$role}},$value);
+ }
} else {
$content{$entry}=$value;
}
}
} elsif ($token->[0] eq 'E') {
- if ($token->[1] eq 'functions') {
+ if ($token->[1] eq 'functions' || $token->[1] eq 'autosec') {
$tool = '';
+ } elsif ($token->[1] eq 'role') {
+ $role = '';
}
+
}
}
return %content;
|