WP Navigation Tool (NAVT) Plugin for operation. Up to five NAVT sidebar widgets are available for use in your theme. Author: Greg A. Bellucci Version: 95.37 - integrated Author URI: http://www.gbellucci.us */ define('NAVT_INSTANCES', 5); // this seems like enough... define('NAVT_WIDGET_OPTIONS', 'widget_navt'); define('NAVT_GRPIDX', 'group'); define('NAVT_TTLIDX', 'title'); /** * NAVT Widget Init * */ function navt_widget_init() { // Check for the required API functions /* @since 95.35 */ if ( function_exists('wp_register_sidebar_widget') && function_exists('wp_register_widget_control') ) { /* @since 95.35 */ $dims = array('width' => 310, 'height' => 165); $class = array('classname' => 'widget_navt'); for ($i = 1; $i <= NAVT_INSTANCES; $i++) { $name = sprintf(__('NAVT Widget %d'), $i); $id = "navt-$i"; wp_register_sidebar_widget($id, $name, 'navt_widget', $class, $i); wp_register_widget_control($id, $name, 'navt_widget_control', $dims, $i); } $options = get_option(NAVT_WIDGET_OPTIONS); if(empty($options)) { for( $instance = 1; $instance <= NAVT_INSTANCES; $instance++ ) { $options[$instance][NAVT_TTLIDX] = $options[$instance][NAVT_GRPIDX] = '';} add_option(NAVT_WIDGET_OPTIONS, $options, 'NAVT Widget settings'); } } } // Wait for the sidebar widget plugin to load add_action('widgets_init', 'navt_widget_init'); // -------------- /** * Widget * * @param array $args - display classes/arrgs * @param integer $number - widget instance */ function navt_widget($args, $instance = 1) { extract($args); $options = get_option(NAVT_WIDGET_OPTIONS); if( function_exists('navt_getlist') ) { $widget_title = htmlspecialchars($options[$instance][NAVT_TTLIDX], ENT_QUOTES); $group = $options[$instance][NAVT_GRPIDX]; if ( !empty($widget_title) ) {$title = $before_title . $widget_title . $after_title;} else $title = ''; echo $before_widget; echo $title; navt_getlist($group); echo $after_widget; } } /** * Widget control * * @param integer $number - instance of the widget */ function navt_widget_control($instance = 1) { $grps = array(); $navt_submit = 'navt-submit-'.$instance; $navt_title = 'navt-title-'.$instance; $navt_group = 'navt-group-'.$instance; if( !function_exists('navt_getlist') ) { ?>

The primary NAVT Plugin is not activated/installed.

0 ) { $ddlist = sprintf("\n"); ?>