[LON-CAPA-cvs] cvs: rat / lonratedt.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 04 Dec 2002 14:05:07 -0000


www		Wed Dec  4 09:05:07 2002 EDT

  Modified files:              
    /rat	lonratedt.pm 
  Log:
  Bug #881 - ":" in resource titles.
  
  
Index: rat/lonratedt.pm
diff -u rat/lonratedt.pm:1.40 rat/lonratedt.pm:1.41
--- rat/lonratedt.pm:1.40	Mon Nov 11 16:04:49 2002
+++ rat/lonratedt.pm	Wed Dec  4 09:05:07 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Edit Handler for RAT Maps
 #
-# $Id: lonratedt.pm,v 1.40 2002/11/11 21:04:49 www Exp $
+# $Id: lonratedt.pm,v 1.41 2002/12/04 14:05:07 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -712,7 +712,7 @@
        my ($name,@resrest)=split(/\:/,$Apache::lonratedt::resources[$residx]);
        $name=$ENV{'form.renametitle'};
        $name=~s/\:/\&colon\;/g;
-       $Apache::lonratedt::resources[$residx]=$name.':'.join(':'.@resrest);
+       $Apache::lonratedt::resources[$residx]=$name.':'.join(':',@resrest);
        &storemap(&Apache::lonnet::filelocation('',$url));
    }
 # ------------------------------------------------------------ Assemble windows
@@ -780,7 +780,14 @@
        var selidx=document.forms.simpleedit.target.selectedIndex;
        var entry=(document.forms.simpleedit.targetdetail.value.split('&'))
                 [selidx];
-       var newtitle=prompt('New Title',unescape((entry.split('='))[0]));
+       var oldname=unescape((entry.split('='))[0]);
+       var nameparts=oldname.split(':');
+       oldname=unescape(nameparts.join(':'));
+       nameparts=oldname.split('"');
+       oldname=unescape(nameparts.join('"'));
+       nameparts=oldname.split(''');
+       oldname=unescape(nameparts.join("'"));
+       newtitle=prompt('New Title',oldname);
        if (newtitle) {
            document.forms.simpleedit.renameres.value=1;
            document.forms.simpleedit.renameidx.value=selidx;