"; $after = ""; $content = "%series"; if($basic_opts['show_series_post_count']) { switch($basic_opts['series_post_count_position']) { case 'before': $content = "(%count) %series"; break; case 'after': // Fall through default: $content = "%series (%count)"; break; } } return $before . $content . $after; } function make_format($show_toc, $show_links, &$options) { $basic_opts =& $options["basic_config"]; $toc = "
%toc
"; $half_links = ""; $full_links = ""; $before = ""; $after = ""; if($show_toc) { switch($basic_opts['toc_position']) { case "bottom": $after .= $toc; break; case "top": // Fall through default: $before = $toc . $before; break; } } switch($basic_opts['link_types']) { case "first_prev_next_last": $links =& $full_links; break; case "prev_next": // Fall through default: $links =& $half_links; break; } if($show_links) { switch($basic_opts['link_position']) { case "top": $before = $links . $before; break; case "both": $before = $links . $before; $after .= $links; break; case "bottom": // Fall through default: $after .= $links; break; } } return $before . "%content" . $after; } function apply_basic_options(&$options) { $basic_opts =& $options['basic_config']; $active =& $options['active_config']; $active['format_first'] = "{$basic_opts['first_link_text']}"; $active['format_first_active'] = ""; $active['format_prev'] = "{$basic_opts['prev_link_text']}"; $active['format_prev_first'] = ""; $active['format_next'] = "{$basic_opts['next_link_text']}"; $active['format_next_last'] = ""; $active['format_last'] = "{$basic_opts['last_link_text']}"; $active['format_last_active'] = ""; $active['format_toc_block'] = "

{$basic_opts['toc_title_text']}

    %entries
"; $active['format_toc_entry'] = "
  • %title
  • "; $active['format_toc_active_entry'] = "
  • %title
  • "; $active['format_post_multi_switch'] = true; $active['format_series_list_block'] = "
    "; $active['format_series_list_entry'] = make_series_list_format($options); $active['meta_links'] = $basic_opts['meta_links']; $active['format_post'] = make_format($basic_opts['show_toc'], $basic_opts['show_links'], $options); $active['format_post_multi'] = make_format( $basic_opts['show_toc'] && strtolower($basic_opts['toc_visibility'] == "all"), $basic_opts['show_links'] && strtolower($basic_opts['link_visibility']) == "all", $options); } if($_POST['in_series']['submit'] || $config_switch) { check_admin_referer($option_key); apply_basic_options($options); update_option("in_series", $options); } $default_show_toc = InSeriesInternal::make_check($basic_opts['show_toc']); $default_toc_visibility_everywhere = InSeriesInternal::make_select($basic_opts['toc_visibility'], "all"); $default_toc_visibility_single = InSeriesInternal::make_select($default_toc_visibility_everywhere && true); $default_toc_location_bottom = InSeriesInternal::make_select($basic_opts['toc_position'], "bottom"); $default_toc_location_top = InSeriesInternal::make_select($default_toc_location_bottom && true); $default_toc_title_text = htmlspecialchars($basic_opts['toc_title_text'], ENT_QUOTES); $default_show_links = InSeriesInternal::make_check($basic_opts['show_links']); $default_links_visibility_single = InSeriesInternal::make_select($basic_opts['link_visibility'], "single"); $default_links_visibility_everywhere = InSeriesInternal::make_select($default_links_visibility_single && true); $default_links_prev_next = InSeriesInternal::make_select($basic_opts['link_types'], "prev_next"); $default_links_first_prev_next_last = InSeriesInternal::make_select($default_links_prev_next && true); $default_link_location_top = InSeriesInternal::make_select($basic_opts['link_position'], "top"); $default_link_location_both = InSeriesInternal::make_select($basic_opts['link_position'], "both"); $default_link_location_bottom = InSeriesInternal::make_select($default_link_location_top || $default_link_location_both); $default_first_link_text = htmlspecialchars($basic_opts['first_link_text'], ENT_QUOTES); $default_prev_link_text = htmlspecialchars($basic_opts['prev_link_text'], ENT_QUOTES); $default_next_link_text = htmlspecialchars($basic_opts['next_link_text'], ENT_QUOTES); $default_last_link_text = htmlspecialchars($basic_opts['last_link_text'], ENT_QUOTES); $default_show_series_post_count = InSeriesInternal::make_check($basic_opts['show_series_post_count']); $default_series_post_count_position_before = InSeriesInternal::make_select($basic_opts['series_post_count_position'], "before"); $default_series_post_count_position_after = InSeriesInternal::make_select($default_series_post_count_position_before && true); $default_meta_links = InSeriesInternal::make_check($basic_opts['meta_links']); $meta_links_label = __("Use <link> tags to cross-link articles.", "in_series"); $meta_links_postlabel = __("(enables browser prefetching)", "in_series"); $first_link_text_label = __("Links to the first post in a series have the following text: ", "in_series"); $prev_link_text_label = __("Links to the previous post in a series have the following text: ", "in_series"); $next_link_text_label = __("Links to the next post in a series have the following text: ", "in_series"); $last_link_text_label = __("Links to the last post in a series have the following text: ", "in_series"); $series_post_count_label = __("I want the number of posts in a series to show up in the series list.", "in_series"); $basic_toc_query = __( "

    .

    ", "in_series"); $basic_links_query = __("

    .

    ", "in_series"); $basic_list_query = __("

    "); $form = " {$basic_toc_query} {$basic_links_query}

    {$basic_list_query}

    {$meta_links_postlabel}

    "; ?>