version 1.181, 2007/06/11 20:56:38
|
version 1.184.2.1, 2007/07/10 20:57:10
|
Line 567 sub delete_confirmed {
|
Line 567 sub delete_confirmed {
|
$delete_file); |
$delete_file); |
if ($result ne 'ok') { |
if ($result ne 'ok') { |
$r->print('<span class="LC_error">'. |
$r->print('<span class="LC_error">'. |
&mt('An error occured ([_1]) while trying to delete |
&mt('An error occurred ([_1]) while trying to delete |
[_2].',$result,&display_file(undef, $delete_file)). |
[_2].',$result,&display_file(undef, $delete_file)). |
'</span><br /><br />'); |
'</span><br /><br />'); |
} else { |
} else { |
Line 588 sub delete_confirmed {
|
Line 588 sub delete_confirmed {
|
&Apache::lonnet::modify_access_controls($file_name,\%changes, |
&Apache::lonnet::modify_access_controls($file_name,\%changes, |
$udom,$uname); |
$udom,$uname); |
if ($outcome ne 'ok') { |
if ($outcome ne 'ok') { |
$r->print('<br />'.&mt("An error occured ([_1]) while ". |
$r->print('<br />'.&mt("An error occurred ([_1]) while ". |
"trying to delete access controls for the file.",$outcome). |
"trying to delete access controls for the file.",$outcome). |
'</span><br /><br />'); |
'</span><br /><br />'); |
} else { |
} else { |
Line 596 sub delete_confirmed {
|
Line 596 sub delete_confirmed {
|
$r->print('<br />'.&mt('Access controls also deleted for the file.').'<br /><br />'); |
$r->print('<br />'.&mt('Access controls also deleted for the file.').'<br /><br />'); |
} else { |
} else { |
$r->print('<span class="LC_error">'.'<br />'. |
$r->print('<span class="LC_error">'.'<br />'. |
&mt("An error occured ([_1]) while ". |
&mt("An error occurred ([_1]) while ". |
"trying to delete access controls for the file.",$deloutcome). |
"trying to delete access controls for the file.",$deloutcome). |
'</span><br /><br />'); |
'</span><br /><br />'); |
} |
} |
Line 626 sub delete_dir_confirmed {
|
Line 626 sub delete_dir_confirmed {
|
$directory_name); |
$directory_name); |
|
|
if ($result ne 'ok') { |
if ($result ne 'ok') { |
$r->print('<span class="LC_error"> An error occured (dir) ('.$result. |
$r->print('<span class="LC_error"> An error occurred (dir) ('.$result. |
') while trying to delete '.$directory_name.'</span><br />'); |
') while trying to delete '.$directory_name.'</span><br />'); |
} else { |
} else { |
# now remove from recent |
# now remove from recent |
Line 681 sub rename_confirmed {
|
Line 681 sub rename_confirmed {
|
$chg_access = &access_for_renamed($filenewname,$group,$udom,$uname); |
$chg_access = &access_for_renamed($filenewname,$group,$udom,$uname); |
} else { |
} else { |
$r->print('<span class="LC_error">'. |
$r->print('<span class="LC_error">'. |
&mt('An error occured ([_1]) while trying to rename [_2]' |
&mt('An error occurred ([_1]) while trying to rename [_2]' |
.' to [_3]',$result,&display_file(), |
.' to [_3]',$result,&display_file(), |
&display_file('',$filenewname)).'</span><br />'); |
&display_file('',$filenewname)).'</span><br />'); |
return; |
return; |
Line 718 sub access_for_renamed {
|
Line 718 sub access_for_renamed {
|
&Apache::lonnet::modify_access_controls($oldfile,\%change_old, |
&Apache::lonnet::modify_access_controls($oldfile,\%change_old, |
$udom,$uname); |
$udom,$uname); |
if ($outcome ne 'ok') { |
if ($outcome ne 'ok') { |
$chg_text ='<br /><br />'.&mt("An error occured ([_1]) while ". |
$chg_text ='<br /><br />'.&mt("An error occurred ([_1]) while ". |
"trying to delete access control records for the old name.",$outcome). |
"trying to delete access control records for the old name.",$outcome). |
'</span><br />'; |
'</span><br />'; |
} else { |
} else { |
if ($deloutcome ne 'ok') { |
if ($deloutcome ne 'ok') { |
$chg_text = '<br /><br /><span class="LC_error"><br />'. |
$chg_text = '<br /><br /><span class="LC_error"><br />'. |
&mt("An error occured ([_1]) while ". |
&mt("An error occurred ([_1]) while ". |
"trying to delete access control records for the old name.",$deloutcome). |
"trying to delete access control records for the old name.",$deloutcome). |
'</span><br />'; |
'</span><br />'; |
} |
} |
Line 734 sub access_for_renamed {
|
Line 734 sub access_for_renamed {
|
$udom,$uname); |
$udom,$uname); |
if ($outcome ne 'ok') { |
if ($outcome ne 'ok') { |
$chg_text .= '<br /><br />'. |
$chg_text .= '<br /><br />'. |
&mt("An error occured ([_1]) while ". |
&mt("An error occurred ([_1]) while ". |
"trying to update access control records for the new name.",$outcome). |
"trying to update access control records for the new name.",$outcome). |
'</span><br />'; |
'</span><br />'; |
} |
} |
Line 1733 ENDSMP
|
Line 1733 ENDSMP
|
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; |
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; |
} |
} |
} |
} |
opener.document.forms.lonhomework.$env{'form.fieldname'}.value=fileList; |
var hwfield = opener.document.getElementsByName('$env{'form.fieldname'}'); |
|
hwfield[0].value = fileList; |
self.close(); |
self.close(); |
} |
} |
</script> |
</script> |
Line 1818 sub upload {
|
Line 1819 sub upload {
|
$port_path.$env{'form.currentpath'}, |
$port_path.$env{'form.currentpath'}, |
$mode,\%allfiles,\%codebase); |
$mode,\%allfiles,\%codebase); |
if ($result !~ m|^/uploaded/|) { |
if ($result !~ m|^/uploaded/|) { |
$r->print('<span class="LC_error">'.'An error occured ('.$result. |
$r->print('<span class="LC_error">'.'An error occurred ('.$result. |
') while trying to upload '.&display_file().'</span><br />'); |
') while trying to upload '.&display_file().'</span><br />'); |
$r->print(&done('Back',$url)); |
$r->print(&done('Back',$url)); |
} else { |
} else { |
Line 1829 sub upload {
|
Line 1830 sub upload {
|
<input type="hidden" name="fieldname" value="$env{'form.fieldname'}" /> |
<input type="hidden" name="fieldname" value="$env{'form.fieldname'}" /> |
<input type="hidden" name="mode" value="$env{'form.mode'}" /> |
<input type="hidden" name="mode" value="$env{'form.mode'}" /> |
STATE |
STATE |
$r->print("<p>Completed upload of the file. This file contained references to other files. You can upload these now: </p>"); |
$r->print("<h2>".&mt("Reference Warning")."</h2>"); |
|
$r->print("<p>".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."</p>"); |
|
$r->print("<p>".&mt("Please select the locations from which the referenced files are to be uploaded.")."</p>"); |
$r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase, |
$r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase, |
{'error_on_invalid_names' => 1, |
{'error_on_invalid_names' => 1, |
'ignore_remote_references' => 1,})); |
'ignore_remote_references' => 1,})); |
Line 1844 sub upload_embedded {
|
Line 1847 sub upload_embedded {
|
my ($r,$url,$group)=@_; |
my ($r,$url,$group)=@_; |
for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) { |
for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) { |
next if (!exists($env{'form.embedded_item_'.$i.'.filename'})); |
next if (!exists($env{'form.embedded_item_'.$i.'.filename'})); |
|
my $orig_uploaded_filename = |
|
$env{'form.embedded_item_'.$i.'.filename'}; |
|
|
$env{'form.embedded_orig_'.$i} = |
$env{'form.embedded_orig_'.$i} = |
&unescape($env{'form.embedded_orig_'.$i}); |
&unescape($env{'form.embedded_orig_'.$i}); |
my ($path,$fname) = |
my ($path,$fname) = |
($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)}); |
($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)}); |
|
# no path, whole string is fname |
|
if (!$fname) { $fname = $env{'form.embedded_orig_'.$i} }; |
|
|
$path = $env{'form.currentpath'}.$path; |
$path = $env{'form.currentpath'}.$path; |
$fname = &Apache::lonnet::clean_filename($fname); |
$fname = &Apache::lonnet::clean_filename($fname); |
|
|
Line 1870 sub upload_embedded {
|
Line 1878 sub upload_embedded {
|
&Apache::lonnet::userfileupload('embedded_item_'.$i,'', |
&Apache::lonnet::userfileupload('embedded_item_'.$i,'', |
$port_path.$path); |
$port_path.$path); |
if ($result !~ m|^/uploaded/|) { |
if ($result !~ m|^/uploaded/|) { |
$r->print('<span class="LC_error">'.'An error occured ('.$result. |
$r->print('<span class="LC_error">'.'An error occurred ('.$result. |
') while trying to upload '.&display_file($path,$fname).'</span><br />'); |
') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'</span><br />'); |
next; |
next; |
} else { |
} else { |
$r->print("<p> Uploaded ". |
$r->print("<p> Uploaded ". |
Line 1953 sub createdir {
|
Line 1961 sub createdir {
|
my $result=&Apache::lonnet::mkdiruserfile($uname,$udom, |
my $result=&Apache::lonnet::mkdiruserfile($uname,$udom, |
$port_path.$env{'form.currentpath'}.$newdir); |
$port_path.$env{'form.currentpath'}.$newdir); |
if ($result ne 'ok') { |
if ($result ne 'ok') { |
$r->print('<span class="LC_error">'.'An error occured ('.$result. |
$r->print('<span class="LC_error">'.'An error occurred ('.$result. |
') while trying to create a new directory '.&display_file().'</span><br />'); |
') while trying to create a new directory '.&display_file().'</span><br />'); |
} |
} |
} |
} |