<?php
/** registers the backend functionality */
add_action('admin_menu', 'bibpress_adminmenu');

/** admin menu hook */
function bibpress_adminmenu() {
	add_options_page('Bibpress options', 'Bibpress', 'administrator', 'bibpress@fstoffel.de', 'bibpress_options');
	add_action('admin_init', 'bibpress_register_settings');
}

function bibpress_register_settings() {
	register_setting('bibpress_options_group', 'bibpress_bibtex_file');
}

function bibpress_options() {
?>
	<div class="wrap"><div id="icon-edit-pages" class="icon32"><br></div>
	<h2>Bibpress <?php _e('options') ?></h2><form method="post" action="options.php">
<?php
	settings_fields('bibpress_options_group');
?>
<table class="form-table">
<tr valign="top">
	<th scope="row"><label for="bibpress_bibtex_file"><?php _e('Bibtex source file') ?></label></th>
<td>
<input name="bibpress_bibtex_file" id="bibpress_bibtex_file" value="<?= get_option('bibpress_bibtex_file', '') ?>" class="small-text" type="text" style="width: 200px;"><br/>
<span class="description"><?php _e('The base name of the bibtex source file. The file is expected to be in the <strong>wp-content/bibtex</strong> folder.') ?></span></td></tr>
</td>
</tr>
</table>
<p class="submit"><input name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" type="submit"></p>
</form></div>
<?php
}
?>
