function theme_views_ui_build_group_filter_form

Theme the build group filter form.

File

includes/admin.inc, line 3693

Code

function theme_views_ui_build_group_filter_form($variables) {
    $form = $variables['form'];
    $more = drupal_render($form['more']);
    $output = drupal_render($form['form_description']);
    $output .= drupal_render($form['expose_button']);
    $output .= drupal_render($form['group_button']);
    if (isset($form['required'])) {
        $output .= drupal_render($form['required']);
    }
    $output .= drupal_render($form['operator']);
    $output .= drupal_render($form['value']);
    $output .= '<div class="views-left-40">';
    $output .= drupal_render($form['optional']);
    $output .= drupal_render($form['remember']);
    $output .= '</div>';
    $output .= '<div class="views-right-60">';
    $output .= drupal_render($form['widget']);
    $output .= drupal_render($form['label']);
    $output .= drupal_render($form['description']);
    $output .= '</div>';
    $header = array(
        t('Default'),
        t('Weight'),
        t('Label'),
        t('Operator'),
        t('Value'),
        t('Operations'),
    );
    $form['default_group'] = form_process_radios($form['default_group']);
    $form['default_group_multiple'] = form_process_checkboxes($form['default_group_multiple']);
    $form['default_group']['All']['#title'] = '';
    drupal_render($form['default_group_multiple']['All']);
    // Don't render.
    $rows[] = array(
        drupal_render($form['default_group']['All']),
        '',
        array(
            'data' => variable_get('views_exposed_filter_any_label', 'new_any') == 'old_any' ? t('&lt;Any&gt;') : t('- Any -'),
            'colspan' => 4,
            'class' => array(
                'class' => 'any-default-radios-row',
            ),
        ),
    );
    foreach (element_children($form['group_items']) as $group_id) {
        $form['group_items'][$group_id]['value']['#title'] = '';
        $data = array(
            'default' => drupal_render($form['default_group'][$group_id]) . drupal_render($form['default_group_multiple'][$group_id]),
            'weight' => drupal_render($form['group_items'][$group_id]['weight']),
            'title' => drupal_render($form['group_items'][$group_id]['title']),
            'operator' => drupal_render($form['group_items'][$group_id]['operator']),
            'value' => drupal_render($form['group_items'][$group_id]['value']),
            'remove' => drupal_render($form['group_items'][$group_id]['remove']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array(
                'attributes' => array(
                    'id' => 'views-remove-link-' . $group_id,
                    'class' => array(
                        'views-hidden',
                        'views-button-remove',
                        'views-groups-remove-link',
                        'views-remove-link',
                    ),
                    'alt' => t('Remove this item'),
                    'title' => t('Remove this item'),
                ),
                'html' => TRUE,
            )),
        );
        $rows[] = array(
            'data' => $data,
            'id' => 'views-row-' . $group_id,
            'class' => array(
                'draggable',
            ),
        );
    }
    $table = theme('table', array(
        'header' => $header,
        'rows' => $rows,
        'attributes' => array(
            'class' => array(
                'views-filter-groups',
            ),
            'id' => 'views-filter-groups',
        ),
    )) . drupal_render($form['add_group']);
    drupal_add_tabledrag('views-filter-groups', 'order', 'sibling', 'weight');
    $render_form = drupal_render_children($form);
    return $output . $render_form . $table . $more;
}