Same name in other branches
  1. 7.x-2.x includes/admin.inc \theme_quicktabs_style_options()

Theme function for quicktabs style radio options.

1 theme call to theme_quicktabs_style_options()
quicktabs_tabstyles_styles dans quicktabs_tabstyles/quicktabs_tabstyles.module
Callback function for admin/structure/quicktabs/styles. The style chooser form.

Fichier

quicktabs_tabstyles/quicktabs_tabstyles.module, line 71

Code

function theme_quicktabs_style_options($variables) {
    $style_element = $variables['quicktabs_tabstyle'];
    $markup = '';
    $tabs = array(
        array(
            'title' => t('One'),
            'contents' => array(
                '#markup' => t('First tab'),
            ),
            'weight' => 0,
        ),
        array(
            'title' => t('Two'),
            'contents' => array(
                '#markup' => t('Second tab'),
            ),
            'weight' => 1,
        ),
        array(
            'title' => t('Three'),
            'contents' => array(
                '#markup' => t('Third tab'),
            ),
            'weight' => 2,
        ),
    );
    $options = array(
        'renderer' => 'quicktabs',
        'hide_empty_tabs' => 0,
        'ajax' => 0,
    );
    // Preview for each style.
    foreach (element_children($style_element) as $style) {
        $element = $style_element[$style];
        $options['style'] = $style;
        $quicktabs = quicktabs_build_quicktabs(drupal_strtolower($style), $options, $tabs);
        $preview = '<div class="quicktabs-preview">' . drupal_render($quicktabs['content']) . '</div>';
        $element['#description'] = t('%style preview', array(
            '%style' => $element['#title'],
        )) . ':<br />' . $preview;
        $markup .= drupal_render($element);
    }
    $build = array(
        'style' => array(
            '#markup' => $markup,
        ),
        '#attached' => array(
            'css' => array(
                drupal_get_path('module', 'quicktabs_tabstyles') . '/css/quicktabs-tabstyles-admin.css',
            ),
        ),
    );
    return drupal_render($build);
}