2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2006 by Greg Gay & Joel Kronenberg */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
13 // $Id: merlot.php 6614 2006-09-27 19:32:29Z greg $
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 $_custom_css = $_base_path . 'mods/merlot/module.css'; // use a custom stylesheet
18 //$default_results_per_page = 25;
19 $default_results_per_page = 10;
21 $advanced = intval($advanced);
22 $browse = intval($browse);
24 if (!isset($_REQUEST["search_type"])) $_REQUEST["search_type"] = 0;
25 if (!isset($_REQUEST["results_per_page"])) $_REQUEST["results_per_page"] = $default_results_per_page;
27 // check if merlot is configured
28 if(!isset($_config['merlot_key']) || !isset($_config['merlot_location']))
30 $msg->addError('MERLOT_NOT_CONFIG');
32 require (AT_INCLUDE_PATH.'header.inc.php');
34 require(AT_INCLUDE_PATH.'footer.inc.php');
39 // If Merlot is configured, display the simple search form, and results
40 require (AT_INCLUDE_PATH.'header.inc.php');
42 <script type="text/javascript" language="JavaScript" src="<?php echo $_base_path; ?>mods/merlot/merlot.js"></script>
46 if($_REQUEST['advanced']){
47 require (AT_INCLUDE_PATH.'../mods/merlot/merlot_adv.php');
50 <form action="<?php echo $_SERVER['PHP_SELF']; ?>#search_results" method="post" name="form">
51 <div class="input-form">
53 <div style="padding:1em;">
54 <a href="http://www.merlot.org">
55 <img src="<?php echo $_base_path; ?>mods/merlot/merlotlogo.gif" height="53" width="187" style="float:right;text-align:right;border:0;" alt="<?php echo _AT('merlot'); ?>" />
57 <?php echo _AT('merlot_howto'); ?>
62 <input type="radio" name="search_type" value="0" id="allKeyWords" <?php if ($_REQUEST["search_type"] == 0) echo 'checked="checked"'; ?> /><label for="allKeyWords">All Words</label>
63 <input type="radio" name="search_type" value="1" id="anyKeyWords" <?php if ($_REQUEST["search_type"] == 1) echo 'checked="checked"'; ?> /><label for="anyKeyWords">Any Word</label>
64 <input type="radio" name="search_type" value="2" id="exactPhraseKeyWords" <?php if ($_REQUEST["search_type"] == 2) echo 'checked="checked"'; ?> /><label for="exactPhraseKeyWords">Exact Phrase</label>
69 <td width="20%"><label for="words2"><?php echo _AT('keywords'); ?></label></td>
70 <td><input type="text" name="keywords" size="100" id="words2" value="<?php echo $_REQUEST['keywords']; ?>" /></td>
74 <td><label for="title"><?php echo _AT('title'); ?></label></td>
75 <td><input type="text" name="title" size="100" id="title" value="<?php echo $_REQUEST['title']; ?>" /></td>
79 <td><label for="description"><?php echo _AT('description'); ?></label></td>
80 <td><input type="text" name="description" size="100" id="description" value="<?php echo $_REQUEST['description']; ?>" /></td>
84 <td><label for="author"><?php echo _AT('author'); ?></label></td>
85 <td><input type="text" name="author" size="100" id="author" value="<?php echo $_REQUEST['author']; ?>" /></td>
90 <input type="checkbox" name="creativeCommons" value="true" id="creativeCommons" <?php if ($_REQUEST["creativeCommons"] == "true") echo 'checked="checked"'; ?> /><label for="creativeCommons"><?php echo _AT("merlot_creative_commons"); ?></label>
96 <label for="results_per_page"><?php echo _AT('merlot_results_per_page'); ?></label>
97 <select name="results_per_page">
98 <option value="5" <?php if ($_REQUEST["results_per_page"] == 5) echo 'selected="selected"' ?>>5</option>
99 <option value="10" <?php if ($_REQUEST["results_per_page"] == 10) echo 'selected="selected"' ?>>10</option>
100 <option value="15" <?php if ($_REQUEST["results_per_page"] == 15) echo 'selected="selected"' ?>>15</option>
101 <option value="20" <?php if ($_REQUEST["results_per_page"] == 20) echo 'selected="selected"' ?>>20</option>
102 <option value="25" <?php if ($_REQUEST["results_per_page"] == 25) echo 'selected="selected"' ?>>25</option>
109 <div class="row buttons">
110 <input type="submit" name="submit" value="<?php echo _AT('merlot_search'); ?>" />
118 <a href="http://about.merlot.org/wsrs.html"><?php echo _AT('merlot_web_service_agreement'); ?></a>
119 <a href="http://taste.merlot.org/acceptableuserpolicy.html"><?php echo _AT('merlot_user_agreement'); ?></a>
126 if ($_REQUEST['submit'] || isset($_REQUEST['p']))
128 require(AT_INCLUDE_PATH.'../mods/merlot/merlot_rest.php');
133 require(AT_INCLUDE_PATH.'footer.inc.php');