function views_ui_process_container_radios

Custom form radios process function.

Roll out a single radios element to a list of radios, using the options array as index. While doing that, create a container element underneath each option, which contains the settings related to that option.

See also

form_process_radios()

1 string reference to 'views_ui_process_container_radios'
views_handler_argument::options_form in handlers/views_handler_argument.inc
Build the options form.

File

includes/admin.inc, line 2072

Code

function views_ui_process_container_radios($element) {
    if (count($element['#options']) > 0) {
        foreach ($element['#options'] as $key => $choice) {
            $element += array(
                $key => array(),
            );
            // Generate the parents as the autogenerator does, so we will have a
            // unique id for each radio button.
            $parents_for_id = array_merge($element['#parents'], array(
                $key,
            ));
            $element[$key] += array(
                '#type' => 'radio',
                '#title' => $choice,
                // The key is sanitized in drupal_attributes() during output from the
                // theme function.
'#return_value' => $key,
                '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
                '#attributes' => $element['#attributes'],
                '#parents' => $element['#parents'],
                '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)),
                '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL,
            );
            $element[$key . '_options'] = array(
                '#type' => 'container',
                '#attributes' => array(
                    'class' => array(
                        'views-admin-dependent',
                    ),
                ),
            );
        }
    }
    return $element;
}