From a47ffa1fa1d8b6b99c93aa4e5494c3a0e38e854e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 8 Nov 2011 19:58:21 -0200 Subject: Link icons --- images/icons/messages.png | Bin 0 -> 259 bytes template.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 images/icons/messages.png diff --git a/images/icons/messages.png b/images/icons/messages.png new file mode 100644 index 0000000..30bbfb5 Binary files /dev/null and b/images/icons/messages.png differ diff --git a/template.php b/template.php index 9da450e..5038ead 100644 --- a/template.php +++ b/template.php @@ -286,3 +286,32 @@ function muambeiro_ns() { } return $output; } + +/** + * Overrides theme_link(). Add icons to links. + */ +function muambeiro_link($variables) { + $path = drupal_get_path('theme', 'muambeiro'); + $file = $path .'/images/icons/' . $variables['path'] .'.png'; + + if (file_exists($file)) { + $icon = theme('image', + array( + 'path' => $file, + 'alt' => $variables['text'], + 'title' => $variables['text'], + ) + ); + + $link = ''; + $link .= $icon; + $link .= ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])); + $link .= ''; + + return $link; + } + else { + return theme_link($variables); + } +} -- cgit v1.2.3