some work on fixing navigation
This commit is contained in:
parent
67b8c4ee6a
commit
0a7f1e39ac
|
@ -35,6 +35,10 @@ class ComicPressNavigation {
|
||||||
foreach ($valid as $field) {
|
foreach ($valid as $field) {
|
||||||
$nav["storyline-chapter-${field}"] = $this->_dbi->get_first_comic($this->_storyline->{$field}($category));
|
$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'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,12 +83,13 @@ class ComicPressStoryline {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function current($id) { return $id; }
|
||||||
function parent($id) { return $this->_get_field('parent', $id); }
|
function parent($id) { return $this->_get_field('parent', $id); }
|
||||||
function previous($id) { return $this->_get_field('previous', $id); }
|
function previous($id) { return $this->_get_field('previous', $id); }
|
||||||
function next($id) { return $this->_get_field('next', $id); }
|
function next($id) { return $this->_get_field('next', $id); }
|
||||||
function valid($id) {
|
function valid($id) {
|
||||||
if (isset($this->_structure[$id])) {
|
if (isset($this->_structure[$id])) {
|
||||||
return array_keys($this->_structure[$id]);
|
return array_merge(array_keys($this->_structure[$id]), array('current'));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget {
|
||||||
case 'story_next':
|
case 'story_next':
|
||||||
case 'next':
|
case 'next':
|
||||||
$link = get_permalink($target->ID);
|
$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) {
|
if ($ok) {
|
||||||
?><a href="<?php echo $link; ?>"
|
?><a href="<?php echo $link; ?>"
|
||||||
class="navi navi-<?php echo $which ; ?>"
|
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']); ?>" />
|
value="<?php echo attribute_escape($instance['archive_path']); ?>" />
|
||||||
</div>
|
</div>
|
||||||
<?php break;
|
<?php break;
|
||||||
case "next": ?>
|
case "last": ?>
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<input id="<?php echo $this->get_field_id('nextgohome'); ?>"
|
<input id="<?php echo $this->get_field_id('nextgohome'); ?>"
|
||||||
|
|
Loading…
Reference in New Issue