--- link_to_us/link_to_us.module.orig 2009-01-04 21:47:49.000000000 -0800 +++ link_to_us/link_to_us.module 2009-01-04 22:03:38.000000000 -0800 @@ -265,14 +265,31 @@ $path = url($path, array('absolute' => TRUE)); if (variable_get('link_to_us_textlink', NULL)) { $links[] = array( + 'help' => t('Paste HTML for a Text-Only link:'), 'link' => ''. $title .'', 'banner' => '', + 'id' => 'link-to-us-text-link', ); } + $count = 1; foreach ($images as $imagepath => $image) { + // The following is not 100% correct because + // 1. two files can have the same name and different extensions + // 2. two files can use different case and have the same name (Linux only) + // So to be 100% safe we should probably check with an array that it is indeed unique + $id = basename($imagepath); + $id = preg_replace(array('/\..*/', '/-/'), array('', '_'), $id); + if (!$id) { + // just in case the filename starts with a period + $id = 'id'. $count; + $count++; + } + $id = 'link_to_us_'. check_plain(drupal_strtolower($id)); $links[] = array( + 'help' => t('Paste HTML for this Banner as a Link:'), 'link' => ''. $title .'', 'banner' => ''. $title .'', + 'id' => $id, ); } drupal_set_title(t('Link to !title page', array('!title' => $title))); @@ -281,21 +298,16 @@ function theme_link_to_us_banners($links) { - $output = ''; + $output = ''; return $output; }