Helper function to construct link options for tab links.

1 call to _quicktabs_construct_link_options()
_quicktabs_build_tablinks dans ./quicktabs.module

Fichier

./quicktabs.module, line 575

Code

function _quicktabs_construct_link_options($quicktab, $tabkey) {
    $qt_name = $quicktab->machine_name;
    $ajax = $quicktab->ajax;
    $tab = $quicktab->tabs[$tabkey];
    $id = 'quicktabs-tab-' . implode('-', array(
        $qt_name,
        $tabkey,
    ));
    // Need to construct the correct querystring for the tab links.
    $query = drupal_get_query_parameters(NULL, array(
        "quicktabs_{$qt_name}",
        'q',
        'page',
    ));
    $query["quicktabs_{$qt_name}"] = $tabkey;
    $class = array();
    if ($ajax) {
        $class[] = 'qt_ajax_tab';
    }
    else {
        $class[] = 'qt_tab';
    }
    $link_options = array(
        'attributes' => array(
            'id' => $id,
            'class' => $class,
        ),
        'query' => $query,
        'fragment' => 'quicktabs-' . $qt_name,
    );
    return $link_options;
}