'.
+ &Apache::loncommon::end_data_table_row();
+ }
+ $output .= &Apache::loncommon::end_data_table();
+ $output .= &row_closure();
+ return $output;
+}
-=back
-Returns: a string containing HTML for a multiple select box for
-selecting sections of a course.
+sub submit_row {
+ my ($title,$cmd,$submit_text,$css_class) = @_;
+ my $output = &row_title($title,$css_class,'LC_pick_box_submit');
+ $output .= qq|
+
+
+
+
+ \n|;
+ return $output;
+}
-The form element name is 'Section'. @$sections is sorted prior to output.
+sub course_custom_roles {
+ my ($cdom,$cnum) = @_;
+ my %returnhash=();
+ my %coursepersonnel=&Apache::lonnet::dump('nohist_userroles',$cdom,$cnum);
+ foreach my $person (sort(keys(%coursepersonnel))) {
+ my ($role) = ($person =~ /^([^:]+):/);
+ my ($end,$start) = split(/:/,$coursepersonnel{$person});
+ if ($end == -1 && $start == -1) {
+ next;
+ }
+ if ($role =~ m|^cr/[^/]+/[^/]+/[^/]|) {
+ $returnhash{$role} ++;
+ }
+ }
+ return %returnhash;
+}
-=cut
-########################################################
-########################################################
-sub MultipleSectionSelect {
- my ($sections,$selectedSections)=@_;
+##############################################
+##############################################
- my $Str = '';
- $Str .= ''."\n";
+# topic_bar
+#
+# Generates a div containing an (optional) number with a white background followed by a
+# title with a background color defined in the corresponding CSS: LC_topic_bar
+# Inputs:
+# 1. number to display.
+# If input for number is empty only the title will be displayed.
+# 2. title text to display.
+# Outputs - a scalar containing html mark-up for the div.
+
+sub topic_bar {
+ my ($num,$title) = @_;
+ my $number = '';
+ if ($num ne '') {
+ $number = ''.$num.'';
+ }
+ return '
+#
+# NOTES: See sub htmltag for further information.
+#
+# OUTPUT: List of subroutines.
+sub inittags {
+ my @tags = @_;
+ return map { my $tag = $_;
+ sub { return htmltag( $tag, @_ ) }
+ } @tags;
}
-########################################################
-########################################################
-=pod
+# USAGE: scripttag(scriptcode, [start|end|both]);
+#
+# EXAMPLES:
+# - scripttag("alert('Hello World!')", 'both')
+# returns:
+#
+#
+# NOTES:
+# - works currently only for javascripts
+#
+# OUTPUT:
+# Scriptcode properly enclosed in ");
+=item funclist_from_array( \@array, {legend => 'text for legend'} )
- my %prog_state;
- $prog_state{'now'}=0;
- $prog_state{'since'}=time;
- $prog_state{'started'}=time;
- $prog_state{'total'}=$number_to_do;
+Constructs a XHTML list from \@array with the first item being visually
+highlighted and set to the value of legend or 'Functions' if legend is
+empty.
- $r->rflush();
- return %prog_state;
-}
+=over
-# update progress
-sub Update_PrgWin {
- my ($r,$prog_state,$displayString)=@_;
- $r->print('');
- $$prog_state{'started'}=time;
- $r->rflush();
-}
+=item \@array
-# increment progress state
-sub Increment_PrgWin {
- my ($r,$prog_state,$extraInfo)=@_;
- $$prog_state{'now'}++;
- $r->print('');
- $$prog_state{'started'}=time;
- $r->rflush();
-}
+A reference to the array containing text that will be wrapped in tags.
-# close Progress Line
-sub Close_PrgWin {
- my ($r,$prog_state)=@_;
- $r->print(''."\n");
- undef(%$prog_state);
- $r->rflush();
+=item { legend => 'text' }
+
+A string that's used as visually highlighted first item. 'Functions' is used if
+it's value evaluates to false.
+
+=back
+
+returns: XHTML list as string.
+
+=back
+
+=cut
+
+sub funclist_from_array {
+ my ($items, $args) = @_;
+ $args->{legend} ||= mt('Functions');
+ return list_from_array( [$args->{legend}, @$items],
+ { listattr => {class => 'LC_funclist'} });
}
1;
+
__END__