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

raeburn raeburn at source.lon-capa.org
Sun Jun 11 16:45:40 EDT 2023


raeburn		Sun Jun 11 20:45:40 2023 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmenu.pm 
    /loncom/publisher	lonpubdir.pm 
  Log:
  - Remove "Actions for current directory" drop-down list from box created by
    &CSTR_pageheader() when listing contents of a directory in Authoring Space
    and replace with icons/links in Functions menu below standard inline menus.
  - Reverse part of changes in lonpubdir.pm 1.176 and loncommon.pm 1.1406  
  
  
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1406 loncom/interface/loncommon.pm:1.1407
--- loncom/interface/loncommon.pm:1.1406	Sat Jun 10 23:55:36 2023
+++ loncom/interface/loncommon.pm	Sun Jun 11 20:45:35 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1406 2023/06/10 23:55:36 raeburn Exp $
+# $Id: loncommon.pm,v 1.1407 2023/06/11 20:45:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6369,6 +6369,8 @@
        If page header is being requested for use in a frameset, then
        the second (option) argument -- frameset will be true, and
        the target attribute set for links should be target="_parent".
+       If $title is supplied as the thitd arg, that will be used to 
+       the left of the breadcrumbs tail for the current path.
 
 Returns: HTML div with CSTR path and recent box
          To be included on Authoring Space pages
@@ -6376,7 +6378,7 @@
 =cut
 
 sub CSTR_pageheader {
-    my ($trailfile,$frameset,$title,$diraction) = @_;
+    my ($trailfile,$frameset,$title) = @_;
     if ($trailfile eq '') {
         $trailfile = $env{'request.filename'};
     }
@@ -6424,7 +6426,7 @@
     }
 
     my $output =
-         '<div style="display:inline-block">'
+         '<div>'
         .&Apache::loncommon::help_open_menu('','',3,'Authoring') #FIXME: Broken? Where is it?
         .'<b>'.$title.'</b> '
         .'<form name="dirs" method="post" action="'.$formaction.'"'.$target.'>'
@@ -6447,7 +6449,7 @@
             .'</form>'
             .&Apache::lonmenu::constspaceform($frameset);
     }
-    $output .= '</div>'.$diraction;
+    $output .= '</div>';
 
     return $output;
 }
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.531 loncom/interface/lonmenu.pm:1.532
--- loncom/interface/lonmenu.pm:1.531	Tue Apr 11 21:54:09 2023
+++ loncom/interface/lonmenu.pm	Sun Jun 11 20:45:35 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.531 2023/04/11 21:54:09 raeburn Exp $
+# $Id: lonmenu.pm,v 1.532 2023/06/11 20:45:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1150,6 +1150,13 @@
                         $is_const_dir = 2;
                     }
                 }
+                my $esc_currdir = &Apache::loncommon::escape_single($currdir);
+                $menuitems=(<<ENDMENUITEMS);
+s&6&3&pub.png&Publish&dir[_2]&gocstr('/adm/publish','$esc_currdir')&Publish this Directory
+s&7&4&docs-22x22.png&Edit Metadata&defaults[_1]&gopost('${esc_currdir}default.meta','')&Edit metadata for this Directory
+s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of directory
+s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory
+ENDMENUITEMS
             } else {
                 $currdir =~ s|[^/]+$||;
 		my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.177 loncom/publisher/lonpubdir.pm:1.178
--- loncom/publisher/lonpubdir.pm:1.177	Sun Jun 11 19:46:01 2023
+++ loncom/publisher/lonpubdir.pm	Sun Jun 11 20:45:40 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Authoring Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.177 2023/06/11 19:46:01 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.178 2023/06/11 20:45:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,14 +104,9 @@
                                 "$londocroot/priv/$udom/$uname"); # expressed in kB
     my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,
                                                  $cstr,$crstype); # expressed in MB
-    my $diraction;
-    if (-d $fn) {
-        $diraction = &diractions($thisdisfn);
-    }
-
     # Put out the start of page.
     
-    &startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor, $diraction);
+    &startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor);
 
     if (!-d $fn) {
         if (-e $fn) {
@@ -366,7 +361,7 @@
 #      $crstype - Course type, if this is for "course author"
 
 sub startpage {
-    my ($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor, $diraction) = @_;
+    my ($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota, $crsauthor) = @_;
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
@@ -396,13 +391,12 @@
 
     $disk_quota = 1024 * $disk_quota; # convert from MB to kB
 
-    my $heading = &mt('Directory');
     $r->print(&Apache::loncommon::head_subbox(
                      '<div style="float:right;padding-top:0;margin-top;0">'
                     .&Apache::lonhtmlcommon::display_usage($current_disk_usage,
                                                            $disk_quota,'authoring')
                     .'</div>'
-                    .&Apache::loncommon::CSTR_pageheader('','',$heading,$diraction)));
+                    .&Apache::loncommon::CSTR_pageheader('','',&mt('Directory'))));
 
     my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn);
     my $doctitle = 'LON-CAPA '.&mt($title);
@@ -416,25 +410,6 @@
 
 // Confirmation dialogues
 
-    function currdiract(theform) {
-        if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'publish') {
-            document.publishdir.filename.value = theform.filename.value;
-	    document.publishdir.submit();
-        }
-        if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'editmeta') {
-            top.location=theform.filename.value+'default.meta'
-        }
-        if (theform.dirtask.options[theform.dirtask.selectedIndex].value == 'printdir' ) {
-            document.printdir.postdata.value=theform.filename.value
-            document.printdir.submit();
-        }
-        if (theform.dirtask.options[theform.dirtask.selectedIndex].value == "delete") {
-              var delform = document.delresource
-              delform.filename.value = theform.filename.value
-              delform.submit()
-        }
-    }
-  
     function checkUpload(theform) {
         if (theform.file == '') {
             alert("Please use 'Browse..' to choose a file first, before uploading")
@@ -517,41 +492,6 @@
     $r->print($pubdirscript);
 }
 
-sub diractions {
-    my ($thisdisfn) = @_;
-    my %lt=&Apache::lonlocal::texthash(
-                                       acti => 'Actions for current directory',
-                                       sela => 'Select Action',
-                                       pubd => 'Publish this Directory',
-                                       prnt => 'Print contents of directory',
-                                       edit => 'Edit Metadata',
-                                       dedr => 'Delete Directory',
-    );
-    return <<END;
-<div style="display:inline-block;padding-left:20px">
-<b>$lt{'acti'}</b><br />
-<form name="curractions" method="post" action="">
-    <select name="dirtask" onchange="currdiract(this.form)">
-        <option>$lt{'sela'}</option>
-        <option value="publish">$lt{'pubd'}</option>
-        <option value="editmeta">$lt{'edit'}</option>
-        <option value="printdir">$lt{'prnt'}</option>
-        <option value="delete">$lt{'dedr'}</option>
-    </select>
-    <input type="hidden" name="filename" value="/priv$thisdisfn/" />
-</form>
-<form name="publishdir" method="post" action="/adm/publish">
-  <input type="hidden" name="pubrec" value="" />
-  <input type="hidden" name="filename" value="" />
-</form>
-<form name="printdir" method="post" action="/adm/printout">
-  <input type="hidden" name="postdata" value="" />
-</form>
-</div>
-END
-
-}
-
 sub dircontrols {
     my ($r,$uname,$udom,$thisdisfn, $current_disk_usage, $disk_quota) = @_;
     my %lt=&Apache::lonlocal::texthash(
@@ -662,7 +602,7 @@
                  <a href="javascript:void(0)" onclick="javascript:validate_action('problemtempl')"> 
                     <img src="/adm/lonIcons/problem.gif" title="Create new problem from template" alt="problem icon" /></a>
                  <a href="javascript:void(0)" onclick="javascript:validate_action('blankhtml')"> 
-                    <img src="/adm/lonIcons/html.gif" title="Create new blank HTML file"  alt="web page icon" /></a>
+                    <img src="/adm/lonIcons/html.gif" title="Create new blank HTML file" alt="web page icon" /></a>
                  <a href="javascript:void(0)" onclick="javascript:validate_action('folder')"> 
 		    <img src="/adm/lonIcons/navmap.folder.closed.gif" title="Create new subdirectory" alt="folder icon" /></a>
                 </span>


More information about the LON-CAPA-cvs mailing list