--- loncom/interface/portfolio.pm 2013/04/30 14:27:51 1.244 +++ loncom/interface/portfolio.pm 2013/05/03 17:53:02 1.245 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.244 2013/04/30 14:27:51 raeburn Exp $ +# $Id: portfolio.pm,v 1.245 2013/05/03 17:53:02 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2101,21 +2101,24 @@ function confirmOverwrite() { } // ]]> </script> +<p> $msg -<br /><div class="LC_warning"><form method="post" action="$url" name="existingfile" onsubmit="return confirmOverwrite();"> -<span class="LC_nobreak">$lt{'over'} +</p> +<form method="post" action="$url" name="existingfile" onsubmit="return confirmOverwrite();"> +<p class="LC_nobreak">$lt{'over'} <label><input type="radio" name="overwrite" value="1" /> $lt{'yes'}</label> -<label><input type="radio" name="overwrite" value="0" checked="checked" />$lt{'no'}</label></span> +<label><input type="radio" name="overwrite" value="0" checked="checked" />$lt{'no'}</label></p> +<p> <input type="hidden" name="action" value="cancel_overwrite" /> <input type="hidden" name="filename" value="$showfname" /> <input type="hidden" name="timestamp" value="$timestamp" /> $hidden $parserflag $group_elem -<br /><br /> <input type="submit" name="process" value="$lt{'cont'}" /> -</form></div> +</p> +</form> END } else { $r->print( @@ -2213,10 +2216,13 @@ sub overwrite { } } if ($fname eq '') { - my $msg = &mt('Invalid filename: [_1]; the name of the uploaded file did not contain any letters, '. + $r->print( + &Apache::loncommon::confirmwrapper( + &Apache::lonhtmlcommon::confirm_success( + &mt('Invalid filename: [_1]; the name of the uploaded file did not contain any letters, '. 'so after eliminating special characters there was nothing left.', - '<span class="LC_filename">'.$env{'form.filename'}.'</span>'); - $r->print($msg.&done(undef,$url)); + '<span class="LC_filename">'.$env{'form.filename'}.'</span>'),1))); + $r->print(&done(undef,$url)); return; } $env{'form.'.$formname.'.filename'} = $fname; @@ -2227,9 +2233,11 @@ sub overwrite { \%allfiles,\%codebase,undef,undef,undef, undef,undef,undef,\$mimetype); if ($result !~ m|^/uploaded/|) { - $r->print('<p class="LC_error">'.&mt('An error occurred ([_1]) while trying to overwrite [_2].' - ,$result,&display_file(undef,$fname)).'</p>'); - $r->print(&after_overwrite(&mt('Back'),$url)); + $r->print( + &Apache::loncommon::confirmwrapper( + &Apache::lonhtmlcommon::confirm_success( + &mt('An error occurred ([_1]) while trying to overwrite [_2].' + ,$result,&display_file(undef,$fname)),1))); } else { if ($mode eq 'parse') { if ($mimetype eq 'text/html') { @@ -2237,18 +2245,21 @@ sub overwrite { &print_dependency_form($r,$url,\%allfiles,\%codebase,$result); return; } else { - $r->print('<p>'.&mt('Overwriting completed.').'<br />'. - &mt('No embedded items identified.').'</p>'); + $r->print( + &Apache::loncommon::confirmwrapper( + &Apache::lonhtmlcommon::confirm_success( + &mt('Overwriting completed.')) + .'<br />'.&mt('No embedded items identified.'))); } } + } else { + $r->print( + &Apache::loncommon::confirmwrapper( + &Apache::lonhtmlcommon::confirm_success( + &mt('Overwriting completed.')))); } - $r->print(&after_overwrite(undef,$url)); } - return; -} -sub after_overwrite { - my ($text,$url) = @_; my $group_elem; if (defined($env{'form.group'})) { $group_elem = '<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'; @@ -2256,18 +2267,18 @@ sub after_overwrite { $group_elem .= '<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />'."\n"; } } - if ($text eq '') { - $text = &mt('Done'); - } my $hidden = &hidden_elems(); - return <<END; - -<h3><a href="javascript:document.overwritedone.submit();">$text</a></h3> -<form name="overwritedone" method="post" action="$url" /> -$hidden -$group_elem -</form> -END + $r->print( + &Apache::lonhtmlcommon::actionbox( + ['<a href="javascript:document.overwritedone.submit();">' + .&mt('Return to directory') + .'</a>']) + .'<form name="overwritedone" method="post" action="'.$url.'">' + .$hidden + .$group_elem + .'</form>' + ); + return; } sub lock_info {