drupal_attributes

Versions
mediamosa-21
drupal_attributes(array $attributes = array())

Format an attribute string to insert in a tag.

Each array key and its value will be formatted into an HTML attribute string. If a value is itself an array, then each array element is concatenated with a space between each value (e.g. a multi-value class attribute).

Parameters

$attributes An associative array of HTML attributes.

Return value

An HTML string ready for insertion in a tag.

▾ 35 functions call drupal_attributes()

format_xml_elements in includes/common.inc
Format XML elements.
l in includes/common.inc
Format an internal Drupal link.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.
template_preprocess_user_profile_category in modules/user/user.pages.inc
Process variables for user-profile-category.tpl.php.
template_preprocess_user_profile_item in modules/user/user.pages.inc
Process variables for user-profile-item.tpl.php.
template_process in includes/theme.inc
A default process function used to alter variables as late as possible.
template_process_field in modules/field/field.module
Theme process function for theme_field() and field.tpl.php.
theme_button in includes/form.inc
Theme a button form element.
theme_checkbox in includes/form.inc
Theme a checkbox form element.
theme_container in includes/form.inc
Adds a container for grouped items.
theme_devel_querylog_row in sites/all/modules/devel/devel.module
theme_fieldset in includes/form.inc
Theme a fieldset form element.
theme_file in includes/form.inc
Theme a file upload form element.
theme_form in includes/form.inc
Theme a form.
theme_form_element_label in includes/form.inc
Theme a form element label and required marker.
theme_form_required_marker in includes/form.inc
Theme the marker for required form elements.
theme_hidden in includes/form.inc
Theme a hidden form element.
theme_html_tag in includes/theme.inc
Generate the output for a generic HTML tag with attributes.
theme_image in includes/theme.inc
Return a themed image.
theme_image_button in includes/form.inc
Theme a image button form element.
theme_item_list in includes/theme.inc
Return a themed list of items.
theme_link in includes/theme.inc
Return a themed link.
theme_links in includes/theme.inc
Return a themed set of links.
theme_menu_link in includes/menu.inc
Generate the HTML output for a menu link and submenu.
theme_password in includes/form.inc
Theme a password form element.
theme_radio in includes/form.inc
Theme a radio button form element.
theme_rdf_metadata in modules/rdf/rdf.module
Outputs a series of empty spans for exporting RDF metadata in RDFa.
theme_rdf_template_variable_wrapper in modules/rdf/rdf.module
Wraps a template variable in an HTML element with the desired attributes.
theme_select in includes/form.inc
Theme select form element.
theme_table in includes/theme.inc
Return a themed table.
theme_textarea in includes/form.inc
Theme a textarea form element.
theme_textfield in includes/form.inc
Theme a textfield form element.
theme_toolbar_toggle in modules/toolbar/toolbar.module
Formats an element used to toggle the toolbar drawer's visibility.
theme_username in includes/theme.inc
Format a username.
_theme_table_cell in includes/theme.inc

Code

includes/common.inc, line 2119

<?php
function drupal_attributes(array $attributes = array()) {
  foreach ($attributes as $attribute => &$data) {
    if (is_array($data)) {
      $data = implode(' ', $data);
    }
    $data = $attribute . '="' . check_plain($data) . '"';
  }
  return $attributes ? ' ' . implode(' ', $attributes) : '';
}
?>