--- loncom/interface/loncommon.pm 2009/03/26 14:59:10 1.779 +++ loncom/interface/loncommon.pm 2009/04/24 05:14:09 1.792 @@ -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.792 2009/04/24 05:14:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -602,8 +602,13 @@ function setSect(sectionlist) { sub selectcourse_link { my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_; - return "".&mt('Select Course').""; + return '' + ."".&mt('Select Course').'' + .''; } sub selectauthor_link { @@ -710,6 +715,21 @@ sub select_datelocale { return $output; } +sub select_language { + my ($name,$selected,$includeempty) = @_; + my %langchoices; + if ($includeempty) { + %langchoices = ('' => 'No language preference'); + } + foreach my $id (&languageids()) { + my $code = &supportedlanguagecode($id); + if ($code) { + $langchoices{$code} = &plainlanguagedescription($id); + } + } + return &select_form($selected,$name,%langchoices); +} + =pod =item * &linked_select_forms(...) @@ -935,7 +955,7 @@ sub help_open_topic { $template.=' ' .''.&mt('Help: [_1]',$topic).''; if ($text ne "") { $template.=''; @@ -2165,7 +2185,7 @@ sub authform_kerberos { } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) { @@ -2174,7 +2194,7 @@ sub authform_kerberos { if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2251,7 +2271,7 @@ sub authform_internal{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'int'}) { @@ -2260,7 +2280,7 @@ sub authform_internal{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2306,7 +2326,7 @@ sub authform_local{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'loc'}) { @@ -2315,7 +2335,7 @@ sub authform_local{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2357,7 +2377,7 @@ sub authform_filesystem{ } } else { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } if (!$can_assign{'fsys'}) { @@ -2366,7 +2386,7 @@ sub authform_filesystem{ if (defined($in{'mode'})) { if ($in{'mode'} eq 'modifycourse') { if ($authnum == 1) { - $authtype = ''; + $authtype = ''; } } } @@ -2847,6 +2867,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 @@ -4341,8 +4382,8 @@ ENDROLE return(< -$upperleft - $messages  +$upperleft + $messages  $titleinfo $dc_info $menu $roleinfo @@ -4459,6 +4500,7 @@ sub standard_css { my $img = &designparm($function.'.img', $domain); my $tabbg = &designparm($function.'.tabbg', $domain); my $font = &designparm($function.'.font', $domain); +#second colour for later usage my $sidebg = &designparm($function.'.sidebg',$domain); my $pgbg_or_bgcolor = $bgcolor || @@ -4561,6 +4603,7 @@ form, .inline { display: inline; } .LC_icon { border: none; + vertical-align: middle; } .LC_indexer_icon { @@ -4633,15 +4676,6 @@ table#LC_title_bar .LC_title_bar_realm { span.LC_metadata { font-family: $sans; } -table#LC_title_bar td.LC_title_bar_domain_logo { - background: $sidebg; - text-align: right; - padding: 0px; -} -table#LC_title_bar td.LC_title_bar_role_logo { - background: $sidebg; - padding: 0px; -} table#LC_menubuttons img{ border: 0px; @@ -5601,6 +5635,7 @@ p, .LC_ContentBox { padding: 4px; border: 1px solid #000033; white-space: nowrap; +/* vertical-align: middle; */ } dl,ul,div,fieldset { @@ -5693,7 +5728,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 +5739,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%; } @@ -5723,6 +5758,10 @@ ol#LC_PathBreadcrumbs li a{ font-size:100%; font-weight:bold; } +.LC_BoxPadding +{ + padding: 10px; +} .LC_ContentBoxSpecial { border: solid 1px $lg_border_color; @@ -5844,7 +5883,7 @@ div.LC_columnSection > .ContentBoxSpecia .LC_loginpage_container { text-align:left; margin : 0 auto; - width:65%; + width:90%; padding: 10px; height: auto; background-color:#FFFFFF; @@ -5855,6 +5894,7 @@ div.LC_columnSection > .ContentBoxSpecia .LC_loginpage_loginContainer { float:left; width: 182px; + padding: 2px; border:1px solid #CCCCCC; background-color:$loginbg; } @@ -5866,19 +5906,12 @@ div.LC_columnSection > .ContentBoxSpecia color:$textcol; padding-left:5px; } + .LC_loginpage_loginInfo { - margin-left:20px; float:left; - width:30%; + width:182px; border:1px solid #CCCCCC; - padding:10px; -} - -.LC_loginpage_loginDomain { - margin-right:20px; - width:20%; - float:left; - padding:10px; + padding:2px; } .LC_loginpage_space { @@ -5887,6 +5920,12 @@ div.LC_columnSection > .ContentBoxSpecia border-bottom: 1px solid #CCCCCC; } +.LC_loginpage_floatLeft { + float: left; + width: 200px; + margin: 0; +} + table em{ font-weight: bold; font-style: normal; @@ -5899,6 +5938,11 @@ table.LC_tableOfContent{ background-color: #FFFFFF; font-size: 90%; } + +table.LC_tableOfContent{ + border-collapse: collapse; +} + table.LC_tableBrowseRes a, table.LC_tableOfContent a { background-color: transparent; @@ -5970,6 +6014,7 @@ ul#LC_toolbar li{ vertical-align:middle; } + a.LC_toolbarItem{ display:block; padding:0; @@ -5982,6 +6027,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 +7069,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 +7619,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