diff --git a/template.php b/template.php index 52068b8..a8fe76b 100644 --- a/template.php +++ b/template.php @@ -171,3 +171,32 @@ function rijkshuisstijl_breadcrumb(&$variables) { return $output; } } + +/** + * Implements theme_link(). + * + * Override links to add an 'external' class if needed. + * + * Adds the external class to external links that + * don't contain an image. + * + */ +function rijkshuisstijl_link($variables) { + global $base_url; + if (url_is_external($variables['path']) + && strstr($variables['path'], $base_url) === FALSE + && strstr($variables['text'], ' $title)); + } + else { + $variables['options']['attributes']['title'] = t('(Opens an external page)'); + } + } + return '' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . ''; +}