[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 01 May 2003 16:13:50 -0000


www		Thu May  1 12:13:50 2003 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Bug 1405: make sure people do not accidently "remove" instead of "rename".
  Visually different now, and "remove" confirmation dialog.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.53 loncom/interface/londocs.pm:1.54
--- loncom/interface/londocs.pm:1.53	Wed Apr 30 22:20:17 2003
+++ loncom/interface/londocs.pm	Thu May  1 12:13:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.53 2003/05/01 02:20:17 www Exp $
+# $Id: londocs.pm,v 1.54 2003/05/01 16:13:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -232,16 +232,18 @@
 # Edit commands
     if ($allowed) {
        $line.=(<<END);
-<td><table border='0' cellspacing='0' cellpadding='0'>
-<tr><td><a href='/adm/coursedocs?folder=$folder&cmd=up_$index'>
+<td><table border='0' cellspacing='2' cellpadding='0'>
+<tr><td bgcolor="#DDDDDD">
+<a href='/adm/coursedocs?folder=$folder&cmd=up_$index'>
 <img src="${iconpath}move_up.gif" alt='UP' border='0' /></a></td></tr>
-<tr><td><a href='/adm/coursedocs?folder=$folder&cmd=down_$index'>
+<tr><td bgcolor="#DDDDDD">
+<a href='/adm/coursedocs?folder=$folder&cmd=down_$index'>
 <img src="${iconpath}move_down.gif" alt='DOWN' border='0' /></a></td></tr>
-</table></td><td>
-<a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>
-<font size="-2">Remove</font></a>
+</table></td><td bgcolor="#DDDDDD">
+<a href='javascript:removeres("$folder","$index","$renametitle");'>
+<font size="-2" color="#990000">Remove</font></a>
 <a href='javascript:changename("$folder","$index","$renametitle");'>
-<font size="-2">Rename</font></a></td>
+<font size="-2" color="#009900">Rename</font></a></td>
 END
     }
 # Figure out what kind of a resource this is
@@ -595,6 +597,14 @@
     if (title) {
 	this.document.forms.renameform.title.value=title;
 	this.document.forms.renameform.cmd.value='rename_'+index;
+	this.document.forms.renameform.folder.value=folder;
+        this.document.forms.renameform.submit();
+    }
+}
+
+function removeres(folder,index,oldtitle) {
+    if (confirm('Remove "'+oldtitle+'"?')) {
+	this.document.forms.renameform.cmd.value='del_'+index;
 	this.document.forms.renameform.folder.value=folder;
         this.document.forms.renameform.submit();
     }