/ Published in: PHP
Expand |
Embed | Plain Text
$output = ''; $output = '<ul'. drupal_attributes($attributes) .'>'; $i = 1; foreach ($links as $key => $link) { $class = $key; // Add first, last and active classes to the list of links to help out themers. if ($i == 1) { $class .= ' first'; } if ($i == $num_links) { $class .= ' last'; } $class .= ' active'; } $output .= '<li class="'. $class .'">'; // Pass in $link as $options, they share the same keys. $link['html'] = TRUE; $output .= l('<span>'. $link['title'] .'</span>', $link['href'], $link); } // Some links are actually not links, but we wrap these in <span> for adding title and class attributes $link['title'] = check_plain($link['title']); } $span_attributes = ''; $span_attributes = drupal_attributes($link['attributes']); } $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>'; } $i++; $output .= "</li>n"; } $output .= '</ul>'; } return $output; }
You need to login to post a comment.
