Merge github.com:johnbintz/comicpress-2.8

This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-25 11:05:57 -08:00
commit 6a44dea720
4 changed files with 10 additions and 29 deletions

View File

@ -2,12 +2,12 @@
require_once('PHPUnit/Framework.php');
require_once('MockPress/mockpress.php');
require_once(dirname(__FILE__) . '/../../widgets/BuyThisPrintWidget.inc');
require_once(dirname(__FILE__) . '/../../widgets/BuyPrintWidget.inc');
class BuyThisPrintWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
$this->w = new BuyThisPrintWidget('id', 'name', array());
$this->w = new ComicPressBuyPrintWidget('id', 'name', array());
}
function providerTestUpdate() {

View File

@ -7,7 +7,7 @@ require_once(dirname(__FILE__) . '/../../widgets/CalendarWidget.inc');
class CalendarWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
$this->w = new CalendarWidget('id', 'name', array());
$this->w = new ComicPressCalendarWidget('id', 'name', array());
}
function providerTestUpdate() {

View File

@ -7,7 +7,7 @@ require_once(dirname(__FILE__) . '/../../widgets/GraphicalNavigationWidget.inc')
class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
$this->w = new GraphicalNavigationWidget();
$this->w = new ComicPressGraphicalNavigationWidget();
}
function testUpdateWidget() {
@ -120,7 +120,7 @@ class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
$post = 'post';
$css = $this->getMock('GraphicalNavigationWidget', array('_new_comicpress_storyline', '_new_comicpress_navigation'));
$css = $this->getMock('ComicPressGraphicalNavigationWidget', array('_new_comicpress_storyline', '_new_comicpress_navigation'));
update_option('comicpress-storyline-category-order', 'test');

View File

@ -303,10 +303,8 @@ class ComicPressGraphicalNavigationWidget extends WP_Widget {
}
function comicpress_set_up_post_nav($post_nav, $instance) {
if ($instance['story_prev_acts_as_prev_in'] == 'on') {
if ($post_nav['storyline-previous'] !== false) {
$post_nav['storyline-chapter-previous'] = $post_nav['storyline-previous'];
}
if ($post_nav['storyline-previous'] !== false) {
$post_nav['storyline-chapter-previous'] = $post_nav['storyline-previous'];
}
return array($post_nav, $instance);
}
@ -322,8 +320,7 @@ class ComicPressGraphicalNavigationWidget extends WP_Widget {
$all_fields = array(
'first', 'story_prev', 'story_next', 'story_prev_in',
'story_next_in', 'previous', 'random', 'archives',
'comments', 'next', 'last', 'buyprint', 'comictitle', 'lastgohome',
'story_prev_acts_as_prev_in'
'comments', 'next', 'last', 'buyprint', 'comictitle', 'lastgohome'
);
foreach ($all_fields as $field) {
@ -354,8 +351,7 @@ class ComicPressGraphicalNavigationWidget extends WP_Widget {
'archive_path' => '',
'buyprint' => 'off',
'comictitle' => 'off',
'lastgohome' => 'off',
'story_prev_acts_as_prev_in' => 'on'
'lastgohome' => 'off'
);
$title_defaults = array(
@ -431,21 +427,6 @@ class ComicPressGraphicalNavigationWidget extends WP_Widget {
</label>
</div>
<?php break;
case "story_prev": ?>
<div>
<label>
<input id="<?php echo $this->get_field_id('story_prev_acts_as_prev_in'); ?>"
name="<?php echo $this->get_field_name('story_prev_acts_as_prev_in'); ?>"
type="checkbox" class="comicpress-field" value="yes"<?php if ($instance['story_prev_acts_as_prev_in'] == "on") { echo ' checked="checked"'; } ?> />
<strong><?php _e('Enable go to start of chapter category.', 'comicpress'); ?></strong>
<p>
<em>
<?php _e('If the current post is not at the start of a chapter, the button will bring you back to the beginning of the chapter before going to a previous chapter.', 'comicpress') ?>
</em>
</p>
</label>
</div>
<?php break;
}
?>
</div>