Diff for /loncom/interface/lonindexer.pm between versions 1.190 and 1.198

version 1.190, 2009/03/17 20:07:45 version 1.198, 2009/07/03 09:59:06
Line 409  function gothere(val) { Line 409  function gothere(val) {
 ENDHEADER  ENDHEADER
   
         my ($headerdom)=($uri=~m{^/res/($match_domain)/});          my ($headerdom)=($uri=~m{^/res/($match_domain)/});
  $r->print(&Apache::loncommon::start_page('Content Library',$js,  
  {'domain' => $headerdom,}));          if ($env{'form.catalogmode'}) {
               # "Popup mode"
               $r->print(&Apache::loncommon::start_page('Browse published resources',$js,
                                                        {'only_body' => 1,
                                                         'domain' => $headerdom,}));
           } else {
               # Only display page header and breadcrumbs in non-popup mode
               &Apache::lonhtmlcommon::clear_breadcrumbs();
               &Apache::lonhtmlcommon::add_breadcrumb({
                   'text'  => 'Browse published resources',
                   'href'  => '/res/fhwfdev/?launch=1',
               });
               $r->print(&Apache::loncommon::start_page('Browse published resources',$js,
                                                        {'domain' => $headerdom,})
                        .&Apache::lonhtmlcommon::breadcrumbs()
               );
           }
   
 # ---------------------------------- get state of file types to be showing  # ---------------------------------- get state of file types to be showing
  if ($env{'form.only'}) {   if ($env{'form.only'}) {
     $typeselect = $env{'form.only'};      $typeselect = $env{'form.only'};
Line 420  ENDHEADER Line 437  ENDHEADER
   
 # ---------------------------------- 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<=14; $i++) {      for (my $i=0; $i<=16; $i++) {
  delete $hash{'display_attrs_'.$i};   delete $hash{'display_attrs_'.$i};
  if ($env{'form.attr'.$i} == 1) {   if ($env{'form.attr'.$i} == 1) {
     $attrchk[$i] = 'checked';      $attrchk[$i] = 'checked';
Line 428  ENDHEADER Line 445  ENDHEADER
  }   }
     }      }
  } else {   } else {
     for (my $i=0; $i<=14; $i++) {      for (my $i=0; $i<=16; $i++) {
  $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;   $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
     }      }
  }   }
Line 448  ENDHEADER Line 465  ENDHEADER
    'nt' => 'Notes',     'nt' => 'Notes',
    'ab' => 'Abstract',     'ab' => 'Abstract',
    'ln' => 'Language',     'ln' => 'Language',
      'gl' => 'Grade Level',
      'sd' => 'Standards',
    'sa' => 'Source Available',     'sa' => 'Source Available',
    'sr' => 'Show resource',     'sr' => 'Show resource',
    'li' => 'Linked/Related Resources',     'li' => 'Linked/Related Resources',
Line 471  ENDHEADER Line 490  ENDHEADER
 <td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</label></td>  <td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</label></td>
 <td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</label></td>  <td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</label></td>
 <td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onClick="this.form.submit();" /> $lt{'nt'}</label></td>  <td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onClick="this.form.submit();" /> $lt{'nt'}</label></td>
   <td><label><input type="checkbox" name="attr16" value="1" $attrchk[16] onClick="this.form.submit();" /> $lt{'sd'}</label></td>
 </tr>  </tr>
 <tr>  <tr>
 <td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</label></td>  <td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</label></td>
Line 478  ENDHEADER Line 498  ENDHEADER
 <td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</label></td>  <td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</label></td>
 <td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</label></td>  <td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</label></td>
 <td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onClick="this.form.submit();" /> $lt{'ab'}</label></td>  <td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onClick="this.form.submit();" /> $lt{'ab'}</label></td>
   <td>&nbsp;</td>
 </tr>  </tr>
 <tr>  <tr>
 <td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td>  <td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td>
 <td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</label></td>  <td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</label></td>
 <td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</label></td>  <td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</label></td>
 <td><label><input type="checkbox" name="attr12" value="1" $attrchk[12] onClick="this.form.submit();" /> $lt{'sb'}</label></td>  <td><label><input type="checkbox" name="attr12" value="1" $attrchk[12] onClick="this.form.submit();" /> $lt{'sb'}</label></td>
   <td><label><input type="checkbox" name="attr15" value="1" $attrchk[15] onClick="this.form.submit();" /> $lt{'gl'}</label></td>
 <td>&nbsp;</td>  <td>&nbsp;</td>
 </tr>  </tr>
 </table>  </table>
Line 527  END Line 549  END
 # -------------------------------------------------------- Resource Home Button  # -------------------------------------------------------- Resource Home Button
  my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'};   my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'};
  if ($reshome) {   if ($reshome) {
     $r->print("<span class=\"LC_fontsize_small\"><a href='");      $r->print("<span class=\"LC_fontsize_large\"><a href='");
     if ($env{'form.catalogmode'} eq 'import') {      if ($env{'form.catalogmode'} eq 'import') {
  $r->print('javascript:document.forms.fileattr.action="'.&Apache::loncommon::inhibit_menu_check($reshome).'";document.forms.fileattr.submit();');   $r->print('javascript:document.forms.fileattr.action="'.&Apache::loncommon::inhibit_menu_check($reshome).'";document.forms.fileattr.submit();');
     } else {      } else {
Line 549  END Line 571  END
         #$r->print(&writedebug("Omit:@Omit")) if (@Omit);          #$r->print(&writedebug("Omit:@Omit")) if (@Omit);
         #$r->print(&writedebug("Only:@Only")) if (@Only);          #$r->print(&writedebug("Only:@Only")) if (@Only);
         $r->print('<br /><br />');          $r->print('<br /><br />');
         $r->print(&Apache::loncommon::start_data_table("LC_tableOfContent")          $r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes")
                  .&Apache::loncommon::start_data_table_header_row());                   .&Apache::loncommon::start_data_table_header_row());
  $r->print("<th $colspan>".&mt('Name')."</th>\n");   $r->print("<th $colspan>".&mt('Name')."</th>\n");
  $r->print("<th>".&mt('Title')."</th>\n")    $r->print("<th>".&mt('Title')."</th>\n") 
Line 581  END Line 603  END
     if ($hash{'display_attrs_13'} == 1);      if ($hash{'display_attrs_13'} == 1);
  $r->print("<th>".&mt("Abstract")."</th>\n")   $r->print("<th>".&mt("Abstract")."</th>\n")
     if ($hash{'display_attrs_14'} == 1);      if ($hash{'display_attrs_14'} == 1);
    $r->print("<th>".&mt("Grade Level")."</th>\n")
       if ($hash{'display_attrs_15'} == 1);
    $r->print("<th>".&mt("Standards")."</th>\n")
       if ($hash{'display_attrs_16'} == 1);
           
     $r->print(&Apache::loncommon::end_data_table_header_row());      $r->print(&Apache::loncommon::end_data_table_header_row());
           
Line 850  sub display_line { Line 876  sub display_line {
   
     my $tabtag='</td>';      my $tabtag='</td>';
     my $i=0;      my $i=0;
     while ($i<=14) {      while ($i<=16) {
  $tabtag=join('',$tabtag,"<td>&nbsp;</td>")   $tabtag=join('',$tabtag,"<td>&nbsp;</td>")
     if ($i != 9 &&      if ($i != 9 &&
  $hash{'display_attrs_'.$i} == 1);   $hash{'display_attrs_'.$i} == 1);
Line 876  sub display_line { Line 902  sub display_line {
    'enctype="application/x-www-form-urlencoded"'.     'enctype="application/x-www-form-urlencoded"'.
                    '>'."\n");                     '>'."\n");
  $r->print(&Apache::loncommon::inhibit_menu_check('input'));   $r->print(&Apache::loncommon::inhibit_menu_check('input'));
  $r->print ('<input type=hidden name=openuri value="'.   $r->print ('<input type="hidden" name="openuri" value="'.
    $startdir.'" />'."\n");     $startdir.'" />'."\n");
         $r->print ('<input type="hidden" name="acts" value="" />'."\n");          $r->print ('<input type="hidden" name="acts" value="" />'."\n");
  $r->print ('<a href="#" onClick="document.dirpathUP.submit()"><img src="'.$iconpath.'arrow.up.gif"');   $r->print ('<a href="#" onClick="document.dirpathUP.submit()"><img src="'.$iconpath.'arrow.up.gif"');
  $r->print (' name="'.$msg.'" type="image" class="LC_icon" />'.   $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" />'.
    "\n");     "\n");
  $r->print(&mt("Up")."</a></form>$tabtag");   $r->print(&mt("Up")."</a></form>$tabtag");
         $r->print(&Apache::loncommon::end_data_table_row());          $r->print(&Apache::loncommon::end_data_table_row());
Line 907  sub display_line { Line 933  sub display_line {
  $r->print ('<a name="'.$anchor.'"></a>');   $r->print ('<a name="'.$anchor.'"></a>');
 $r->print ('<input type="hidden" name="acts" value="" />');  $r->print ('<input type="hidden" name="acts" value="" />');
  $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');    $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"'); 
  $r->print (' name="'.$msg.'" type="image" class="LC_icon" /></a>'.   $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" /></a>'.
    "\n");     "\n");
  my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);   my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
  $r->print ('<a href="javascript:gothere(\''.$quotable_filecom.   $r->print ('<a href="javascript:gothere(\''.$quotable_filecom.
    '\')"><img alt="" src="'.$iconpath.'server.gif"');     '\')"><img alt="" src="'.$iconpath.'server.gif"');
  $r->print (' class="LC_icon" />'."\n");   $r->print (' class="LC_fileicon" />'."\n");
  $r->print (&mt("Domain")." - $listname </a>");   $r->print (&mt("Domain")." - $listname </a>");
  if (&Apache::lonnet::domain($listname,'description')) {   if (&Apache::lonnet::domain($listname,'description')) {
     $r->print("(".&Apache::lonnet::domain($listname,'description').      $r->print("<br />(".&Apache::lonnet::domain($listname,'description').
       ")");        ")");
  }   }
  $r->print("</form>$tabtag");   $r->print("</form>$tabtag");
Line 938  $r->print ('<input type="hidden" name="a Line 964  $r->print ('<input type="hidden" name="a
  $r->print ('<input type="hidden" name="acts" value="" />');   $r->print ('<input type="hidden" name="acts" value="" />');
  $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()">');   $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()">');
         $r->print ('<img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).          $r->print ('<img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).
    '.gif" class="LC_icon"');      '.gif" class="LC_fileicon"'); 
  $r->print (' name="'.$msg.'" type="image" class="LC_indexer_icon" /></a>'.   $r->print (' name="'.$msg.'"/></a>'.
    "\n");     "\n");
  my $quotable_curdir = &Apache::loncommon::escape_single($curdir);   my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
  $r->print ('<a href="javascript:gothere(\''.$quotable_curdir   $r->print ('<a href="javascript:gothere(\''.$quotable_curdir
    .'\')"><img alt="'.$msg.'" src="'.     .'\')"><img alt="'.$msg.'" src="'.
    $iconpath.'quill.gif" class="LC_indexer_icon" />');     $iconpath.'quill.gif" class="LC_fileicon" />');
  my $domain=(split(m|/|,$startdir))[2];   my $domain=(split(m|/|,$startdir))[2];
  my $plainname=&Apache::loncommon::plainname($listname,$domain);   my $plainname=&Apache::loncommon::plainname($listname,$domain);
         $r->print ($listname.'</a>');          $r->print ($listname.'</a>');
Line 1021  $r->print ('<input type="hidden" name="a Line 1047  $r->print ('<input type="hidden" name="a
     my $anchor = $curdir;      my $anchor = $curdir;
     $anchor =~ s/\W//g;      $anchor =~ s/\W//g;
     $r->print ('<input type="hidden" name="acts" value="" />');      $r->print ('<input type="hidden" name="acts" value="" />');
     $r->print ('<a name="'.$anchor.'"></a><input src="'.$iconpath.      $r->print ('<a name="'.$anchor.'"></a>');
        'arrow'.($nowOpen ? "open" : "closed" ).'.gif"');              $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()">');
     $r->print (' name="'.$msg.'" type="image" class="LC_icon" />'.              $r->print ('<img src="'.$iconpath.'arrow.'.($nowOpen ? "open" : "closed" ).
                          '.gif" class="LC_fileicon"');
       $r->print (' name="'.$msg.'" type="image" class="LC_fileicon" /></a>'.
        "\n");         "\n");
  }   }
 # Filetype icons  # Filetype icons
  $r->print("<img alt=\"\" src='$iconname' class='LC_icon' />\n");   $r->print("<img alt=\"\" src='$iconname' class='LC_fileicon' />\n");
  my $quotable_filelink = &Apache::loncommon::escape_single($filelink);   my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
   
  $r->print (" <a href=\"javascript:openWindow('".$quotable_filelink.   $r->print (" <a href=\"javascript:openWindow('".$quotable_filelink.
Line 1059  $r->print ('<input type="hidden" name="a Line 1087  $r->print ('<input type="hidden" name="a
   
  if ($hash{'display_attrs_4'} == 1) {   if ($hash{'display_attrs_4'} == 1) {
     my $author = &Apache::lonnet::metadata($filelink,'author');      my $author = &Apache::lonnet::metadata($filelink,'author');
     $r->print('<td> '.($author eq '' ? '&nbsp;' : $author).      $r->print('<td class="LC_nobreak"> '.($author eq '' ? '&nbsp;' : $author).
       " </td>\n");        " </td>\n");
  }   }
  if ($hash{'display_attrs_5'} == 1) {   if ($hash{'display_attrs_5'} == 1) {
Line 1079  $r->print ('<input type="hidden" name="a Line 1107  $r->print ('<input type="hidden" name="a
 # statistics  # statistics
     &dynmetaread($filelink);      &dynmetaread($filelink);
     $r->print("<td>");      $r->print("<td>");
     &dynmetaprint($r,$filelink,'count');  
     &dynmetaprint($r,$filelink,'course');          for (qw(count course stdno avetries difficulty disc clear technical
     &dynmetaprint($r,$filelink,'stdno');              correct helpful depth)) {
     &dynmetaprint($r,$filelink,'avetries');  
     &dynmetaprint($r,$filelink,'difficulty');              dynmetaprint($r,$filelink,$_);
     &dynmetaprint($r,$filelink,'disc');          }
     &dynmetaprint($r,$filelink,'clear');  
     &dynmetaprint($r,$filelink,'technical');  
     &dynmetaprint($r,$filelink,'correct');  
     &dynmetaprint($r,$filelink,'helpful');  
     &dynmetaprint($r,$filelink,'depth');  
     $r->print("&nbsp;</td>\n");      $r->print("&nbsp;</td>\n");
   
  }   }
Line 1112  $r->print ('<input type="hidden" name="a Line 1136  $r->print ('<input type="hidden" name="a
    &dynmetaread($filelink);     &dynmetaread($filelink);
    $r->print('<td>');     $r->print('<td>');
    &coursecontext($r,$filelink);     &coursecontext($r,$filelink);
    &dynmetaprint($r,$filelink,'goto_list');         for (qw(goto_list comefrom_list sequsage_list dependencies course_list)) {
    &dynmetaprint($r,$filelink,'comefrom_list');               dynmetaprint($r,$filelink,$_);
    &dynmetaprint($r,$filelink,'sequsage_list');         }
    &dynmetaprint($r,$filelink,'dependencies');  
            &dynmetaprint($r,$filelink,'course_list');  
    $r->print('</td>');     $r->print('</td>');
         }          }
                   
Line 1147  $r->print ('<input type="hidden" name="a Line 1169  $r->print ('<input type="hidden" name="a
       " </td>\n");        " </td>\n");
  }   }
   
    if ($hash{'display_attrs_15'} == 1) {
       my $gradelevel = &Apache::lonnet::metadata($filelink,'gradelevel');
       $r->print('<td> '.($gradelevel eq '' ? '&nbsp;' : $gradelevel).
         " </td>\n");
    }
   
    if ($hash{'display_attrs_16'} == 1) {
       my $standards = &Apache::lonnet::metadata($filelink,'standards');
       $r->print('<td> '.($standards eq '' ? '&nbsp;' : $standards).
         " </td>\n");
    }
   
  $r->print(&Apache::loncommon::end_data_table_row());   $r->print(&Apache::loncommon::end_data_table_row());
 }  }
           
Line 1173  $r->print ('<input type="hidden" name="a Line 1207  $r->print ('<input type="hidden" name="a
  $r->print ('<a name="'.$anchor.'"></a>');   $r->print ('<a name="'.$anchor.'"></a>');
         $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.          $r->print ('<a href="#" onClick="document.dirpath'.($dnum-1).'.submit()"><img src="'.$iconpath.
    'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');     'arrow.'.($nowOpen ? "open" : "closed" ).'.gif"');
  $r->print (' name="'.$msg.'" class="LC_icon" /></a>'.   $r->print (' name="'.$msg.'" class="LC_fileicon" /></a>'.
    "\n");     "\n");
  my $quotable_curdir = &Apache::loncommon::escape_single($curdir);   my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
                   
Line 1181  $r->print ('<input type="hidden" name="a Line 1215  $r->print ('<input type="hidden" name="a
  my $icon = "navmap.folder.".($nowOpen ? "open":"closed").'.gif';   my $icon = "navmap.folder.".($nowOpen ? "open":"closed").'.gif';
         $r->print ('<a href="javascript:gothere(\''          $r->print ('<a href="javascript:gothere(\''
    .$quotable_curdir.'\')"">'     .$quotable_curdir.'\')"">'
    .'<img alt="'.&mt('Open Folder').'" src="'.     .'<img class="LC_fileicon" alt="'.&mt('Open Folder').'" src="'.
                    $location."/".$icon.'" />'.                     $location."/".$icon.'" />'.
                    "\n");                     "\n");
  $r->print ("$listname</a></form></td>\n");   $r->print ("$listname</a></form></td>\n");
Line 1250  $r->print ('<input type="hidden" name="a Line 1284  $r->print ('<input type="hidden" name="a
       " </td>\n");        " </td>\n");
  }   }
   
    if ($hash{'display_attrs_15'} == 1) {
       my $gradelevel = &Apache::lonnet::metadata($filelink,'gradelevel');
       $r->print('<td> '.($gradelevel eq '' ? '&nbsp;' : $gradelevel).
         " </td>\n");
    }
   
    if ($hash{'display_attrs_16'} == 1) {
       my $standards = &Apache::lonnet::metadata($filelink,'standards');
       $r->print('<td> '.($standards eq '' ? '&nbsp;' : $standards).
         " </td>\n");
    }
   
   
  $r->print(&Apache::loncommon::end_data_table_row());   $r->print(&Apache::loncommon::end_data_table_row());
     }      }
   

Removed from v.1.190  
changed lines
  Added in v.1.198


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