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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Dec 2004 21:10:59 -0000


albertel		Tue Dec 14 16:10:59 2004 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - need to pagesymb around everywhere.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.155 loncom/interface/londocs.pm:1.156
--- loncom/interface/londocs.pm:1.155	Sun Dec 12 20:57:10 2004
+++ loncom/interface/londocs.pm	Tue Dec 14 16:10:58 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.155 2004/12/13 01:57:10 raeburn Exp $
+# $Id: londocs.pm,v 1.156 2004/12/14 21:10:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1034,10 +1034,11 @@
 	$folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'});
 	# $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
     }
-    my $pagepath;
+    my ($pagepath,$pagesymb);
     if ($ENV{'form.pagepath'}) {
         $container = 'page';
         $pagepath=&Apache::lonnet::escape($ENV{'form.pagepath'});
+        $pagesymb=&Apache::lonnet::escape($ENV{'form.pagesymb'});
     }
     if ($allowed) {
 	my $incindex=$index+1;
@@ -1064,20 +1065,21 @@
             $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="setparms" value="$orderidx" />
 <td><table border='0' cellspacing='2' cellpadding='0'>
 <tr><td bgcolor="#DDDDDD">
-<a href='/adm/coursedocs?cmd=up_$index&pagepath=$pagepath'>
+<a href='/adm/coursedocs?cmd=up_$index&pagepath=$pagepath&pagesymb=$pagesymb'>
 <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'>
+<a href='/adm/coursedocs?cmd=down_$index&pagepath=$pagepath&pagesymb=$pagesymb'>
 <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");'>
+<a href='javascript:removeres("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#990000">$lt{'rm'}</font></a>
-<a href='javascript:changename("$pagepath","$index","$renametitle","page");'>
+<a href='javascript:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#009900">$lt{'rn'}</font></a></td>
 END
         } else {
@@ -1626,6 +1628,7 @@
     if (defined($ENV{'form.pagepath'})) {
 	$pathvar='pagepath';
 	$path=&Apache::lonnet::escape($ENV{'form.pagepath'});
+	$path.='&amp;symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'});
     }
     $r->print(
 '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'. 
@@ -1700,14 +1703,16 @@
         my (@pagepath)=split('&',$ENV{'form.pagepath'});
         $ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
         $ENV{'form.folder'}=pop(@pagepath);
-        $containertag = '<input type="hidden" name="pagepath" value="" />';
-        $uploadtag = '<input type="hidden" name="pagepath" value="'.$ENV{'form.pagepath'}.'" />';
+        $containertag = '<input type="hidden" name="pagepath" value="" />'.
+	    '<input type="hidden" name="pagesymb" value="" />';
+        $uploadtag = '<input type="hidden" name="pagepath" value="'.$ENV{'form.pagepath'}.'" />'.
+	    '<input type="hidden" name="pagesymb" value="'.$ENV{'form.pagesymb'}.'" />';
     }
     if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
        $showdoc='/'.$1;
     }
     unless ($showdoc) { # got called from remote
-       if (($ENV{'form.folder'}=~/^default_$/) || 
+       if (($ENV{'form.folder'}=~/^default_/) || 
           ($ENV{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
            $forcestandard = 1;
        } 
@@ -1844,7 +1849,7 @@
     '";this.document.forms.'+form+'.submit();');
 }
 
-function changename(folderpath,index,oldtitle,container) {
+function changename(folderpath,index,oldtitle,container,pagesymb) {
     var title=prompt('New Title',oldtitle);
     if (title) {
 	this.document.forms.renameform.title.value=title;
@@ -1854,12 +1859,13 @@
         }
         if (container == 'page') {
             this.document.forms.renameform.pagepath.value=folderpath;
+            this.document.forms.renameform.pagesymb.value=pagesymb;
         }
         this.document.forms.renameform.submit();
     }
 }
 
-function removeres(folderpath,index,oldtitle,container) {
+function removeres(folderpath,index,oldtitle,container,pagesymb) {
     if (confirm('Remove "'+oldtitle+'"?')) {
 	this.document.forms.renameform.cmd.value='del_'+index;
         if (container == 'sequence') {
@@ -1867,6 +1873,7 @@
         }
         if (container == 'page') {
             this.document.forms.renameform.pagepath.value=folderpath;
+            this.document.forms.renameform.pagesymb.value=pagesymb;
         }
         this.document.forms.renameform.submit();
     }