You are here

function theme_urlfield in Elements 7

Same name and namespace in other branches
  1. 6 elements.theme.inc \theme_urlfield()

Returns HTML for an urlfield form element.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes, #autocomplete_path.
1 theme call to theme_urlfield()
elements_element_info in ./elements.module
Implements hook_element_info().

File

./elements.theme.inc, line 90
The theme include file for the elements module.

Code

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;
}