Full ELMS Learning Network documentation
function theme_radio
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 form.inc | theme_radio($variables) |
cle7 form.inc | theme_radio($variables) |
elmsmedia7 form.inc | theme_radio($variables) |
icor7 form.inc | theme_radio($variables) |
meedjum_blog7 form.inc | theme_radio($variables) |
mooc7 form.inc | theme_radio($variables) |
Returns HTML for a radio button form element.
Note: The input "name" attribute needs to be sanitized before output, which is currently done by passing all attributes to drupal_attributes().
Parameters
$variables: An associative array containing:
- element: An associative array containing the properties of the element. Properties used: #required, #return_value, #value, #attributes, #title, #description
Related topics
2 theme calls to theme_radio()
- theme_select_as_radios in sites/
all/ modules/ ulmus/ better_exposed_filters/ better_exposed_filters.theme - Themes a select drop-down as a collection of radio buttons.
- theme_select_as_tree in sites/
all/ modules/ ulmus/ better_exposed_filters/ better_exposed_filters.theme - Themes a taxonomy-based exposed filter as a nested unordered list.
19 string references to the theme hook from theme_radio()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- ajax_pre_render_element in includes/
ajax.inc - Adds Ajax information about an element to communicate with JavaScript.
- ctools_dependent_element_info_alter in sites/
all/ modules/ ulmus/ ctools/ includes/ dependent.inc - CTools alters the element_info to be able to add #process functions to every major form element to make it much more handy to use #dependency, because you don't have to add #process.
- ctools_stylizer_edit_style_form_choose in sites/
all/ modules/ ulmus/ ctools/ includes/ stylizer.inc - Choose which plugin to use to create a new style.
- date_repeat_form_element_radios_process in sites/
all/ modules/ ulmus/ date/ date_repeat/ date_repeat.module - Process function for 'date_repeat_form_element_radios'.
- DrupalWebTestCase::handleForm in modules/
simpletest/ drupal_web_test_case.php - Handle form input related to drupalPost(). Ensure that the specified fields exist and attempt to create POST data in the correct manner for the particular field type.
File
- includes/
form.inc, line 2845 - Functions for form and batch generation and processing.
Code
function theme_radio($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'radio';
element_set_attributes($element, array('id', 'name','#return_value' => 'value'));
if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == $element['#return_value']) {
$element['#attributes']['checked'] = 'checked';
}
_form_set_class($element, array('form-radio'));
return '<input' . drupal_attributes($element['#attributes']) . ' />';
}