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

raeburn raeburn at source.lon-capa.org
Tue Nov 8 21:04:04 EST 2016


raeburn		Wed Nov  9 02:04:04 2016 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - &checkbox() can take additional arg (e.g., to set to disabled).
  - If system-level bre priv absent, /res in breadcrumb trail is plain text
    instead of a link, when browsing resource space.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.377 loncom/interface/lonhtmlcommon.pm:1.378
--- loncom/interface/lonhtmlcommon.pm:1.377	Wed Nov  9 01:58:43 2016
+++ loncom/interface/lonhtmlcommon.pm	Wed Nov  9 02:04:04 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.377 2016/11/09 01:58:43 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.378 2016/11/09 02:04:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -407,7 +407,7 @@
 ##############################################
 ##############################################
 sub checkbox {
-    my ($name,$checked,$value) = @_;
+    my ($name,$checked,$value,$special) = @_;
     my $Str = '<input type="checkbox" name="'.$name.'" ';
     if (defined($value)) {
         $Str .= 'value="'.$value.'"';
@@ -415,7 +415,7 @@
     if ($checked) {
         $Str .= ' checked="checked"';
     }
-    $Str .= ' />';
+    $Str .= $special.' />';
     return $Str;
 }
 
@@ -1218,6 +1218,12 @@
             } else {
                 $path.='/'; 
             }
+            if ($path eq '/res/') {
+                unless (&Apache::lonnet::allowed('bre',$path)) {
+                    $output.="$dir/";
+                    next;
+                }
+            }
             my $href_path = &HTML::Entities::encode($path,'<>&"');
             &Apache::loncommon::inhibit_menu_check(\$href_path);
             if ($form) {




More information about the LON-CAPA-cvs mailing list