From 1abd155217a92cff621843b8085f07534f1dbb47 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sat, 4 Jul 2009 12:16:14 -0400 Subject: [PATCH] move options admin page into separate file --- options.php | 7 +------ partials/options-admin.inc | 15 +++++++++++++++ test/OptionsPageTest.php | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 partials/options-admin.inc diff --git a/options.php b/options.php index 554ade3..91b210a 100644 --- a/options.php +++ b/options.php @@ -4,12 +4,7 @@ class ComicPressOptionsAdmin { function render_admin() { $nonce = wp_create_nonce('comicpress'); - echo '
'; - echo '

ComicPress Config

'; - echo '
'; - echo ''; - echo '
'; - echo '
'; + include(dirname(__FILE__) . '/partials/options-admin.inc'); } function get_root_categories() { diff --git a/partials/options-admin.inc b/partials/options-admin.inc new file mode 100644 index 0000000..5e17003 --- /dev/null +++ b/partials/options-admin.inc @@ -0,0 +1,15 @@ +
+

ComicPress Config

+
+ + + + + + +
Master Comic Category + +
+
+
diff --git a/test/OptionsPageTest.php b/test/OptionsPageTest.php index a2c88a9..e6fafef 100644 --- a/test/OptionsPageTest.php +++ b/test/OptionsPageTest.php @@ -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