Diff for /loncom/interface/lonindexer.pm between versions 1.174 and 1.179

version 1.174, 2007/08/01 21:12:12 version 1.179, 2007/08/17 22:54:36
Line 106  sub handler { Line 106  sub handler {
   
     my $fileclr='#ffffe6';      my $fileclr='#ffffe6';
     my $line;      my $line;
     my (@attrchk,@openpath);      my (@attrchk,@openpath,$typeselect);
     my $uri=$r->uri;      my $uri=$r->uri;
   
 # -------------------------------------- see if called from an interactive mode  # -------------------------------------- see if called from an interactive mode
Line 359  END Line 359  END
                   
  my $js = <<"ENDHEADER";   my $js = <<"ENDHEADER";
 <script type="text/javascript">  <script type="text/javascript">
 $catalogmodefunctions  $catalogmodefunctions;
   function update_only(field) {
       alert(field.name);
   }
 function checkAll() {  function checkAll() {
     var numForms = document.forms.length;      var numForms = document.forms.length;
     for (i=0;i<numForms;i++) {      for (i=0;i<numForms;i++) {
Line 406  ENDHEADER Line 409  ENDHEADER
         my ($headerdom)=($uri=~m{^/res/($match_domain)/});          my ($headerdom)=($uri=~m{^/res/($match_domain)/});
  $r->print(&Apache::loncommon::start_page('Browse Resources',$js,   $r->print(&Apache::loncommon::start_page('Browse Resources',$js,
  {'domain' => $headerdom,}));   {'domain' => $headerdom,}));
   # ---------------------------------- get state of file types to be showing
    if ($env{'form.only'}) {
       $typeselect = $env{'form.only'};
    } else {
       $typeselect = '';
    }
   
 # ---------------------------------- get state of file attributes to be showing  # ---------------------------------- get state of file attributes to be showing
  if ($env{'form.attrs'}) {   if ($env{'form.attrs'}) {
     for (my $i=0; $i<=11; $i++) {      for (my $i=0; $i<=11; $i++) {
Line 467  ENDHEADER Line 477  ENDHEADER
 </tr>  </tr>
 </table>  </table>
 <input type="hidden" name="attrs" value="1" />  <input type="hidden" name="attrs" value="1" />
 <input type="hidden" name="only" value="" />  END
 <label><input type="checkbox" name="problem" value="problem" onClick="this.form.only.value += 'problem';this.form.submit();" />$lt{'pr'}</label>          my @file_categories = &Apache::loncommon::filecategories();
 <label><input type="checkbox" name="graphic" value="gif,jpg,jpeg" onClick="this.form.only.value += ',gif,jpg,jpg';this.form.submit();" />$lt{'gr'}</label>          my %select_file_categories;
 <label><input type="checkbox" name="all" value="" onClick="this.form.only.value = '';this.form.submit();" />$lt{'at'}</label>          my @select_form_order = ('');
           $select_file_categories{''} = &mt('All file types');
           foreach my $cat (@file_categories) {
       my $types = join(",",&Apache::loncommon::filecategorytypes($cat));
       $select_file_categories{$types} = $cat;
       push(@select_form_order,$types);
    }
           $select_file_categories{'select_form_order'} = \@select_form_order;
           my $type_element=
       &Apache::loncommon::select_form($typeselect,'only',
       %select_file_categories);
           $type_element = '<label>'.&mt('File Type Displayed: [_1]',
         $type_element).'</label>';
           $r->print(<<END);
   $type_element
 <br />  <br />
 <input type="submit" name="updatedisplay" value="$lt{'ud'}" />  <input type="submit" name="updatedisplay" value="$lt{'ud'}" />
 <input type="hidden" name="acts" value="" />  <input type="hidden" name="acts" value="" />
 $closebutton $groupimportbutton  $closebutton $groupimportbutton
 END  END
         $r->print(&Apache::loncommon::inhibit_menu_check('input'));          $r->print(&Apache::loncommon::inhibit_menu_check('input'));
      
 # -------------- Filter out sequence containment in crumbs and "recent folders"  # -------------- Filter out sequence containment in crumbs and "recent folders"
  my $storeuri=$uri;   my $storeuri=$uri;
  $storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1];   $storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1];
Line 911  sub display_line { Line 935  sub display_line {
  my @file_ext = split (/\./,$listname);   my @file_ext = split (/\./,$listname);
  my $curfext = $file_ext[-1];   my $curfext = $file_ext[-1];
         if (@Omit) {          if (@Omit) {
             foreach (@Omit) { return OK if ($curfext eq $_); }              foreach (@Omit) { return OK if (lc($curfext) eq $_); }
         }          }
         if (@Only) {          if (@Only) {
             my $skip = 1;              my $skip = 1;
             foreach (@Only) { $skip = 0 if ($curfext eq $_); }              foreach (@Only) { $skip = 0 if (lc($curfext) eq $_); }
             return OK if ($skip > 0);              return OK if ($skip > 0);
         }          }
  # Set the icon for the file   # Set the icon for the file

Removed from v.1.174  
changed lines
  Added in v.1.179


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>