'widget_comicpress_graphical_navigation', 'description' => __('Displays Graphical Navigation Buttons. (used in comic sidebars)','comicpress') ); $this->WP_Widget('graphicalnavigation', __('Comic Navigation','comicpress'), $widget_ops); } function comicpress_display_navigation_link($which, $current, $target, $title, $content = '') { switch ($which) { case 'first': } } /** * Returns true if the combination of target and current post will show or hide this nav link. * Different from whether or not a user explicitly hid this link. * @param string $which The link to test. * @param object $current The currently visible post. * @param object $target The target post to comare to. * @return boolean True if this link should be visible. */ function _will_display_nav_link($which, $current, $target) { switch ($which) { case 'first': case 'last': return ($target->ID != $current->ID); default: return true; } } function comicpress_display_navigation_order($order = array()) { return array( 'first', 'storyline-previous', 'previous', 'archives', 'random', 'comictitle', 'comments', 'buyprint', 'next', 'storynext', 'last' ); } function widget($args, $instance) { global $post; if (is_home() || is_single()) { $storyline = new ComicPressStoryline(); $storyline->create_structure(get_option('comicpress-storyline-category-order')); $dbi = ComicPressDBInterface::get_instance(); $dbi->set_comic_categories($storyline->get_comic_categories()); $navigation = new ComicPressNavigation(); $navigation->init($storyline); $storyline_to_nav_mapping = array( ); $this_permalink = get_permalink(); $temp_query = $wp_query->is_single; $wp_query->is_single = true; $prev_comic = get_previous_comic_permalink(); $next_comic = get_next_comic_permalink(); $wp_query->is_single = $temp_query; $temp_query = null; $first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink(); $prev_story = get_previous_storyline_start_permalink(); $next_story = get_next_storyline_start_permalink(); ?>
'on', 'last' => 'on', 'story_prev' => 'off', 'story_next' => 'off', 'previous' => 'on', 'random' => 'off', 'archives' => 'off', 'comments' => 'off', 'next' => 'on', 'archive_path' => '', 'buyprint' => 'off', 'comictitle' => 'off' ); $title_defaults = array( 'first_title' => __('First', 'comicpress'), 'last_title' => __('Latest', 'comicpress'), 'story_prev_title' => __('Chapter', 'comicpress'), 'story_next_title' => __('Chapter', 'comicpress'), 'previous_title' => __('Previous', 'comicpress'), 'random_title' => __('Random', 'comicpress'), 'archives_title' => __('Archives', 'comicpress'), 'comments_title' => __('Comments', 'comicpress'), 'next_title' => __('Next', 'comicpress'), 'buyprint_title' => __('Buy Print', 'comicpress') ); $instance = wp_parse_args((array)$instance, array_merge($field_defaults, $title_defaults)); foreach (array( 'first' => __('First', 'comicpress'), 'last' => __('Last', 'comicpress'), 'previous' => __('Previous', 'comicpress'), 'next' => __('Next', 'comicpress'), 'story_prev' => __('Previous Chapter', 'comicpress'), 'story_next' => __('Next Chapter', 'comicpress'), 'comictitle' => __('Comic Title', 'comicpress'), 'archives' => __('Archives', 'comicpress'), 'comments' => __('Comments', 'comicpress'), 'random' => __('Random', 'comicpress'), 'buyprint' => __('Buy Print', 'comicpress'), ) as $field => $label) { $title_field = "${field}_title"; ?>