version 1.474, 2006/11/29 07:46:39
|
version 1.479, 2006/11/30 22:29:03
|
Line 65 use Apache::lonhtmlcommon();
|
Line 65 use Apache::lonhtmlcommon();
|
use Apache::loncoursedata(); |
use Apache::loncoursedata(); |
use Apache::lontexconvert(); |
use Apache::lontexconvert(); |
use Apache::lonclonecourse(); |
use Apache::lonclonecourse(); |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $readit; |
my $readit; |
|
|
Line 157 BEGIN {
|
Line 157 BEGIN {
|
opendir(DIR,$designdir); |
opendir(DIR,$designdir); |
while ($filename=readdir(DIR)) { |
while ($filename=readdir(DIR)) { |
if ($filename!~/\.tab$/) { next; } |
if ($filename!~/\.tab$/) { next; } |
my ($domain)=($filename=~/^(\w+)\./); |
my ($domain)=($filename=~/^($match_domain)\./); |
{ |
{ |
my $designfile = $designdir.'/'.$filename; |
my $designfile = $designdir.'/'.$filename; |
if ( open (my $fh,"<$designfile") ) { |
if ( open (my $fh,"<$designfile") ) { |
Line 1377 sub select_form {
|
Line 1377 sub select_form {
|
return $selectform; |
return $selectform; |
} |
} |
|
|
|
# For display filters |
|
|
|
sub display_filter { |
|
if (!$env{'form.show'}) { $env{'form.show'}=10; } |
|
if (!$env{'form.displayfilter'}) { $env{'form.displayfilter'}='currentfolder'; } |
|
return '<nobr><label>'.&mt('Records [_1]', |
|
&Apache::lonmeta::selectbox('show',$env{'form.show'},undef, |
|
(&mt('all'),10,20,50,100,1000,10000))). |
|
'</label></nobr> <nobr>'. |
|
&mt('Filter [_1]', |
|
&select_form($env{'form.displayfilter'}, |
|
'displayfilter', |
|
('currentfolder' => 'Current folder/page', |
|
'containing' => 'Containing phrase', |
|
'none' => 'None'))). |
|
'<input type="text" name="containingphrase" size="30" value="'.&HTML::Entities::encode($env{'form.containingphrase'}).'" /></nobr>'; |
|
} |
|
|
sub gradeleveldescription { |
sub gradeleveldescription { |
my $gradelevel=shift; |
my $gradelevel=shift; |
my %gradelevels=(0 => 'Not specified', |
my %gradelevels=(0 => 'Not specified', |
Line 2792 sub findallcourses {
|
Line 2810 sub findallcourses {
|
my %courses; |
my %courses; |
my $now=time; |
my $now=time; |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ( $key=~m{^user\.role\.(\w+)\./(\w+)/(\w+)/?(\w*)$} || |
if ( $key=~m{^user\.role\.(\w+)\./($match_domain)/($match_username)/?(\w*)$} || |
$key=~m{^user\.role\.(cr/\w+/\w+/\w+)\./(\w+)/(\w+)}) { |
$key=~m{^user\.role\.(cr/$match_domain/$match_username/\w+)\./($match_domain)/($match_username)}) { |
my ($role,$domain,$id,$sec) = ($1,$2,$3,$4); |
my ($role,$domain,$id,$sec) = ($1,$2,$3,$4); |
next if ($role eq 'ca' || $role eq 'aa'); |
next if ($role eq 'ca' || $role eq 'aa'); |
next if (%roles && !exists($roles{$role})); |
next if (%roles && !exists($roles{$role})); |
Line 2879 sub parse_block_record {
|
Line 2897 sub parse_block_record {
|
($setuname,$setudom) = split(/:/,$record->{'setter'}); |
($setuname,$setudom) = split(/:/,$record->{'setter'}); |
$title = &unescape($record->{'event'}); |
$title = &unescape($record->{'event'}); |
$blocks = $record->{'blocks'}; |
$blocks = $record->{'blocks'}; |
|
|
} else { |
} else { |
my @data = split(/:/,$record,3); |
my @data = split(/:/,$record,3); |
if (scalar(@data) eq 2) { |
if (scalar(@data) eq 2) { |
Line 2902 sub build_block_table {
|
Line 2919 sub build_block_table {
|
'blse' => 'Block set by' |
'blse' => 'Block set by' |
); |
); |
my $output; |
my $output; |
$output = '<br /><br />'.$lt{'cacb'}.':<br /><br />'; |
$output = '<br />'.$lt{'cacb'}.':<br />'; |
$output .= &start_data_table(); |
$output .= &start_data_table(); |
$output .= ' |
$output .= ' |
<tr> |
<tr> |
Line 2915 sub build_block_table {
|
Line 2932 sub build_block_table {
|
my %courseinfo=&Apache::lonnet::coursedescription($course); |
my %courseinfo=&Apache::lonnet::coursedescription($course); |
for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) { |
for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) { |
my ($uname,$udom) = @{$$setters{$course}{staff}[$i]}; |
my ($uname,$udom) = @{$$setters{$course}{staff}[$i]}; |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my $fullname = &aboutmewrapper(&plainname($uname,$udom),$uname,$udom); |
my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]}; |
my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]}; |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row(). |
'<td>'.$courseinfo{'description'}.'</td>'. |
'<td>'.$courseinfo{'description'}.'</td>'. |
'<td>'.$openblock.' to '.$closeblock.'</td>'. |
'<td>'.$openblock.' to '.$closeblock.'</td>'. |
'<td>'.$fullname.' ('.$uname.':'.$udom. |
'<td>'.$fullname.'.</td>'. |
')</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
Line 3102 sub bodytag {
|
Line 3118 sub bodytag {
|
# role and realm |
# role and realm |
my ($role,$realm) = split(/\./,$env{'request.role'},2); |
my ($role,$realm) = split(/\./,$env{'request.role'},2); |
if ($role eq 'ca') { |
if ($role eq 'ca') { |
my ($rdom,$rname) = ($realm =~ m-^/(\w+)/(\w+)$-); |
my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$}); |
$realm = &plainname($rname,$rdom).':'.$rdom; |
$realm = &plainname($rname,$rdom).':'.$rdom; |
} |
} |
# realm |
# realm |
Line 3608 table.LC_whatsnew tr.LC_empty_row td {
|
Line 3624 table.LC_whatsnew tr.LC_empty_row td {
|
table.LC_whatsnew tr.LC_empty_row td { |
table.LC_whatsnew tr.LC_empty_row td { |
padding: 4ex |
padding: 4ex |
} |
} |
|
|
|
|
table.LC_whatsnew { |
table.LC_whatsnew { |
} |
} |
|
|
Line 5999 sub construct_course {
|
Line 6013 sub construct_course {
|
# |
# |
# Check if created correctly |
# Check if created correctly |
# |
# |
($$crsudom,$$crsunum)=($$courseid=~/^\/(\w+)\/(\w+)$/); |
($$crsudom,$$crsunum)= &LONCAPA::split_courseid($$courseid); |
my $crsuhome=&Apache::lonnet::homeserver($$crsunum,$$crsudom); |
my $crsuhome=&Apache::lonnet::homeserver($$crsunum,$$crsudom); |
$outcome .= &mt('Created on').': '.$crsuhome.'<br>'; |
$outcome .= &mt('Created on').': '.$crsuhome.'<br>'; |
# |
# |
Line 6008 sub construct_course {
|
Line 6022 sub construct_course {
|
my $cloneid=''; |
my $cloneid=''; |
if (($args->{'clonecourse'}) && ($args->{'clonedomain'})) { |
if (($args->{'clonecourse'}) && ($args->{'clonedomain'})) { |
$cloneid='/'.$args->{'clonedomain'}.'/'.$args->{'clonecourse'}; |
$cloneid='/'.$args->{'clonedomain'}.'/'.$args->{'clonecourse'}; |
my ($clonecrsudom,$clonecrsunum)=($cloneid=~/^\/(\w+)\/(\w+)$/); |
my ($clonecrsudom,$clonecrsunum)= &LONCAPA::split_courseid($cloneid); |
my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom); |
my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom); |
if ($clonehome eq 'no_host') { |
if ($clonehome eq 'no_host') { |
$outcome .= |
$outcome .= |