[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm /localize/localize de.pm zh.pm

bisitz bisitz@source.lon-capa.org
Fri, 31 Jul 2009 10:59:04 -0000


This is a MIME encoded message

--bisitz1249037944
Content-Type: text/plain

bisitz		Fri Jul 31 10:59:04 2009 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
    /loncom/localize/localize	de.pm zh.pm 
  Log:
  - Display search results in data_table
  - Corrected unbalanced tags:
      - <p>: Course Search
      - <form>: &output_date_error
  - Added info, warning, error style to messages
  - Wording and &mt() usage optimizations, updated translations files de.pm, zh.pm
  - Added missing translations entries (de.pm, zh.pm)
  - Added alt attribute to images (currently empty)
  
  
--bisitz1249037944
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20090731105904.txt"

Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.311 loncom/interface/lonsearchcat.pm:1.312
--- loncom/interface/lonsearchcat.pm:1.311	Fri Jul  3 08:18:48 2009
+++ loncom/interface/lonsearchcat.pm	Fri Jul 31 10:58:57 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.311 2009/07/03 08:18:48 bisitz Exp $
+# $Id: lonsearchcat.pm,v 1.312 2009/07/31 10:58:57 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -524,7 +524,7 @@
         untie(%hash);
     }
     unless ($totalfound) {
-	$r->print('<p>'.&mt('No matches found in resources').'.</p>');
+	$r->print('<p class="LC_info">'.&mt('No matches found in resources.').'</p>');
     }
 
 # Check discussions if requested
@@ -599,7 +599,7 @@
                 }
             }
             unless ($totaldiscussions) {
-                $r->print('<p>'.&mt('No matches found in postings').'.</p>');
+                $r->print('<p class="LC_info">'.&mt('No matches found in postings.').'</p>');
             }
         } else {
             $r->print('<div class="LC_error">'.&mt('An error occurred retrieving information about resources in the course.').'<br />'.&mt('It is recommended that you [_1]re-initialize the course[_2] and then try your search again.','<a href="/adm/roles">','</a>').'</div>');
@@ -729,7 +729,6 @@
 <p>
 $lt{'note'}.
 </p>
-<p>
 <table>
 <tr><td>
 ENDCOURSESEARCH
@@ -750,8 +749,9 @@
 <tr><td><label>$relcheckbox $lt{'use'}</label></td><td></td></tr>
 <tr><td><label>$crscheckbox $lt{'full'}</label></td><td></td></tr>
 <tr><td><label>$discheckbox $lt{'disc'}</label></td><td></td></tr>
-</table><p>
-&nbsp;<input type="submit" name="coursesubmit" value='$lt{'srch'}' />
+</table>
+<p>
+<input type="submit" name="coursesubmit" value='$lt{'srch'}' />
 </p>
 </center>
 </form>
@@ -2761,7 +2761,9 @@
     ##
     my $viewfunction = $Views{$env{'form.viewselect'}};
     if (!defined($viewfunction)) {
-        $r->print("Internal Error - Bad view selected.\n");
+        $r->print('<p class="LC_error">'
+                 .&mt('Internal Error - Bad view selected.')
+                 .'</p>'."\n");
         $r->rflush();
         return;
     }
@@ -2778,7 +2780,10 @@
     if ($env{'form.catalogmode'} eq 'import') {
         if (! tie(%groupsearch_db,'GDBM_File',$diropendb,
                   &GDBM_WRCREAT(),0640)) {
-            $r->print('Unable to save import results.</form>'.
+            $r->print('<p class="LC_error">'.
+              &mt('Unable to save import results.').
+              '</p>'.
+              '</form>'.
 		      &Apache::loncommon::end_page());
             $r->rflush();
             return;
@@ -2792,7 +2797,10 @@
     ## 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.</form>".
+        $r->print('<p class="LC_error">'.
+          &mt('A MySQL error has occurred.').
+          '</p>'.
+          '</form>'.
 		  &Apache::loncommon::end_page());
         &Apache::lonnet::logthis("lonmysql was unable to determine the number".
                                  " of rows in table ".$table);
@@ -2919,15 +2927,15 @@
          );
     if ($total_results == 0) {
         $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="2" />'.
-                  '<h3>'.&mt('There are currently no results').'.</h3>'.
+                  '<p class="LC_info">'.&mt('There are currently no results').'.</p>'.
                   "</form>".
 		  &Apache::loncommon::end_page());
         return;
     } else {
-        $r->print('<center>'.
+        $r->print('<div>'.
                   mt('Results [_1] to [_2] out of [_3]',
                      $min,$max,$total_results).
-                  "</center>\n");
+                  "</div>\n");
     }
     ##
     ## Get results from MySQL table
@@ -2957,13 +2965,14 @@
     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="<p>\n";
+        my $output;
         if (! defined($Fields{'title'}) || $Fields{'title'} eq '') {
             $Fields{'title'} = 'Untitled';
         }
@@ -2972,11 +2981,19 @@
         # 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()
+                 .'<td>'
+                 .$output
+                 .'</td>'
+                 .&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('<p class="LC_info">'
+                 .&mt('There were no results matching your query.')
+                 .'</p>');
     } else {
         $r->print
             ('<center>'.
@@ -3395,7 +3412,7 @@
     my $jumpurl=$values{'url'};
     $jumpurl=~s|^/ext/|http://|;
     $result .= '<b>'.$prefix.
-        '<img src="'.&Apache::loncommon::icon($values{'url'}).'" />'.'&nbsp;'.
+        '<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'.'&nbsp;'.
         '<a href="'.$jumpurl.'?inhibitmenu=yes" '.
         'target="preview">'.$values{'title'}."</a></b>\n";
     $result .= "<p>\n";
@@ -3487,17 +3504,14 @@
     if (exists($values{'shortabstract'}) && $values{'shortabstract'} ne '') {
         $result .= '<p>'.$values{'shortabstract'}.'</p>';
     }
-    $result .= '<hr />'."\n";
     return $result;
 }
 
 sub detailed_citation_preview {
     my ($prefix,%values)=@_;
-    return '<table><tr><td>'.
-           &detailed_citation_view($prefix,%values).
+    return &detailed_citation_view($prefix,%values).
            '</td><td>'.
-           &Apache::lonindexer::showpreview($values{'url'}).
-           '</td></tr></table><hr />';
+           &Apache::lonindexer::showpreview($values{'url'});
 }
 
 
@@ -3514,7 +3528,7 @@
 sub summary_view {
     my ($prefix,%values) = @_;
     my $icon=&Apache::loncommon::icon($values{'url'});
-    my $result=qq{$prefix<img src="$icon" />};
+    my $result=qq{$prefix<img src="$icon" alt="" />};
     if (exists($env{'form.sortfield'}) && 
         $env{'form.sortfield'} !~ /^(default|
                                      author|
@@ -3533,24 +3547,20 @@
 
     $result.=<<END;
 <a href="$jumpurl?inhibitmenu=yes" 
-   target='preview'>$values{'title'}</a> <br />
-$link <br />
+   target="preview">$values{'title'}</a><br />
+$link<br />
 $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br />
 $values{'copyrighttag'}<br />
 $values{'extrashow'}
-</p>
-<hr />
 END
     return $result;
 }
 
 sub summary_preview {
     my ($prefix,%values)=@_;
-    return '<table><tr><td>'.
-           &summary_view($prefix,%values).
+    return &summary_view($prefix,%values).
            '</td><td>'.
-           &Apache::lonindexer::showpreview($values{'url'}).
-           '</td></tr></table><hr />';
+           &Apache::lonindexer::showpreview($values{'url'});
 }
 
 ######################################################################
@@ -3583,7 +3593,7 @@
     $result.=' <span class="LC_nobreak">'.
 	'<a href="'.$jumpurl.'?inhibitmenu=yes" target="preview">'.
         &HTML::Entities::encode($values{'title'},'<>&"').'</a></span> '.
-	$link.' <b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />';
+	$link.' <b>'.$values{'author'}.'</b> ('.$values{'domain'}.')';
     return $result;
 }
 
@@ -3623,7 +3633,7 @@
     $jumpurl=~s|^/ext/|http://|;
 
     my $result=<<END;
-$prefix <img src="$icon" />
+$prefix <img src="$icon" alt="" />
 <dl>
 <dt>URL:</dt>
     <dd><a href="$jumpurl?inhibitmenu=yes" 
@@ -3649,7 +3659,6 @@
     }
     $result .= "</dl>\n";
     $result .= $values{'extrashow'};
-    $result .= '<hr />'."\n";
     return $result;
 }
 
@@ -3723,7 +3732,6 @@
 $xml
 </pre>
 $values{'extrashow'}
-<hr />
 END
     return $result;
 }
@@ -3763,9 +3771,12 @@
     my ($r,$closebutton,$parms,$hidden_fields,$field)=@_;
     my $errorstring;
     if ($field eq 'basicexp') {
-        $errorstring = &mt('Unable to understand the search phrase <i>[_1]</i>.  Please modify your search.',$env{'form.basicexp'});
+        $errorstring = &mt('Unable to understand the search phrase [_1]. Please modify your search.'
+                           ,'<i>'.$env{'form.basicexp'}.'</i>');
     } else {
-        $errorstring = &mt('Unable to understand the search phrase <b>[_1]</b>:<i>[_2]</i>.',$field,$env{'form.'.$field});
+        $errorstring = &mt('Unable to understand the search phrase [_1]: [_2]'
+                           ,'<i>'.$field.'</i>'
+                           ,$env{'form.'.$field});
     }
     my $heading = &mt('Unparsed Field');
     my $revise  = &mt('Revise search request');
@@ -3779,7 +3790,7 @@
 $closebutton
 <hr />
 <h2>$heading</h2>
-<p>
+<p class="LC_warning">
 $errorstring
 </p>
 <p>
@@ -3811,7 +3822,7 @@
 ######################################################################
 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 $start_page = &Apache::loncommon::start_page('Search');
@@ -3823,7 +3834,7 @@
 $closebutton
 <hr />
 <h2>$heading</h2>
-<p>
+<p class="LC_warning">
 $errormsg
 </p>
 <p>
@@ -3858,6 +3869,7 @@
     # 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(<<RESULTS);
 $start_page
 <form method="post" action="/adm/searchcat">
@@ -3865,9 +3877,10 @@
 <input type='button' value='Revise search request'
 onClick='this.form.submit();' />
 $closebutton
+</form>
 <hr />
-<h3>Error</h3>
-<p>
+<h3>$heading</h3>
+<p class="LC_error">
 $message
 </p>
 $end_page
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.317 loncom/localize/localize/de.pm:1.318
--- loncom/localize/localize/de.pm:1.317	Tue Jul 21 14:36:12 2009
+++ loncom/localize/localize/de.pm	Fri Jul 31 10:59:04 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.317 2009/07/21 14:36:12 droeschl Exp $
+# $Id: de.pm,v 1.318 2009/07/31 10:59:04 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8228,12 +8228,24 @@
    'There are [_1] matches to your query.'
 => 'Ihre Suche hat [_1] Treffer ergeben.',
 
+   'There were no results matching your query.'
+=> 'Ihre Suche hat keine Treffer ergeben.',
+
    'Revise search'
 => 'Suche ändern',
 
    'Sort by [_1] [_2]'
 => 'Sortiert nach [_1] [_2]',
 
+   'Internal Error - Bad view selected.'
+=> 'Interner Fehler - ungültige Ansicht ausgewählt',
+
+   'Unable to save import results.'
+=> 'Eingelesene Ergebnisse konnten nicht gespeichert werden.',
+
+   'A MySQL error has occurred.'
+=> 'Ein MySQL-Fehler ist aufgetreten.',
+
    'Number of accesses'
 => 'Anzahl der Zugriffe',
 
@@ -14551,7 +14563,19 @@
    '[_1]Log in again[_2]'
 => '[_1]Erneut einloggen[_2]',
 
-   '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.'
+   'No matches found in resources.'
+=> 'Keine Treffer in den Ressourcen.',
+
+   'No matches found in postings.'
+=> 'Keine Treffer in den Diskussionsbeiträgen.',
+
+   'Unable to understand the search phrase [_1]. Please modify your search.'
+=> 'Der Suchbegriff [_1] kann nicht ausgewertet werden. Bitte verändern Sie Ihre Anfrage.',
+
+   'Unable to understand the search phrase [_1]: [_2]'
+=> 'Der Suchbegriff [_1] kann nicht ausgewertet werden: [_2]',
+
+   '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.'
 => 'Die Suche kann nicht durchgeführt werden, da Sie nicht genügend Daten angegeben haben. Sie müssen auf der Suchseite relevante Felder ausfüllen, damit Ihre Anfrage verarbeitet werden kann.',
 
    'conditionally hidden'
Index: loncom/localize/localize/zh.pm
diff -u loncom/localize/localize/zh.pm:1.70 loncom/localize/localize/zh.pm:1.71
--- loncom/localize/localize/zh.pm:1.70	Thu Jul 30 13:29:46 2009
+++ loncom/localize/localize/zh.pm	Fri Jul 31 10:59:04 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Chinese Simplified Localization Lexicon
 #
-# $Id: zh.pm,v 1.70 2009/07/30 13:29:46 zhu Exp $
+# $Id: zh.pm,v 1.71 2009/07/31 10:59:04 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8284,12 +8284,24 @@
    'There are [_1] matches to your query.'
 => '有 [_1] 匹配您的查询。',
 
+   'There were no results matching your query.'
+=> 'Ihre Suche hat keine Treffer ergeben.',
+
    'Revise search'
 => '修改搜寻',
 
    'Sort by [_1] [_2]'
 => '排序依据 [_1] [_2]',
 
+   'Internal Error - Bad view selected.'
+=> 'Interner Fehler - ungültige Ansicht ausgewählt',
+
+   'Unable to save import results.'
+=> 'Eingelesene Ergebnisse konnten nicht gespeichert werden.',
+
+   'A MySQL error has occurred.'
+=> 'Ein MySQL-Fehler ist aufgetreten.',
+
    'Number of accesses'
 => 'Anzahl der Zugriffe',
 
@@ -14678,7 +14690,19 @@
    '[_1]Log in again[_2]'
 => '[_1]重新登录[_2]',
 
-   '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.'
+   'No matches found in resources.'
+=> 'Keine Treffer in den Ressourcen.',
+
+   'No matches found in postings.'
+=> 'Keine Treffer in den Diskussionsbeiträgen.',
+
+   'Unable to understand the search phrase [_1]. Please modify your search.'
+=> 'Der Suchbegriff [_1] kann nicht ausgewertet werden. Bitte verändern Sie Ihre Anfrage.',
+
+   'Unable to understand the search phrase [_1]: [_2]'
+=> 'Der Suchbegriff [_1] kann nicht ausgewertet werden: [_2]',
+
+   '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.'
 => '搜寻无法完成,因为您没有足够的数据。您必须在搜索页面的搜索栏里填写关键词,从而使您的要求可以得到处理。',
 # '您没有填写足够的信息进行搜索的开始。您需要填写在有关领域在搜寻网页上,以便查询处理。'
 

--bisitz1249037944--