<?cs include:"super_util.cs" ?>

<?cs def:print_description(desc) ?>
 <?cs if:desc ?><?cs var:desc ?><?cs else ?><?cs var:lang.super_import_course_form.no_description ?><?cs /if ?>
<?cs /def ?>




<?cs def:print_group() ?>
<?cs with:lang=lang.super_import_course_form ?>
 <tr>
  <th align="left"><?cs var:lang.group_label ?></th>
  <td><select name="subdir" id="subdir"  title="<?cs var:lang.select_group_help ?>" >
      <option value="__new__"><?cs var:lang.new_group_selection ?></option>
      <?cs each:this = course_group ?>
      <option value="<?cs var:this.value ?>"><?cs var:this.value ?>(<?cs call:print_description(this.description) ?>)</option>
      <?cs /each ?>
     </select>
  <input type="text" name="new_subdir" id="new_subdir" size="20" maxlength="<?cs var:max_sub ?>" title="<?cs var:lang.new_group_help ?>"  />
  </td>
 </tr>
<?cs /with ?>
<?cs /def ?>





<?cs def:print_file_upload() ?>
<?cs with:lang=lang.super_import_course_form ?>
 <tr>
   <th align="left"><?cs var:lang.tar_file_label ?></th>
   <td><input type="file" name="roster" id="roster" title="<?cs var:lang.tar_file_help?>"  />
   </td>
 </tr>
<?cs /with ?>
<?cs /def ?>





<?cs def:print_type_option() ?>
 <?cs with:lang=lang.super_import_course_form ?>
  <tr>
   <th align="left"><?cs var:lang.course_type_label ?></th>
   <td>
    <select name="type"  title="<?cs var:lang.course_type_help ?>" >
    <option value="0"><?cs var:lang.normal ?></option>
    <option value="1"><?cs var:lang.standalone ?></option>
    <option value="2"><?cs var:lang.template ?></option>
   </select>
  </td>
 </tr> 
<?cs /with ?>
<?cs /def ?>






<?cs def:print_submit_button() ?>
  <tr>
   <td colspan="2" align="center">
   <input type="submit" value="<?cs var:lang.super_import_course_form.submit_button ?>" title="<?cs var:lang.super_import_course_form.submit_button_help ?>" class="super_color_button" />
   </td>
  </tr>
<?cs /def ?>





<?cs def:print_import_form() ?>
 <fieldset>
  <legend><?cs var:lang.super_import_course_form.page_title ?></legend>
   <div><form  method="post" enctype="multipart/form-data" action="super_upload_tar" onsubmit="return check_import()" >
     <div>
       <input type="hidden" name="id" value="<?cs var:Query.id ?>" />
     </div>
    <table cellspacing="0" cellpadding="4">
     <?cs call:print_group() ?>
     <?cs call:print_file_upload() ?>
     <?cs call:print_type_option() ?>
     <?cs call:print_submit_button() ?>
    </table>
    </form>
    <script type="text/javascript"> document.forms[0].roster.focus(); </script>
    </div>
    <div class="instruction">
  <?cs each:this = lang.super_import_course_form.notes ?>
   <h4><?cs var:this.msg ?></h4>
   <?cs each:desc = this.desc ?>
      <div><?cs var:desc ?></div>
      <?cs if:desc.sub_msg.0 ?>
      <ul>
      <?cs each:sub_msg = desc.sub_msg ?>
        <li><?cs var:sub_msg ?></li>
      <?cs /each ?>
     </ul>
     <?cs /if ?>
   <?cs /each ?>
   <br />
  <?cs /each ?>
  </div>

 </fieldset>
<?cs /def ?>






<?cs call:html_header() ?>
   <head>
      <title><?cs var:lang.super_import_course_form.page_title ?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" href="<?cs var:image_path ?>super_template.css" type="text/css"  />
  <script type="text/javascript" src="<?cs var:image_path ?>form_validation.js"></script>
  <script type="text/javascript" src="<?cs var:image_path ?>xp_progress.js"></script>
   <?cs call:addDoIMenu() ?> 
	<script type="text/javascript">
       function check_import()
       {
          var index = document.getElementById('subdir').selectedIndex;
          if(index == 0)
           {
               var new_subdir = document.getElementById('new_subdir').value;
               if(is_whitespace(new_subdir))
               {
                    window.alert("<?cs var:lang.super_import_course_form.create_new_group_must_be_filled ?>");                     return false;
               }
           }
           value = document.getElementById('roster').value;
           if(is_whitespace(value))
           {
                window.alert("<?cs var:lang.super_import_course_form.rosterfile_must_be_filled ?>");
                     return false;
           }
           else
           {
             bar1.showBar();
             scroll(0,0);
             return true;
          }
       }
  </script>
  </head>
<?cs call:define_super_onload_onunload_body() ?>

  <div id="container">
  <?cs call:top_container() ?>
  <?cs call:doIMenu() ?>
  <div id="content">
   <?cs call:print_import_form() ?>
  </div>
</div>
<script type="text/javascript">
     var bar1 = createBar( 'white', 1, 'black', 'blue', 85, 7, 3, "");
</script>

</body>
</html>
<?cs call:runtime() ?>
