My users don't want to see "Bookmark/Search this post with:" - they want something else. Could you, please, make that text customizable?

If I can get by the other small issues, we have, I may go ahead and create a patch, but this should be real simple.

Comments

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Active » Needs review
StatusFileSize
new11.5 KB

Here's a patch to add a title setting. At no extra charge, you get a settings page that is Vertical Tabs ready. I'v also created CSS files for the admin and node displays.

Melissamcewen’s picture

Status: Needs work » Needs review
StatusFileSize
new10.85 KB

Thanks for this great patch! Here is my review:

* Is the patch in unified diff format? Yep
* Does the patch meet Drupal's coding standards? The only problem I see is that the CSS isn't alphabetized, which I've correct in this patch.
* Is the code secure? Don't know.
* If the patch makes major changes to a function or adds a new one, does it have appropriate code comments? No major changes.
* Does the patch degrade performance and does it need benchmarking? No
* Does the patch add theme functions or .tpl.php files where appropriate? NA
* If new pages are added, are they are in a logical place? If forms or other UI elements are added, are they intuitive and logical to use? Does it come with appropriate contextual help? Is the interface consistent? NA

Let me know if this patch works!

coltrane’s picture

Status: Needs review » Needs work
+++ service_links.module	13 Jun 2010 21:04:53 -0000
@@ -493,7 +494,8 @@ function theme_service_links_build_link(
+  $title = variable_get('service_links_links_title', t('Bookmark/Search this post with'));
+  return '<div class="service-links"><div class="service-label">'. t($title) .' </div>'. theme('links', $links) .'</div>';

If the user doesn't enter anything in the variable the default text is ran through t() twice. Recommend replacing with the following where default isn't run through t():

  $title = variable_get('service_links_links_title', 'Bookmark/Search this post with');
  return '<div class="service-links"><div class="service-label">'. t($title) .' </div>'. theme('links', $links) .'</div>';

The fieldset and CSS stuff is another feature and typically it's best to separate features in patches. One to make the title customizable and another for fieldset + CSS, but I'll let the module maintainer make the call. I haven't applied the patch, just looked at it.

coltrane’s picture

Actually the $title placed directly in t() would open a cross-site scripting attack via the links title. Text pass directly to t() is not sanitized. You should instead do something like following example, or review http://drupal.org/writing-secure-code for other approaches.

$title = variable_get('service_links_links_title', 'Bookmark/Search this post with');
return '<div class="service-links"><div class="service-label">'. t('@title', array('@title' => $title)) .' </div>'. theme('links', $links) .'</div>';
Melissamcewen’s picture

Status: Needs review » Needs work
StatusFileSize
new11.57 KB

Thanks Coltrane. I've added your suggestions to the patch. I also found some missing spaces on lines 12-15 that I corrected. So- so far this patch adds in customized title, created CSS files for the admin and node displays for vertical tabs, and corrects some code styling.

Melissamcewen’s picture

Status: Needs work » Needs review
nancydru’s picture

Looks good, I will try to test your changes in the next day or so.

Gabriel R.’s picture

Good to see this coming up, and with i18n support. Thanks!

fitter’s picture

#5: What do you mean when you say "node displays for vertical tabs?" I have the vertical tab module installed but I'm not seeing any integration with vertical tabs. Sorry if I misunderstood what that actually does.

nancydru’s picture

It is VT-ready, but needs to be enabled in settings.php, IIRC.

TheCrow’s picture

Status: Needs review » Fixed

Added it, Thank you!

nancydru’s picture

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.