'.&mt('An error occurred retrieving information about resources in the course.').' '.&mt('It is recommended that you [_1]re-initialize the course[_2] and then try your search again.','','').'
');
@@ -690,7 +703,7 @@ sub print_basic_search_form {
my $bread_crumb =
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic',
$env{'form.catalogmode'} ne 'import');
- my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb;
+ my $scrout = &Apache::loncommon::start_page('Content Library').$bread_crumb;
# Search form for resource space
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {
$scrout .= &setup_basic_search($r,'res',$hidden_fields,$closebutton);
@@ -716,7 +729,6 @@ $hidden_fields
'.'';
return $scrout;
}
@@ -839,15 +856,18 @@ sub print_advanced_search_form{
'reset' => 'Reset',
'help' => 'Help');
my $advanced_buttons=<<"END";
+
$closebutton
+
END
my $srchtype = 'Catalog';
my $jscript;
if ($env{'form.area'} eq 'portfolio') {
$srchtype = 'Portfolio';
$jscript = '';
}
my $scrout= &Apache::loncommon::start_page("Advanced $srchtype Search",
$jscript);
- $scrout .= <<"ENDHEADER";
-$bread_crumb
-';
+
$scrout .= &Apache::loncommon::end_page();
$r->print($scrout);
return;
@@ -1159,21 +1198,23 @@ Outputs: text for box with view options
######################################################################
######################################################################
sub viewoptions {
- my $scrout = '';
+ my $scrout;
if (! defined($env{'form.viewselect'})) {
$env{'form.viewselect'}='detailed';
}
- $scrout.=&Apache::lonmeta::selectbox('viewselect',
- $env{'form.viewselect'},
- \&viewoptiontext,
- sort(keys(%Views)));
- $scrout.= ' ';
+ $scrout .= ''
+ .&mt('Type:').' '
+ .&Apache::lonmeta::selectbox('viewselect',
+ $env{'form.viewselect'},
+ \&viewoptiontext,
+ sort(keys(%Views)))
+ .'';
my $countselect = &Apache::lonmeta::selectbox('show',
$env{'form.show'},
undef,
(10,20,50,100,1000,10000));
- $scrout .= (' 'x2)
- .&mt('[_1] Records per Page',$countselect)
+ $scrout .= ' '
+ .&mt('Records per Page:').' '.$countselect
.''.$/;
return $scrout;
}
@@ -2154,9 +2195,13 @@ sub ensure_db_and_table {
## Sanity check the table id.
##
if (! defined($table) || $table eq '' || $table =~ /\D/ ) {
- $r->print("Unable to retrieve search results. ".
- "Unable to determine the table results were saved in. ".
- &Apache::loncommon::end_page());
+ $r->print(&Apache::loncommon::start_page(&mt('Error'))
+. '
table: |'.$table.'|
' # SB
+ .'
'
+ .&mt('Unable to retrieve search results. '
+ .'Unable to determine the table results were saved in.')
+ .&Apache::loncommon::end_page()
+ );
return undef;
}
##
@@ -2238,18 +2283,19 @@ sub print_sort_form {
}
my $js =<
+//
END
- my $start_page = &Apache::loncommon::start_page('Results',$js,
- {'no_title' => 1});
+ my $start_page = &Apache::loncommon::start_page('Results',$js);
my $breadcrumbs=
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
$env{'form.catalogmode'} ne 'import');
@@ -2388,16 +2434,28 @@ Returns: Nothing.
sub update_count_status {
my ($r,$text) = @_;
$text =~ s/\'/\\\'/g;
- $r->print
- ("\n");
+ $r->print(<
+SCRIPT
+
$r->rflush();
}
sub update_status {
my ($r,$text) = @_;
$text =~ s/\'/\\\'/g;
- $r->print
- ("\n");
+ $r->print(<
+SCRIPT
+
$r->rflush();
}
@@ -2424,9 +2482,14 @@ sub update_seconds {
my ($r) = @_;
my $time = &time_left();
if (($last_time-$time) > 0) {
- $r->print("\n");
+ $r->print(<
+SCRIPT
+
$r->rflush();
}
$last_time = $time;
@@ -2455,10 +2518,10 @@ sub revise_button {
$revise_phase = 'disp_adv' if ($env{'form.searchmode'} eq 'advanced');
my $newloc = '/adm/searchcat'.
'?persistent_db_id='.$env{'form.persistent_db_id'}.
- '&cleargroupsort=1'.
- '&phase='.$revise_phase;
+ '&cleargroupsort=1'.
+ '&phase='.$revise_phase;
my $result = qq{ };
+ qq{ onclick="parent.location='$newloc';" /> };
return $result;
}
@@ -2487,8 +2550,7 @@ sub run_search {
#
# Print run_search header
#
- my $start_page = &Apache::loncommon::start_page('Search Status',undef,
- {'no_title' => 1});
+ my $start_page = &Apache::loncommon::start_page('Search Status',undef);
my $breadcrumbs =
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
$env{'form.catalogmode'} ne 'import');
@@ -2680,7 +2742,7 @@ END
last if ($connection->aborted());
&update_seconds($r);
}
- &update_status($r,&mt('Search Complete [_1]',$server));
+ &update_status($r,&mt('Search Complete on Server [_1]',$server));
&update_seconds($r);
#
&Apache::lonmysql::disconnect_from_db(); # This is unneccessary
@@ -2690,11 +2752,11 @@ END
# loaded from /adm/searchcat
$r->print(&Apache::loncommon::end_page());
# if ($env{'form.catalogmode'} ne 'import') {
- $r->print("");
+ $r->print(<
+SCRIPT
# }
return;
}
@@ -2717,15 +2779,15 @@ sub prev_next_buttons {
return '' if ($show eq 'all'); # No links if you get them all at once.
#
# Create buttons
- my $buttons = '';
- $buttons .= ' 'x3;
- $buttons .= ''
+ .''
+ .' '
+ .''
+ .' '
+ .''
+ .'
';
}
######################################################################
@@ -2750,7 +2812,9 @@ sub display_results {
##
my $viewfunction = $Views{$env{'form.viewselect'}};
if (!defined($viewfunction)) {
- $r->print("Internal Error - Bad view selected.\n");
+ $r->print('
'
+ .&mt('Internal Error - Bad view selected.')
+ .'
'."\n");
$r->rflush();
return;
}
@@ -2767,7 +2831,10 @@ sub display_results {
if ($env{'form.catalogmode'} eq 'import') {
if (! tie(%groupsearch_db,'GDBM_File',$diropendb,
&GDBM_WRCREAT(),0640)) {
- $r->print('Unable to save import results.'.
+ $r->print('
'.
+ &mt('Unable to save import results.').
+ '
'.
+ ''.
&Apache::loncommon::end_page());
$r->rflush();
return;
@@ -2781,7 +2848,10 @@ sub display_results {
## Get the number of results
my $total_results = &Apache::lonmysql::number_of_rows($table);
if (! defined($total_results)) {
- $r->print("A MySQL error has occurred.".
+ $r->print('
'.
+ &mt('A MySQL error has occurred.').
+ '
'.
+ ''.
&Apache::loncommon::end_page());
&Apache::lonnet::logthis("lonmysql was unable to determine the number".
" of rows in table ".$table);
@@ -2886,37 +2956,40 @@ sub display_results {
$env{'form.sortorder'}='asc';
}
}
- my $sortform = &mt('Sort by [_1] [_2]',
- &Apache::loncommon::select_form($env{'form.sortfield'},
+ my $sortform = ''
+ .&mt('Sort by:').' '
+ .&Apache::loncommon::select_form($env{'form.sortfield'},
'sortfield',
- %sort_fields),
- &Apache::loncommon::select_form($env{'form.sortorder'},
+ %sort_fields)
+ .' '
+ .&Apache::loncommon::select_form($env{'form.sortorder'},
'sortorder',
(asc =>&mt('Ascending'),
desc=>&mt('Descending')
))
- );
+ .'';
##
- ## Output links (if necessary) for 'prev' and 'next' pages.
- $r->print
- ('
'.
mt('Results [_1] to [_2] out of [_3]',
$min,$max,$total_results).
- "\n");
+ "
\n");
}
##
## Get results from MySQL table
@@ -2946,13 +3019,14 @@ sub display_results {
if ($area eq 'portfolio') {
$tabletype = 'portfolio_search';
}
+ $r->print(&Apache::loncommon::start_data_table());
foreach my $row (@Results) {
if ($connection->aborted()) {
&cleanup();
return;
}
my %Fields = %{&parse_row($tabletype,@$row)};
- my $output="
\n";
+ my $output;
if (! defined($Fields{'title'}) || $Fields{'title'} eq '') {
$Fields{'title'} = 'Untitled';
}
@@ -2961,21 +3035,27 @@ sub display_results {
# Render the result into html
$output.= &$viewfunction($prefix,%Fields);
# Print them out as they come in.
- $r->print($output);
+ $r->print(&Apache::loncommon::start_data_table_row()
+ .'
'
+ .$output
+ .'
'
+ .&Apache::loncommon::end_data_table_row()
+ );
$r->rflush();
}
+ $r->print(&Apache::loncommon::end_data_table());
if (@Results < 1) {
- $r->print(&mt("There were no results matching your query"));
+ $r->print('
'
+ .&mt('There were no results matching your query.')
+ .'
$end_page
ENDPAGE
@@ -3800,23 +3882,32 @@ $parms is extra information to include i
######################################################################
sub output_blank_field_error {
my ($r,$closebutton,$parms,$hidden_fields)=@_;
- my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.');
+ my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.');
my $revise = &mt('Revise Search Request');
- my $heading = &mt('Unactionable Search Queary');
+ my $heading = &mt('Unactionable Search Query');
my $start_page = &Apache::loncommon::start_page('Search');
my $end_page = &Apache::loncommon::end_page();
+ if ($closebutton) {
+ $closebutton = '
$end_page
ENDPAGE
@@ -3847,16 +3938,18 @@ sub output_date_error {
# make query information persistent to allow for subsequent revision
my $start_page = &Apache::loncommon::start_page('Search');
my $end_page = &Apache::loncommon::end_page();
+ my $heading = &mt('Error');
$r->print(<
$hidden_fields
+onclick='this.form.submit();' />
$closebutton
+
-