version 1.263, 2006/12/01 22:17:26
|
version 1.264, 2006/12/05 02:55:52
|
Line 42 use HTML::Entities;
|
Line 42 use HTML::Entities;
|
use GDBM_File; |
use GDBM_File; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Cwd; |
use Cwd; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $iconpath; |
my $iconpath; |
|
|
Line 99 sub authorhosts {
|
Line 99 sub authorhosts {
|
$ca=$env{'user.name'}; |
$ca=$env{'user.name'}; |
$cd=$env{'user.domain'}; |
$cd=$env{'user.domain'}; |
} else { |
} else { |
($cd,$ca)=($realm=~/^\/(\w+)\/(\w+)$/); |
($cd,$ca)=($realm=~/^\/($match_domain)\/($match_username)$/); |
} |
} |
my $allowed=0; |
my $allowed=0; |
my $myhome=&Apache::lonnet::homeserver($ca,$cd); |
my $myhome=&Apache::lonnet::homeserver($ca,$cd); |
Line 366 sub exportcourse {
|
Line 366 sub exportcourse {
|
if (ref($curRes)) { |
if (ref($curRes)) { |
my $symb = $curRes->symb(); |
my $symb = $curRes->symb(); |
my $ressymb = $symb; |
my $ressymb = $symb; |
if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) { |
if ($ressymb =~ m|adm/($match_domain)/($match_username)/(\d+)/bulletinboard$|) { |
unless ($ressymb =~ m|adm/wrapper/adm|) { |
unless ($ressymb =~ m|adm/wrapper/adm|) { |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
} |
} |
Line 613 sub build_package {
|
Line 613 sub build_package {
|
if (grep/^$count$/,@$discussions) { |
if (grep/^$count$/,@$discussions) { |
my $ressymb = $symb; |
my $ressymb = $symb; |
my $mode; |
my $mode; |
if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) { |
if ($ressymb =~ m|adm/($match_domain)/($match_username)/(\d+)/bulletinboard$|) { |
unless ($ressymb =~ m|adm/wrapper/adm|) { |
unless ($ressymb =~ m|adm/wrapper/adm|) { |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
} |
} |
Line 698 sub process_content {
|
Line 698 sub process_content {
|
} |
} |
} elsif ($symb =~ m-lib/templates/examupload\.problem$-) { |
} elsif ($symb =~ m-lib/templates/examupload\.problem$-) { |
$content_type = 'examupload'; |
$content_type = 'examupload'; |
} elsif ($symb =~ m-adm/(\w+)/(\w+)/(\d+)/bulletinboard$-) { |
} elsif ($symb =~ m-adm/($match_domain)/($match_username)/(\d+)/bulletinboard$-) { |
$content_type = 'bulletinboard'; |
$content_type = 'bulletinboard'; |
my $contents = &Apache::imsexport::templatedpage($content_type,$3,$count,\@uploads,$1,$2); |
my $contents = &Apache::imsexport::templatedpage($content_type,$3,$count,\@uploads,$1,$2); |
if ($contents) { |
if ($contents) { |
Line 1309 sub editor {
|
Line 1309 sub editor {
|
$url=~/^(.+)\.(\w+)$/; |
$url=~/^(.+)\.(\w+)$/; |
my $newurl=$1.$newid.'.'.$2; |
my $newurl=$1.$newid.'.'.$2; |
my $storefn=$newurl; |
my $storefn=$newurl; |
$storefn=~s/^\/\w+\/\w+\/\w+\///; |
$storefn=~s{^/\w+/$match_domain/$match_username/}{}; |
&Apache::lonclonecourse::writefile |
&Apache::lonclonecourse::writefile |
($env{'request.course.id'},$storefn, |
($env{'request.course.id'},$storefn, |
&Apache::lonnet::getfile($url)); |
&Apache::lonnet::getfile($url)); |
Line 1632 sub entryline {
|
Line 1632 sub entryline {
|
my $foldertitle=$title; |
my $foldertitle=$title; |
my $pagetitle=$title; |
my $pagetitle=$title; |
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
if ($title=~ /^(\d+)___&&&___(\w+)___&&&___(\w+)___&&&___(.*)$/ ) { |
if ($title=~ /^(\d+)___&&&___($match_username)___&&&___($match_domain)___&&&___(.*)$/ ) { |
$foldertitle=&Apache::lontexconvert::msgtexconverted($4); |
$foldertitle=&Apache::lontexconvert::msgtexconverted($4); |
$renametitle=$4; |
$renametitle=$4; |
$title='<i>'.&Apache::lonlocal::locallocaltime($1).'</i> '. |
$title='<i>'.&Apache::lonlocal::locallocaltime($1).'</i> '. |
Line 1783 END
|
Line 1783 END
|
if ($uploaded) { |
if ($uploaded) { |
if ($extension eq 'sequence') { |
if ($extension eq 'sequence') { |
$icon=$iconpath.'/folder_closed.gif'; |
$icon=$iconpath.'/folder_closed.gif'; |
$url=~/$coursenum\/([\/\w]+)\.sequence$/; |
$url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/; |
$url='/adm/coursedocs?'; |
$url='/adm/coursedocs?'; |
$folderarg=$1; |
$folderarg=$1; |
$isfolder=1; |
$isfolder=1; |
} elsif ($extension eq 'page') { |
} elsif ($extension eq 'page') { |
$icon=$iconpath.'/page.gif'; |
$icon=$iconpath.'/page.gif'; |
$url=~/$coursenum\/([\/\w]+)\.page$/; |
$url=~/\Q$coursenum\E\/([\/\w]+)\.page$/; |
$pagearg=$1; |
$pagearg=$1; |
$url='/adm/coursedocs?'; |
$url='/adm/coursedocs?'; |
$ispage=1; |
$ispage=1; |
Line 2490 sub handler {
|
Line 2490 sub handler {
|
my %codebase = (); |
my %codebase = (); |
my ($upload_result,$upload_output); |
my ($upload_result,$upload_output); |
if ($allowed) { |
if ($allowed) { |
if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) { |
if (($env{'form.uploaddoc.filename'}) && |
|
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
# Process file upload - phase one - upload and parse primary file. |
# Process file upload - phase one - upload and parse primary file. |
$upload_result = &process_file_upload(\$upload_output,$coursenum, |
$upload_result = &process_file_upload(\$upload_output,$coursenum, |
$coursedom,\%allfiles, |
$coursedom,\%allfiles, |