"; echo $output; } function widget_series_list_register() { $id = ""; // #, if we want to do more than 1 in the future. $name = __("Series List{$id}"); register_sidebar_widget($name, array("InSeriesWidgets", 'widget_series_list'), "is_series_list", 0 /* $id */); register_widget_control($name, array("InSeriesWidgets", 'widget_series_list_control'), 460, 350, 0 /* $id */); } /**************************************************************************\ * Table of Contents * \**************************************************************************/ function widget_series_toc($args, $classname, $index) { $options = get_option('in_series'); $options = $options['series_toc_widget'][$index]; $format = array(); // $format['format_series_list_entry'] = ; $format['format_toc_block'] = "
    %entries
"; $toc = InSeriesInternal::ToCHtml($format); $output = $args['before_widget']; if(!empty($toc) && is_single()) { $output .= $args['before_title'] . $options['title'] . $args['after_title']; $output .= $toc; } else { $output .= " "; } $output .= $args['after_widget']; echo $output; } function widget_series_toc_control($index) { $all_options = get_option('in_series'); if(!is_array($all_options['series_toc_widget'])) { $all_options['series_toc_widget'] = array(); } if(!is_array($all_options['series_toc_widget'][$index])) { $all_options['series_toc_widget'][$index] = array(); $all_options['series_toc_widget'][$index]['title'] = __("Table of Contents: ", "in_series"); update_option("in_series", $all_options); } $options =& $all_options['series_toc_widget'][$index]; if(isset($_POST["series-toc-submit-$index"])) { $options['title'] = $_POST["series-toc-title-$index"]; update_option('in_series', $all_options); } $default_title = htmlspecialchars($options['title']); $title_label = __("Widget title: ", "in_series"); $output = "

"; echo $output; } function widget_series_toc_register() { $id = ""; // #, if we want to do more than 1 in the future. $name = __("Series Table of Contents{$id}", "in_series"); register_sidebar_widget($name, array("InSeriesWidgets", 'widget_series_toc'), "is_series_toc", 0 /* $id */); register_widget_control($name, array("InSeriesWidgets", 'widget_series_toc_control'), 460, 350, 0 /* $id */); } } InSeriesWidgets::widget_series_list_register(); InSeriesWidgets::widget_series_toc_register(); ?>