\$','\$ ');
+ }
+ );
+ config.registerButton('ed_math_eqn','LaTeX Equation',
+ '/htmlarea/images/ed_math_eqn.gif',false,
+ function(editor,id) {
+ editor.surroundHTML(
+ ' \\n\\\\[','\\\\]\\n ');
+ }
+ );
+ config.toolbar.push(['ed_math','ed_math_eqn']);
+ENDADDBUTTON
+}
+
+# ----------------------------------------------------------------- Preferences
+
+sub disablelink {
+ my @fields=@_;
+ if (defined($#fields)) {
+ unless ($#fields>=0) { return ''; }
+ }
+ return ''.&mt('Disable WYSIWYG Editor').'';
+}
+
+sub enablelink {
+ my @fields=@_;
+ if (defined($#fields)) {
+ unless ($#fields>=0) { return ''; }
+ }
+ return ''.&mt('Enable WYSIWYG Editor').'';
+}
+
+# ----------------------------------------- Script to activate only some fields
+
+sub htmlareaselectactive {
+ my @fields=@_;
+ unless (&htmlareabrowser()) { return ''; }
+ if (&htmlareablocked()) { return '
'.&enablelink(@fields); }
+ my $output='
".
+ &disablelink(@fields);
+ return $output;
+}
+
+# --------------------------------------------------------------------- Blocked
+
+sub htmlareablocked {
+ unless ($env{'environment.wysiwygeditor'} eq 'on') { return 1; }
+ return 0;
}
# ---------------------------------------- Browser capable of running HTMLArea?
@@ -886,6 +1087,9 @@ All inputs can be undef without problems
Inputs: $color (the background color of the table returned),
$component (the large text on the right side of the table),
$component_help
+ $function (role to get colors from)
+ $domain (domian of role)
+ $menulink (boolean, controls whether to include a link to /adm/menu)
Returns a string containing breadcrumbs for the current page.
@@ -911,7 +1115,8 @@ returns: nothing
my @Crumbs;
sub breadcrumbs {
- my ($color,$component,$component_help,$function,$domain) = @_;
+ my ($color,$component,$component_help,$function,$domain,$menulink,
+ $helplink) = @_;
if (! defined($color)) {
if (! defined($function)) {
$function = &Apache::loncommon::get_users_function();
@@ -928,39 +1133,58 @@ returns: nothing
# 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'};
+ # 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',
- text=>$ENV{'course.'.$cid.'.description'},
- });
+ href =>'/adm/menu',
+ title =>'Go to main menu',
+ target =>'_top',
+ text =>$description,
+ });
}
my $links .=
join('->',
map {
$faq = $_->{'faq'} if (exists($_->{'faq'}));
$bug = $_->{'bug'} if (exists($_->{'bug'}));
- ''.
- &mt($_->{'text'}).''
+ $help = $_->{'help'} if (exists($_->{'help'}));
+ my $result = '{'target'}) && $_->{'target'} ne '') {
+ $result .= 'target="'.$_->{'target'}.'" ';
+ }
+ $result .='title="'.&mt($_->{'title'}).'">'.
+ &mt($_->{'text'}).'';
+ $result;
} @Crumbs
);
$links .= '->' if ($links ne '');
- $links .= ''.$last->{'text'}.'';
+ $links .= ''.&mt($last->{'text'}).'';
#
my $icons = '';
$faq = $last->{'faq'} if (exists($last->{'faq'}));
$bug = $last->{'bug'} if (exists($last->{'bug'}));
- if ($faq ne '') {
- $icons .= &Apache::loncommon::help_open_faq($faq);
- }
- if ($bug ne '') {
- $icons .= &Apache::loncommon::help_open_bug($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 ($helplink ne 'nohelp') {
+ $icons .= &Apache::loncommon::help_open_menu($color,$component,$component_help,$function,$faq,$bug);
+ }
if ($icons ne '') {
$Str .= $icons.' ';
}
@@ -969,12 +1193,7 @@ returns: nothing
#
if (defined($component)) {
$Str .= ''.
- ''.&mt($component).'';
- if (defined($component_help)) {
- $Str .=
- &Apache::loncommon::help_open_topic($component_help);
- }
- $Str.= ' | ';
+ ''.&mt($component).'';
}
$Str .= ''."\n";
#
500 Internal Server Error
Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.
More information about this error may be available
in the server error log.