\n";
endif;
if(empty($active_tabs) || empty($output)) return atom_add_debug_message("Tabbed widgets are not configured or missing content in {$args['widget_id']} ({$args['widget_name']}). Widget marked as inactive");
echo $before_widget;
?>
id}\" class=\"arbitrary-widget-list\">\n";
foreach ($ordered_widgets as $w):
// is the current widget checked?
$checked = (in_array($w['id'], $active_tabs));
// checkbox and label
echo "
\n\n
\n";
endforeach;
echo "
\n ";
endif; ?>
$widget_id):
// get the widget instance settings
$options = atom_get_options($wp_registered_widgets[$widget_id]['callback'][0]->option_name);
$options = $options[$wp_registered_widgets[$widget_id]['params'][0]['number']];
// generate css classes, that can be used for styling the tabs with things like icons
$id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base;
if($id_base == 'atom-splitter') continue; // no splitters here
$classes = array();
$classes[] = str_replace('atom-', '', $id_base); // first class (the widget id_base without "atom-")
// add extra classes based on widget options for certain widgets
// this is to allow different styling for widgets of the same type inside the tabs (for eg. recent/popular/random posts)
switch($id_base):
// order + post type if different than "post", + related if checked
case 'posts':
$classes[] = "posts-{$options['order_by']}";
if($options['post_type'] != 'post') $classes[] = "posts-{$options['post_type']}";
if($options['related']) $classes[] = "posts-related";
break;
// menu id
case 'menu':
$classes[] = "posts-{$options['nav_menu']}";
break;
// term taxonomy
case 'tag_cloud':
$classes[] = "tag_cloud-{$options['taxonomy']}";
break;
// term taxonomy
case 'terms':
$classes[] = "terms-{$options['taxonomy']}";
break;
// link category ID
case 'links':
if($options['category']) $classes[] = "links-{$options['category']}";
break;
// archives
case 'archives':
$classes[] = "archives-{$options['type']}";
break;
// blogs, sort order
case 'blogs':
$classes[] = "blogs-{$options['order_by']}";
break;
endswitch;
$matches[$count]['id'] = $widget_id;
$matches[$count]['number'] = $count;
$matches[$count]['name'] = $wp_registered_widgets[$widget_id]['name'];
$matches[$count]['title'] = isset($options['title']) ? $options['title'] : $matches[$count]['name'];
$matches[$count]['class'] = apply_filters('atom_widget_tabs_classes', $classes, $options, $count);
// use first class as slug (needed by the cookie to identify active tab class)
$matches[$count]['slug'] = $id_base;
$count++;
endforeach;
return $matches;
endif;
return array();
}
}