You are here

function asset_search_element_data in Asset 6

Same name and namespace in other branches
  1. 5.2 contrib/asset_search/asset_search.parser.inc \asset_search_element_data()

Call-back function used by the XML parser.

1 string reference to 'asset_search_element_data'
asset_search_parse_feed in contrib/asset_search/asset_search.parser.inc
Parse an rss feed and return an array of items Taken from aggregator_parse_feed

File

contrib/asset_search/asset_search.parser.inc, line 234
Include file to parse RSS feeds into an array of items that will then be used as pseudo-assets.

Code

function asset_search_element_data($parser, $data) {
  global $channel, $element, $items, $item, $image, $tag;
  switch ($element) {
    case 'ITEM':
      $items[$item][$tag] .= $data;
      break;
    case 'IMAGE':
    case 'LOGO':
      $image[$tag] .= $data;
      break;
    case 'LINK':
      if ($data) {
        $items[$item][$tag] .= $data;
      }
      break;
    case 'CONTENT':
      $items[$item]['CONTENT'] .= $data;
      break;
    case 'SUMMARY':
      $items[$item]['SUMMARY'] .= $data;
      break;
    case 'TAGLINE':
    case 'SUBTITLE':
      $channel['DESCRIPTION'] .= $data;
      break;
    case 'INFO':
    case 'ID':
    case 'TEXTINPUT':

      // The sub-element is not supported. However, we must recognize
      // it or its contents will end up in the item array.
      break;
    default:
      $channel[$tag] .= $data;
  }
}