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

amueller amueller@source.lon-capa.org
Sun, 08 Nov 2009 19:51:22 -0000


amueller		Sun Nov  8 19:51:22 2009 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Codestyling. Put the correct indention space in subroutine extractResourceInformation.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.479 loncom/interface/lonparmset.pm:1.480
--- loncom/interface/lonparmset.pm:1.479	Fri Nov  6 18:32:42 2009
+++ loncom/interface/lonparmset.pm	Sun Nov  8 19:51:22 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.479 2009/11/06 18:32:42 raeburn Exp $
+# $Id: lonparmset.pm,v 1.480 2009/11/08 19:51:22 amueller Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1161,81 +1161,80 @@
     my $navmap = Apache::lonnavmaps::navmap->new();
     my @allres=$navmap->retrieveResources(undef,undef,1,undef,1);
     foreach my $resource (@allres) {
-    my $id=$resource->id();
+        my $id=$resource->id();
         my ($mapid,$resid)=split(/\./,$id);
-    if ($mapid eq '0') { next; }
-    $$ids[$#$ids+1]=$id;
-    my $srcf=$resource->src();
-    $srcf=~/\.(\w+)$/;
-    $$typep{$id}=$1;
-    $$keyp{$id}='';
+        if ($mapid eq '0') { next; }
+        $$ids[$#$ids+1]=$id;
+        my $srcf=$resource->src();
+        $srcf=~/\.(\w+)$/;
+        $$typep{$id}=$1;
+        $$keyp{$id}='';
         $$uris{$id}=$srcf;
-    foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
-        next if ($key!~/^parameter_/);
+        foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
+            next if ($key!~/^parameter_/);
 
 # Hidden parameters
-        next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
+            next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');
 #
 # allparms is a hash of parameter names
 #
-        my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
-        if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
-        my ($display,$parmdis);
-        $display = &standard_parameter_names($name);
-        if ($display eq '') {
-            $display= &Apache::lonnet::metadata($srcf,$key.'.display');
-            $parmdis = $display;
-            $parmdis =~ s/\s*\[Part.*$//g;
-        } else {
-            $parmdis = &mt($display);
-        }
-        $$allparms{$name}=$parmdis;
-        if (ref($defkeytype)) {
-            $$defkeytype{$name}=
-            &Apache::lonnet::metadata($srcf,$key.'.type');
-        }
-        }
+            my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
+            if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
+                my ($display,$parmdis);
+                $display = &standard_parameter_names($name);
+                if ($display eq '') {
+                    $display= &Apache::lonnet::metadata($srcf,$key.'.display');
+                    $parmdis = $display;
+                    $parmdis =~ s/\s*\[Part.*$//g;
+                } else {
+                    $parmdis = &mt($display);
+                }
+                $$allparms{$name}=$parmdis;
+                if (ref($defkeytype)) {
+                    $$defkeytype{$name}=
+                    &Apache::lonnet::metadata($srcf,$key.'.type');
+                }
+            }
 
 #
 # allparts is a hash of all parts
 #
-        my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
-        $$allparts{$part} = &mt('Part: [_1]',$part);
+            my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
+            $$allparts{$part} = &mt('Part: [_1]',$part);
 #
 # Remember all keys going with this resource
 #
-        if ($$keyp{$id}) {
-        $$keyp{$id}.=','.$key;
-        } else {
-        $$keyp{$id}=$key;
-        }
+            if ($$keyp{$id}) {
+                $$keyp{$id}.=','.$key;
+            } else {
+                $$keyp{$id}=$key;
+            }   
 #
 # Put in order
 #
-        unless ($$keyorder{$key}) {
-        $$keyorder{$key}=$keyordercnt;
-        $keyordercnt++;
+            unless ($$keyorder{$key}) {
+                $$keyorder{$key}=$keyordercnt;
+                $keyordercnt++;
+            }
         }
-    }
 
 
-    if (!exists($$mapp{$mapid})) {
-        $$mapp{$id}=
-        &Apache::lonnet::declutter($resource->enclosing_map_src());
-        $$mapp{$mapid}=$$mapp{$id};
-        $$allmaps{$mapid}=$$mapp{$id};
-        if ($mapid eq '1') {
-        $$maptitles{$mapid}=&mt('Main Course Documents');
+        if (!exists($$mapp{$mapid})) {
+            $$mapp{$id}=
+            &Apache::lonnet::declutter($resource->enclosing_map_src());
+            $$mapp{$mapid}=$$mapp{$id};
+            $$allmaps{$mapid}=$$mapp{$id};
+            if ($mapid eq '1') {
+                $$maptitles{$mapid}=&mt('Main Course Documents');
+            } else {
+                $$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id});
+            }
+            $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
+            $$symbp{$mapid}=$$mapp{$id}.'___(all)';
         } else {
-        $$maptitles{$mapid}=
-            &Apache::lonnet::gettitle($$mapp{$id});
+            $$mapp{$id} = $$mapp{$mapid};
         }
-        $$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
-        $$symbp{$mapid}=$$mapp{$id}.'___(all)';
-    } else {
-        $$mapp{$id} = $$mapp{$mapid};
-    }
-    $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
+        $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf);
     }
 }