<?php

    global $fs_page_url;
    $box = $this->last_input;
    ?>
    <form method="post" action="<?php echo $page_url; ?>">
      <?php show_nonce(); ?>
      <input type="hidden" id='tab' name='tab' value='boxes'></input>
      <input type="hidden" id='action' name='action' value='<?php echo ACT_EDIT_BOX; ?>'></input>
      <input type="hidden" id='item' name='item' value='<?php echo $box['item']; ?>'></input>
      
      <table class="form-table">
        <tbody>
        
        <tr>
    			<th valign="top" scope="row"><label for="tag-key"><?php _e('Key'); ?></label></th>
    			<td><input type="text" aria-required="true" size="40" value="<?php echo $box['key'] ?>" id="tag-key" name="key"></input>
    			<p class="description">Keys should be in lowercase and contain only alphabet, numbers and dashes '-'.</p></td>
    		</tr> 
    		
        <tr>
    			<th valign="top" scope="row"><label for="tag-title"><?php _e('Title'); ?></label></th>
    			<td><input type="text" aria-required="true" size="40" value="<?php echo $box['title']; ?>" id="tag-title" name="title"></input>
          </td>
    		</tr> 
    		
        <tr>
    			<th valign="top" scope="row"><label for="tag-description"><?php _e('Description'); ?></label></th>
    			<td><textarea style="width: 50%;" rows="5" id="tag-description" name="description"><?php echo $box['description']; ?></textarea>
    		</tr>    		
    		        
        <tr>
    			<th valign="top" scope="row"><label for="groups"><?php _e('Included groups'); ?></label></th>
    			<td><?php $this->list_groups(is_array($box['groups'])?$box['groups']:0, ''); ?>
    			<p class="description"><?php _e('Select which groups are included in your box'); ?></p></td>
    		</tr>      		

        <tr>
    			<th valign="top" scope="row"><label for="post_types"><?php _e('Supported post types'); ?></label></th>
    			<td><?php $this->list_post_types(is_array($box['post_types'])?$box['post_types']:0, ''); ?>	
    			<p class="description"><?php _e('Select which post types are supported by your box'); ?></p></td>
    		</tr> 
    		    		
        </tbody>
      </table>
      <p><input class="button-primary" type="submit" value="<?php _e('Update Box' ,'fields'); ?>"></input></p>
    </form>
    <?php
    
?>