[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmenu.pm /publisher lonpubdir.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 30 Nov 2004 19:08:18 -0000


This is a MIME encoded message

--raeburn1101841698
Content-Type: text/plain

raeburn		Tue Nov 30 14:08:18 2004 EDT

  Modified files:              
    /loncom/publisher	lonpubdir.pm 
    /loncom/interface	loncommon.pm lonmenu.pm 
  Log:
  Fix bugs #3640, 3631, 3630, 3628.  Menu buttons eliminated when viewing directories in iCSTR in remoteless mode. Directory position and selection now directly below top menu bar. Directory location larger font, headings for directory options (remoteless only) smaller font. Certain directory actions directed to top, (to escape frame), to avoid nesting frames.
  
  
--raeburn1101841698
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20041130140818.txt"

Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.65 loncom/publisher/lonpubdir.pm:1.66
--- loncom/publisher/lonpubdir.pm:1.65	Mon Nov  8 17:42:20 2004
+++ loncom/publisher/lonpubdir.pm	Tue Nov 30 14:08:18 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.65 2004/11/08 22:42:20 albertel Exp $
+# $Id: lonpubdir.pm,v 1.66 2004/11/30 19:08:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -192,24 +192,24 @@
 
     $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
 
-    my $pagetitle; 
-    my $formaction='/priv/'.$uname.'/'.$thisdisfn;
+    my $pagetitle;
+    my $formaction='/priv/'.$uname.'/'.$thisdisfn.'/';
     $formaction=~s/\/+/\//g;
-    $pagetitle .= ('<form name="dirs" method="post" action="'.$formaction
-              .'" target="_parent">'.
+    $pagetitle .= &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
         '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font>&nbsp;'.
-        &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'top','/priv','','-1').
+        '<form name="dirs" method="post" action="'.$formaction.
+        '" target="_parent">'.
+        &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn.'/','_top','/priv','','+1').
         &Apache::lonhtmlcommon::select_recent('construct','recent',
                  'this.form.action=this.form.recent.value;this.form.submit()').
-              '</form>');
-     &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
+              '</form>';
+    &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
     if ($ENV{'environment.remote'} eq 'off') {
 	$ENV{'request.noversionuri'}=$currdir;
 	$r->print(&Apache::loncommon::bodytag('Construction Space',undef,undef,undef,undef,undef,$pagetitle));
     } else {
 	$r->print($pagetitle);
     }
-    $r->print(&Apache::loncommon::help_open_menu('','','','',3,'Authoring'));
     my $pubdirscript=(<<ENDPUBDIRSCRIPT);
 <script>
 // Store directory location for menu bar to find
@@ -228,7 +228,7 @@
             pubrecdir(document.publishdir)
         }
         if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editcat') {
-            window.location=theform.filename.value+'default.meta'
+            top.location=theform.filename.value+'default.meta'
         }
         if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'printdir' ) {
             document.printdir.postdata.value=theform.filename.value
@@ -266,7 +266,7 @@
 
     function SetPubDir(theform,printForm) {
         if (theform.diraction.options[theform.diraction.selectedIndex].value == "open") {
-            window.location = theform.filename.value
+            top.location = theform.filename.value
             return
         }
         if (theform.diraction.options[theform.diraction.selectedIndex].value == "publish") {
@@ -276,7 +276,7 @@
             pubrecdir(theform)
         }
         if (theform.diraction.options[theform.diraction.selectedIndex].value == "editcat") {
-            window.location=theform.filename.value+'default.meta'
+            top.location=theform.filename.value+'default.meta'
         }
         if (theform.diraction.options[theform.diraction.selectedIndex].value == "print") {
             theform.action = '/adm/printout'
@@ -370,9 +370,9 @@
     $r->print(<<END);
         <table cellspacing="4" cellpadding="4" width="100%">
          <tr>
-          <th bgcolor="#DDDDDD">Actions for current directory</th>
-          <th bgcolor="#DDDDDD">Upload a new document</th>
-          <th bgcolor="#DDDDDD">Create a new directory or LON-CAPA document</th>
+          <td bgcolor="#DDDDDD" align="middle"><b>Actions for current directory</b></td>
+          <td bgcolor="#DDDDDD" align="middle"><b>Upload a new document</b></td>
+          <td bgcolor="#DDDDDD" align="middle"><b>Create a new directory or LON-CAPA document</b></td>
         </tr>
         <tr>
          <td bgcolor="#ccddaa" valign="top" align="center">
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.234 loncom/interface/loncommon.pm:1.235
--- loncom/interface/loncommon.pm:1.234	Tue Nov 23 02:29:24 2004
+++ loncom/interface/loncommon.pm	Tue Nov 30 14:08:18 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.234 2004/11/23 07:29:24 raeburn Exp $
+# $Id: loncommon.pm,v 1.235 2004/11/30 19:08:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2599,26 +2599,41 @@
 		$font.'"><b>'.$title.'</b></font>';
         if ($customtitle) {
             $titleinfo = $customtitle;
-        } 
+        }
+
 	if ($ENV{'request.state'} eq 'construct') {
 	    my ($uname,$thisdisfn)=
 		($ENV{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
 	    my $formaction='/priv/'.$uname.'/'.$thisdisfn;
 	    $formaction=~s/\/+/\//g;
-	    $titleinfo = '<form name="dirs" method="post" action="'.$formaction
-		.'" target="_top">'
-		.&Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'_top','/priv','',-1,1)."<br />"
-		.&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
-		.'</form>'
-		.&Apache::lonmenu::constspaceform();
-
-	    &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
-	    if ($thisdisfn!~m|/$|) {  $forcereg=1; }
-	}
+            unless ($customtitle) {
+                my $parentpath = $thisdisfn;
+                if ($thisdisfn =~ m-(.+/)[^/]*$-) {
+                    $parentpath = $1;
+                }
+	        $titleinfo = &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
+                      '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font>&nbsp;'. 
+                      '<form name="dirs" method="post" action="'.$formaction
+		    .'" target="_top"><tt><b>'
+		    .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."</b></tt><br />"
+		    .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
+		    .'</form>'
+		    .&Apache::lonmenu::constspaceform();
 
-        return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web',
-                                                      $forcereg).
-      '<table bgcolor="'.$pgbg.'" width="100%" border="0" cellspacing="3" cellpadding="3"><tr><td rowspan="3" bgcolor="'.$tabbg.'">'.$titleinfo.'</td>'.$roleinfo.'</tr></table>';
+            }
+	    $forcereg=1;
+        }
+        my $titletable = '<table bgcolor="'.$pgbg.'" width="100%" border="0" '.
+                         'cellspacing="3" cellpadding="3">'.
+                         '<tr><td rowspan="3" bgcolor="'.$tabbg.'">'.
+                         $titleinfo.'</td>'.$roleinfo.'</tr></table>';
+        if ($ENV{'request.state'} eq 'construct') {
+            $bodytag .= &Apache::lonmenu::menubuttons($forcereg,'web',$forcereg,$titletable);
+	} else {
+            $bodytag .= &Apache::lonmenu::menubuttons($forcereg,'web',$forcereg).
+                        $titletable;
+        }
+        return $bodytag;
     }
 
 #
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.130 loncom/interface/lonmenu.pm:1.131
--- loncom/interface/lonmenu.pm:1.130	Sun Nov 14 02:32:20 2004
+++ loncom/interface/lonmenu.pm	Tue Nov 30 14:08:18 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.130 2004/11/14 07:32:20 albertel Exp $
+# $Id: lonmenu.pm,v 1.131 2004/11/30 19:08:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -69,6 +69,7 @@
     my $forcereg=shift;
     my $target  =shift;
     my $registration=shift;
+    my $titletable=shift;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
 					    ['inhibitmenu']);
     if ($ENV{'form.inhibitmenu'} eq 'yes') { return ''; }
@@ -153,7 +154,7 @@
         }
         my $reg='';
         if ($registration) {
-           $reg=&innerregister($forcereg,$target);
+           $reg=&innerregister($forcereg,$target,$titletable);
         }
         my $form=&serverform();
 	my $utility=&utilityfunctions();
@@ -229,9 +230,11 @@
 sub innerregister {
     my $forcereg=shift;
     my $target = shift;
+    my $titletable = shift;
     my $result = '';
     my ($uname,$thisdisfn);
     my $const_space = ($ENV{'request.state'} eq 'construct');
+    my $is_const_dir = 0;
 
     if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
 
@@ -269,6 +272,9 @@
  '<b><a href="/adm/communicate" target="_top">You have new messages</a></b><br />':
                           'swmenu.setstatus("you have","messages");');
     }
+    if ($ENV{'request.state'} eq 'construct') {
+        $newmail = $titletable;
+    }
     if ($noremote) {
 	$newmail.='</td></tr></table></font>';
     }
@@ -371,14 +377,18 @@
 	    my ($uname,$thisdisfn) =
 		($ENV{'request.filename'}=~m|^/home/([^/]+)/public_html/(.*)|);
             my $currdir = '/priv/'.$uname.'/'.$thisdisfn;
-            $currdir =~ s#[^/]+$##;
-            $menuitems=(<<ENDMENUITEMS);
-s&6&1&list.gif&list[_1]&dir[_1]&go('$currdir')&List current directory
-s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retreive old version
+            if ($currdir =~ m-/$-) {
+                $is_const_dir = 1;
+            } else {
+                $currdir =~ s#[^/]+$##;
+                $menuitems=(<<ENDMENUITEMS);
+s&6&1&list.gif&list[_1]&dir[_1]&golist('$currdir')&List current directory
+s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version
 s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource
 s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource
 s&7&2&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
 ENDMENUITEMS
+            }
         } else {
 	    $menuitems=(<<ENDMENUITEMS);
 c&3&1
@@ -424,6 +434,9 @@
 <tr><td>$inlineremote[91]</td><td>$inlineremote[92]</td><td>$inlineremote[93]</td></tr>
 ENDINLINE
 	    }
+            if ($const_space && $is_const_dir) {
+                $inlinebuttons = '';
+            }
 	    $result =(<<ENDREGTEXT);
 <script type="text/javascript">
 // BEGIN LON-CAPA Internal
@@ -1004,6 +1017,15 @@
     }
 }
 
+function golist(url) {
+   if (url!='' && url!= null) {
+       currentURL = null;
+       currentSymb= null;
+       top.location.href=url;
+   }
+}
+
+
 
 function catalog_info() {
    loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');

--raeburn1101841698--