version 1.72, 2004/06/03 14:28:39
|
version 1.79, 2004/07/03 18:49:42
|
Line 841 sub r_print {
|
Line 841 sub r_print {
|
# ------------------------------------------------------- Puts directory header |
# ------------------------------------------------------- Puts directory header |
|
|
sub crumbs { |
sub crumbs { |
my ($uri,$target,$prefix,$form,$size)=@_; |
my ($uri,$target,$prefix,$form,$size,$noformat)=@_; |
if (! defined($size)) { |
if (! defined($size)) { |
$size = '+2'; |
$size = '+2'; |
} |
} |
my $output='<br /><tt><b><font size="'.$size.'">'.$prefix.'/'; |
my $output=''; |
|
unless ($noformat) { $output.='<br /><tt><b>'; } |
|
$output.='<font size="'.$size.'">'.$prefix.'/'; |
if ($ENV{'user.adv'}) { |
if ($ENV{'user.adv'}) { |
my $path=$prefix.'/'; |
my $path=$prefix.'/'; |
foreach (split('/',$uri)) { |
foreach (split('/',$uri)) { |
Line 862 sub crumbs {
|
Line 864 sub crumbs {
|
$output.=$uri; |
$output.=$uri; |
} |
} |
unless ($uri=~/\/$/) { $output=~s/\/$//; } |
unless ($uri=~/\/$/) { $output=~s/\/$//; } |
return $output.'</font></b></tt><br />'; |
return $output.'</font>'.($noformat?'':'</b></tt><br />'); |
} |
} |
|
|
# ------------------------------------------------- Output headers for HTMLArea |
# ------------------------------------------------- Output headers for HTMLArea |
|
|
sub htmlareaheaders { |
sub htmlareaheaders { |
if (&htmlareablocked()) { return ''; } |
if (&htmlareablocked()) { return ''; } |
|
unless (&htmlareabrowser()) { return ''; } |
my $lang='en'; |
my $lang='en'; |
if (&mt('htmlarea_lang') ne 'htmlarea_lang') { |
if (&mt('htmlarea_lang') ne 'htmlarea_lang') { |
$lang=&mt('htmlarea_lang'); |
$lang=&mt('htmlarea_lang'); |
} |
} |
return (<<ENDHEADERS); |
return (<<ENDHEADERS); |
<script type="text/javascript"> |
<script type="text/javascript"> |
_editor_url="/htmlarea/"; |
|
</script> |
|
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script> |
|
<style type="text/javascript"> |
|
_editor_url='/htmlarea/'; |
_editor_url='/htmlarea/'; |
_editor_lang='$lang'; |
_editor_lang='$lang'; |
</style> |
</script> |
|
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script> |
ENDHEADERS |
ENDHEADERS |
} |
} |
|
|
# ---------------------------------------------------------- Script to activate |
# ------------------------------------------------- Activate additional buttons |
|
|
sub htmlareaactive { |
sub htmlareaaddbuttons { |
if (&htmlareablocked()) { return ''; } |
if (&htmlareablocked()) { return ''; } |
return (<<ENDSCRIPT); |
unless (&htmlareabrowser()) { return ''; } |
<script type="text/javascript" defer="1"> |
return (<<ENDADDBUTTON); |
HTMLArea.replaceAll(); |
var config=new HTMLArea.Config(); |
</script> |
config.registerButton('ed_math','LaTeX Inline', |
ENDSCRIPT |
'/htmlarea/images/ed_math.gif',false, |
|
function(editor,id) { |
|
editor.surroundHTML('<m>\$','\$</m>'); |
|
} |
|
); |
|
config.registerButton('ed_math_eqn','LaTeX Equation', |
|
'/htmlarea/images/ed_math_eqn.gif',false, |
|
function(editor,id) { |
|
editor.surroundHTML( |
|
'<center><m>\\\\[','\\\\]</m></center>'); |
|
} |
|
); |
|
config.toolbar.push(['ed_math','ed_math_eqn']); |
|
ENDADDBUTTON |
|
} |
|
|
|
# ----------------------------------------------------------------- Preferences |
|
|
|
sub disablelink { |
|
my @fields=@_; |
|
if (defined($#fields)) { |
|
unless ($#fields>=0) { return ''; } |
|
} |
|
return '<a href="/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl='.&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>'; |
|
} |
|
|
|
sub enablelink { |
|
my @fields=@_; |
|
if (defined($#fields)) { |
|
unless ($#fields>=0) { return ''; } |
|
} |
|
return '<a href="/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl='.&Apache::lonnet::escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>'; |
} |
} |
|
|
# ----------------------------------------- Script to activate only some fields |
# ----------------------------------------- Script to activate only some fields |
|
|
sub htmlareaselectactive { |
sub htmlareaselectactive { |
if (&htmlareablocked()) { return ''; } |
my @fields=@_; |
my $output='<script type="text/javascript" defer="1">'; |
unless (&htmlareabrowser()) { return ''; } |
foreach(@_) { |
if (&htmlareablocked()) { return '<br />'.&enablelink(@fields); } |
$output.="\nHTMLArea.replace('$_');"; |
my $output='<script type="text/javascript" defer="1">'. |
|
&htmlareaaddbuttons(); |
|
foreach(@fields) { |
|
$output.="\nHTMLArea.replace('$_',config);"; |
} |
} |
$output.="\n</script>"; |
$output.="\nwindow.status='Activated Editfields';\n</script><br />". |
|
&disablelink(@fields); |
return $output; |
return $output; |
} |
} |
|
|
# --------------------------------------------------------------------- Blocked |
# --------------------------------------------------------------------- Blocked |
|
|
sub htmlareablocked { |
sub htmlareablocked { |
unless (&htmlareabrowser()) { return 1; } |
unless ($ENV{'environment.wysiwygeditor'} eq 'on') { return 1; } |
return 0; |
return 0; |
} |
} |
|
|
Line 1025 returns: nothing
|
Line 1060 returns: nothing
|
my $icons = ''; |
my $icons = ''; |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$bug = $last->{'bug'} if (exists($last->{'bug'})); |
$bug = $last->{'bug'} if (exists($last->{'bug'})); |
if ($faq ne '') { |
# if ($faq ne '') { |
$icons .= &Apache::loncommon::help_open_faq($faq); |
# $icons .= &Apache::loncommon::help_open_faq($faq); |
} |
# } |
if ($bug ne '') { |
# if ($bug ne '') { |
$icons .= &Apache::loncommon::help_open_bug($bug); |
# $icons .= &Apache::loncommon::help_open_bug($bug); |
} |
# } |
|
$icons .= &Apache::loncommon::help_open_menu($color,$component,$component_help,$function,$faq,$bug); |
if ($icons ne '') { |
if ($icons ne '') { |
$Str .= $icons.' '; |
$Str .= $icons.' '; |
} |
} |