Skip to content

Commit

Permalink
Full XHTML 1.0 compliance. I hope I didn't miss anything.
Browse files Browse the repository at this point in the history
  • Loading branch information
defacer committed Sep 9, 2004
1 parent 67b1b6c commit deaa884
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 74 deletions.
8 changes: 4 additions & 4 deletions calendar/event.php
Expand Up @@ -452,16 +452,16 @@
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);

echo calendar_filter_controls('event', 'action='.$_REQUEST['action'].'&type='.$_REQUEST['type'].'&id='.$_REQUEST['id']);
echo '<p>';
echo '<div>';
echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</p><p>';
echo '</div><div>';
echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</p><p>';
echo '</div><div>';
echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</p>';
echo '</div>';
print_side_block_end();
print_spacer(1, 180);
echo '</td>';
Expand Down
4 changes: 2 additions & 2 deletions calendar/event_edit.html
@@ -1,5 +1,5 @@
<form method="post" action="event.php" name="edit">
<table cellpadding=5>
<table cellpadding="5">
<tr>
<td style="vertical-align: top; text-align: right;">
<?php print_string('eventname', 'calendar'); ?>:
Expand Down Expand Up @@ -59,7 +59,7 @@
</td>
</tr>
<tr>
<td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>"></p></td>
<td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>" /></p></td>
</tr>
</table>
<p>
Expand Down
26 changes: 13 additions & 13 deletions calendar/event_new.html
Expand Up @@ -3,13 +3,13 @@
$course = get_record('course', 'id', ($form->courseid) ? $form->courseid : $site->id);
?>
<form method="post" action="event.php" name="new">
<table cellpadding=5>
<table cellpadding="5">
<tr>
<td style="vertical-align: top; text-align: right;">
<?php print_string('eventname', 'calendar'); ?>:
</td>
<td>
<input type="text" name="name" size="67" value="<?php p($form->name); ?>" />
<input type="text" name="name" size="67" value="<?php p($form->name); ?>" />
<?php if (isset($err['name'])) formerr($err['name']); ?>
</td>
</tr>
Expand All @@ -18,9 +18,9 @@
<?php print_string('eventdescription', 'calendar'); ?>:
</td>
<td>
<?php
<?php
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
if (isset($err['description'])) formerr($err['description']);
if (isset($err['description'])) formerr($err['description']);
?>
</td>
</tr>
Expand All @@ -29,9 +29,9 @@
<?php print_string('eventdate', 'calendar'); ?>:
</td>
<td>
<?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
<?php print_string('eventtime', 'calendar');?>
<?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
<?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
<?php print_string('eventtime', 'calendar');?>
<?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
<?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
</td>
</tr>
Expand All @@ -47,15 +47,15 @@
<div>
<input type="radio" name="duration" value="1" id="duration_yes" <?php if($form->duration == 1) echo 'checked="checked"'; ?>/>
<label for="duration_yes"><?php print_string('durationuntil', 'calendar'); ?></label>
<?php print_date_selector('endday', 'endmon', 'endyr', $form->timestart + $form->timeduration);?>
<?php print_string('eventtime', 'calendar');?>
<?php print_time_selector('endhr', 'endmin', $form->timestart + $form->timeduration) ?>
<?php print_date_selector('endday', 'endmon', 'endyr', $form->timestart + $form->timeduration);?>
<?php print_string('eventtime', 'calendar');?>
<?php print_time_selector('endhr', 'endmin', $form->timestart + $form->timeduration) ?>
<?php if (isset($err['timeduration'])) formerr($err['timeduration']); ?>
</div>
<div>
<input type="radio" name="duration" value="2" id="duration_minutes" <?php if($form->duration == 2) echo 'checked="checked"'; ?>/>
<label for="duration_minutes"><?php print_string('durationminutes', 'calendar'); ?></label>
<input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" />
<input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" />
<?php if (isset($err['minutes'])) formerr($err['minutes']); ?>
</div>
</td>
Expand All @@ -77,15 +77,15 @@
<label for="repeat_yes">
<?php print_string('repeatweeksl', 'calendar'); ?>
</label>
<input type="text" name="repeats" size="2" value="<?php p($form->repeats); ?>" />
<input type="text" name="repeats" size="2" value="<?php p($form->repeats); ?>" />
<?php print_string('repeatweeksr', 'calendar'); ?>
<?php if (isset($err['repeats'])) formerr($err['repeats']); ?>
</div>
</td>
</tr>

<tr>
<td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>"></p></td>
<td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>" /></p></td>
</tr>
</table>
<p>
Expand Down
64 changes: 33 additions & 31 deletions calendar/event_select.html
@@ -1,37 +1,39 @@
<form method="post" action="event.php">
<table class="formtable">
<form method="post" action="event.php">
<p>
<input type="hidden" name="action" value="new" />
<input type="hidden" name="timestart" value="<?php echo $form->timestart; ?>" />
</p>
<tr>
<td style="vertical-align: top; text-align: right;"><?php print_string('eventkind', 'calendar'); ?>:</td>
<td>
<?php if(!empty($allowed->user)) { ?><p><input type='radio' name='type' value='user' id='type_user' checked='checked' /><label for='type_user'><?php print_string('typeuser', 'calendar') ?></label></p>
<?php } ?>
<?php if(!empty($allowed->groups)) { ?><p><input type='radio' name='type' value='group' id='type_group' /><label for='type_group'><?php echo get_string('typegroup', 'calendar').' '.get_string('groupfor'); ?></label>
<select name='groupid'>
<option value=''></option>
<?php foreach($allowed->groups as $group) {?>
<option value='<?php echo $group->id; ?>' <?php if($group->id == $groupid) echo 'selected="selected"';?>><?php echo $group->name; ?></option>
<?php }?>
</select>
<?php } ?>
<?php if(!empty($allowed->courses)) { ?>
<p><input type='radio' name='type' value='course' id='type_course' /><input type="hidden" name="courseid" value="<?php echo($courseid) ?>" /><label for='type_course'><?php print_string('typecourse', 'calendar') ?></label></p>
<?php } ?>
<?php if(!empty($allowed->site)) { ?>
<p><input type='radio' name='type' value='site' id='type_site' /><label for='type_site'><?php print_string('typesite', 'calendar') ?></label></p>
<?php } ?>
</td>
<td style="vertical-align: top; text-align: right;"><?php print_string('eventkind', 'calendar'); ?>:</td>
<td>
<?php if(!empty($allowed->user)) { ?><div><input type='radio' name='type' value='user' id='type_user' checked='checked' /><label for='type_user'><?php print_string('typeuser', 'calendar') ?></label></div>
<?php } ?>
<?php if(!empty($allowed->groups)) { ?><div><input type='radio' name='type' value='group' id='type_group' /><label for='type_group'><?php echo get_string('typegroup', 'calendar').' '.get_string('groupfor'); ?></label>
<select name='groupid'>
<option value=''></option>
<?php foreach($allowed->groups as $group) {?>
<option value='<?php echo $group->id; ?>' <?php if($group->id == $groupid) echo 'selected="selected"';?>><?php echo $group->name; ?></option>
<?php }?>
</select>
</div>
<?php } ?>
<?php if(!empty($allowed->courses)) { ?>
<div><input type='radio' name='type' value='course' id='type_course' /><input type="hidden" name="courseid" value="<?php echo($courseid) ?>" /><label for='type_course'><?php print_string('typecourse', 'calendar') ?></label></div>
<?php } ?>
<?php if(!empty($allowed->site)) { ?>
<div><input type='radio' name='type' value='site' id='type_site' /><label for='type_site'><?php print_string('typesite', 'calendar') ?></label></div>
<?php } ?>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<p><input type="submit" value=" <?php print_string('ok') ?> ">
<input type="button" onclick="document.location.href='view.php?view=upcoming';" value=" <?php print_string('cancel') ?> ">
</p>
</td>
<td>&nbsp;</td>
<td>
<div>
<input type="submit" value=" <?php print_string('ok') ?> " />
<input type="button" onclick="document.location.href='view.php?view=upcoming';" value=" <?php print_string('cancel') ?> " />
</div>
</td>
</tr>
</form>
</table>
<p>
<input type="hidden" name="action" value="new" />
<input type="hidden" name="timestart" value="<?php echo $form->timestart; ?>" />
</p>
</form>
12 changes: 6 additions & 6 deletions calendar/lib.php
Expand Up @@ -223,7 +223,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
else if(isset($typesbyday[$day]['startuser'])) {
$class .= ' cal_event_user';
}
$cell = '<strong><a href="'.$dayhref.'" '.$popup.'">'.$day.'</a></strong>';
$cell = '<strong><a href="'.$dayhref.'" '.$popup.'>'.$day.'</a></strong>';
}
else {
$cell = $day;
Expand Down Expand Up @@ -348,7 +348,7 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
$eventtype = get_string($event->eventtype, $event->modulename);
$icon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';

$output[$outkey]->icon = '<img height=16 width=16 src="'.$icon.'" alt="" title="'.$modulename.'" style="vertical-align: middle;" />';
$output[$outkey]->icon = '<img height="16" width="16" src="'.$icon.'" alt="" title="'.$modulename.'" style="vertical-align: middle;" />';
$output[$outkey]->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';
$output[$outkey]->time = $eventtime;
$output[$outkey]->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$event->courseid.'">'.$coursecache[$event->courseid]->fullname.'</a>';
Expand All @@ -357,28 +357,28 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve


} else if($event->courseid == 1) { // Site event
$output[$outkey]->icon = '<img height=16 width=16 src="'.$CFG->pixpath.'/c/site.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->icon = '<img height="16" width="16" src="'.$CFG->pixpath.'/c/site.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->time = $eventtime;



} else if($event->courseid > 1 and !$event->groupid) { // Course event
calendar_get_course_cached($coursecache, $event->courseid);

$output[$outkey]->icon = '<img height=16 width=16 src="'.$CFG->pixpath.'/c/course.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->icon = '<img height="16" width="16" src="'.$CFG->pixpath.'/c/course.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->time = $eventtime;
$output[$outkey]->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$event->courseid.'">'.$coursecache[$event->courseid]->fullname.'</a>';



} else if ($event->groupid) { // Group event
$output[$outkey]->icon = '<img height=16 width=16 src="'.$CFG->pixpath.'/c/group.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->icon = '<img height="16" width="16" src="'.$CFG->pixpath.'/c/group.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->time = $eventtime;



} else if($event->userid) { // User event
$output[$outkey]->icon = '<img height=16 width=16 src="'.$CFG->pixpath.'/c/user.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->icon = '<img height="16" width="16" src="'.$CFG->pixpath.'/c/user.gif" alt="" style="vertical-align: middle;" />';
$output[$outkey]->time = $eventtime;
}
++$processed;
Expand Down
24 changes: 12 additions & 12 deletions calendar/preferences.html
Expand Up @@ -2,14 +2,14 @@

<table cellpadding="9" cellspacing="0">
<tr valign="top">
<td nowrap="nowrap" align="right"><p><?php print_string('pref_timeformat', 'calendar')?>:</td>
<td nowrap="nowrap" align="right"><?php print_string('pref_timeformat', 'calendar')?>:</td>
<td>
<?php
<?php
$options = NULL;
$options['0'] = get_string('default', 'calendar');
$options[CALENDAR_TF_12] = get_string('timeformat_12', 'calendar');
$options[CALENDAR_TF_24] = get_string('timeformat_24', 'calendar');
choose_from_menu ($options, "timeformat", $prefs->timeformat, "", "", "");
choose_from_menu ($options, "timeformat", $prefs->timeformat, "", "", "");
?>
</td>
<td>
Expand All @@ -18,9 +18,9 @@
</tr>

<tr valign="top">
<td nowrap="nowrap" align="right"><p><?php print_string('pref_startwday', 'calendar')?>:</td>
<td nowrap="nowrap" align="right"><?php print_string('pref_startwday', 'calendar')?>:</td>
<td>
<?php
<?php
$options = NULL;
$options[0] = get_string('sunday', 'calendar');
$options[1] = get_string('monday', 'calendar');
Expand All @@ -38,14 +38,14 @@
</tr>

<tr valign="top">
<td nowrap="nowrap" align="right"><p><?php print_string('pref_maxevents', 'calendar')?>:</td>
<td nowrap="nowrap" align="right"><?php print_string('pref_maxevents', 'calendar')?>:</td>
<td>
<?php
<?php
$options = NULL;
for ($i=1; $i<=20; $i++) {
$options[$i] = $i;
}
choose_from_menu ($options, "maxevents", $prefs->maxevents, "", "", "");
choose_from_menu ($options, "maxevents", $prefs->maxevents, "", "", "");
?>
</td>
<td>
Expand All @@ -54,14 +54,14 @@
</tr>

<tr valign="top">
<td nowrap="nowrap" align="right"><p><?php print_string('pref_lookahead', 'calendar')?>:</td>
<td nowrap="nowrap" align="right"><?php print_string('pref_lookahead', 'calendar')?>:</td>
<td>
<?php
<?php
$options = NULL;
for ($i=1; $i<=200; $i++) {
$options[$i] = $i;
}
choose_from_menu ($options, "lookahead", $prefs->lookahead, "", "", "");
choose_from_menu ($options, "lookahead", $prefs->lookahead, "", "", "");
?>
</td>
<td>
Expand All @@ -71,7 +71,7 @@

<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>"></td>
<input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr>
</table>

Expand Down
12 changes: 6 additions & 6 deletions calendar/view.php
Expand Up @@ -162,16 +162,16 @@
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'cal_d='.$day.'&amp;cal_m='.$mon.'&amp;cal_y='.$yr; // For filtering
echo calendar_filter_controls($_GET['view'], $getvars);
echo '<p>';
echo '<div style="margin: 10px 0px;">';
echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</p><p>';
echo '</div><div style="margin: 10px 0px;">';
echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</p><p>';
echo '</div><div style="margin: 10px 0px;">';
echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</p>';
echo '</div>';
print_side_block_end();
print_spacer(1, 180);
echo '</td>';
Expand Down Expand Up @@ -213,7 +213,7 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
}

print_side_block_start($text, array('class' => 'mycalendar'));
echo '<p>'.calendar_top_controls('day', array('d' => $d, 'm' => $m, 'y' => $y)).'</p>';
echo '<div>'.calendar_top_controls('day', array('d' => $d, 'm' => $m, 'y' => $y)).'</div>';

if (empty($events)) {
// There is nothing to display today.
Expand Down Expand Up @@ -505,7 +505,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
echo "</tr>\n";
}

echo '<tbody></table><br />';
echo '</tbody></table><br />';
print_side_block_end();
}

Expand Down

0 comments on commit deaa884

Please sign in to comment.