<?php
// Optionen-Seite erstellen
function wowpress_api_options_page() {
global $select_options, $radio_options;
if ( ! isset( $_REQUEST['settings-updated'] ) )
	$_REQUEST['settings-updated'] = false; ?>

<div class="wrap"> 
<h2>API-Optionen für <?php bloginfo('name'); ?></h2> 

<?php if ( false !== $_REQUEST['settings-updated'] ) : ?> 
<div class="updated fade">
	<p><strong>Einstellungen gespeichert!</strong></p>
</div>
<?php endif; ?>

  <form method="post" action="options.php">
	<?php settings_fields( 'wowpress_options' ); ?>
    <?php $options = get_option( 'wowpress_api' ); ?>

    <h3>Battle.net</h3>
    <table class="form-table">
      <tr valign="top">
        <th scope="row">BattleNet - Identifier</th>
        <td><input id="wowpress_api[bnet][id]" class="regular-text" type="text" name="wowpress_api[bnet][id]" value="<?php esc_attr_e( $options['bnet']['id'] ); ?>" /></td>
      </tr>  
      <tr valign="top">
        <th scope="row">BattleNet - Key</th>
        <td><input id="wowpress_api[bnet][key]" class="regular-text" type="text" name="wowpress_api[bnet][key]" value="<?php esc_attr_e( $options['bnet']['key'] ); ?>" /></td>
      </tr>
    </table>

    <h3>WoWaudit</h3>
    <table class="form-table"> 
      <tr valign="top">
        <th scope="row">WoWAudit - Key</th>
        <td><input id="wowpress_api[wowaudit][key]" class="regular-text" type="text" name="wowpress_api[wowaudit][key]" value="<?php esc_attr_e( $options['wowaudit']['key'] ); ?>" /></td>
      </tr>
    </table>
    
    <!-- submit -->
    <p class="submit"><input type="submit" class="button-primary" value="Einstellungen speichern" /></p>
  </form>
</div>
<?php }

