| 1 |
<?php |
<?php |
| 2 |
$delimiter = " "; |
|
| 3 |
$path = $base_path . path_to_theme(); |
$delimiter = " "; |
| 4 |
$link_count = count($links); |
$path = base_path() . path_to_theme(); |
| 5 |
$current = 1; |
|
| 6 |
foreach ( $links as $lnk ) { |
$output = ''; |
| 7 |
// Print the link |
|
| 8 |
if ($lnk['title'] == 'Add new comment') { |
if (count($links) > 0) { |
| 9 |
print "<img alt=\"\" src=" . $path . "/images/comment.gif>"; |
//$output = '<ul'. drupal_attributes($attributes) .'>'; |
| 10 |
|
|
| 11 |
|
$num_links = count($links); |
| 12 |
|
$i = 1; |
| 13 |
|
|
| 14 |
|
foreach ($links as $key => $link) { |
| 15 |
|
$class = $key; |
| 16 |
|
|
| 17 |
|
// Add first, last and active classes to the list of links to help out themers. |
| 18 |
|
if ($i == 1) { |
| 19 |
|
$class .= ' first'; |
| 20 |
|
} |
| 21 |
|
if ($i == $num_links) { |
| 22 |
|
$class .= ' last'; |
| 23 |
|
} |
| 24 |
|
if (isset($link['href']) && $link['href'] == $_GET['q']) { |
| 25 |
|
$class .= ' active'; |
| 26 |
|
} |
| 27 |
|
//$output .= '<li class="'. $class .'">'; |
| 28 |
|
|
| 29 |
|
if ($link['title'] == 'Add new comment') { |
| 30 |
|
$output .= "<img alt=\"\" src=" . $path . "/images/comment.gif>" ; |
| 31 |
|
} |
| 32 |
|
if ($link['title'] == 'Read more') { |
| 33 |
|
$output .= "<img alt=\"\" src=" . $path . "/images/more.gif>"; |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
if (isset($link['href'])) { |
| 37 |
|
// Pass in $link as $options, they share the same keys. |
| 38 |
|
$output .= l($link['title'], $link['href'], $link); |
| 39 |
|
} |
| 40 |
|
else if (!empty($link['title'])) { |
| 41 |
|
// Some links are actually not links, but we wrap these in <span> for adding title and class attributes |
| 42 |
|
if (empty($link['html'])) { |
| 43 |
|
$link['title'] = check_plain($link['title']); |
| 44 |
|
} |
| 45 |
|
$span_attributes = ''; |
| 46 |
|
if (isset($link['attributes'])) { |
| 47 |
|
$span_attributes = drupal_attributes($link['attributes']); |
| 48 |
|
} |
| 49 |
|
$output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>'; |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
$i++; |
| 53 |
|
$output .= $delimiter; |
| 54 |
|
//$output .= "</li>\n"; |
| 55 |
} |
} |
| 56 |
if ($lnk['title'] == 'Read more') { |
|
| 57 |
print "<img alt=\"\" src=" . $path . "/images/more.gif>"; |
//$output .= '</ul>'; |
| 58 |
} |
} |
| 59 |
print l($lnk['title'], $lnk['href'], |
|
| 60 |
$lnk['attributes'], $lnk['query'], |
print $output; |
|
$lnk['fragment'], FALSE, $lnk['html']); |
|
|
// Only print the delimiter if not the last link |
|
|
if ( $current < $link_count ) { |
|
|
print $delimiter; |
|
|
} |
|
|
$current++; |
|
|
} |
|
| 61 |
?> |
?> |