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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 19 Apr 2004 14:42:24 -0000


matthew		Mon Apr 19 10:42:24 2004 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
  Log:
  Cosmetic interface changes.
  
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.207 loncom/interface/lonsearchcat.pm:1.208
--- loncom/interface/lonsearchcat.pm:1.207	Mon Apr 19 09:51:36 2004
+++ loncom/interface/lonsearchcat.pm	Mon Apr 19 10:42:24 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.207 2004/04/19 13:51:36 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.208 2004/04/19 14:42:24 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -506,7 +506,7 @@
 <tr><td>
 ENDDOCUMENT
         $scrout.='&nbsp;'.
-        &Apache::lonhtmlcommon::textbox('basicexp',
+            &Apache::lonhtmlcommon::textbox('basicexp',
                                         $ENV{'form.basicexp'},40).
                                         '&nbsp;';
         my $relatedcheckbox = 
@@ -609,56 +609,85 @@
 <input type="reset" name="reset" value='$lt{"reset"}' />
 $closebutton
 <input type="button" value="$lt{'help'}" onClick="openhelp()" />
-</p>
 END
     my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search');
     my $searchhelp=&searchhelp();
     my $scrout=&search_html_header();
     $scrout .= <<"ENDHEADER";
 $bodytag
-$searchhelp
 <form method="post" action="/adm/searchcat" name="advsearch">
 $advanced_buttons
-$hidden_fields
-<input type="hidden" name="phase" value="adv_search" />
 ENDHEADER
-    $scrout.=&viewoptions();
+    $scrout.=('&nbsp;'x2).&viewoptions().'</p>'.$hidden_fields. 
+        '<input type="hidden" name="phase" value="adv_search" />';
     my %fields=&Apache::lonmeta::fieldnames();
-
-    $scrout.='<table>';
-    $scrout.="<tr><th>".&mt('Field').'</th><th>'.&mt('Value').'</th><th>'
-	.&mt('Related').'<br />'.&mt('Words')."</td></tr>\n";
-    foreach ('title','author','owner','authorspace','modifyinguser',
-	     'keywords','notes','abstract','standards',
-	     'lowestgradelevel','highestgradelevel','mime') {
-	$scrout.='<tr><td>'.&titlefield($fields{$_}).'</td><td>'.
-	    &Apache::lonmeta::prettyinput($_,$ENV{'form.'.$_},$_,'advsearch',
-					  1,'</td><td>',$ENV{'form.'.$_.'_related'}).
-	    '</td></tr>';
+    #
+    $scrout.= '<p>'.$searchhelp.'</p>'.
+        "<table>\n";
+    my %related_word_search = 
+        ('title'=>1,
+         'author'=>0,
+         'owner'=>0,
+         'authorspace'=>0,
+         'modifyinguser'=>0,
+         'keywords'=>1,
+         'notes'=>1,
+         'abstract'=>1,
+         'standards'=>1,
+         'mime'=>1,
+         );
+
+    foreach my $field ('title','author','owner','authorspace','modifyinguser',
+	     'keywords','notes','abstract','standards','mime') {
+	$scrout.='<tr><td align="right">'.&titlefield($fields{$field}).'</td><td>'.
+	    &Apache::lonmeta::prettyinput($field,
+                                          $ENV{'form.'.$field},
+                                          $field,
+                                          'advsearch',
+					  $related_word_search{$field},
+                                          '</td><td align="left">',
+                                          $ENV{'form.'.$field.'_related'},
+                                          50);
+        if ($related_word_search{$field}) {
+            $scrout .= 'related words';
+        } else {
+            $scrout .= '</td><td>&nbsp;';
+        }
+        $scrout .= '</td></tr>'.$/;
+    }
+    foreach my $field ('lowestgradelevel','highestgradelevel') {
+	$scrout.='<tr>'.
+            '<td align="right">'.&titlefield($fields{$field}).'</td>'.
+            '<td colspan="2">'.
+	    &Apache::lonmeta::prettyinput($field,
+                                          $ENV{'form.'.$field},
+                                          $field,
+                                          'advsearch',
+					  0).
+                                          '</td></tr>'.$/;
     }
-    $scrout.='<tr><td>'.
-	&titlefield(&mt('MIME Type Category')).'</td><td>'. 
+    $scrout.='<tr><td align="right">'.
+	&titlefield(&mt('MIME Type Category')).'</td><td colspan="2">'. 
 	    &Apache::loncommon::filecategoryselect('category',
 						   $ENV{'form.category'}).
-	    '</td><td>&nbsp;</td></td></tr>';
-    $scrout.='<tr><td>'.
-	&titlefield(&mt('Limit Search to Domains')).'</td><td>'. 
+	    '</td></tr>'.$/;
+    $scrout.='<tr><td align="right" valign="top">'.
+	&titlefield(&mt('Domains')).'</td><td colspan="2">'. 
 	    &Apache::loncommon::domain_select('domains',
 						   $ENV{'form.domains'},1).
-	    '</td><td>&nbsp;</td></td></tr>';
+	    '</td></tr>'.$/;
+    $scrout .= "</table>\n<br />\n<table>\n";
     my %dates=&Apache::lonlocal::texthash
         ('creationdatestart'     => 'Creation Date After',
          'creationdateend'       => 'Creation Date Before',
          'lastrevisiondatestart' => 'Last Revision Date After',
          'lastrevisiondateend'   => 'Last Revision Date Before');
-    foreach (sort keys %dates) {
+    foreach my $field (sort keys %dates) {
 	$scrout.='<tr>'.
-            '<td>'.&titlefield($dates{$_}).'</td><td>'. 
-	    &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1).
-	    '</td><td>&nbsp;</td></td>'.
-            '</tr>';
+            '<td align="right">'.&titlefield($dates{$field}).'</td><td>'. 
+	    &Apache::lonhtmlcommon::date_setter('advsearch',$field,0,'',1).
+	    '</td></tr>'.$/;
     }
-
     $scrout.="</table>\n";
     $scrout.=<<ENDDOCUMENT;
 $advanced_buttons
@@ -687,7 +716,7 @@
 ######################################################################
 sub titlefield {
     my $title=shift;
-    return '<font face="arial" color="#800000">'.$title.'</font>';
+    return $title;
 }
 
 ######################################################################
@@ -732,20 +761,20 @@
 ######################################################################
 ######################################################################
 sub viewoptions {
-    my $scrout="\n\n".'<table>'.
-        '<tr><th>'.&mt('View Options').'</th><th>'.
-	&mt('Records per Page').'</th></tr><tr><td>';
-    unless ($ENV{'form.viewselect'}) { $ENV{'form.viewselect'}='detailed'; }
+    my $scrout="\n".'<nobr>';
+    if (! defined($ENV{'form.viewselect'})) { 
+        $ENV{'form.viewselect'}='detailed'; 
+    }
     $scrout.=&Apache::lonmeta::selectbox('viewselect',
 			$ENV{'form.viewselect'},
 			\&viewoptiontext,
 			sort(keys(%Views)));
-    $scrout.='</td><td>';
+    $scrout.= '&nbsp;&nbsp;';
     $scrout.=&Apache::lonmeta::selectbox('show',
 			$ENV{'form.show'},
 			undef,
 			(10,20,50,100,1000,10000));
-    $scrout.="</td></tr></table>\n\n";
+    $scrout .= ('&nbsp;'x2).&mt('Records per Page').'</nobr>'.$/;
     return $scrout;
 }