--- loncom/interface/loncommon.pm 2006/11/09 21:57:40 1.468 +++ loncom/interface/loncommon.pm 2006/11/23 00:04:09 1.473 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.468 2006/11/09 21:57:40 raeburn Exp $ +# $Id: loncommon.pm,v 1.473 2006/11/23 00:04:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3268,8 +3268,8 @@ sub standard_css { my $mono = 'monospace'; my $data_table_head = $tabbg; my $data_table_light = '#EEEEEE'; - my $data_table_dark = '#DDD'; - my $data_table_darker = '#CCC'; + my $data_table_dark = '#DDDDDD'; + my $data_table_darker = '#CCCCCC'; my $data_table_highlight = '#FFFF00'; my $mail_new = '#FFBB77'; my $mail_new_hover = '#DD9955'; @@ -3354,6 +3354,9 @@ table#LC_title_bar td.LC_title_bar_who { font: small $sans; text-align: right; } +span.LC_metadata { + font-family: $sans; +} span.LC_title_bar_title { font: bold x-large $sans; } @@ -3511,6 +3514,19 @@ table.LC_whatsnew tr.LC_odd_row td { background-color: #EEE; } +table.LC_createuser { +} + +table.LC_createuser tr.LC_section_row td { + font-size: smaller; +} + +table.LC_createuser tr.LC_info_row td { + background-color: #CCC; + font-weight: bold; + text-align: center; +} + table.LC_calendar { border: 1px solid #000000; border-collapse: collapse; @@ -4200,6 +4216,13 @@ sub simple_error_page { $css_class = (join(' ',$css_class,$add_class)); return ''."\n";; } + + sub continue_data_table_row { + my ($add_class) = @_; + my $css_class = ($row_count % 2)?'':'LC_even_row'; + $css_class = (join(' ',$css_class,$add_class)); + return ''."\n";; + } sub end_data_table_row { return ''."\n";; @@ -4602,6 +4625,96 @@ sub get_user_info { return; } +############################################### + +=pod + +=item * &get_user_quota() + +Retrieves quota assigned for storage of portfolio files for a user + +Incoming parameters: +1. user's username +2. user's domain + +Returns: +1. Disk quota (in Mb) assigned to student. + +If a value has been stored in the user's environment, +it will return that, otherwise it returns the default +for users in the domain. + +=cut + +############################################### + + +sub get_user_quota { + my ($uname,$udom) = @_; + my $quota; + if (!defined($udom)) { + $udom = $env{'user.domain'}; + } + if (!defined($uname)) { + $uname = $env{'user.name'}; + } + if (($udom eq '' || $uname eq '') || + ($udom eq 'public') && ($uname eq 'public')) { + $quota = 0; + } else { + if ($udom eq $env{'user.domain'} && $uname eq $env{'user.name'}) { + $quota = $env{'environment.portfolioquota'}; + } else { + my %userenv = &Apache::lonnet::dump('environment',$udom,$uname); + my ($tmp) = keys(%userenv); + if ($tmp !~ /^(con_lost|error|no_such_host)/i) { + $quota = $userenv{'portfolioquota'}; + } else { + undef(%userenv); + } + } + if ($quota eq '') { + $quota = &default_quota($udom); + } + } + return $quota; +} + +############################################### + +=pod + +=item * &default_quota() + +Retrieves default quota assigned for storage of user portfolio files + +Incoming parameters: +1. domain + +Returns: +1. Default disk quota (in Mb) for user portfolios in the domain. + +If a value has been stored in the domain's configuration db, +it will return that, otherwise it returns 20 (for backwards +compatibility with domains which have not set up a configuration +db file; the original statically defined portfolio quota was 20 Mb). + +=cut + +############################################### + + +sub default_quota { + my ($udom) = @_; + my %defaults = &Apache::lonnet::get_dom('configuration', + ['portfolioquota'],$udom); + if ($defaults{'portfolioquota'} ne '') { + return $defaults{'portfolioquota'}; + } else { + return '20'; + } +} + sub get_secgrprole_info { my ($cdom,$cnum,$needroles,$type) = @_; my %sections_count = &get_sections($cdom,$cnum);