version 1.72, 2004/06/03 14:28:39
|
version 1.81, 2004/07/16 19:54:51
|
Line 772 sub Increment_PrgWin {
|
Line 772 sub Increment_PrgWin {
|
$$prog_state{'done'} * |
$$prog_state{'done'} * |
($$prog_state{'max'}-$$prog_state{'done'}); |
($$prog_state{'max'}-$$prog_state{'done'}); |
$time_est = int($time_est); |
$time_est = int($time_est); |
if (int ($time_est/60) > 0) { |
# |
my $min = int($time_est/60); |
my $min = int($time_est/60); |
my $sec = $time_est % 60; |
my $sec = $time_est % 60; |
$time_est = $min.' '.&mt('minutes'); |
# |
if ($min < 10) { |
my $str; |
if ($sec > 1) { |
if ($min == 1 && $sec > 1) { |
$time_est.= ', '.$sec.' '.&mt('seconds'); |
$str = '[_2] seconds'; |
} elsif ($sec > 0) { |
} elsif ($min == 1 && $sec < 2) { |
$time_est.= ', '.$sec.' '.&mt('second'); |
$str = '1 minute'; |
} |
} elsif ($min < 10 && $sec > 1) { |
} |
$str = '[_1] minutes, [_2] seconds'; |
} else { |
} elsif ($min >= 10 || $sec < 2) { |
$time_est .= ' '.&mt('seconds'); |
$str = '[_1] minutes'; |
} |
} |
|
$time_est = &mt($str,$min,$sec); |
|
# |
my $lasttime = &Time::HiRes::time()-$$prog_state{'laststart'}; |
my $lasttime = &Time::HiRes::time()-$$prog_state{'laststart'}; |
if ($lasttime > 9) { |
if ($lasttime > 9) { |
$lasttime = int($lasttime); |
$lasttime = int($lasttime); |
Line 841 sub r_print {
|
Line 843 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 866 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 1062 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.' '; |
} |
} |