--- rat/lonratedt.pm 2003/07/25 04:14:32 1.46
+++ rat/lonratedt.pm 2004/01/15 03:18:20 1.53
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Edit Handler for RAT Maps
#
-# $Id: lonratedt.pm,v 1.46 2003/07/25 04:14:32 bowersj2 Exp $
+# $Id: lonratedt.pm,v 1.53 2004/01/15 03:18:20 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -173,6 +173,7 @@ use Apache::lonnet;
use Apache::lonratsrv;
use Apache::lonsequence;
use Apache::loncommon;
+use Apache::lonlocal;
use File::Copy;
use vars qw(@order @resources);
@@ -205,7 +206,7 @@ sub mapread {
$links[$number]=$content;
}
if ($command eq 'objparms') {
- return('Map has resource parameters. Use advanced editor.',1);
+ return(&mt('Map has resource parameters. Use advanced editor.'),1);
}
}
# ------------------------------------------------------- Is this a linear map?
@@ -219,13 +220,13 @@ sub mapread {
my ($start,$end,$cond)=split(/\:/,$_);
if ((defined($starters[$start])) || (defined($endings[$end]))) {
return
- ('Map has branchings. Use advanced editor.',1);
+ (&mt('Map has branchings. Use advanced editor.'),1);
}
$starters[$start]=1;
$endings[$end]=1;
if ($cond) {
return
- ('Map has conditions. Use advanced editor.',1);
+ (&mt('Map has conditions. Use advanced editor.'),1);
}
}
@@ -234,7 +235,7 @@ sub mapread {
if (defined($resources[$i])) {
unless (($starters[$i]) || ($endings[$i])) {
return
- ('Map has unconnected resources. Use advanced editor.',1);
+ (&mt('Map has unconnected resources. Use advanced editor.'),1);
}
}
}
@@ -413,12 +414,15 @@ sub buttons {
my $adv=shift;
my $output='
';
}
@@ -526,6 +530,7 @@ sub storemap {
sub editscript {
my $mode=shift;
+ my $resurl=&Apache::loncommon::lastresurl();
return(<You are working with an unsaved version of your map. ';
+ ''.&mt('You are working with an unsaved version of your map.').' ';
my ($errtext,$fatal)=&mapread($tmpfn,'');
}
# ---------------------------------------------------------- Process form input
@@ -877,7 +882,7 @@ sub smpedt {
$importdetail='&'.$importdetail;
$importdetail=~s/^\&+/\&/;
my $importwindow=
- ''.
+ ''.
join("\n",map {
$idx++;
if ($_) {
@@ -892,7 +897,7 @@ sub smpedt {
$idx=0;
$targetdetail='';
my $targetwindow=
- ''.
+ ''.
join("\n",map {
my ($name,$url)=split(/\:/,$resources[$_]);
unless ($name) { $name=(split(/\//,$url))[-1]; }
@@ -906,7 +911,30 @@ sub smpedt {
# ----------------------------------------------------- Start simple RAT screen
my $editscript=&editscript('simple');
- my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1);
+ my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1).
+ &Apache::loncommon::help_open_topic('Sequence_Simple_Editor_Creation').
+ &Apache::loncommon::help_open_faq(6).
+ &Apache::loncommon::help_open_bug('RAT');
+ my %lt=&Apache::lonlocal::texthash(
+ 'sa' => 'Save',
+ 'nt' => 'New Title',
+ 'se' => 'Search',
+ 'im' => 'Import',
+ 'vi' => 'View',
+ 'lm' => 'Load Map',
+ 'ds' => 'Discard Selected',
+ 'ca' => 'Clear All',
+ 'ta' => 'Temporary Assembly Workspace',
+ 'rv' => 'Revert to Last Saved',
+ 'sa' => 'Save',
+ 'mu' => 'Move Up',
+ 'md' => 'Move Down',
+ 're' => 'Rename',
+ 'as' => 'after selected',
+ 'cs' => 'Cut selected',
+ 'ps' => 'Copy selected',
+ 'pas' => 'Paste after selected',
+ );
$r->print(<
@@ -943,7 +971,7 @@ sub smpedt {
oldname=unescape(nameparts.join('"'));
nameparts=oldname.split(''');
oldname=unescape(nameparts.join("'"));
- newtitle=prompt('New Title',oldname);
+ newtitle=prompt('$lt{'nt'}',oldname);
if (newtitle) {
document.forms.simpleedit.renameres.value=1;
document.forms.simpleedit.renameidx.value=selidx;
@@ -963,37 +991,37 @@ $buttons