theme_pipe

Definition

theme_pipe($data, $location, $keywords)
pipes/pipes.module, line 244

Description

Theme a pipe

Code

function theme_pipe($data, $location, $keywords) {
  // in future, this will be flexible, but for now, it isn't
  // get the idenitifying data
  $count = $data['count'];
  foreach($data['value'] as $key => $value) {
    ${$key} = $value;
  }
  drupal_set_title(t('Yahoo! Pipes ') . check_plain($title));

  $output .= '<br /><h2>Search results for "' . check_plain(urldecode($keywords)) . '" in <em>'  .  check_plain(urldecode($location)) . "</em></h2>";
  $output .= "<small>$count records found on $pubDate</small>";

  if (arg(2) == 'debug' || arg(4) == 'debug') {
    $output .= '<br />'l($link, $link);
  } 
  
    // get each element
  foreach($items as $item) {
    $item['y:location']['phone'] = $item['Phone'];
    $item['y:location']['map'] = $item['MapUrl'];   
        $item['y:location']['distance'] = $item['Distance'] . ' miles from city center';   
        $item['title'] = html_entity_decode($item['title'], ENT_QUOTES);
    $output .= '<div style="padding-bottom: 10px">';
    $output .= '<p><h2>' . l($item['title'], $item['link']) . '</h2>';
    if (!empty($item['BusinessUrl'])) {
      $output .= '<small>' . l(rtrim($item['BusinessUrl'], '/'), $item['BusinessUrl']) . '</small><br />';
    } 
      $output .= theme('pipes_location', $item['y:location']);
     $output .= theme('pipes_images', $item['images']);
    $output .= theme('pipes_categories', $item['Categories']['Category']);
    $output .= theme('pipes_rating', $item['Rating']);
    $output .= '</p></div>';
  }
  if (arg(2) == 'debug' || arg(4) == 'debug') {
    $output .= '<pre>' . print_r($data, TRUE) . '</pre>';
  } 
    return $output;
}