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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 13 Jul 2007 23:08:12 -0000


albertel		Fri Jul 13 19:08:12 2007 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - don't warn on removal of non grades related items (simplepages etc)
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.290 loncom/interface/londocs.pm:1.291
--- loncom/interface/londocs.pm:1.290	Thu Jul 12 20:29:21 2007
+++ loncom/interface/londocs.pm	Fri Jul 13 19:08:07 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.290 2007/07/13 00:29:21 albertel Exp $
+# $Id: londocs.pm,v 1.291 2007/07/13 23:08:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1812,6 +1812,18 @@
         my $copylink=' ';
         my $cutlink=' ';
 	
+	my $skip_confirm = 0;
+	if ( $folder =~ /^supplemental/
+	     || ($url =~ m{( /smppg$
+			    |/syllabus$
+			    |/aboutme$
+			    |/navmaps$
+			    |/bulletinboard$
+			    |\.html$
+			    |^/adm/wrapper/ext)}x)) {
+	    $skip_confirm = 1;
+	}
+
 	if (!$nocopy) {
 	    $copylink=(<<ENDCOPY);
 <a href='javascript:markcopy("$esc_path","$index","$renametitle","$container","$symb","$folder");' class="LC_docs_copy">$lt{'cp'}</a>
@@ -1819,7 +1831,7 @@
         }
 	if (!$nocut) {
 	    $cutlink=(<<ENDCUT);
-<a href='javascript:cutres("$esc_path","$index","$renametitle","$container","$symb","$folder");' class="LC_docs_cut">$lt{'ct'}</a>
+<a href='javascript:cutres("$esc_path","$index","$renametitle","$container","$symb","$folder",$skip_confirm);' class="LC_docs_cut">$lt{'ct'}</a>
 ENDCUT
         }
 	$form_start = (<<END);
@@ -1851,7 +1863,7 @@
    $form_end
 </td>
 <td class="LC_docs_entry_commands">
-   <a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_remove">$lt{'rm'}</a>
+   <a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a>
 $cutlink
    <a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_rename">$lt{'rn'}</a>
 $copylink
@@ -3263,8 +3275,8 @@
     }
 }
 
-function removeres(folderpath,index,oldtitle,container,pagesymb) {
-    if (confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {
+function removeres(folderpath,index,oldtitle,container,pagesymb,skip_confirm) {
+    if (skip_confirm || confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {
 	this.document.forms.renameform.markcopy.value=-1;
 	this.document.forms.renameform.cmd.value='del_'+index;
         if (container == 'sequence') {
@@ -3278,8 +3290,8 @@
     }
 }
 
-function cutres(folderpath,index,oldtitle,container,pagesymb,folder) {
-    if (confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible!\\nGrades remain inaccessible if resource is pasted into another folder.\\nCut "'+oldtitle+'"?')) {
+function cutres(folderpath,index,oldtitle,container,pagesymb,folder,skip_confirm) {
+    if (skip_confirm || confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible!\\nGrades remain inaccessible if resource is pasted into another folder.\\nCut "'+oldtitle+'"?')) {
 	this.document.forms.renameform.cmd.value='cut_'+index;
 	this.document.forms.renameform.markcopy.value=index;
 	this.document.forms.renameform.copyfolder.value=folder+'.'+container;