Diff for /loncom/interface/lonsearchcat.pm between versions 1.231 and 1.232

version 1.231, 2004/07/19 16:38:07 version 1.232, 2004/08/20 15:45:51
Line 2633  sub display_results { Line 2633  sub display_results {
               &hidden_field('persistent_db_id').                &hidden_field('persistent_db_id').
               &hidden_field('start')                &hidden_field('start')
               );                );
       #
       # Build sorting selector
       my @field_order =  ('default',
                           'title',
                           'author',
                           'subject',
                           'url',
                           'keywords',
                           'version',
                           'language',
                           'creationdate'=>,
                           'lastrevisiondate',
                           'owner',
                           'copyright',
                           'authorspace',
                           'lowestgradeleve',
                           'highestgradelevel',
                           'standards',
                           'count',
                           'stdno',
                           'avetries',
                           'difficulty',
                           'disc',
                           'clear',
                           'technical',
                           'correct',
                           'helpful',
                           'depth',
                           );                                              
       my %sort_fields = ('default'     => 'Default',
                          'title'       => 'Title',
                          'author'      => 'Author',
                          'subject'     => 'Subject',
                          'url'         => 'URL',
                          'keywords'    => 'Keywords',
                          'version'     => 'Version',
                          'language'    => 'Language',
                          'creationdate'=> 'Creation Date',
                          'lastrevisiondate' => 'Last Revision Date',
                          'owner'       => 'Owner',
                          'copyright'   => 'Copyright',
                          'authorspace' => 'Authorspace',
                          'lowestgradeleve' => 'Lowest Grade Level',
                          'highestgradelevel' => 'Highest Grade Level',
                          'standards'   => 'Standards',
                          'count'       => 'Number of Accesses',
                          'stdno'       => 'Students Attempting',
                          'avetries'    => 'Average Number of Tries',
                          'difficulty'  => 'Mean Degree of Difficulty',
                          'disc'        => 'Mean Degree of Discrimination',
                          'clear'       => 'Evaluation: Clear',
                          'technical'   => 'Evaluation: Technically Correct',
                          'correct'     => 'Evaluation: Material is Correct',
                          'helpful'     => 'Evaluation: Material is Helpful',
                          'depth'       => 'Evaluation: Material has Depth',
                          'select_form_order' => \@field_order,
                          );
   
       my $sortform = &mt('Sort by [_1]',
                          &Apache::loncommon::select_form($ENV{'form.sortfield'},
                                                         'sortfield',
                                                         %sort_fields));
     ##      ##
     ## Output links (if necessary) for 'prev' and 'next' pages.      ## Output links (if necessary) for 'prev' and 'next' pages.
     $r->print      $r->print
         ('<table width="100%"><tr><td width="50%" align="right">'.          ('<table width="100%"><tr><td width="25%" align="right">'.
            $sortform.
            '</td><td width="25%" align="right">'.
          &prev_next_buttons($min,$ENV{'form.show'},$total_results).           &prev_next_buttons($min,$ENV{'form.show'},$total_results).
          '</td><td align="right">'.           '</td><td align="right">'.
          &viewoptions().'</td></tr></table>'           &viewoptions().'</td></tr></table>'
Line 2647  sub display_results { Line 2711  sub display_results {
                   "</form></body></html>");                    "</form></body></html>");
         return;          return;
     } else {      } else {
         $r->print          $r->print('<center>'.
             ("<center>Results $min to $max out of $total_results</center>\n");                    mt('Results [_1] to [_2] out of [_3]',
                        $min,$max,$total_results).
                     "</center>\n");
     }      }
     ##      ##
     ## Get results from MySQL table      ## Get results from MySQL table
     my @Results = &Apache::lonmysql::get_rows($table,      my $sort_command  = 'id>='.$min.' AND id<='.$max;
                                               'id>='.$min.' AND id<='.$max);      if ($ENV{'form.sortfield'} ne 'default' && 
           exists($sort_fields{$ENV{'form.sortfield'}})) {
           $sort_command = $ENV{'form.sortfield'}.' IS NOT NULL '.
               'ORDER BY '.$ENV{'form.sortfield'}.
               '  LIMIT '.($min-1).','.($max-$min);
       }
       my @Results = &Apache::lonmysql::get_rows($table,$sort_command);
     ##      ##
     ## Loop through the results and output them.      ## Loop through the results and output them.
     foreach my $row (@Results) {      foreach my $row (@Results) {

Removed from v.1.231  
changed lines
  Added in v.1.232


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