<form method="post" action="site.php" name="form">
<table cellpadding="9" cellspacing="0" >
<tr valign="top">
    <td align="right"><?php print_string("fullsitename") ?>:</td>
    <td><input type="text" name="fullname" size="50" maxlength="254" value="<?php p($form->fullname) ?>" alt="<?php print_string("fullsitename") ?>" />
    <?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("shortsitename") ?>:</td>
    <td><input type="text" name="shortname" size="15" maxlength="15" value="<?php p($form->shortname) ?>" alt="<?php print_string("shortsitename") ?>" />
    <?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("frontpagedescription") ?>:<br /><br />
     <?PHP
        helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
        echo "<br />";
        if ($usehtmleditor) {
           helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
        } else {
           helpbutton("html", get_string("helphtml"), "moodle", true, true);
        }
        echo "<br />";
      ?>
    </td>
    <td><?php  print_textarea($usehtmleditor, 20, 50, 600, 400, "summary", $form->summary); ?></td>
</tr>
<tr valign="top">
        <td align="right"><?php print_string("frontpageformat") ?>:</td>
        <td>
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
        <?php
           $coursecount = (count_records('course') <= FRONTPAGECOURSELIMIT);
           $options = array(FRONTPAGENEWS           =>  get_string("frontpagenews"),
                            FRONTPAGECOURSELIST     =>  get_string("frontpagecourselist"),
                            FRONTPAGECATEGORYNAMES  =>  get_string("frontpagecategorynames"),
                            FRONTPAGECATEGORYCOMBO  =>  get_string("frontpagecategorycombo"),
                            );
           $values = array(get_string('hide'), get_string('order1', 'admin'), get_string('order2', 'admin'), get_string('order3', 'admin'), get_string('order4', 'admin'));
           $seq = array_flip(explode(',',$form->frontpage));
           foreach ($seq as $k => $s) {
               $seq[$k]++;
           }
           if (!$coursecount and isset($seq[FRONTPAGECOURSELIST])) {
               unset($seq[FRONTPAGECOURSELIST]); //disable course list option when too many course present
           }

           foreach ($options as $key => $option) {
               $disabled = (!$coursecount and ($key == FRONTPAGECOURSELIST));
               echo "<td>$option<br />";
               choose_from_menu ($values, "frontpage[$key]", isset($seq[$key])?$seq[$key]:0, '', '', 0, false, $disabled);
               echo '</td>';
           }
        ?>
            </tr>
          </table>
        </td>
</tr>
<tr valign="top">
        <td align="right"><?php print_string("frontpageformatloggedin") ?>:</td>
        <td>
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
        <?php
           $seq = array_flip(explode(',',$form->frontpageloggedin));
           foreach ($seq as $k => $s) {
               $seq[$k]++;
           }

           foreach ($options as $key => $option) {
               echo "<td>$option<br />";
               choose_from_menu ($values, "frontpageloggedin[$key]", isset($seq[$key])?$seq[$key]:0, '');
               echo '</td>';
           }
        ?>
            </tr>
          </table>
        </td>
</tr>
<tr valign="top">
    <td align="right"><?php  print_string("sitesection") ?>:</td>
    <td><?php
    unset($choices);
    $choices["0"] = get_string("no");
    $choices["1"] = get_string("yes");
    choose_from_menu ($choices, "numsections", $form->numsections, "");
    ?>
    </td>
</tr>
<tr valign="top">
        <td align="right"><?php print_string("newsitemsnumber") ?>:</td>
        <td><?php
           $newsitem  = get_string("newsitem");
           $newsitems = get_string("newsitems");
           $options = array("0"  =>  "0 $newsitems",
                            "1"  =>  "1 $newsitem",
                            "2"  =>  "2 $newsitems",
                            "3"  =>  "3 $newsitems",
                            "4"  =>  "4 $newsitems",
                            "5"  =>  "5 $newsitems",
                            "6"  =>  "6 $newsitems",
                            "7"  =>  "7 $newsitems",
                            "8"  =>  "8 $newsitems",
                            "9"  =>  "9 $newsitems",
                            "10" => "10 $newsitems");
           choose_from_menu ($options, "newsitems", "$form->newsitems", "");
        ?>
        </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("wordforteacher") ?>:</td>
    <td><input type="text" name="teacher" maxlength="100" size="25" value="<?php p($form->teacher) ?>" alt="<?php print_string("wordforteacher") ?>" />
    (<?php print_string("wordforteachereg") ?>)
    <?php if (isset($err["teacher"])) formerr($err["teacher"]); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("wordforteachers") ?>:</td>
    <td><input type="text" name="teachers" maxlength="100" size="25" value="<?php p($form->teachers) ?>" alt="<?php print_string("wordforteachers") ?>" />
    (<?php print_string("wordforteacherseg") ?>)
    <?php if (isset($err["teachers"])) formerr($err["teachers"]); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("wordforstudent") ?>:</td>
    <td><input type="text" name="student" maxlength="100" size="25" value="<?php p($form->student) ?>" alt="<?php print_string("wordforstudent") ?>" />
    (<?php print_string("wordforstudenteg") ?>)
    <?php if (isset($err["student"])) formerr($err["student"]); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right"><?php print_string("wordforstudents") ?>:</td>
    <td><input type="text" name="students" maxlength="100" size="25" value="<?php p($form->students) ?>" alt="<?php print_string("wordforstudents") ?>" />
    (<?php print_string("wordforstudentseg") ?>)
    <?php if (isset($err["students"])) formerr($err["students"]); ?>
    </td>
</tr>
<tr>
    <td></td>
    <td><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php p($form->id) ?>" />
<input type="hidden" name="category" value="<?php p($form->category) ?>" />
<input type="hidden" name="format" value="<?php p($form->format) ?>" />
<input type="hidden" name="sesskey" value="<?php p($sesskey) ?>" />
</form>
