version 1.231, 2004/07/19 16:38:07
|
version 1.233, 2004/09/23 21:16:45
|
Line 659 sub print_basic_search_form {
|
Line 659 sub print_basic_search_form {
|
my $scrout = &search_html_header().$bodytag; |
my $scrout = &search_html_header().$bodytag; |
if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { |
# Define interface components |
# Define interface components |
my $userelatedwords= |
my $userelatedwords= '<label>'. |
&mt('[_1] use related words', |
&mt('[_1] use related words', |
&Apache::lonhtmlcommon::checkbox |
&Apache::lonhtmlcommon::checkbox |
('related',$ENV{'form.related'},'related')); |
('related',$ENV{'form.related'},'related')).'</label>'; |
my $onlysearchdomain= |
my $onlysearchdomain='<label>'. |
&mt('[_1] only search domain [_2]', |
&mt('[_1] only search domain [_2]', |
&Apache::lonhtmlcommon::checkbox('domains', |
&Apache::lonhtmlcommon::checkbox('domains', |
$ENV{'form.domains'}, |
$ENV{'form.domains'}, |
$r->dir_config('lonDefDomain') |
$r->dir_config('lonDefDomain') |
), |
), |
$r->dir_config('lonDefDomain') |
$r->dir_config('lonDefDomain') |
); |
).'</label>'; |
my $adv_search_link = |
my $adv_search_link = |
'<a href="/adm/searchcat?'. |
'<a href="/adm/searchcat?'. |
'phase=disp_adv&'. |
'phase=disp_adv&'. |
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) { |