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

raeburn raeburn at source.lon-capa.org
Sun Mar 27 16:22:52 EDT 2016


raeburn		Sun Mar 27 20:22:52 2016 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Re-enable upload in case where no LTI Tools defined in domain config.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.599 loncom/interface/londocs.pm:1.600
--- loncom/interface/londocs.pm:1.599	Fri Mar 18 21:59:42 2016
+++ loncom/interface/londocs.pm	Sun Mar 27 20:22:52 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.599 2016/03/18 21:59:42 damieng Exp $
+# $Id: londocs.pm,v 1.600 2016/03/27 20:22:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4990,8 +4990,9 @@
             }
             my $tabidstr = join("','", at tabids);
             %ltitools = &Apache::lonnet::get_domain_ltitools($coursedom);
+            my $posslti = keys(%ltitools);
             my $exttoolurl = "/adm/$coursedom/$coursenum/new/exttool";
-	    $script .= &editing_js($udom,$uname,$supplementalflag).
+	    $script .= &editing_js($udom,$uname,$supplementalflag,$posslti).
                        &history_tab_js().
                        &inject_data_js().
                        &Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid).
@@ -6087,7 +6088,7 @@
 }
 
 sub editing_js {
-    my ($udom,$uname,$supplementalflag) = @_;
+    my ($udom,$uname,$supplementalflag,$posslti) = @_;
     my %js_lt = &Apache::lonlocal::texthash(
                                           p_mnf => 'Name of New Folder',
                                           t_mnf => 'New Folder',
@@ -6161,12 +6162,18 @@
         $backtourl = '/adm/navmaps';
     }
 
-    my $fieldsets = "'ext','tool','doc'";
+    my $fieldsets = "'ext','doc'";
+    if ($posslti) {
+        $fieldsets .= ",'tool'";
+    }
     unless ($main_container_page) {
         $fieldsets .=",'ims'";
     }
     if ($supplementalflag) {
-        $fieldsets = "'suppext','supptool','suppdoc'";
+        $fieldsets = "'suppext','suppdoc'";
+        if ($posslti) {
+            $fieldsets .= ",'supptool'";
+        }
     }
 
     return <<ENDNEWSCRIPT;




More information about the LON-CAPA-cvs mailing list