function seopress_component_tab($bp_component)
{
    $sp_seo_settings = get_option('seopress_seo_settings_values');
    $is_component = 0;
    $accordion = new TK_WP_JQUERYUI_ACCORDION();
    // If component has directory view
    if ($sp_seo_settings['bp-componentspage-types-' . $bp_component . '-directory'] == 'on') {
        $is_component = 1;
        $accordion->add_section('bp-component-' . $bp_component, sprintf(__('%s Directory', 'seopress'), ucwords(strtolower($bp_component))), sp_type_box('bp-component-' . $bp_component));
    }
    // Getting all active components
    $bp_components = sp_get_bp_components();
    foreach ($bp_components as $sub_comp) {
        // If component creates a page in sub component
        if ($sp_seo_settings['bp-componentspage-types-' . $bp_component . '-' . $sub_comp] == 'on') {
            $is_component = 1;
            $accordion->add_section('bp-component-' . $bp_component . '-' . $sub_comp, sprintf(__('Page in %s', 'seopress'), ucwords(strtolower($sub_comp))), sp_type_box('bp-component-' . $sub_comp . '-' . $bp_component));
        }
    }
    $accordion->add_section('bp-component-config-' . $bp_component . '-' . $sub_comp, sprintf(__('Configurate "%s" plugin', 'seopress'), ucwords(strtolower($bp_component))), seopress_component_config($bp_component), ' class="settings"');
    $html = $accordion->get_html();
    if ($is_component == 0) {
        // return '<div class="seopress-notice"><p>' . sprintf(__('Please config your "%s" plugin before you setup your component meta! (Do this at the bottom of this page)'), str_replace( '_', ' ', ucwords( strtolower( $bp_component ) ) ) ) . '</p></div>';
        return seopress_component_config($bp_component);
    } else {
        return $html;
    }
}
/**
 * Configuration page for wordpress main blog
 *
 * @package SeoPress
 * @author Sven Wagener
 * @copyright Copyright (C) Themekraft
 **/
function sp_admin_wp_tab()
{
    global $seopress_plugin_url;
    $html .= sp_admin_tab_header(__('Wordpress Blog', 'seopress'), __('Setup your title and meta tags of your Wordpress blog.', 'seopress'), $seopress_plugin_url . 'includes/images/logo-wordpress.png');
    $sections = array();
    array_push($sections, array('type' => 'wp-home', 'title' => __('Home', 'seopress'), 'content' => $content, 'extra_title' => ' class="home"'));
    array_push($sections, array('type' => 'wp-post', 'title' => __('Posts', 'seopress'), 'content' => $content, 'extra_title' => ' class="posts"'));
    array_push($sections, array('type' => 'wp-page', 'title' => __('Pages', 'seopress'), 'content' => $content, 'extra_title' => ' class="pages"'));
    array_push($sections, array('type' => 'wp-archive', 'title' => __('Archive', 'seopress'), 'content' => $content));
    array_push($sections, array('type' => 'wp-category', 'title' => __('Categories', 'seopress'), 'content' => $content));
    array_push($sections, array('type' => 'wp-tag', 'title' => __('Tags', 'seopress'), 'content' => $content));
    array_push($sections, array('type' => 'wp-author', 'title' => __('Author', 'seopress'), 'content' => $content));
    array_push($sections, array('type' => 'wp-search', 'title' => __('Search result', 'seopress'), 'content' => $content));
    apply_filters('sp_admin_wp_sections', $sections);
    $accordion = new TK_WP_JQUERYUI_ACCORDION();
    foreach ($sections as $section) {
        $accordion->add_section($section['type'], $section['title'], sp_type_box($section['type']), $section['extra_title']);
    }
    $html .= $accordion->get_html();
    $button = '<p class="submit"><input class="button-primary" type="submit" name="save" value="' . __('Save', 'seopress') . '" /></p>';
    $html .= $button;
    do_action('sp_admin_wp_tab_bottom');
    return $html;
}
function sp_admin_bp_register()
{
    global $bp, $groups;
    $sections = array();
    array_push($sections, array('type' => 'bp-component-registration', 'title' => __('Registration', 'seopress'), 'values' => $content));
    apply_filters('sp_admin_bp_registration_sections', $sections);
    $accordion = new TK_WP_JQUERYUI_ACCORDION();
    foreach ($sections as $section) {
        $accordion->add_section($section['type'], $section['title'], sp_type_box($section['type']));
    }
    $html .= $accordion->get_html();
    do_action('sp_admin_bp_registration_tab_bottom');
    return $html;
}