<?php
    if (!isset($form->name)) {
        $form->name = "";
    }
    if (!isset($form->template)) {
        $form->template = "";
    }
    if (!isset($form->intro)) {
        $form->intro = "";
    }
    $nohtmleditorneeded = true;
?>

<form name="form" method="post" action="../mod/survey/details.php">
<table cellpadding="5">
<tr valign="top">
    <td align="right"><b><?php  print_string("surveyname", "survey") ?>:</b></td>
    <td>
        <input type="text" name="name" size="30" value="<?php p($form->name) ?>" alt="<?php  print_string("surveyname", "survey") ?>" />
    </td>
</tr>
<tr>
    <td align="right"><b><?php print_string("surveytype", "survey") ?>:</b></td>
    <td>
    <?php
        if ($options = get_records_menu("survey", "template", 0, "name", "id, name")) {
            foreach ($options as $id => $name) {
                $options[$id] = get_string($name, "survey");
            }
            choose_from_menu($options, "template", $form->template);
            helpbutton("surveys", get_string("helpsurveys", "survey"));
        } else {
            echo "No surveys to choose from!";
        }
    ?>
    </td>
</tr>
<?php print_standard_coursemodule_settings($form); ?>
</table>
<center>
<input type="hidden" name="intro"   value="<?php p($form->intro) ?>" />
<input type="hidden" name="course"     value="<?php p($form->course) ?>" />
<input type="hidden" name="sesskey"    value="<?php p($form->sesskey) ?>" />
<input type="hidden" name="coursemodule"  value="<?php p($form->coursemodule) ?>" />
<input type="hidden" name="section"       value="<?php p($form->section) ?>" />
<input type="hidden" name="module"     value="<?php p($form->module) ?>" />
<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
<input type="hidden" name="instance"   value="<?php p($form->instance) ?>" />
<input type="hidden" name="mode"       value="<?php p($form->mode) ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
</center>
</form>
