version 1.28, 2009/04/04 21:45:53
|
version 1.34, 2011/10/24 21:58:04
|
Line 90 function createWin() {
|
Line 90 function createWin() {
|
newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") |
newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") |
newWindow.document.open() |
newWindow.document.open() |
newWindow.document.write('$start_page') |
newWindow.document.write('$start_page') |
newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n") |
newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]' />\\n") |
newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600'>\\n") |
newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600'>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<tr><td width='2'> </td><td width='3'> </td>\\n") |
newWindow.document.write("<td><h3>$lt{'loca'} <tt>$fullpath</tt></h3><h3>$lt{'newd'}</h3></td></tr>\\n") |
newWindow.document.write("<td><h3>$lt{'loca'} <tt>$fullpath</tt></h3><h3>$lt{'newd'}</h3></td></tr>\\n") |
Line 299 sub display_one {
|
Line 299 sub display_one {
|
<option value="-1" selected="selected">Please select</option> |
<option value="-1" selected="selected">Please select</option> |
<option value="bb5">Blackboard 5</option> |
<option value="bb5">Blackboard 5</option> |
<option value="bb6">Blackboard 6</option> |
<option value="bb6">Blackboard 6</option> |
<option value="angel">ANGEL</option> |
<option value="angel5">ANGEL 5.5</option> |
<option value="webctce4">WebCT 4 Campus Edition</option> |
<option value="webctce4">WebCT 4 Campus Edition</option> |
<option value="webctvista4">WebCT Vista 4</option> |
<option value="webctvista4">WebCT Vista 4</option> |
</select><br />'."\n". |
</select><br />'."\n". |
Line 380 sub display_two {
|
Line 380 sub display_two {
|
$count{$area} ++; |
$count{$area} ++; |
} |
} |
} |
} |
} elsif ($cms eq 'angel') { |
} elsif ($cms eq 'angel5') { |
foreach my $area (keys %{$$cmsmap{$cms}}) { |
foreach my $area (keys %{$$cmsmap{$cms}}) { |
if ($area eq 'doc') { |
if ($area eq 'doc') { |
if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) { |
if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) { |
Line 526 sub display_three {
|
Line 526 sub display_three {
|
|
|
foreach my $area (@{$areas}) { |
foreach my $area (@{$areas}) { |
if (defined($env{"form.$area"}) ) { |
if (defined($env{"form.$area"}) ) { |
if ($cms eq 'angel' && $area eq 'doc') { |
if ($cms eq 'angel5' && $area eq 'doc') { |
foreach (@{$$cmsmap{$cms}{$area}}) { |
foreach (@{$$cmsmap{$cms}{$area}}) { |
$importareas{$_} = 1; |
$importareas{$_} = 1; |
} |
} |
Line 599 sub display_three {
|
Line 599 sub display_three {
|
|
|
$r->print("<h3>IMS import completed</h3>"); |
$r->print("<h3>IMS import completed</h3>"); |
|
|
if ($cms eq 'angel') { |
if ($cms eq 'angel5') { |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,bulletin board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n"); |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,bulletin board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n"); |
} else { |
} else { |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n"); |
$r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n"); |
} |
} |
$r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$uname.'/'.$newdir.'">'.$lt{'disp'}.'</a>'); |
$r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$udom.'/'.$uname.'/'.$newdir.'">'.$lt{'disp'}.'</a>'); |
if ($destdir =~ m-^/home/$uname/public_html/-) { |
if ($destdir =~ m-^/home/httpd/html/priv/$udom/$uname/-) { |
system (" rm -r -f $destdir/temp"); |
system (" rm -r -f $destdir/temp"); |
} |
} |
} elsif ($manifest_result eq 'nomanifest') { |
} elsif ($manifest_result eq 'nomanifest') { |
Line 616 sub display_three {
|
Line 616 sub display_three {
|
# ---------------------------------------------------------------- Get LON-CAPA Course Coordinator roles for this user |
# ---------------------------------------------------------------- Get LON-CAPA Course Coordinator roles for this user |
sub get_ccroles { |
sub get_ccroles { |
my ($user,$dom,$crsentry,$crslist) = @_; |
my ($user,$dom,$crsentry,$crslist) = @_; |
my %roles = (); |
my %roles; |
unless ($user eq '') { |
unless ($user eq '') { |
%roles = &Apache::lonnet::dump('roles',$dom,$user); |
my $ccrole = 'cc'; |
|
%roles = &Apache::lonnet::get_my_roles($user,$dom,'userroles',undef,[$ccrole]); |
} |
} |
my $iter = 0; |
my $iter = 0; |
my @codes = (); |
my @codes = (); |
my %courses = (); |
my %courses = (); |
my @crslist = (); |
my @crslist = (); |
my %descrip =(); |
my %descrip =(); |
foreach my $key (keys %roles ) { |
foreach my $key (keys(%roles)) { |
if ($key =~ m{^/($LONCAPA::domain_re)/($LONCAPA::username_re)_cc$}) { |
if ($key =~ m{^/($LONCAPA::domain_re)/($LONCAPA::username_re)_cc$}) { |
my $cdom = $1; |
my $cdom = $1; |
my $crs = $2; |
my $crs = $2; |
my $role_end = 0; |
my $currcode = ''; |
my $role_start = 0; |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','description'],$cdom,$crs); |
my $active_chk = 1; |
if (defined($settings{'description'}) ) { |
if ( $roles{$key} =~ m/^cc_(\d+)/ ) { |
$descrip{$crs} = $settings{'description'}; |
$role_end = $1; |
} else { |
if ( $roles{$key} =~ m/^cc_($role_end)_(\d+)$/ ) |
$descrip{$crs} = 'Unknown'; |
{ |
|
$role_start = $2; |
|
} |
|
} |
|
if ($role_start > 0) { |
|
if (time < $role_start) { |
|
$active_chk = 0; |
|
} |
|
} |
|
if ($role_end > 0) { |
|
if (time > $role_end) { |
|
$active_chk = 0; |
|
} |
|
} |
} |
if ($active_chk) { |
if (defined($settings{'internal.coursecode'}) ) { |
my $currcode = ''; |
$currcode = $settings{'internal.coursecode'}; |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','description'],$cdom,$crs); |
if ($currcode eq '') { |
if (defined($settings{'description'}) ) { |
|
$descrip{$crs} = $settings{'description'}; |
|
} else { |
|
$descrip{$crs} = 'Unknown'; |
|
} |
|
if (defined($settings{'internal.coursecode'}) ) { |
|
$currcode = $settings{'internal.coursecode'}; |
|
if ($currcode eq '') { |
|
$currcode = "____".$iter; |
|
$iter ++; |
|
} |
|
} else { |
|
$currcode = "____".$iter; |
$currcode = "____".$iter; |
$iter ++; |
$iter ++; |
} |
} |
unless (grep/^$currcode$/,@codes) { |
} else { |
push @codes,$currcode; |
$currcode = "____".$iter; |
@{$courses{$currcode}} = (); |
$iter ++; |
} |
} |
push @{$courses{$currcode}}, $cdom.'/'.$crs; |
unless (grep/^$currcode$/,@codes) { |
|
push @codes,$currcode; |
|
@{$courses{$currcode}} = (); |
} |
} |
|
push @{$courses{$currcode}}, $cdom.'/'.$crs; |
} |
} |
} |
} |
foreach my $code (sort @codes) { |
foreach my $code (sort @codes) { |
Line 705 sub handler {
|
Line 684 sub handler {
|
# re-attach user |
# re-attach user |
# |
# |
if ($env{'form.uploaduname'}) { |
if ($env{'form.uploaduname'}) { |
$env{'form.filename'}='/priv/'.$env{'form.uploaduname'}.'/'. |
$env{'form.filename'}='/priv/'.$dom.'/'.$env{'form.uploaduname'}.'/'. |
$env{'form.filename'}; |
$env{'form.filename'}; |
} |
} |
($uname,$udom)= |
($uname,$udom)= |
Line 724 sub handler {
|
Line 703 sub handler {
|
$fn=$env{'form.filename'}; |
$fn=$env{'form.filename'}; |
$fn=~s/^https?\:\/\/[^\/]+\///; |
$fn=~s/^https?\:\/\/[^\/]+\///; |
$fn=~s/^\///; |
$fn=~s/^\///; |
$fn=~s/(\~|priv\/)($LONCAPA::username_re)//; |
$fn=~s/(priv\/)($LONCAPA::domain_re)\/($LONCAPA::username_re)//; |
$fn=~s/\/+/\//g; |
$fn=~s/\/+/\//g; |
} else { |
} else { |
$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. |
$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. |
' unspecified filename for upload', $r->filename); |
' unspecified filename for upload', $r->filename); |
return HTTP_NOT_FOUND; |
return HTTP_NOT_FOUND; |
} |
} |
my $zipupload = '/home/'.$uname.'/public_html'.$fn; |
my $zipupload = '/home/httpd/html/priv/'.$udom.'/'.$uname.$fn; |
my $pathname = &File::Basename::dirname($fn); |
my $pathname = &File::Basename::dirname($fn); |
my $fullpath = '/priv/'.$uname.$pathname; |
my $fullpath = '/priv/'.$udom.'/'.$uname.$pathname; |
unless ($pathname eq '/') { |
unless ($pathname eq '/') { |
$fullpath .= '/'; |
$fullpath .= '/'; |
} |
} |
Line 762 sub handler {
|
Line 741 sub handler {
|
$r->print(&Apache::loncommon::start_page($title, $javascript)); |
$r->print(&Apache::loncommon::start_page($title, $javascript)); |
|
|
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
$r->print('<h3><font color=red>'.&mt('Co-Author').': '.$uname. |
$r->print('<p><span class="LC_warning">' |
&mt(' at ').$udom.'</font></h3>'); |
.&mt('Co-Author [_1]',$uname.':'.$udom) |
|
.'</span></p>' |
|
); |
} |
} |
if ($env{'form.phase'} eq 'two') { |
if ($env{'form.phase'} eq 'two') { |
my $flag = &Apache::lonupload::phasetwo($r,$fn,$uname,$udom,'imsimport'); |
my $flag = &Apache::lonupload::phasetwo($r,$fn,$uname,$udom,'imsimport'); |