--- loncom/interface/loncommon.pm 2009/03/26 14:59:10 1.779 +++ loncom/interface/loncommon.pm 2009/04/04 21:47:40 1.784 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.779 2009/03/26 14:59:10 bisitz Exp $ +# $Id: loncommon.pm,v 1.784 2009/04/04 21:47:40 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -935,7 +935,7 @@ sub help_open_topic { $template.=' ' .''.&mt('Help: [_1]',$topic).''; if ($text ne "") { $template.=''; @@ -2165,7 +2165,7 @@ sub authform_kerberos { } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) { @@ -2174,7 +2174,7 @@ sub authform_kerberos { if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2251,7 +2251,7 @@ sub authform_internal{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'int'}) { @@ -2260,7 +2260,7 @@ sub authform_internal{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2306,7 +2306,7 @@ sub authform_local{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'loc'}) { @@ -2315,7 +2315,7 @@ sub authform_local{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2357,7 +2357,7 @@ sub authform_filesystem{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'fsys'}) { @@ -2366,7 +2366,7 @@ sub authform_filesystem{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2847,6 +2847,27 @@ sub track_student_link { &help_open_topic('View_recent_activity'); } +sub slot_reservations_link { + my ($linktext,$sname,$sdom,$target) = @_; + my $link ="/adm/slotrequest?command=showresv&origin=aboutme"; + my $title = 'View slot reservation history'; + if (defined($sname) && $sname !~ /^\s*$/ && + defined($sdom) && $sdom !~ /^\s*$/) { + $link .= "&uname=$sname&udom=$sdom"; + $title .= ' of this student'; + } + if (defined($target) && $target !~ /^\s*$/) { + $target = qq{target="$target"}; + } else { + $target = ''; + } + $title = &mt($title); + $linktext = &mt($linktext); + return qq{$linktext}; +# FIXME uncomment when help item created: &help_open_topic('Slot_Reservation_History'); + +} + # ===================================================== Display a student photo @@ -5601,6 +5622,7 @@ p, .LC_ContentBox { padding: 4px; border: 1px solid #000033; white-space: nowrap; +/* vertical-align: middle; */ } dl,ul,div,fieldset { @@ -5693,7 +5715,7 @@ ul.LC_TabContentBigger li, ul.LC_TabCont font-weight:bold; } -ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcrumbs { +ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcrumbs, ul.LC_CourseBreadcrumbs{ border-top: solid 1px RGB(255, 255, 255); height: 20px; line-height: 20px; @@ -5704,17 +5726,17 @@ ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcr background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top; } -ol#LC_MenuBreadcrumbs li, ol#LC_PathBreadcrumbs li { +ol#LC_MenuBreadcrumbs li, ol#LC_PathBreadcrumbs li, ul.LC_CourseBreadcrumbs li { /* background: url(/adm/lonIcons/arrow_white.png) no-repeat left center; */ display: inline; padding: 0px 0px 0px 10px; - vertical-align: bottom; +/* vertical-align: bottom; */ overflow:hidden; } -ol#LC_MenuBreadcrumbs li a { +ol#LC_MenuBreadcrumbs li a, ul.LC_CourseBreadcrumbs li a { text-decoration: none; font-size:90%; } @@ -5970,6 +5992,18 @@ ul#LC_toolbar li{ vertical-align:middle; } +/* + This style is used for standard function lists, e.g. functions of Personal Information Page. + It produces a horizontally aligned list with a bullet at the beginning of each function item. + */ +.LC_fieldset_functions li { + float: right; + height: 35px; + background-color: blue; + white-space: nowrap; + margin-left: 10px; +} + a.LC_toolbarItem{ display:block; padding:0; @@ -5982,6 +6016,13 @@ a.LC_toolbarItem{ background-color:transparent; } +ul.LC_functionslist li { + float: left; + white-space: nowrap; + height: 35px; /* at least as high as heighest list item */ + margin: 0px 15px 15px 10px; +} + END } @@ -7017,6 +7058,8 @@ If the user's status includes multiple t the largest default quota which applies to the user determines the default quota returned. +=back + =cut ############################################### @@ -7565,8 +7608,57 @@ sub get_institutional_codes { =pod +=head1 Slot Helpers + +=over 4 + +=item * sorted_slots() + +Sorts an array of slot names in order of slot start time (earliest first). + +Inputs: + +=over 4 + +slotsarr - Reference to array of unsorted slot names. + +slots - Reference to hash of hash, where outer hash keys are slot names. + +=back + +Returns: + +=over 4 + +sorted - An array of slot names sorted by the start time of the slot. + +=back + =back +=cut + + +sub sorted_slots { + my ($slotsarr,$slots) = @_; + my @sorted; + if ((ref($slotsarr) eq 'ARRAY') && (ref($slots) eq 'HASH')) { + @sorted = + sort { + if (ref($slots->{$a}) && ref($slots->{$b})) { + return $slots->{$a}{'starttime'} <=> $slots->{$b}{'starttime'} + } + if (ref($slots->{$a})) { return -1;} + if (ref($slots->{$b})) { return 1;} + return 0; + } @{$slotsarr}; + } + return @sorted; +} + + +=pod + =head1 HTTP Helpers =over 4