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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 29 Jun 2007 21:08:12 -0000


albertel		Fri Jun 29 17:08:12 2007 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - remove some copy/past html
  - tabinate some of the html
  
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.279 loncom/interface/londocs.pm:1.280
--- loncom/interface/londocs.pm:1.279	Fri Jun 29 16:14:18 2007
+++ loncom/interface/londocs.pm	Fri Jun 29 17:08:07 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.279 2007/06/29 20:14:18 albertel Exp $
+# $Id: londocs.pm,v 1.280 2007/06/29 21:08:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1671,17 +1671,17 @@
     my $line='<tr>';
 # Edit commands
     my $container;
-    my $folderpath;
+    my ($container, $type, $esc_path, $path, $symb);
     if ($env{'form.folderpath'}) {
+	$type = 'folder';
         $container = 'sequence';
-	$folderpath=&escape($env{'form.folderpath'});
+	$esc_path=&escape($path = $env{'form.folderpath'});
 	# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"');
     }
-    my ($pagepath,$pagesymb);
     if ($env{'form.pagepath'}) {
-        $container = 'page';
-        $pagepath=&escape($env{'form.pagepath'});
-        $pagesymb=&escape($env{'form.pagesymb'});
+        $type = $container = 'page';
+        $esc_path=&escape($path = $env{'form.pagepath'});
+        $symb=&escape($env{'form.pagesymb'});
     }
     my $cpinfo='';
     if ($env{'form.markedcopy_url'}) {
@@ -1737,82 +1737,52 @@
         }
         my $copylink='&nbsp;';
         my $cutlink='&nbsp;';
-        if ($env{'form.pagepath'}) {
-           if (!$nocopy) {
-               $copylink=(<<ENDCOPY);
-<a href='javascript:markcopy("$pagepath","$index","$renametitle","page","$pagesymb");'>
-<font size="-2" color="#000099">$lt{'cp'}</font></a></td>
-ENDCOPY
-           }
-           if (!$nocut) {
-               $cutlink=(<<ENDCUT);
-<a href='javascript:cutres("$pagepath","$index","$renametitle","page","$pagesymb");'>
-<font size="-2" color="#550044">$lt{'ct'}</font></a>
-ENDCUT
-            }
-            $line.=(<<END);
-<form name="entry_$index" action="/adm/coursedocs" method="post">
-<input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />
-<input type="hidden" name="pagesymb" value="$env{'form.pagesymb'}" />
-<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
-<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
-<input type="hidden" name="setparms" value="$orderidx" />
-<input type="hidden" name="changeparms" value="0" />
-<td><table border='0' cellspacing='2' cellpadding='0'>
-<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?cmd=up_$index&pagepath=$pagepath&pagesymb=$pagesymb$cpinfo'>
-<img src="${iconpath}move_up.gif" alt='$lt{'up'}' border='0' /></a></td></tr>
-<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?cmd=down_$index&pagepath=$pagepath&pagesymb=$pagesymb$cpinfo'>
-<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr>
-</table></td>
-<td>$selectbox
-</td><td bgcolor="#DDDDDD">
-<a href='javascript:removeres("$pagepath","$index","$renametitle","page","$pagesymb");'>
-<font size="-2" color="#990000">$lt{'rm'}</font></a>
-$cutlink
-<a href='javascript:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>
-<font size="-2" color="#009900">$lt{'rn'}</font></a>
-$copylink
-END
-        } else {
-           if (!$nocopy) {
-               $copylink=(<<ENDCOPY);
-<a href='javascript:markcopy("$folderpath","$index","$renametitle","sequence");'>
-<font size="-2" color="#000099">$lt{'cp'}</font></a></td>
+	
+	if (!$nocopy) {
+	    $copylink=(<<ENDCOPY);
+<a href='javascript:markcopy("$esc_path","$index","$renametitle","$container","$symb");'>
+<font size="-2" color="#000099">$lt{'cp'}</font></a>
 ENDCOPY
-            }
-            if (!$nocut) {
-               $cutlink=(<<ENDCUT);
-<a href='javascript:cutres("$folderpath","$index","$renametitle","sequence");'>
+        }
+	if (!$nocut) {
+	    $cutlink=(<<ENDCUT);
+<a href='javascript:cutres("$esc_path","$index","$renametitle","$container","$symb");'>
 <font size="-2" color="#550044">$lt{'ct'}</font></a>
 ENDCUT
-            }
-            $line.=(<<END); 
-<form name="entry_$index" action="/adm/coursedocs" method="post">
-<input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
-<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
-<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
-<input type="hidden" name="setparms" value="$orderidx" />
-<input type="hidden" name="changeparms" value="0" />
-<td><table border='0' cellspacing='2' cellpadding='0'>
-<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?cmd=up_$index&folderpath=$folderpath$cpinfo'>
-<img src="${iconpath}move_up.gif" alt='$lt{'up'}' border='0' /></a></td></tr>
-<tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?cmd=down_$index&folderpath=$folderpath$cpinfo'>
-<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr>
-</table></td>
-<td>$selectbox
-</td><td bgcolor="#DDDDDD">
-<a href='javascript:removeres("$folderpath","$index","$renametitle","sequence");'>
-<font size="-2" color="#990000">$lt{'rm'}</font></a>
+        }
+	$line.=(<<END);
+   <form name="entry_$index" action="/adm/coursedocs" method="post">
+   <input type="hidden" name="${type}path" value="$path" />
+   <input type="hidden" name="${type}symb" value="$symb" />
+   <input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
+   <input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
+   <input type="hidden" name="setparms" value="$orderidx" />
+   <input type="hidden" name="changeparms" value="0" />
+<td>
+   <table border='0' cellspacing='2' cellpadding='0'>
+      <tr>
+         <td bgcolor="#DDDDDD">
+            <a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'><img src="${iconpath}move_up.gif" alt='$lt{'up'}' border='0' /></a>
+         </td>
+      </tr>
+      <tr>
+        <td bgcolor="#DDDDDD">
+           <a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'><img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a>
+        </td>
+      </tr>
+    </table>
+</td>
+<td>
+   $selectbox
+</td>
+<td bgcolor="#DDDDDD">
+   <a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb");'><font size="-2" color="#990000">$lt{'rm'}</font></a>
 $cutlink
-<a href='javascript:changename("$folderpath","$index","$renametitle","sequence");'>
-<font size="-2" color="#009900">$lt{'rn'}</font></a>
+   <a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");'><font size="-2" color="#009900">$lt{'rn'}</font></a>
 $copylink
+</td>
 END
-        }
+
     }
 # Figure out what kind of a resource this is
     my ($extension)=($url=~/\.(\w+)$/);