You are here

function taxonomy_image_parse_tags in Taxonomy Image 6

Same name and namespace in other branches
  1. 5 taxonomy_image.module \taxonomy_image_parse_tags()
1 call to taxonomy_image_parse_tags()
taxonomy_image_display in ./taxonomy_image.module
Function to display the image associated with the given term id. An html <img> tag will be returned if an image is found. The link format can be modified with the tags parameter.

File

./taxonomy_image.module, line 169
taxonomy_image.module Simple module for providing an association between taxonomy terms and images. Written by Jeremy Andrews <jeremy@kerneltrap.org>, May 2004.

Code

function taxonomy_image_parse_tags($tags) {
  $attrs = array();
  $arr = explode(' ', $tags);
  foreach ($arr as $tag) {
    if (!empty($tag)) {

      // Ignore extra blanks.
      $key_len = strpos($tag, '=');
      $attrs[drupal_substr($tag, 0, $key_len)] = trim(drupal_substr($tag, $key_len + 1), '\'"');
    }
  }
  return $attrs;
}