version 1.59, 2004/03/03 22:55:35
|
version 1.66, 2004/04/19 16:43:03
|
Line 231 sub date_setter {
|
Line 231 sub date_setter {
|
} |
} |
} |
} |
# other potentially useful values: wkday,yrday,is_daylight_savings |
# other potentially useful values: wkday,yrday,is_daylight_savings |
my ($sec,$min,$hour,$mday,$month,$year)=('','','','','',''); |
my ($sec,$min,$hour,$mday,$month,$year)=('','',undef,'','',''); |
if ($currentvalue) { |
if ($currentvalue) { |
($sec,$min,$hour,$mday,$month,$year,undef,undef,undef) = |
($sec,$min,$hour,$mday,$month,$year,undef,undef,undef) = |
localtime($currentvalue); |
localtime($currentvalue); |
Line 327 ENDJS
|
Line 327 ENDJS
|
if ($includeempty) { $result.="<option value=''></option>"; } |
if ($includeempty) { $result.="<option value=''></option>"; } |
for (my $h = 0;$h<24;$h++) { |
for (my $h = 0;$h<24;$h++) { |
$result .= " <option value=\"$h\" "; |
$result .= " <option value=\"$h\" "; |
$result .= "selected " if ($hour == $h); |
$result .= "selected " if (defined($hour) && $hour == $h); |
$result .= "> "; |
$result .= "> "; |
my $timest=''; |
my $timest=''; |
if ($h == 0) { |
if ($h == 0) { |
Line 392 sub get_date_from_form {
|
Line 392 sub get_date_from_form {
|
if (($tmpsec =~ /^\d+$/) && ($tmpsec >= 0) && ($tmpsec < 60)) { |
if (($tmpsec =~ /^\d+$/) && ($tmpsec >= 0) && ($tmpsec < 60)) { |
$sec = $tmpsec; |
$sec = $tmpsec; |
} |
} |
|
if (!defined($tmpsec) || $tmpsec eq '') { $sec = 0; } |
} |
} |
if (defined($ENV{'form.'.$dname.'_minute'})) { |
if (defined($ENV{'form.'.$dname.'_minute'})) { |
my $tmpmin = $ENV{'form.'.$dname.'_minute'}; |
my $tmpmin = $ENV{'form.'.$dname.'_minute'}; |
if (($tmpmin =~ /^\d+$/) && ($tmpmin >= 0) && ($tmpmin < 60)) { |
if (($tmpmin =~ /^\d+$/) && ($tmpmin >= 0) && ($tmpmin < 60)) { |
$min = $tmpmin; |
$min = $tmpmin; |
} |
} |
|
if (!defined($tmpmin) || $tmpmin eq '') { $min = 0; } |
} |
} |
if (defined($ENV{'form.'.$dname.'_hour'})) { |
if (defined($ENV{'form.'.$dname.'_hour'})) { |
my $tmphour = $ENV{'form.'.$dname.'_hour'}; |
my $tmphour = $ENV{'form.'.$dname.'_hour'}; |
Line 814 sub r_print {
|
Line 816 sub r_print {
|
# ------------------------------------------------------- Puts directory header |
# ------------------------------------------------------- Puts directory header |
|
|
sub crumbs { |
sub crumbs { |
my ($uri,$target,$prefix,$form)=@_; |
my ($uri,$target,$prefix,$form,$size)=@_; |
my $output='<br /><tt><b><font size="+2">'.$prefix.'/'; |
if (! defined($size)) { |
|
$size = '+2'; |
|
} |
|
my $output='<br /><tt><b><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 838 sub crumbs {
|
Line 843 sub crumbs {
|
# ------------------------------------------------- Output headers for HTMLArea |
# ------------------------------------------------- Output headers for HTMLArea |
|
|
sub htmlareaheaders { |
sub htmlareaheaders { |
unless (&htmlareabrowser()) { return ''; } |
unless (&htmlareablocked()) { return ''; } |
my $lang='en'; |
my $lang='en'; |
return (<<ENDHEADERS); |
return (<<ENDHEADERS); |
|
<script type="text/javascript"> |
|
_editor_url="/htmlarea/"; |
|
</script> |
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script> |
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script> |
<script type="text/javascript" src="/htmlarea/lang/$lang.js"></script> |
<script type="text/javascript" src="/htmlarea/lang/$lang.js"></script> |
<script type="text/javascript" src="/htmlarea/dialog.js"></script> |
<script type="text/javascript" src="/htmlarea/dialog.js"></script> |
Line 853 ENDHEADERS
|
Line 861 ENDHEADERS
|
# ---------------------------------------------------------- Script to activate |
# ---------------------------------------------------------- Script to activate |
|
|
sub htmlareaactive { |
sub htmlareaactive { |
unless (&htmlareabrowser()) { return ''; } |
unless (&htmlareablocked()) { return ''; } |
return (<<ENDSCRIPT); |
return (<<ENDSCRIPT); |
<script type="text/javascript" defer="1"> |
<script type="text/javascript" defer="1"> |
HTMLArea.replaceAll(); |
HTMLArea.replaceAll(); |
Line 861 sub htmlareaactive {
|
Line 869 sub htmlareaactive {
|
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
|
|
# --------------------------------------------------------------------- Blocked |
|
|
|
sub htmlareablocked { |
|
unless (&htmlareabrowser()) { return ''; } |
|
return 1; |
|
} |
|
|
# ---------------------------------------- Browser capable of running HTMLArea? |
# ---------------------------------------- Browser capable of running HTMLArea? |
|
|
sub htmlareabrowser { |
sub htmlareabrowser { |
Line 886 All inputs can be undef without problems
|
Line 901 All inputs can be undef without problems
|
Inputs: $color (the background color of the table returned), |
Inputs: $color (the background color of the table returned), |
$component (the large text on the right side of the table), |
$component (the large text on the right side of the table), |
$component_help |
$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. |
Returns a string containing breadcrumbs for the current page. |
|
|
Line 911 returns: nothing
|
Line 929 returns: nothing
|
my @Crumbs; |
my @Crumbs; |
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($color,$component,$component_help,$function,$domain) = @_; |
my ($color,$component,$component_help,$function,$domain,$menulink) = |
|
@_; |
if (! defined($color)) { |
if (! defined($color)) { |
if (! defined($function)) { |
if (! defined($function)) { |
$function = &Apache::loncommon::get_users_function(); |
$function = &Apache::loncommon::get_users_function(); |
Line 928 returns: nothing
|
Line 947 returns: nothing
|
# Make the faq and bug data cascade |
# Make the faq and bug data cascade |
my $faq = ''; |
my $faq = ''; |
my $bug = ''; |
my $bug = ''; |
# The last breadcrumb does not have a link, so handle it seperately. |
# The last breadcrumb does not have a link, so handle it separately. |
my $last = pop(@Crumbs); |
my $last = pop(@Crumbs); |
# |
# |
# The first one should be the course, I guess. |
# The first one should be the course, I guess. |
if (exists($ENV{'request.course.id'})) { |
if (!defined($menulink)) { $menulink=1; } |
|
if ($menulink && exists($ENV{'request.course.id'}) && $ENV{'request.course.id'} ne '') { |
my $cid = $ENV{'request.course.id'}; |
my $cid = $ENV{'request.course.id'}; |
unshift(@Crumbs,{ |
unshift(@Crumbs,{ |
href=>'/adm/menu', |
href=>'/adm/menu', |