MDL-8831 - Forum search boxes date checkboxes loose their checked status. Merged from MOODLE_18_STABLE

This commit is contained in:
poltawski
2007-03-17 23:41:58 +00:00
parent 76a2edc8fd
commit 2c3f3e77a9
+11 -3
View File
@@ -304,10 +304,14 @@ function forum_print_big_search_form($course) {
echo '<tr>';
echo '<td class="c0">'.get_string('searchdatefrom', 'forum').':</td>';
echo '<td class="c1">';
echo '<input name="timefromrestrict" type="checkbox" value="1" alt="'.get_string('searchdatefrom', 'forum').'" onclick="return lockoptions(\'searchform\', \'timefromrestrict\', timefromitems)" /> ';
if (empty($dateto)) {
if (empty($datefrom)) {
$datefromchecked = '';
$datefrom = make_timestamp(2000, 1, 1, 0, 0, 0);
}else{
$datefromchecked = 'checked="checked"';
}
echo '<input name="timefromrestrict" type="checkbox" value="1" alt="'.get_string('searchdatefrom', 'forum').'" onclick="return lockoptions(\'searchform\', \'timefromrestrict\', timefromitems)" '. $datefromchecked . ' /> ';
print_date_selector('fromday', 'frommonth', 'fromyear', $datefrom);
print_time_selector('fromhour', 'fromminute', $datefrom);
@@ -323,10 +327,14 @@ function forum_print_big_search_form($course) {
echo '<tr>';
echo '<td class="c0">'.get_string('searchdateto', 'forum').':</td>';
echo '<td class="c1">';
echo '<input name="timetorestrict" type="checkbox" value="1" alt="'.get_string('searchdateto', 'forum').'" onclick="return lockoptions(\'searchform\', \'timetorestrict\', timetoitems)" /> ';
if (empty($dateto)) {
$datetochecked = '';
$dateto = time()+3600;
}else{
$datetochecked = 'checked="checked"';
}
echo '<input name="timetorestrict" type="checkbox" value="1" alt="'.get_string('searchdateto', 'forum').'" onclick="return lockoptions(\'searchform\', \'timetorestrict\', timetoitems)" ' .$datetochecked. ' /> ';
print_date_selector('today', 'tomonth', 'toyear', $dateto);
print_time_selector('tohour', 'tominute', $dateto);