version 1.5, 2001/03/08 16:55:43
|
version 1.12, 2001/03/15 13:40:20
|
Line 7 package Apache::lonsearchcat;
|
Line 7 package Apache::lonsearchcat;
|
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
|
use Apache::lonnet(); |
|
use Apache::File(); |
|
use CGI qw(:standard); |
|
|
my %language; |
my %language; |
my $scrout; |
my $scrout; |
Line 16 my %mimetag;
|
Line 19 my %mimetag;
|
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
|
|
|
# -------------------------------------- see if called from an interactive mode |
|
map { |
|
my ($name, $value) = split(/=/,$_); |
|
$value =~ tr/+/ /; |
|
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
|
if ($name eq 'catalogmode') { |
|
$ENV{'form.'.$name}=$value; |
|
} |
|
} (split(/&/,$ENV{'QUERY_STRING'})); |
|
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
%metadatafields=(); |
%metadatafields=(); |
|
|
|
my $hidden=''; |
|
$hidden=<<END if $ENV{'form.catalogmode'} eq 'interactive'; |
|
<input type='hidden' name='catalogmode' value='interactive'> |
|
END |
|
|
# ------------------------------------------------ First, check out environment |
# ------------------------------------------------ First, check out environment |
$metadatafields{'owner'}=$ENV{'user.name'}.'@'.$ENV{'user.domain'}; |
$metadatafields{'owner'}=$ENV{'user.name'}.'@'.$ENV{'user.domain'}; |
|
|
|
# --------------------------------- Compute various listings of metadata values |
|
|
%language=(); |
%language=(); |
$language{'any'}='Any language'; |
$language{'any'}='Any language'; |
Line 56 sub handler {
|
Line 76 sub handler {
|
} <$fh>; |
} <$fh>; |
} |
} |
|
|
$scrout=""; |
if ($ENV{'form.basicsubmit'} eq 'SEARCH') { |
|
return &basicsearch($r,$ENV{'form.basicexp'}); |
|
} |
|
|
|
$scrout=''; # building a part of screen output |
$scrout.=&searchphrasefield('Limit by title','title', |
$scrout.=&searchphrasefield('Limit by title','title', |
''); |
$ENV{'form.title'}); |
|
|
$scrout.=&searchphrasefield('Limit by author','author', |
$scrout.=&searchphrasefield('Limit by author','author', |
''); |
$ENV{'form.author'}); |
|
|
$scrout.=&searchphrasefield('Limit by subject','subject', |
$scrout.=&searchphrasefield('Limit by subject','subject', |
''); |
$ENV{'form.subject'}); |
|
|
|
$scrout.=&searchphrasefield('Limit by keywords','keywords', |
|
$ENV{'form.keywords'}); |
|
|
|
$scrout.=&searchphrasefield('Limit by URL','url', |
|
$ENV{'form.url'}); |
|
|
|
$scrout.=&searchphrasefield('Limit by version','version', |
|
$ENV{'form.version'}); |
|
|
$scrout.=&searchphrasefield('Limit by notes','notes', |
$scrout.=&searchphrasefield('Limit by notes','notes', |
''); |
$ENV{'form.notes'}); |
|
|
$scrout.=&searchphrasefield('Limit by abstract','abstract', |
$scrout.=&searchphrasefield('Limit by abstract','abstract', |
''); |
$ENV{'form.abstract'}); |
|
|
|
$ENV{'form.mime'}='notxxx' unless length($ENV{'form.mime'}); |
$scrout.=&selectbox('Limit by MIME type','mime', |
$scrout.=&selectbox('Limit by MIME type','mime', |
'notxxx',%mimetag); |
$ENV{'form.mime'},%mimetag); |
|
|
|
$ENV{'form.language'}='any' unless length($ENV{'form.language'}); |
|
|
$scrout.=&selectbox('Limit by language','language', |
$scrout.=&selectbox('Limit by language','language', |
'any',%language); |
$ENV{'form.language'},%language); |
|
|
$scrout.=<<CREATIONDATEEND; |
|
|
# ------------------------------------------------ Compute date selection boxes |
|
$scrout.=<<CREATIONDATESTART; |
<p> |
<p> |
<font color="#800000" face="helvetica"><b>LIMIT BY CREATION DATE RANGE:</b> |
<font color="#800000" face="helvetica"><b>LIMIT BY CREATION DATE RANGE:</b> |
</font> |
</font> |
<br> |
<br> |
between:<select name="creationdatemonthstart"> |
between: |
<option value="01"> </option> |
CREATIONDATESTART |
<option value="01">January</option> |
$scrout.=&dateboxes('creationdatestart',1,1,1976, |
<option value="02">February</option> |
$ENV{'form.creationdatestart_month'}, |
<option value="03">March</option> |
$ENV{'form.creationdatestart_day'}, |
<option value="04">April</option> |
$ENV{'form.creationdatestart_year'}, |
<option value="05">May</option> |
); |
<option value="06">June</option> |
$scrout.=<<CREATIONDATEEND; |
<option value="07">July</option> |
and: |
<option value="08">August</option> |
|
<option value="09">September</option> |
|
<option value="10">October</option> |
|
<option value="11">November</option> |
|
<option value="12">December</option> |
|
</select> |
|
<select name="creationdatedaystart"> |
|
<option value="1"> </option> |
|
<option value=1>1</option> |
|
<option value=2>2</option> |
|
<option value=3>3</option> |
|
<option value=4>4</option> |
|
<option value=5>5</option> |
|
<option value=6>6</option> |
|
<option value=7>7</option> |
|
<option value=8>8</option> |
|
<option value=9>9</option> |
|
<option value=10>10</option> |
|
<option value=11>11</option> |
|
<option value=12>12</option> |
|
<option value=13>13</option> |
|
<option value=14>14</option> |
|
<option value=15>15</option> |
|
<option value=16>16</option> |
|
<option value=17>17</option> |
|
<option value=18>18</option> |
|
<option value=19>19</option> |
|
<option value=20>20</option> |
|
<option value=21>21</option> |
|
<option value=22>22</option> |
|
<option value=23>23</option> |
|
<option value=24>24</option> |
|
<option value=25>25</option> |
|
<option value=26>26</option> |
|
<option value=27>27</option> |
|
<option value=28>28</option> |
|
<option value=29>29</option> |
|
<option value=30>30</option> |
|
<option value=31>31</option> |
|
</select> |
|
<select name="creationdateyearstart"> |
|
<option value=1976> </option> |
|
<option value=1976>1976</option> |
|
<option value=1977>1977</option> |
|
<option value=1978>1978</option> |
|
<option value=1979>1979</option> |
|
<option value=1980>1980</option> |
|
<option value=1981>1981</option> |
|
<option value=1982>1982</option> |
|
<option value=1983>1983</option> |
|
<option value=1984>1984</option> |
|
<option value=1985>1985</option> |
|
<option value=1986>1986</option> |
|
<option value=1987>1987</option> |
|
<option value=1988>1988</option> |
|
<option value=1989>1989</option> |
|
<option value=1990>1990</option> |
|
<option value=1991>1991</option> |
|
<option value=1992>1992</option> |
|
<option value=1993>1993</option> |
|
<option value=1994>1994</option> |
|
<option value=1995>1995</option> |
|
<option value=1996>1996</option> |
|
<option value=1997>1997</option> |
|
<option value=1998>1998</option> |
|
<option value=1999>1999</option> |
|
<option value=2000>2000</option> |
|
<option value=2001>2001</option> |
|
<option value=2002>2002</option> |
|
<option value=2003>2003</option> |
|
<option value=2004>2004</option> |
|
<option value=2005>2005</option> |
|
<option value=2006>2006</option> |
|
<option value=2007>2007</option> |
|
<option value=2008>2008</option> |
|
<option value=2009>2009</option> |
|
<option value=2010>2010</option> |
|
<option value=2011>2011</option> |
|
<option value=2012>2012</option> |
|
<option value=2013>2013</option> |
|
<option value=2014>2014</option> |
|
<option value=2015>2015</option> |
|
<option value=2016>2016</option> |
|
<option value=2017>2017</option> |
|
<option value=2018>2018</option> |
|
<option value=2019>2019</option> |
|
<option value=2020>2020</option> |
|
<option value=2021>2021</option> |
|
<option value=2022>2022</option> |
|
<option value=2023>2023</option> |
|
<option value=2024>2024</option> |
|
<option value=2025>2025</option> |
|
<option value=2026>2026</option> |
|
<option value=2027>2027</option> |
|
<option value=2028>2028</option> |
|
<option value=2029>2029</option> |
|
<option value=2030>2030</option> |
|
<option value=2031>2031</option> |
|
<option value=2032>2032</option> |
|
<option value=2033>2033</option> |
|
<option value=2034>2034</option> |
|
<option value=2035>2035</option> |
|
<option value=2036>2036</option> |
|
<option value=2037>2037</option> |
|
<option value=2038>2038</option> |
|
<option value=2039>2039</option> |
|
<option value=2040>2040</option> |
|
<option value=2041>2041</option> |
|
<option value=2042>2042</option> |
|
<option value=2043>2043</option> |
|
<option value=2044>2044</option> |
|
<option value=2045>2045</option> |
|
<option value=2046>2046</option> |
|
<option value=2047>2047</option> |
|
<option value=2048>2048</option> |
|
<option value=2049>2049</option> |
|
<option value=2050>2050</option> |
|
<option value=2051>2051</option> |
|
</select> |
|
and:<select name="creationdatemonthend"> |
|
<option value="12"> </option> |
|
<option value="01">January</option> |
|
<option value="02">February</option> |
|
<option value="03">March</option> |
|
<option value="04">April</option> |
|
<option value="05">May</option> |
|
<option value="06">June</option> |
|
<option value="07">July</option> |
|
<option value="08">August</option> |
|
<option value="09">September</option> |
|
<option value="10">October</option> |
|
<option value="11">November</option> |
|
<option value="12">December</option> |
|
</select> |
|
<select name="creationdatedayend"> |
|
<option value=28> </option> |
|
<option value=1>1</option> |
|
<option value=2>2</option> |
|
<option value=3>3</option> |
|
<option value=4>4</option> |
|
<option value=5>5</option> |
|
<option value=6>6</option> |
|
<option value=7>7</option> |
|
<option value=8>8</option> |
|
<option value=9>9</option> |
|
<option value=10>10</option> |
|
<option value=11>11</option> |
|
<option value=12>12</option> |
|
<option value=13>13</option> |
|
<option value=14>14</option> |
|
<option value=15>15</option> |
|
<option value=16>16</option> |
|
<option value=17>17</option> |
|
<option value=18>18</option> |
|
<option value=19>19</option> |
|
<option value=20>20</option> |
|
<option value=21>21</option> |
|
<option value=22>22</option> |
|
<option value=23>23</option> |
|
<option value=24>24</option> |
|
<option value=25>25</option> |
|
<option value=26>26</option> |
|
<option value=27>27</option> |
|
<option value=28>28</option> |
|
<option value=29>29</option> |
|
<option value=30>30</option> |
|
<option value=31>31</option> |
|
</select> |
|
<select name="creationdateyearend"> |
|
<option value=2051> </option> |
|
<option value=1976>1976</option> |
|
<option value=1977>1977</option> |
|
<option value=1978>1978</option> |
|
<option value=1979>1979</option> |
|
<option value=1980>1980</option> |
|
<option value=1981>1981</option> |
|
<option value=1982>1982</option> |
|
<option value=1983>1983</option> |
|
<option value=1984>1984</option> |
|
<option value=1985>1985</option> |
|
<option value=1986>1986</option> |
|
<option value=1987>1987</option> |
|
<option value=1988>1988</option> |
|
<option value=1989>1989</option> |
|
<option value=1990>1990</option> |
|
<option value=1991>1991</option> |
|
<option value=1992>1992</option> |
|
<option value=1993>1993</option> |
|
<option value=1994>1994</option> |
|
<option value=1995>1995</option> |
|
<option value=1996>1996</option> |
|
<option value=1997>1997</option> |
|
<option value=1998>1998</option> |
|
<option value=1999>1999</option> |
|
<option value=2000>2000</option> |
|
<option value=2001>2001</option> |
|
<option value=2002>2002</option> |
|
<option value=2003>2003</option> |
|
<option value=2004>2004</option> |
|
<option value=2005>2005</option> |
|
<option value=2006>2006</option> |
|
<option value=2007>2007</option> |
|
<option value=2008>2008</option> |
|
<option value=2009>2009</option> |
|
<option value=2010>2010</option> |
|
<option value=2011>2011</option> |
|
<option value=2012>2012</option> |
|
<option value=2013>2013</option> |
|
<option value=2014>2014</option> |
|
<option value=2015>2015</option> |
|
<option value=2016>2016</option> |
|
<option value=2017>2017</option> |
|
<option value=2018>2018</option> |
|
<option value=2019>2019</option> |
|
<option value=2020>2020</option> |
|
<option value=2021>2021</option> |
|
<option value=2022>2022</option> |
|
<option value=2023>2023</option> |
|
<option value=2024>2024</option> |
|
<option value=2025>2025</option> |
|
<option value=2026>2026</option> |
|
<option value=2027>2027</option> |
|
<option value=2028>2028</option> |
|
<option value=2029>2029</option> |
|
<option value=2030>2030</option> |
|
<option value=2031>2031</option> |
|
<option value=2032>2032</option> |
|
<option value=2033>2033</option> |
|
<option value=2034>2034</option> |
|
<option value=2035>2035</option> |
|
<option value=2036>2036</option> |
|
<option value=2037>2037</option> |
|
<option value=2038>2038</option> |
|
<option value=2039>2039</option> |
|
<option value=2040>2040</option> |
|
<option value=2041>2041</option> |
|
<option value=2042>2042</option> |
|
<option value=2043>2043</option> |
|
<option value=2044>2044</option> |
|
<option value=2045>2045</option> |
|
<option value=2046>2046</option> |
|
<option value=2047>2047</option> |
|
<option value=2048>2048</option> |
|
<option value=2049>2049</option> |
|
<option value=2050>2050</option> |
|
<option value=2051>2051</option> |
|
</select> |
|
</p> |
|
CREATIONDATEEND |
CREATIONDATEEND |
|
$scrout.=&dateboxes('creationdateend',12,31,2051, |
|
$ENV{'form.creationdateend_month'}, |
|
$ENV{'form.creationdateend_day'}, |
|
$ENV{'form.creationdateend_year'}, |
|
); |
|
$scrout.="</p>"; |
|
|
$scrout.=<<LASTREVISIONDATEEND; |
$scrout.=<<LASTREVISIONDATESTART; |
<p> |
<p> |
<font color="#800000" face="helvetica"><b>LIMIT BY LAST REVISION DATE RANGE: |
<font color="#800000" face="helvetica"><b>LIMIT BY LAST REVISION DATE RANGE: |
</b></font> |
</b></font> |
<br>between:<select name="lastrevisiondatemonthstart"> |
<br>between: |
<option value="00"> </option> |
LASTREVISIONDATESTART |
<option value="01">January</option> |
$scrout.=&dateboxes('lastrevisiondatestart',1,1,1976, |
<option value="02">February</option> |
$ENV{'form.lastrevisiondatestart_month'}, |
<option value="03">March</option> |
$ENV{'form.lastrevisiondatestart_day'}, |
<option value="04">April</option> |
$ENV{'form.lastrevisiondatestart_year'}, |
<option value="05">May</option> |
); |
<option value="06">June</option> |
$scrout.=<<LASTREVISIONDATEEND; |
<option value="07">July</option> |
and: |
<option value="08">August</option> |
|
<option value="09">September</option> |
|
<option value="10">October</option> |
|
<option value="11">November</option> |
|
<option value="12">December</option> |
|
</select> |
|
<select name="lastrevisiondatedaystart"> |
|
<option value=1> </option> |
|
<option value=1>1</option> |
|
<option value=2>2</option> |
|
<option value=3>3</option> |
|
<option value=4>4</option> |
|
<option value=5>5</option> |
|
<option value=6>6</option> |
|
<option value=7>7</option> |
|
<option value=8>8</option> |
|
<option value=9>9</option> |
|
<option value=10>10</option> |
|
<option value=11>11</option> |
|
<option value=12>12</option> |
|
<option value=13>13</option> |
|
<option value=14>14</option> |
|
<option value=15>15</option> |
|
<option value=16>16</option> |
|
<option value=17>17</option> |
|
<option value=18>18</option> |
|
<option value=19>19</option> |
|
<option value=20>20</option> |
|
<option value=21>21</option> |
|
<option value=22>22</option> |
|
<option value=23>23</option> |
|
<option value=24>24</option> |
|
<option value=25>25</option> |
|
<option value=26>26</option> |
|
<option value=27>27</option> |
|
<option value=28>28</option> |
|
<option value=29>29</option> |
|
<option value=30>30</option> |
|
<option value=31>31</option> |
|
</select> |
|
<select name="lastrevisiondateyearstart"> |
|
<option value=1976> </option> |
|
<option value=1976>1976</option> |
|
<option value=1977>1977</option> |
|
<option value=1978>1978</option> |
|
<option value=1979>1979</option> |
|
<option value=1980>1980</option> |
|
<option value=1981>1981</option> |
|
<option value=1982>1982</option> |
|
<option value=1983>1983</option> |
|
<option value=1984>1984</option> |
|
<option value=1985>1985</option> |
|
<option value=1986>1986</option> |
|
<option value=1987>1987</option> |
|
<option value=1988>1988</option> |
|
<option value=1989>1989</option> |
|
<option value=1990>1990</option> |
|
<option value=1991>1991</option> |
|
<option value=1992>1992</option> |
|
<option value=1993>1993</option> |
|
<option value=1994>1994</option> |
|
<option value=1995>1995</option> |
|
<option value=1996>1996</option> |
|
<option value=1997>1997</option> |
|
<option value=1998>1998</option> |
|
<option value=1999>1999</option> |
|
<option value=2000>2000</option> |
|
<option value=2001>2001</option> |
|
<option value=2002>2002</option> |
|
<option value=2003>2003</option> |
|
<option value=2004>2004</option> |
|
<option value=2005>2005</option> |
|
<option value=2006>2006</option> |
|
<option value=2007>2007</option> |
|
<option value=2008>2008</option> |
|
<option value=2009>2009</option> |
|
<option value=2010>2010</option> |
|
<option value=2011>2011</option> |
|
<option value=2012>2012</option> |
|
<option value=2013>2013</option> |
|
<option value=2014>2014</option> |
|
<option value=2015>2015</option> |
|
<option value=2016>2016</option> |
|
<option value=2017>2017</option> |
|
<option value=2018>2018</option> |
|
<option value=2019>2019</option> |
|
<option value=2020>2020</option> |
|
<option value=2021>2021</option> |
|
<option value=2022>2022</option> |
|
<option value=2023>2023</option> |
|
<option value=2024>2024</option> |
|
<option value=2025>2025</option> |
|
<option value=2026>2026</option> |
|
<option value=2027>2027</option> |
|
<option value=2028>2028</option> |
|
<option value=2029>2029</option> |
|
<option value=2030>2030</option> |
|
<option value=2031>2031</option> |
|
<option value=2032>2032</option> |
|
<option value=2033>2033</option> |
|
<option value=2034>2034</option> |
|
<option value=2035>2035</option> |
|
<option value=2036>2036</option> |
|
<option value=2037>2037</option> |
|
<option value=2038>2038</option> |
|
<option value=2039>2039</option> |
|
<option value=2040>2040</option> |
|
<option value=2041>2041</option> |
|
<option value=2042>2042</option> |
|
<option value=2043>2043</option> |
|
<option value=2044>2044</option> |
|
<option value=2045>2045</option> |
|
<option value=2046>2046</option> |
|
<option value=2047>2047</option> |
|
<option value=2048>2048</option> |
|
<option value=2049>2049</option> |
|
<option value=2050>2050</option> |
|
<option value=2051>2051</option> |
|
</select> |
|
and:<select name="lastrevisiondatemonthend"> |
|
<option value="12"> </option> |
|
<option value="01">January</option> |
|
<option value="02">February</option> |
|
<option value="03">March</option> |
|
<option value="04">April</option> |
|
<option value="05">May</option> |
|
<option value="06">June</option> |
|
<option value="07">July</option> |
|
<option value="08">August</option> |
|
<option value="09">September</option> |
|
<option value="10">October</option> |
|
<option value="11">November</option> |
|
<option value="12">December</option> |
|
</select> |
|
<select name="lastrevisiondatedayend"> |
|
<option value=28> </option> |
|
<option value=1>1</option> |
|
<option value=2>2</option> |
|
<option value=3>3</option> |
|
<option value=4>4</option> |
|
<option value=5>5</option> |
|
<option value=6>6</option> |
|
<option value=7>7</option> |
|
<option value=8>8</option> |
|
<option value=9>9</option> |
|
<option value=10>10</option> |
|
<option value=11>11</option> |
|
<option value=12>12</option> |
|
<option value=13>13</option> |
|
<option value=14>14</option> |
|
<option value=15>15</option> |
|
<option value=16>16</option> |
|
<option value=17>17</option> |
|
<option value=18>18</option> |
|
<option value=19>19</option> |
|
<option value=20>20</option> |
|
<option value=21>21</option> |
|
<option value=22>22</option> |
|
<option value=23>23</option> |
|
<option value=24>24</option> |
|
<option value=25>25</option> |
|
<option value=26>26</option> |
|
<option value=27>27</option> |
|
<option value=28>28</option> |
|
<option value=29>29</option> |
|
<option value=30>30</option> |
|
<option value=31>31</option> |
|
</select> |
|
<select name="lastrevisiondateyearend"> |
|
<option value=2051> </option> |
|
<option value=1976>1976</option> |
|
<option value=1977>1977</option> |
|
<option value=1978>1978</option> |
|
<option value=1979>1979</option> |
|
<option value=1980>1980</option> |
|
<option value=1981>1981</option> |
|
<option value=1982>1982</option> |
|
<option value=1983>1983</option> |
|
<option value=1984>1984</option> |
|
<option value=1985>1985</option> |
|
<option value=1986>1986</option> |
|
<option value=1987>1987</option> |
|
<option value=1988>1988</option> |
|
<option value=1989>1989</option> |
|
<option value=1990>1990</option> |
|
<option value=1991>1991</option> |
|
<option value=1992>1992</option> |
|
<option value=1993>1993</option> |
|
<option value=1994>1994</option> |
|
<option value=1995>1995</option> |
|
<option value=1996>1996</option> |
|
<option value=1997>1997</option> |
|
<option value=1998>1998</option> |
|
<option value=1999>1999</option> |
|
<option value=2000>2000</option> |
|
<option value=2001>2001</option> |
|
<option value=2002>2002</option> |
|
<option value=2003>2003</option> |
|
<option value=2004>2004</option> |
|
<option value=2005>2005</option> |
|
<option value=2006>2006</option> |
|
<option value=2007>2007</option> |
|
<option value=2008>2008</option> |
|
<option value=2009>2009</option> |
|
<option value=2010>2010</option> |
|
<option value=2011>2011</option> |
|
<option value=2012>2012</option> |
|
<option value=2013>2013</option> |
|
<option value=2014>2014</option> |
|
<option value=2015>2015</option> |
|
<option value=2016>2016</option> |
|
<option value=2017>2017</option> |
|
<option value=2018>2018</option> |
|
<option value=2019>2019</option> |
|
<option value=2020>2020</option> |
|
<option value=2021>2021</option> |
|
<option value=2022>2022</option> |
|
<option value=2023>2023</option> |
|
<option value=2024>2024</option> |
|
<option value=2025>2025</option> |
|
<option value=2026>2026</option> |
|
<option value=2027>2027</option> |
|
<option value=2028>2028</option> |
|
<option value=2029>2029</option> |
|
<option value=2030>2030</option> |
|
<option value=2031>2031</option> |
|
<option value=2032>2032</option> |
|
<option value=2033>2033</option> |
|
<option value=2034>2034</option> |
|
<option value=2035>2035</option> |
|
<option value=2036>2036</option> |
|
<option value=2037>2037</option> |
|
<option value=2038>2038</option> |
|
<option value=2039>2039</option> |
|
<option value=2040>2040</option> |
|
<option value=2041>2041</option> |
|
<option value=2042>2042</option> |
|
<option value=2043>2043</option> |
|
<option value=2044>2044</option> |
|
<option value=2045>2045</option> |
|
<option value=2046>2046</option> |
|
<option value=2047>2047</option> |
|
<option value=2048>2048</option> |
|
<option value=2049>2049</option> |
|
<option value=2050>2050</option> |
|
<option value=2051>2051</option> |
|
</select> |
|
</p> |
|
LASTREVISIONDATEEND |
LASTREVISIONDATEEND |
|
$scrout.=&dateboxes('lastrevisiondateend',12,31,2051, |
|
$ENV{'form.lastrevisiondateend_month'}, |
|
$ENV{'form.lastrevisiondateend_day'}, |
|
$ENV{'form.lastrevisiondateend_year'}, |
|
); |
|
$scrout.='</p>'; |
|
|
$scrout.=&searchphrasefield('Limit by publisher/owner','owner', |
$scrout.=&searchphrasefield('Limit by publisher/owner','owner', |
$metadatafields{'owner'}); |
$ENV{'form.owner'}); |
|
# $metadatafields{'owner'}); |
|
|
|
$ENV{'form.copyright'}='any' unless length($ENV{'form.copyright'}); |
$scrout.=&selectbox('Limit by copyright/distribution','copyright', |
$scrout.=&selectbox('Limit by copyright/distribution','copyright', |
'any',%cprtag); |
$ENV{'form.copyright'},%cprtag); |
|
|
# ---------------------------------------------------------------- Print screen |
# ---------------------------------------------------------------- Print screen |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
Line 621 LASTREVISIONDATEEND
|
Line 177 LASTREVISIONDATEEND
|
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<h1>Search Catalog</h1> |
<h1>Search Catalog</h1> |
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
|
$hidden |
<hr> |
<hr> |
<h3>Basic Search</h3> |
<h3>Basic Search</h3> |
<p> |
<p> |
Line 629 such as AND or OR then press SEARCH belo
|
Line 186 such as AND or OR then press SEARCH belo
|
to the title, author, subject, notes, or abstract information associated |
to the title, author, subject, notes, or abstract information associated |
with a resource. |
with a resource. |
<br> |
<br> |
<input type="text" name="basicexp"> |
ENDDOCUMENT |
<input type="checkbox" name="titleonly"> |
$r->print(&simpletextfield('basicexp',$ENV{'form.basicexp'})); |
<font color="#800000">Title only</font> |
$r->print(' '); |
|
$r->print(&simplecheckbox('titleonly',$ENV{'form.titleonly'})); |
|
$r->print('<font color="#800000">Title only</font> '); |
|
$r->print(&simplecheckbox('allversions',$ENV{'form.allversions'})); |
|
$r->print(<<ENDDOCUMENT); |
|
<font color="#800000">Search historic archives</font> |
<br> |
<br> |
<input type="submit" name="basicsubmit" value="SEARCH"> |
<input type="submit" name="basicsubmit" value="SEARCH"> |
|
<input type="reset" name="reset" value="RESET"> |
|
<input type="button" name="close" value="CLOSE" onClick="self.close()"> |
</p> |
</p> |
<hr> |
<hr> |
<h3>Advanced Search</h3> |
<h3>Advanced Search</h3> |
$scrout |
$scrout |
<p> |
<p> |
<input type="submit" name="advancedsubmit" value="SEARCH"> |
<input type="submit" name="advancedsubmit" value="SEARCH"> |
|
<input type="reset" name="reset" value="RESET"> |
|
<input type="button" name="close" value="CLOSE" onClick="self.close()"> |
</p> |
</p> |
</form> |
</form> |
</body> |
</body> |
Line 656 sub textfield {
|
Line 222 sub textfield {
|
'<input type=text name="'.$name.'" size=80 value="'.$value.'">'; |
'<input type=text name="'.$name.'" size=80 value="'.$value.'">'; |
} |
} |
|
|
|
sub simpletextfield { |
|
my ($name,$value)=@_; |
|
return '<input type=text name="'.$name.'" size=20 value="'.$value.'">'; |
|
} |
|
|
|
sub simplecheckbox { |
|
my ($name,$value)=@_; |
|
my $checked=''; |
|
$checked="CHECKED" if $value eq 'on'; |
|
return '<input type=checkbox name="'.$name.'" '. $checked . '>'; |
|
} |
|
|
sub searchphrasefield { |
sub searchphrasefield { |
my ($title,$name,$value)=@_; |
my ($title,$name,$value)=@_; |
my $instruction=<<END; |
my $instruction=<<END; |
Line 664 as AND or OR.
|
Line 242 as AND or OR.
|
END |
END |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:</b>". |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:</b>". |
":</FONT> $instruction<br>". |
"</FONT> $instruction<br>". |
'<input type=text name="'.$name.'" size=80 value="'.$value.'">'; |
'<input type=text name="'.$name.'" size=80 value="'.$value.'">'; |
} |
} |
|
|
|
sub dateboxes { |
|
my ($name,$defaultmonth,$defaultday,$defaultyear, |
|
$currentmonth,$currentday,$currentyear)=@_; |
|
($defaultmonth,$defaultday,$defaultyear)=('','',''); |
|
my $month=<<END; |
|
<select name="${name}_month"> |
|
<option value='$defaultmonth'> </option> |
|
<option value="1">January</option> |
|
<option value="2">February</option> |
|
<option value="3">March</option> |
|
<option value="4">April</option> |
|
<option value="5">May</option> |
|
<option value="6">June</option> |
|
<option value="7">July</option> |
|
<option value="8">August</option> |
|
<option value="9">September</option> |
|
<option value="10">October</option> |
|
<option value="11">November</option> |
|
<option value="12">December</option> |
|
</select> |
|
END |
|
$month=~s/(\"$currentmonth\")/$1 SELECTED/ if length($currentmonth); |
|
my $day=<<END; |
|
<select name="${name}_day"> |
|
<option value='$defaultday'> </option> |
|
<option value="1">1</option> |
|
<option value="2">2</option> |
|
<option value="3">3</option> |
|
<option value="4">4</option> |
|
<option value="5">5</option> |
|
<option value="6">6</option> |
|
<option value="7">7</option> |
|
<option value="8">8</option> |
|
<option value="9">9</option> |
|
<option value="10">10</option> |
|
<option value="11">11</option> |
|
<option value="12">12</option> |
|
<option value="13">13</option> |
|
<option value="14">14</option> |
|
<option value="15">15</option> |
|
<option value="16">16</option> |
|
<option value="17">17</option> |
|
<option value="18">18</option> |
|
<option value="19">19</option> |
|
<option value="20">20</option> |
|
<option value="21">21</option> |
|
<option value="22">22</option> |
|
<option value="23">23</option> |
|
<option value="24">24</option> |
|
<option value="25">25</option> |
|
<option value="26">26</option> |
|
<option value="27">27</option> |
|
<option value="28">28</option> |
|
<option value="29">29</option> |
|
<option value="30">30</option> |
|
<option value="31">31</option> |
|
</select> |
|
END |
|
$day=~s/(\"$currentday\")/$1 SELECTED/ if length($currentday); |
|
my $year=<<END; |
|
<select name="${name}_year"> |
|
<option value='$defaultyear'> </option> |
|
<option value="1976">1976</option> |
|
<option value="1977">1977</option> |
|
<option value="1978">1978</option> |
|
<option value="1979">1979</option> |
|
<option value="1980">1980</option> |
|
<option value="1981">1981</option> |
|
<option value="1982">1982</option> |
|
<option value="1983">1983</option> |
|
<option value="1984">1984</option> |
|
<option value="1985">1985</option> |
|
<option value="1986">1986</option> |
|
<option value="1987">1987</option> |
|
<option value="1988">1988</option> |
|
<option value="1989">1989</option> |
|
<option value="1990">1990</option> |
|
<option value="1991">1991</option> |
|
<option value="1992">1992</option> |
|
<option value="1993">1993</option> |
|
<option value="1994">1994</option> |
|
<option value="1995">1995</option> |
|
<option value="1996">1996</option> |
|
<option value="1997">1997</option> |
|
<option value="1998">1998</option> |
|
<option value="1999">1999</option> |
|
<option value="2000">2000</option> |
|
<option value="2001">2001</option> |
|
<option value="2002">2002</option> |
|
<option value="2003">2003</option> |
|
<option value="2004">2004</option> |
|
<option value="2005">2005</option> |
|
<option value="2006">2006</option> |
|
<option value="2007">2007</option> |
|
<option value="2008">2008</option> |
|
<option value="2009">2009</option> |
|
<option value="2010">2010</option> |
|
<option value="2011">2011</option> |
|
<option value="2012">2012</option> |
|
<option value="2013">2013</option> |
|
<option value="2014">2014</option> |
|
<option value="2015">2015</option> |
|
<option value="2016">2016</option> |
|
<option value="2017">2017</option> |
|
<option value="2018">2018</option> |
|
<option value="2019">2019</option> |
|
<option value="2020">2020</option> |
|
<option value="2021">2021</option> |
|
<option value="2022">2022</option> |
|
<option value="2023">2023</option> |
|
<option value="2024">2024</option> |
|
<option value="2025">2025</option> |
|
<option value="2026">2026</option> |
|
<option value="2027">2027</option> |
|
<option value="2028">2028</option> |
|
<option value="2029">2029</option> |
|
<option value="2030">2030</option> |
|
<option value="2031">2031</option> |
|
<option value="2032">2032</option> |
|
<option value="2033">2033</option> |
|
<option value="2034">2034</option> |
|
<option value="2035">2035</option> |
|
<option value="2036">2036</option> |
|
<option value="2037">2037</option> |
|
<option value="2038">2038</option> |
|
<option value="2039">2039</option> |
|
<option value="2040">2040</option> |
|
<option value="2041">2041</option> |
|
<option value="2042">2042</option> |
|
<option value="2043">2043</option> |
|
<option value="2044">2044</option> |
|
<option value="2045">2045</option> |
|
<option value="2046">2046</option> |
|
<option value="2047">2047</option> |
|
<option value="2048">2048</option> |
|
<option value="2049">2049</option> |
|
<option value="2050">2050</option> |
|
<option value="2051">2051</option> |
|
</select> |
|
END |
|
$year=~s/(\"$currentyear\")/$1 SELECTED/ if length($currentyear); |
|
return "$month$day$year"; |
|
} |
|
|
sub selectbox { |
sub selectbox { |
my ($title,$name,$value,%options)=@_; |
my ($title,$name,$value,%options)=@_; |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
Line 681 sub selectbox {
|
Line 403 sub selectbox {
|
return $selout.'</select>'; |
return $selout.'</select>'; |
} |
} |
|
|
|
# --------------------------------------------------- Performing a basic search |
|
sub basicsearch { |
|
my ($r,$expression)=@_; |
|
|
|
my $query=$expression; |
|
$query="select * from metadata where concat(title,\" \",author) like '\%$expression\%'"; |
|
# my $reply=&Apache::lonnet::reply("querysend:$query",'msul3'); |
|
my $reply=&Apache::lonnet::metadata_query("querysend:$query",'msul3'); |
|
|
|
my @results; |
|
|
|
my $replyfile=''; |
|
$reply=~/^([\.\w]+)$/; # must do since 'use strict' checks for tainting |
|
$replyfile=$r->dir_config('lonDaemons').'/tmp/'.$1; |
|
$reply=~/(.*?)\_/; |
|
my $hostname=$1; |
|
|
|
{ |
|
while (1) { |
|
last if -e $replyfile; |
|
sleep 1; |
|
} |
|
# QUESTION: how should I handle this error condition.. |
|
# I'm sure there is syntax elsewhere I can use.. |
|
my $fh=Apache::File->new($replyfile) or |
|
($r->print('file cannot be opened') and return OK); |
|
@results=<$fh>; |
|
} |
|
|
|
my $compiledresult=''; |
|
|
|
foreach my $result (@results) { |
|
my ($title,$author,$subject,$url,$keywords,$version, |
|
$notes,$abstract,$mime,$lang, |
|
$creationdate,$lastrevisiondate,$owner,$copyright |
|
)=map {&Apache::lonnet::unescape($_)} (split(/\,/,$result)); |
|
my $shortabstract=$abstract; |
|
$shortabstract=substr($abstract,0,200) if length($abstract)>200; |
|
$compiledresult.=<<END; |
|
<p> |
|
END |
|
$compiledresult.=<<END if $ENV{'form.catalogmode'} eq 'interactive'; |
|
<font size='-1'><INPUT TYPE="button" NAME="returnvalues" VALUE="SELECT" |
|
onClick="javascript:select_data('$title','$url')"> |
|
</font> |
|
<br> |
|
END |
|
$compiledresult.=<<END; |
|
<b>URL: </b> $url<br> |
|
<b>Title:</b> $title<br> |
|
<b>Author(s):</b> $author<br> |
|
<b>Subject:</b> $subject<br> |
|
<b>Keyword(s):</b> $keywords<br> |
|
<b>Notes:</b> $notes<br> |
|
<b>Abstract:</b> $shortabstract<br> |
|
<b>MIME Type:</b> $mimetag{$mime}<br> |
|
<b>Language:</b> $language{$lang}<br> |
|
<b>Creation Date:</b> $creationdate<br> |
|
<b>Last Revision Date:</b> $lastrevisiondate<br> |
|
<b>Publisher/Owner:</b> $owner<br> |
|
<b>Copyright/Distribution:</b> $copyright<br> |
|
<b>Repository Location:</b> $hostname |
|
</p> |
|
END |
|
} |
|
|
|
unless ($compiledresult) { |
|
$compiledresult="There were no results that matched your query"; |
|
} |
|
|
|
# make query information persistent to allow for subsequent revision |
|
my $persistent=''; |
|
map { |
|
if (/^form\./ && !/submit/) { |
|
my $name=$_; |
|
my $key=$name; |
|
$name=~s/^form\.//; |
|
$persistent.=<<END; |
|
<INPUT TYPE='hidden' NAME='$name' VALUE='$ENV{$key}'> |
|
END |
|
} |
|
} (keys %ENV); |
|
|
|
$r->print(<<BEGINNING); |
|
<html> |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
BEGINNING |
|
$r->print(<<SCRIPT) if $ENV{'form.catalogmode'} eq 'interactive'; |
|
<script> |
|
function select_data(title,url) { |
|
changeTitle(title); |
|
changeURL(url); |
|
} |
|
function changeTitle(val) { |
|
if (opener.inf.document.forms.resinfo.elements.t) { |
|
opener.inf.document.forms.resinfo.elements.t.value=val; |
|
} |
|
} |
|
function changeURL(val) { |
|
if (opener.inf.document.forms.resinfo.elements.u) { |
|
opener.inf.document.forms.resinfo.elements.u.value=val; |
|
} |
|
} |
|
</script> |
|
SCRIPT |
|
$r->print(<<RESULTS); |
|
</head> |
|
<body bgcolor="#ffffff"> |
|
<img align=right src=/adm/lonIcons/lonlogos.gif> |
|
<h1>Search Catalog</h1> |
|
<form method="post" action="/adm/searchcat"> |
|
<input type='button' value='Revise search request' |
|
onClick='this.form.submit();'> |
|
<input type='button' value='CLOSE' |
|
onClick='self.close();'> |
|
$persistent |
|
<hr> |
|
<h3>Search Query</h3> |
|
<p> |
|
<b>Basic search:</b> $expression |
|
</p> |
|
<h3>Search Results</h3> |
|
$compiledresult |
|
</body> |
|
</html> |
|
RESULTS |
|
|
|
return OK; |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |