<form method="post" action="event.php" id="eventform">
<table cellpadding="5" cellspacing="0">
  <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); ?>" />
      <?php if (isset($err['name'])) formerr($err['name']); ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventdescription', 'calendar'); ?>:
    </td>
    <td>
      <?php
          print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
          if (isset($err['description'])) formerr($err['description']);
      ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;"><?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 if (isset($err['timestart'])) formerr($err['timestart']); ?>
      <?php 
        // (Shirai186): iCalendar出力を終日イベントに対応させる改良 (2010/04/09)
        // (Shirai186): ここから追加
            if (fs_function_enable('FS_DISABLE_EXTENDEDICALEXPORT')) {
                helpbutton('calendar_allday', get_string('calendarinputalldayevent', 'fs_moodle'), 'fs_moodle', true, false, '', false);
            }
        // (Shirai186): ここまで追加
      ?>
    </td>
  </tr>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventduration', 'calendar'); ?>:
    </td>
    <td>
      <div>
        <input type="radio" name="duration" value="0" id="duration_none" <?php if($form->duration == 0) echo 'checked="checked"'; ?>/>
        <label for="duration_none">
          <?php print_string('durationnone', 'calendar'); ?>
        </label>
      </div>
      <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 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); ?>" />
        <?php if (isset($err['minutes'])) formerr($err['minutes']); ?>
      </div>
    </td>
  </tr>
  <?php if($repeatcount > 1) { ?>
  <tr>
    <td style="vertical-align: top; text-align: right;">
      <?php print_string('eventrepeat', 'calendar'); ?>:
    </td>
    <td>
      <div>
        <input type="radio" name="repeats" value="1" id="edit_all" checked="checked" />
        <label for="edit_all">
          <?php print_string('repeateditall', 'calendar', $repeatcount); ?>
        </label>
      </div>
      <div>
        <input type="radio" name="repeats" value="0" id="edit_this" />
        <label for="edit_this">
          <?php print_string('repeateditthis', 'calendar'); ?>
        </label>
      </div>
    </td>
  </tr>
  <?php } ?>
  <tr>
    <td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>" /></p></td>
  </tr>
</table>
<p>
<input type="hidden" name="id" value="<?php echo $form->id; ?>" />
<input type="hidden" name="courseid" value="<?php echo $form->courseid; ?>" />
<input type="hidden" name="format" value="<?php echo $form->format; ?>" />
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="course" value="<?php p($urlcourse); ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<?php
// (Shirai183): カレンダーの土日と祝日に文字色を付ける改良 (2010/04/01)
	fs_display_declared_eventcolor();
?>
</p>
</form>

