123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?php
- /**
- * @file
- * The theme include file for the elements module.
- *
- * Contains the theme functions for all the elements module elements.
- */
- /**
- * Returns HTML for an emailfield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #required, #placeholder, #attributes, #autocomplete_path.
- *
- * @ingroup themeable
- */
- function theme_emailfield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'email';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
- _form_set_class($element, array('form-text', 'form-email'));
- $extra = elements_add_autocomplete($element);
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output . $extra;
- }
- /**
- * Returns HTML for a searchfield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #required, #placeholder, #attributes, #autocomplete_path.
- *
- * @ingroup themeable
- */
- function theme_searchfield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'search';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
- _form_set_class($element, array('form-text', 'form-search'));
- $extra = elements_add_autocomplete($element);
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output . $extra;
- }
- /**
- * Returns HTML for a telfield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #required, #placeholder, #attributes.
- *
- * @ingroup themeable
- */
- function theme_telfield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'tel';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
- _form_set_class($element, array('form-text', 'form-tel'));
- $extra = elements_add_autocomplete($element);
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output . $extra;
- }
- /**
- * Returns HTML for an urlfield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #required, #placeholder, #attributes, #autocomplete_path.
- *
- * @ingroup themeable
- */
- function theme_urlfield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'url';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
- _form_set_class($element, array('form-text', 'form-url'));
- $extra = elements_add_autocomplete($element);
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output . $extra;
- }
- /**
- * Returns HTML for a numberfield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #placeholder, #min, #max, #step, #required, #attributes.
- *
- * @ingroup themeable
- */
- function theme_numberfield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'number';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder', 'min', 'max', 'step'));
- _form_set_class($element, array('form-text', 'form-number'));
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output;
- }
- /**
- * Returns HTML for a rangefield form element.
- *
- * @param $variables
- * An associative array containing:
- * - element: An associative array containing the properties of the element.
- * Properties used: #title, #value, #description, #size, #maxlength,
- * #placeholder, #min, #max, #step, #required, #attributes.
- *
- * @ingroup themeable
- */
- function theme_rangefield($variables) {
- $element = $variables['element'];
- $element['#attributes']['type'] = 'range';
- element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder', 'min', 'max', 'step'));
- _form_set_class($element, array('form-text', 'form-range'));
- $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
- return $output;
- }
|