--- loncom/interface/loncommon.pm 2009/03/26 12:44:52 1.777
+++ loncom/interface/loncommon.pm 2009/04/21 18:03:45 1.789
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.777 2009/03/26 12:44:52 tempelho Exp $
+# $Id: loncommon.pm,v 1.789 2009/04/21 18:03:45 droeschl 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 {
@@ -935,7 +940,7 @@ sub help_open_topic {
$template.=' '
.'';
if ($text ne "") {
$template.='';
@@ -2165,7 +2170,7 @@ sub authform_kerberos {
}
} else {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {
@@ -2174,7 +2179,7 @@ sub authform_kerberos {
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
}
@@ -2251,7 +2256,7 @@ sub authform_internal{
}
} else {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
if (!$can_assign{'int'}) {
@@ -2260,7 +2265,7 @@ sub authform_internal{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
}
@@ -2306,7 +2311,7 @@ sub authform_local{
}
} else {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
if (!$can_assign{'loc'}) {
@@ -2315,7 +2320,7 @@ sub authform_local{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
}
@@ -2357,7 +2362,7 @@ sub authform_filesystem{
}
} else {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
if (!$can_assign{'fsys'}) {
@@ -2366,7 +2371,7 @@ sub authform_filesystem{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = '';
+ $authtype = '';
}
}
}
@@ -2847,6 +2852,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
@@ -4505,7 +4531,7 @@ body{
}
a:link, a:visited { font-size:100%; }
-a:focus { color: red; background: yellow }
+a:focus { color: red; background: yellow }
table.thinborder,
table.thinborder tr th {
border-style: solid;
@@ -4528,7 +4554,19 @@ form, .inline { display: inline; }
.LC_400Box {width:400px; }
/* end */
-.LC_filename {font-family: $mono; white-space:pre;}
+.LC_filename {
+ font-family: $mono;
+ white-space:pre;
+}
+
+.LC_fileicon {
+ border: none;
+ height: 1.3em;
+ vertical-align: text-bottom;
+ margin-right: 0.3em;
+ text-decoration:none;
+}
+
.LC_error {
color: red;
font-size: larger;
@@ -4578,7 +4616,7 @@ table#LC_top_nav, table#LC_menubuttons,t
padding: 0px;
}
-table#LC_title_bar, table.LC_breadcrumbs,
+table#LC_title_bar, table.LC_breadcrumbs,
table#LC_title_bar.LC_with_remote {
width: 100%;
border-color: $pgbg;
@@ -4656,7 +4694,7 @@ table#LC_top_nav td.LC_top_nav_logo img
vertical-align: bottom;
}
table#LC_top_nav td.LC_top_nav_exit,
-table#LC_top_nav td.LC_top_nav_help {
+table#LC_top_nav td.LC_top_nav_help {
width: 2.0em;
}
table#LC_top_nav td.LC_top_nav_login {
@@ -4671,17 +4709,17 @@ table.LC_breadcrumbs td, table.LC_docs_p
}
table.LC_breadcrumbs td.LC_breadcrumbs_component,
table.LC_docs_path td.LC_docs_path_component {
- background: $tabbg;
+ background: $tabbg;
color: $font;
font-family: $sans;
- font-size: larger;
- text-align: right;
+ font-size: larger;
+ text-align: right;
}
td.LC_table_cell_checkbox {
text-align: center;
}
-table#LC_mainmenu td.LC_mainmenu_column {
- vertical-align: top;
+table#LC_mainmenu td.LC_mainmenu_column {
+ vertical-align: top;
}
.LC_fontsize_small
@@ -4719,7 +4757,7 @@ table#LC_mainmenu td.LC_mainmenu_column
}
td.LC_menubuttons_text {
- color: $font;
+ color: $font;
}
@@ -4790,7 +4828,7 @@ table.LC_data_table tr.LC_info_row > td
font-weight: bold;
text-align: left;
}
-table.LC_data_table tr.LC_odd_row > td,
+table.LC_data_table tr.LC_odd_row > td,
table.LC_pick_box tr > td.LC_odd_row,
table.LC_aboutme_port tr td {
background-color: $data_table_light;
@@ -4885,8 +4923,8 @@ table.LC_calendar tr td {
table.LC_calendar tr td.LC_calendar_day_empty {
background-color: $data_table_dark;
}
-table.LC_calendar tr td.LC_calendar_day_current {
- background-color: $data_table_highlight;
+table.LC_calendar tr td.LC_calendar_day_current {
+ background-color: $data_table_highlight;
}
table.LC_mail_list tr.LC_mail_new {
background-color: $mail_new;
@@ -4926,11 +4964,11 @@ table.LC_data_table tr > td.LC_browser_f
background: #FFAA99;
}
table.LC_data_table tr > td.LC_browser_file_obsolete {
- background: #AAAAAA;
-}
+ background: #AAAAAA;
+}
table.LC_data_table tr > td.LC_browser_file_modified,
-table.LC_data_table tr > td.LC_browser_file_metamodified {
- background: #FFFF77;
+table.LC_data_table tr > td.LC_browser_file_metamodified {
+ background: #FFFF77;
}
table.LC_data_table tr.LC_browser_folder > td {
background: #CCCCFF;
@@ -5195,7 +5233,7 @@ table.LC_descriptive_input td.LC_descrip
div.LC_feedback_link {
clear: both;
background: white;
- width: 100%;
+ width: 100%;
}
span.LC_feedback_link {
background: $feedback_link_bg;
@@ -5226,7 +5264,7 @@ table.LC_prior_tries td {
background: #FFAAAA ! important;
color: black;
}
-.LC_answer_not_charged_try,
+.LC_answer_not_charged_try,
.LC_answer_no_grade,
.LC_answer_late {
background: #FFFFAA;
@@ -5236,13 +5274,13 @@ table.LC_prior_tries td {
background: #AAAAFF;
color: black;
}
-.LC_answer_no_message {
+.LC_answer_no_message {
background: #FFFFFF;
color: black;
-}
-.LC_answer_unknown {
- background: orange;
- color: black;
+}
+.LC_answer_unknown {
+ background: orange;
+ color: black;
}
span.LC_prior_numerical,
span.LC_prior_string,
@@ -5291,8 +5329,8 @@ table.LC_docs_documents {
border-collapse: collapse;
}
table.LC_docs_documents td.LC_docs_document {
- border: 2px solid black;
- padding: 4px;
+ border: 2px solid black;
+ padding: 4px;
}
.LC_docs_entry_move {
border: 0px;
@@ -5366,7 +5404,7 @@ table.LC_double_column tr td.LC_left_col
table.LC_double_column tr td.LC_right_col {
top: 2px;
- right: 2px;
+ right: 2px;
width: 47%;
vertical-align: top;
}
@@ -5444,7 +5482,7 @@ table.LC_scantron_action tr th {
font-weight:bold;
font-style:normal;
}
-.LC_edit_problem_header,
+.LC_edit_problem_header,
div.LC_edit_problem_footer {
font-weight: normal;
font-size: medium;
@@ -5512,12 +5550,12 @@ table#LC_mainmenu td.LC_mainmenu_col_fie
vertical-align: top;
width: 45%;
}
-.LC_mainmenu_fieldset_category {
- color: $font;
- background: $pgbg;
- font-family: $sans;
- font-size: small;
- font-weight: bold;
+.LC_mainmenu_fieldset_category {
+ color: $font;
+ background: $pgbg;
+ font-family: $sans;
+ font-size: small;
+ font-weight: bold;
}
div.LC_createcourse {
margin: 10px 10px 10px 10px;
@@ -5541,7 +5579,7 @@ ul.LC_TabContent li:hover a{
text-decoration:none;
}
-h1 {
+h1 {
padding:5px 10px 5px 20px;
line-height:130%;
}
@@ -5556,7 +5594,7 @@ h2,h3,h4,h5,h6
padding:3px 15px 3px 15px;
margin:0px;
background-color:$tabbg;
- border-bottom:solid 1px $lg_border_color;
+ border-bottom:solid 1px $lg_border_color;
}
.LC_noBorder {
border:0px;
@@ -5576,7 +5614,7 @@ p, .LC_ContentBox {
}
.LC_FormSectionClearButton input {
- background-color:transparent;
+ background-color:transparent;
border:0px;
cursor:pointer;
text-decoration:underline;
@@ -5589,6 +5627,7 @@ p, .LC_ContentBox {
padding: 4px;
border: 1px solid #000033;
white-space: nowrap;
+/* vertical-align: middle; */
}
dl,ul,div,fieldset {
@@ -5653,7 +5692,7 @@ ul.LC_TabContent li{
background-color:$tabbg;
border-bottom:solid 1px $lg_border_color;
}
-ul.LC_TabContent li a, ul.LC_TabContent li{
+ul.LC_TabContent li a, ul.LC_TabContent li{
color:rgb(47,47,47);
text-decoration:none;
font-size:95%;
@@ -5681,7 +5720,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;
@@ -5692,17 +5731,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%;
}
@@ -5711,6 +5750,10 @@ ol#LC_PathBreadcrumbs li a{
font-size:100%;
font-weight:bold;
}
+.LC_BoxPadding
+{
+ padding: 10px;
+}
.LC_ContentBoxSpecial
{
border: solid 1px $lg_border_color;
@@ -5832,7 +5875,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;
@@ -5843,6 +5886,7 @@ div.LC_columnSection > .ContentBoxSpecia
.LC_loginpage_loginContainer {
float:left;
width: 182px;
+ padding: 2px;
border:1px solid #CCCCCC;
background-color:$loginbg;
}
@@ -5854,19 +5898,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 {
@@ -5875,11 +5912,17 @@ 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;
}
-table.LC_tableBrowseRes,
+table.LC_tableBrowseRes,
table.LC_tableOfContent{
border:none;
border-spacing: 1;
@@ -5887,6 +5930,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;
@@ -5942,7 +5990,7 @@ ul#LC_toolbar li a:hover{
}
ul#LC_toolbar{
- padding:0;
+ padding:0;
margin: 2px;
list-style:none;
position:relative;
@@ -5958,18 +6006,26 @@ ul#LC_toolbar li{
vertical-align:middle;
}
+
a.LC_toolbarItem{
display:block;
padding:0;
margin:0;
height: 32px;
width: 32px;
- color:white;
- border:0 none;
+ color:white;
+ border:0 none;
background-repeat:no-repeat;
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
}
@@ -7005,6 +7061,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
###############################################
@@ -7553,8 +7611,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