[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm
banghart
lon-capa-cvs-allow@mail.lon-capa.org
Thu, 02 Aug 2007 00:10:59 -0000
banghart Wed Aug 1 20:10:59 2007 EDT
Modified files:
/loncom/interface lonindexer.pm
Log:
Bug 2633. Change from checkbox to dropdown. Might be done.
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.174 loncom/interface/lonindexer.pm:1.175
--- loncom/interface/lonindexer.pm:1.174 Wed Aug 1 17:12:12 2007
+++ loncom/interface/lonindexer.pm Wed Aug 1 20:10:59 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.174 2007/08/01 21:12:12 banghart Exp $
+# $Id: lonindexer.pm,v 1.175 2007/08/02 00:10:59 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -106,7 +106,7 @@
my $fileclr='#ffffe6';
my $line;
- my (@attrchk,@openpath);
+ my (@attrchk,@openpath,%typechk);
my $uri=$r->uri;
# -------------------------------------- see if called from an interactive mode
@@ -359,7 +359,10 @@
my $js = <<"ENDHEADER";
<script type="text/javascript">
-$catalogmodefunctions
+$catalogmodefunctions;
+function update_only(field) {
+ alert(field.name);
+}
function checkAll() {
var numForms = document.forms.length;
for (i=0;i<numForms;i++) {
@@ -406,6 +409,18 @@
my ($headerdom)=($uri=~m{^/res/($match_domain)/});
$r->print(&Apache::loncommon::start_page('Browse Resources',$js,
{'domain' => $headerdom,}));
+# ---------------------------------- get state of file types to be showing
+ if ($env{'form.only'}) {
+ if ($env{'form.only'} eq 'problem' ) {
+ $typechk{'problem'} = 'selected';
+ } elsif ($env{'form.only'} eq 'gif,jpg,jpeg' ) {
+ $typechk{'graphic'} = 'selected';
+ }
+ } else {
+ $typechk{'all'} = 'selected';
+ }
+
+
# ---------------------------------- get state of file attributes to be showing
if ($env{'form.attrs'}) {
for (my $i=0; $i<=11; $i++) {
@@ -467,11 +482,11 @@
</tr>
</table>
<input type="hidden" name="attrs" value="1" />
-<input type="hidden" name="only" value="" />
-<label><input type="checkbox" name="problem" value="problem" onClick="this.form.only.value += 'problem';this.form.submit();" />$lt{'pr'}</label>
-<label><input type="checkbox" name="graphic" value="gif,jpg,jpeg" onClick="this.form.only.value += ',gif,jpg,jpg';this.form.submit();" />$lt{'gr'}</label>
-<label><input type="checkbox" name="all" value="" onClick="this.form.only.value = '';this.form.submit();" />$lt{'at'}</label>
-
+<label><select name="only" onClick="this.form.submit()">
+<option value='problem' $typechk{'problem'}>Problems</option>
+<option value='gif,jpg,jpeg' $typechk{'graphic'}>Graphics</option>
+<option value='' $typechk{'all'}>All</option>
+</select>File Types Displayed</label>
<br />
<input type="submit" name="updatedisplay" value="$lt{'ud'}" />
<input type="hidden" name="acts" value="" />