version 1.528, 2007/04/17 23:25:41
|
version 1.540, 2007/06/27 22:44:03
|
Line 378 sub coursebrowser_javascript {
|
Line 378 sub coursebrowser_javascript {
|
my ($domainfilter,$sec_element,$formname)=@_; |
my ($domainfilter,$sec_element,$formname)=@_; |
my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role'); |
my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role'); |
my $output = ' |
my $output = ' |
<script type="text/javascript" language="Javascript" > |
<script type="text/javascript"> |
var stdeditbrowser;'."\n"; |
var stdeditbrowser;'."\n"; |
$output .= <<"ENDSTDBRW"; |
$output .= <<"ENDSTDBRW"; |
function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) { |
function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) { |
Line 1467 sub home_server_option_list {
|
Line 1467 sub home_server_option_list {
|
|
|
=pod |
=pod |
|
|
|
=back |
|
|
=cut |
=cut |
|
|
############################################################### |
############################################################### |
Line 2052 if $first is set to 'lastname' then it r
|
Line 2054 if $first is set to 'lastname' then it r
|
############################################################### |
############################################################### |
sub plainname { |
sub plainname { |
my ($uname,$udom,$first)=@_; |
my ($uname,$udom,$first)=@_; |
|
return if (!defined($uname) || !defined($udom)); |
my %names=&getnames($uname,$udom); |
my %names=&getnames($uname,$udom); |
my $name=&Apache::lonnet::format_name($names{'firstname'}, |
my $name=&Apache::lonnet::format_name($names{'firstname'}, |
$names{'middlename'}, |
$names{'middlename'}, |
Line 2083 if the user does not
|
Line 2086 if the user does not
|
|
|
sub nickname { |
sub nickname { |
my ($uname,$udom)=@_; |
my ($uname,$udom)=@_; |
|
return if (!defined($uname) || !defined($udom)); |
my %names=&getnames($uname,$udom); |
my %names=&getnames($uname,$udom); |
my $name=$names{'nickname'}; |
my $name=$names{'nickname'}; |
if ($name) { |
if ($name) { |
Line 2098 sub nickname {
|
Line 2102 sub nickname {
|
|
|
sub getnames { |
sub getnames { |
my ($uname,$udom)=@_; |
my ($uname,$udom)=@_; |
|
return if (!defined($uname) || !defined($udom)); |
if ($udom eq 'public' && $uname eq 'public') { |
if ($udom eq 'public' && $uname eq 'public') { |
return ('lastname' => &mt('Public')); |
return ('lastname' => &mt('Public')); |
} |
} |
Line 2661 sub get_student_answers {
|
Line 2666 sub get_student_answers {
|
$moreenv{'grade_target'}='answer'; |
$moreenv{'grade_target'}='answer'; |
%moreenv=(%form,%moreenv); |
%moreenv=(%form,%moreenv); |
$feedurl = &Apache::lonnet::clutter($feedurl); |
$feedurl = &Apache::lonnet::clutter($feedurl); |
&Apache::lonenc::check_encrypt(\$feedurl); |
|
my $userview=&Apache::lonnet::ssi($feedurl,%moreenv); |
my $userview=&Apache::lonnet::ssi($feedurl,%moreenv); |
return $userview; |
return $userview; |
} |
} |
Line 2912 sub blockcheck {
|
Line 2916 sub blockcheck {
|
} |
} |
my $no_ownblock = 0; |
my $no_ownblock = 0; |
my $no_userblock = 0; |
my $no_userblock = 0; |
if ($otheruser) { |
if ($otheruser && $activity ne 'com') { |
# Check if current user has 'evb' priv for this |
# Check if current user has 'evb' priv for this |
if (defined($own_courses{$course})) { |
if (defined($own_courses{$course})) { |
foreach my $sec (keys(%{$own_courses{$course}})) { |
foreach my $sec (keys(%{$own_courses{$course}})) { |
Line 3165 Returns: Determines which domain should
|
Line 3169 Returns: Determines which domain should
|
############################################### |
############################################### |
sub determinedomain { |
sub determinedomain { |
my $domain=shift; |
my $domain=shift; |
if (! $domain) { |
if (! $domain) { |
# Determine domain if we have not been given one |
# Determine domain if we have not been given one |
$domain = $Apache::lonnet::perlvar{'lonDefDomain'}; |
$domain = $Apache::lonnet::perlvar{'lonDefDomain'}; |
if ($env{'user.domain'}) { $domain=$env{'user.domain'}; } |
if ($env{'user.domain'}) { $domain=$env{'user.domain'}; } |
Line 3248 sub domainlogo {
|
Line 3252 sub domainlogo {
|
# See if there is a logo |
# See if there is a logo |
if ($designhash{$domain.'.login.domlogo'} ne '') { |
if ($designhash{$domain.'.login.domlogo'} ne '') { |
my $imgsrc = $designhash{$domain.'.login.domlogo'}; |
my $imgsrc = $designhash{$domain.'.login.domlogo'}; |
if ($imgsrc =~ /^\/(adm|res)/) { |
if ($imgsrc =~ m{^/(adm|res)/}) { |
$imgsrc = &lonhttpdurl($imgsrc); |
if ($imgsrc =~ m{^/res/}) { |
|
my $local_name = &Apache::lonnet::filelocation('',$imgsrc); |
|
&Apache::lonnet::repcopy($local_name); |
|
} |
|
$imgsrc = &lonhttpdurl($imgsrc); |
} |
} |
return '<img src="'.$imgsrc.'" alt="'.$domain.'" />'; |
return '<img src="'.$imgsrc.'" alt="'.$domain.'" />'; |
} elsif (defined(&Apache::lonnet::domain($domain,'description'))) { |
} elsif (defined(&Apache::lonnet::domain($domain,'description'))) { |
Line 3298 sub designparm {
|
Line 3306 sub designparm {
|
} |
} |
if (($which =~ /^(student|coordinator|author|admin)\.img$/) || |
if (($which =~ /^(student|coordinator|author|admin)\.img$/) || |
($which =~ /login\.(img|logo|domlogo)/)) { |
($which =~ /login\.(img|logo|domlogo)/)) { |
if ($output =~ /^\/(adm|res)\//) { |
if ($output =~ m{^/(adm|res)/}) { |
|
if ($output =~ m{^/res/}) { |
|
my $local_name = &Apache::lonnet::filelocation('',$output); |
|
&Apache::lonnet::repcopy($local_name); |
|
} |
$output = &lonhttpdurl($output); |
$output = &lonhttpdurl($output); |
} |
} |
} |
} |
Line 3375 sub bodytag {
|
Line 3387 sub bodytag {
|
my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain); |
my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain); |
|
|
my %design = ( 'style' => 'margin-top: 0px', |
my %design = ( 'style' => 'margin-top: 0px', |
'bgcolor' => '#ffffff', |
'bgcolor' => $pgbg, |
'text' => $font, |
'text' => $font, |
'alink' => &designparm($function.'.alink',$domain), |
'alink' => &designparm($function.'.alink',$domain), |
'vlink' => &designparm($function.'.vlink',$domain), |
'vlink' => &designparm($function.'.vlink',$domain), |
Line 3411 sub bodytag {
|
Line 3423 sub bodytag {
|
my $bodytag = "<body $extra_body_attr>". |
my $bodytag = "<body $extra_body_attr>". |
&Apache::lontexconvert::init_math_support(); |
&Apache::lontexconvert::init_math_support(); |
|
|
if ($bodyonly |
if ($bodyonly) { |
|| ($env{'request.state'} eq 'construct' |
|
&& $env{'environment.remote'} ne 'off' )) { |
|
return $bodytag; |
return $bodytag; |
} elsif ($env{'browser.interface'} eq 'textual') { |
} elsif ($env{'browser.interface'} eq 'textual') { |
# Accessibility |
# Accessibility |
Line 3717 form, .inline { display: inline; }
|
Line 3727 form, .inline { display: inline; }
|
.LC_diff_removed { |
.LC_diff_removed { |
color: red; |
color: red; |
} |
} |
|
|
|
.LC_info, |
.LC_success, |
.LC_success, |
.LC_diff_added { |
.LC_diff_added { |
color: green; |
color: green; |
Line 3724 form, .inline { display: inline; }
|
Line 3736 form, .inline { display: inline; }
|
.LC_icon { |
.LC_icon { |
border: 0px; |
border: 0px; |
} |
} |
|
.LC_indexer_icon { |
|
border: 0px; |
|
height: 22px; |
|
} |
|
|
|
.LC_internal_info { |
|
color: #999; |
|
} |
|
|
table.LC_pastsubmission { |
table.LC_pastsubmission { |
border: 1px solid black; |
border: 1px solid black; |
Line 4361 table.LC_prior_tries td {
|
Line 4381 table.LC_prior_tries td {
|
} |
} |
|
|
|
|
span.LC_prior_numerical { |
span.LC_prior_numerical, |
|
span.LC_prior_string, |
|
span.LC_prior_custom, |
|
span.LC_prior_reaction, |
|
span.LC_prior_math { |
font-family: monospace; |
font-family: monospace; |
white-space: pre; |
white-space: pre; |
} |
} |
Line 4430 sub headtag {
|
Line 4454 sub headtag {
|
my $bgcolor = $args->{'bgcolor'} || &designparm($function.'.pgbg',$domain); |
my $bgcolor = $args->{'bgcolor'} || &designparm($function.'.pgbg',$domain); |
my $url = join(':',$env{'user.name'},$env{'user.domain'}, |
my $url = join(':',$env{'user.name'},$env{'user.domain'}, |
$Apache::lonnet::perlvar{'lonVersion'}, |
$Apache::lonnet::perlvar{'lonVersion'}, |
time(), |
#time(), |
$env{'environment.color.timestamp'}, |
$env{'environment.color.timestamp'}, |
$function,$domain,$bgcolor); |
$function,$domain,$bgcolor); |
|
|
Line 5217 Incoming parameters:
|
Line 5241 Incoming parameters:
|
2. user's domain |
2. user's domain |
|
|
Returns: |
Returns: |
1. Disk quota (in Mb) assigned to student. |
1. Disk quota (in Mb) assigned to student. |
|
2. (Optional) Type of setting: custom or default |
|
(individually assigned or default for user's |
|
institutional status). |
|
3. (Optional) - User's institutional status (e.g., faculty, staff |
|
or student - types as defined in localenroll::inst_usertypes |
|
for user's domain, which determines default quota for user. |
|
4. (Optional) - Default quota which would apply to the user. |
|
|
If a value has been stored in the user's environment, |
If a value has been stored in the user's environment, |
it will return that, otherwise it returns the default |
it will return that, otherwise it returns the maximal default |
for users in the domain. |
defined for the user's instituional status(es) in the domain. |
|
|
=cut |
=cut |
|
|
Line 5230 for users in the domain.
|
Line 5261 for users in the domain.
|
|
|
sub get_user_quota { |
sub get_user_quota { |
my ($uname,$udom) = @_; |
my ($uname,$udom) = @_; |
my $quota; |
my ($quota,$quotatype,$settingstatus,$defquota); |
if (!defined($udom)) { |
if (!defined($udom)) { |
$udom = $env{'user.domain'}; |
$udom = $env{'user.domain'}; |
} |
} |
Line 5240 sub get_user_quota {
|
Line 5271 sub get_user_quota {
|
if (($udom eq '' || $uname eq '') || |
if (($udom eq '' || $uname eq '') || |
($udom eq 'public') && ($uname eq 'public')) { |
($udom eq 'public') && ($uname eq 'public')) { |
$quota = 0; |
$quota = 0; |
|
$quotatype = 'default'; |
|
$defquota = 0; |
} else { |
} else { |
|
my $inststatus; |
if ($udom eq $env{'user.domain'} && $uname eq $env{'user.name'}) { |
if ($udom eq $env{'user.domain'} && $uname eq $env{'user.name'}) { |
$quota = $env{'environment.portfolioquota'}; |
$quota = $env{'environment.portfolioquota'}; |
|
$inststatus = $env{'environment.inststatus'}; |
} else { |
} else { |
my %userenv = &Apache::lonnet::dump('environment',$udom,$uname); |
my %userenv = |
|
&Apache::lonnet::get('environment',['portfolioquota', |
|
'inststatus'],$udom,$uname); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
$quota = $userenv{'portfolioquota'}; |
$quota = $userenv{'portfolioquota'}; |
|
$inststatus = $userenv{'inststatus'}; |
} else { |
} else { |
undef(%userenv); |
undef(%userenv); |
} |
} |
} |
} |
|
($defquota,$settingstatus) = &default_quota($udom,$inststatus); |
if ($quota eq '') { |
if ($quota eq '') { |
$quota = &default_quota($udom); |
$quota = $defquota; |
|
$quotatype = 'default'; |
|
} else { |
|
$quotatype = 'custom'; |
} |
} |
} |
} |
return $quota; |
if (wantarray) { |
|
return ($quota,$quotatype,$settingstatus,$defquota); |
|
} else { |
|
return $quota; |
|
} |
} |
} |
|
|
############################################### |
############################################### |
Line 5265 sub get_user_quota {
|
Line 5311 sub get_user_quota {
|
|
|
=item * &default_quota() |
=item * &default_quota() |
|
|
Retrieves default quota assigned for storage of user portfolio files |
Retrieves default quota assigned for storage of user portfolio files, |
|
given an (optional) user's institutional status. |
|
|
Incoming parameters: |
Incoming parameters: |
1. domain |
1. domain |
|
2. (Optional) institutional status(es). This is a : separated list of |
|
status types (e.g., faculty, staff, student etc.) |
|
which apply to the user for whom the default is being retrieved. |
|
If the institutional status string in undefined, the domain |
|
default quota will be returned. |
|
|
Returns: |
Returns: |
1. Default disk quota (in Mb) for user portfolios in the domain. |
1. Default disk quota (in Mb) for user portfolios in the domain. |
|
2. (Optional) institutional type which determined the value of the |
|
default quota. |
|
|
If a value has been stored in the domain's configuration db, |
If a value has been stored in the domain's configuration db, |
it will return that, otherwise it returns 20 (for backwards |
it will return that, otherwise it returns 20 (for backwards |
compatibility with domains which have not set up a configuration |
compatibility with domains which have not set up a configuration |
db file; the original statically defined portfolio quota was 20 Mb). |
db file; the original statically defined portfolio quota was 20 Mb). |
|
|
|
If the user's status includes multiple types (e.g., staff and student), |
|
the largest default quota which applies to the user determines the |
|
default quota returned. |
|
|
=cut |
=cut |
|
|
############################################### |
############################################### |
|
|
|
|
sub default_quota { |
sub default_quota { |
my ($udom) = @_; |
my ($udom,$inststatus) = @_; |
my %defaults = &Apache::lonnet::get_dom('configuration', |
my ($defquota,$settingstatus); |
['portfolioquota'],$udom); |
my %quotahash = &Apache::lonnet::get_dom('configuration', |
if ($defaults{'portfolioquota'} ne '') { |
['quota'],$udom); |
return $defaults{'portfolioquota'}; |
if (ref($quotahash{'quota'}) eq 'HASH') { |
|
if ($inststatus ne '') { |
|
my @statuses = split(/:/,$inststatus); |
|
foreach my $item (@statuses) { |
|
if ($quotahash{'quota'}{$item} ne '') { |
|
if ($defquota eq '') { |
|
$defquota = $quotahash{'quota'}{$item}; |
|
$settingstatus = $item; |
|
} elsif ($quotahash{'quota'}{$item} > $defquota) { |
|
$defquota = $quotahash{'quota'}{$item}; |
|
$settingstatus = $item; |
|
} |
|
} |
|
} |
|
} |
|
if ($defquota eq '') { |
|
$defquota = $quotahash{'quota'}{'default'}; |
|
$settingstatus = 'default'; |
|
} |
|
} else { |
|
$settingstatus = 'default'; |
|
$defquota = 20; |
|
} |
|
if (wantarray) { |
|
return ($defquota,$settingstatus); |
} else { |
} else { |
return '20'; |
return $defquota; |
} |
} |
} |
} |
|
|