move options admin page into separate file

This commit is contained in:
John Bintz 2009-07-04 12:16:14 -04:00
parent bc964971f7
commit 1abd155217
3 changed files with 17 additions and 7 deletions

View File

@ -4,12 +4,7 @@ class ComicPressOptionsAdmin {
function render_admin() {
$nonce = wp_create_nonce('comicpress');
echo '<div class="wrap">';
echo '<h2>ComicPress Config</h2>';
echo '<form method="post">';
echo '<input type="hidden" name="cp[_nonce]" value="' . $nonce . '" />';
echo '</form>';
echo '</div>';
include(dirname(__FILE__) . '/partials/options-admin.inc');
}
function get_root_categories() {

View File

@ -0,0 +1,15 @@
<div class="wrap">
<h2>ComicPress Config</h2>
<form method="post">
<input type="hidden" name="cp[_nonce]" value="<?php echo $nonce ?>" />
<table>
<tr>
<th scope="row">Master Comic Category</th>
<td>
<select name="cp[comiccat]">
</select>
</td>
</tr>
</table>
</form>
</div>

View File

@ -16,7 +16,7 @@ class OptionsPageTest extends PHPUnit_Framework_TestCase {
ob_start();
$this->admin->render_admin();
$source = ob_get_clean();
$this->assertTrue(($xml = _to_xml($source)) !== false);
foreach (array(
'//input[@name="cp[_nonce]" and @value="' . $nonce . '"]' => true