some work on fixing navigation

This commit is contained in:
John Bintz 2009-10-22 07:02:16 -04:00
parent 67b8c4ee6a
commit 0a7f1e39ac
3 changed files with 8 additions and 3 deletions

View File

@ -35,6 +35,10 @@ class ComicPressNavigation {
foreach ($valid as $field) {
$nav["storyline-chapter-${field}"] = $this->_dbi->get_first_comic($this->_storyline->{$field}($category));
}
if ($post->ID != $nav['storyline-chapter-current']->ID) {
$nav['storyline-chapter-previous'] = $nav['storyline-chapter-current'];
}
}
}

View File

@ -83,12 +83,13 @@ class ComicPressStoryline {
return false;
}
function current($id) { return $id; }
function parent($id) { return $this->_get_field('parent', $id); }
function previous($id) { return $this->_get_field('previous', $id); }
function next($id) { return $this->_get_field('next', $id); }
function valid($id) {
if (isset($this->_structure[$id])) {
return array_keys($this->_structure[$id]);
return array_merge(array_keys($this->_structure[$id]), array('current'));
}
return false;
}

View File

@ -77,7 +77,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget {
case 'story_next':
case 'next':
$link = get_permalink($target->ID);
if (($which == 'next') && ($instance['nextgohome'] == 'on')) { $link = get_bloginfo('url'); }
if (($which == 'last') && ($instance['nextgohome'] == 'on')) { $link = get_bloginfo('url'); }
if ($ok) {
?><a href="<?php echo $link; ?>"
class="navi navi-<?php echo $which ; ?>"
@ -301,7 +301,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget {
value="<?php echo attribute_escape($instance['archive_path']); ?>" />
</div>
<?php break;
case "next": ?>
case "last": ?>
<div>
<label>
<input id="<?php echo $this->get_field_id('nextgohome'); ?>"