';
#
- my $Str = "\n".
- ''.
- ''.
- '';
- # The last breadcrumb does not have a link, so handle it seperately.
+ # Make the faq and bug data cascade
+ my $faq = '';
+ my $bug = '';
+ my $help='';
+ # The last breadcrumb does not have a link, so handle it separately.
my $last = pop(@Crumbs);
- # The first one should be the course, I guess.
- if (exists($ENV{'request.course.id'})) {
- my $cid = $ENV{'request.course.id'};
- unshift(@Crumbs,{href=>'/adm/menu',
- title=>'Go to main menu',
- text=>$ENV{'course.'.$cid.'.description'},
- });
+ #
+ # The first one should be the course or a menu link
+ if (!defined($menulink)) { $menulink=1; }
+ if ($menulink) {
+ my $description = 'Menu';
+ if (exists($env{'request.course.id'}) &&
+ $env{'request.course.id'} ne '') {
+ $description =
+ $env{'course.'.$env{'request.course.id'}.'.description'};
+ }
+ unshift(@Crumbs,{
+ href =>'/adm/menu',
+ title =>'Go to main menu',
+ target =>'_top',
+ text =>$description,
+ });
}
my $links .=
join('->',
map {
- ''.
- $_->{'text'}.''
+ $faq = $_->{'faq'} if (exists($_->{'faq'}));
+ $bug = $_->{'bug'} if (exists($_->{'bug'}));
+ $help = $_->{'help'} if (exists($_->{'help'}));
+ my $result = '{'target'}) && $_->{'target'} ne '') {
+ $result .= 'target="'.$_->{'target'}.'" ';
+ }
+ if ($_->{'no_mt'}) {
+ $result .='title="'.$_->{'title'}.'">'.
+ $_->{'text'}.'';
+ } else {
+ $result .='title="'.&mt($_->{'title'}).'">'.
+ &mt($_->{'text'}).'';
+ }
+ $result;
} @Crumbs
);
$links .= '->' if ($links ne '');
- $links .= ''.$last->{'text'}.'';
+ if ($last->{'no_mt'}) {
+ $links .= ''.$last->{'text'}.'';
+ } else {
+ $links .= ''.&mt($last->{'text'}).'';
+ }
#
my $icons = '';
- if (exists($last->{'faq'})) {
- $icons .= &Apache::loncommon::help_open_faq($last->{'faq'});
- }
- if (exists($last->{'bug'})) {
- $icons .= &Apache::loncommon::help_open_bug($last->{'bug'});
- }
- if ($icons ne '') {
- $Str .= $icons.' ';
- }
+ $faq = $last->{'faq'} if (exists($last->{'faq'}));
+ $bug = $last->{'bug'} if (exists($last->{'bug'}));
+ $help = $last->{'help'} if (exists($last->{'help'}));
+ $component_help=($component_help?$component_help:$help);
+# if ($faq ne '') {
+# $icons .= &Apache::loncommon::help_open_faq($faq);
+# }
+# if ($bug ne '') {
+# $icons .= &Apache::loncommon::help_open_bug($bug);
+# }
+ if ($faq ne '' || $component_help ne '' || $bug ne '') {
+ $icons .= &Apache::loncommon::help_open_menu($component,
+ $component_help,
+ $faq,$bug);
+ }
#
- $Str .= $links.' | ';
+ $Str .= $links.'';
#
if (defined($component)) {
- $Str .= ''.
- ''.$component.'';
- if (defined($component_help)) {
- $Str .=
- &Apache::loncommon::help_open_topic($component_help);
- }
- $Str.= ' | ';
+ $Str .= ''.
+ &mt($component);
+ if ($icons ne '') {
+ $Str .= ' '.$icons;
+ }
+ $Str .= ' | ';
}
$Str .= ' '."\n";
#
@@ -950,11 +1315,568 @@ returns: nothing
push (@Crumbs,@_);
}
-}
+} # End of scope for @Crumbs
############################################################
############################################################
+# Nested table routines.
+#
+# Routines to display form items in a multi-row table with 2 columns.
+# Uses nested tables to divide form elements into segments.
+# For examples of use see loncom/interface/lonnotify.pm
+#
+# Can be used in following order: ...
+# &start_pick_box()
+# row1
+# row2
+# row3 ... etc.
+# &submit_row(0
+# &end_pickbox()
+#
+# where row1, row 2 etc. are chosen from &role_select_row,&course_select_row,
+# &status_select_row and &email_default_row
+#
+# Can also be used in following order:
+#
+# &start_pick_box()
+# &row_title()
+# &row_closure()
+# &row_title()
+# &row_closure() ... etc.
+# &submit_row()
+# &end_pick_box()
+#
+# In general a &submit_row() call should proceed the call to &end_pick_box(),
+# as this routine adds a button for form submission.
+# &submit_row() does not require a &row_closure after it.
+#
+# &start_pick_box() creates a bounding table with 1-pixel wide black border.
+# rows should be placed between calls to &start_pick_box() and &end_pick_box.
+#
+# &row_title() adds a title in the left column for each segment.
+# &row_closure() closes a row with a 1-pixel wide black line.
+#
+# &role_select_row() provides a select box from which to choose 1 or more roles
+# &course_select_row provides ways of picking groups of courses
+# radio buttons: all, by category or by picking from a course picker pop-up
+# note: by category option is only displayed if a domain has implemented
+# selection by year, semester, department, number etc.
+#
+# &status_select_row() provides a select box from which to choose 1 or more
+# access types (current access, prior access, and future access)
+#
+# &email_default_row() provides text boxes for default e-mail suffixes for
+# different authentication types in a domain.
+#
+# &row_title() and &row_closure() are called internally by the &*_select_row
+# routines, but can also be called directly to start and end rows which have
+# needs that are not accommodated by the *_select_row() routines.
+
+sub start_pick_box {
+ my ($css_class) = @_;
+ if (defined($css_class)) {
+ $css_class = 'class="'.$css_class.'"';
+ } else {
+ $css_class= 'class="LC_pick_box"';
+ }
+ my $output = <<"END";
+
+END
+ return $output;
+}
+
+sub end_pick_box {
+ my $output = <<"END";
+
+END
+ return $output;
+}
+
+sub row_title {
+ my ($title,$css_title_class,$css_value_class) = @_;
+ $css_title_class ||= 'LC_pick_box_title';
+ $css_title_class = 'class="'.$css_title_class.'"';
+
+ $css_value_class ||= 'LC_pick_box_value';
+ $css_value_class = 'class="'.$css_value_class.'"';
+
+ my $output = <<"ENDONE";
+ |