Regards,

i was trying to modify the presentation of the buttons on share this, which is not that complicated since we have css overwriting, however my project request that some buttons show a different text, per instance, "email to a friend" instead of just "email", it turns that the function name is get_button_HTML, i can't overwrite this code, and since what this does is return html we probably want to add as a drupal theme function.

wait for an answer, in the mean time I'm going to create a patch for this.

thanks. :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Category: feature » task

Agreed!

tatewaky’s picture

FileSize
2.27 KB

Hi,

as i said i have create a patch to fix this, would be greate to add in the next version, or probably you want to improve this code, thanks in advance

aaron.r.carlton’s picture

Status: Active » Needs review
FileSize
5.05 KB

I re-implemented this patch against the current dev version and also change the name of the theme function to theme_sharethis to make the namespace a little nicer. It would be really nice to get this in soon, as I'm planning to submit another patch for views integration in 7.x for a project I'm working on.

aaron.r.carlton’s picture

New patch calls the theme function with keyed args and extracts args from variables array explicitly.

theunraveler’s picture

Re-rolled for latest dev.

theunraveler’s picture

[Dupe]

theunraveler’s picture

Sorry, missed a couple lines.

Chaulky’s picture

Re-rolled patch from #7 against latest dev. Applies cleanly to commit 607fa49e.

Note: Missed a variable name change in this patch, will post correction shortly.

Chaulky’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
5.2 KB

Fixed patch from #8 to include variable rename.

Also, tested and everything seems to be working just fine.

ahimsauzi’s picture

Hi Chaulky, did your patch made it to the 7.x.2.4 version?

Chaulky’s picture

I haven't seen any commit notices from the maintainer, so I'm assuming it hasn't.

RobLoach’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
5.2 KB

This still good?

Chaulky’s picture

Still applies cleanly and seems to work

cweagans’s picture

Reroll.

MXT’s picture

#14 doesn't apply against latest dev version:

patch -p1 < 1335836_12-sharethis-use-theme.patch 
patching file sharethis/sharethis.module
Hunk #4 FAILED at 77.
Hunk #6 succeeded at 244 (offset 13 lines).
Hunk #7 succeeded at 269 with fuzz 2 (offset 16 lines).
Hunk #8 succeeded at 292 (offset 16 lines).
Hunk #9 succeeded at 309 (offset 16 lines).
Hunk #10 succeeded at 335 (offset 16 lines).
Hunk #11 succeeded at 349 (offset 16 lines).
Hunk #12 succeeded at 376 (offset 16 lines).
Hunk #13 succeeded at 415 (offset 18 lines).
Hunk #14 succeeded at 446 with fuzz 1 (offset 18 lines).
Hunk #15 succeeded at 458 (offset 18 lines).
Hunk #16 succeeded at 549 (offset 25 lines).
1 out of 16 hunks FAILED -- saving rejects to file sharethis/sharethis.module.rej

MXT’s picture

moreover, there is a small error in #14:

in this part:

$title = $m_title;
    switch ($serviceCodeName) {
      case 'twitter':
        $title = empty($data_options['twitter_suffix']) ? $Title : check_plain($Title) . ' ' . check_plain($data_options['twitter_suffix']);
        break;
    }

the line:

$title = empty($data_options['twitter_suffix']) ? $Title : check_plain($Title) . ' ' . check_plain($data_options['twitter_suffix']);

should be:

$title = empty($data_options['twitter_suffix']) ? $title : check_plain($title) . ' ' . check_plain($data_options['twitter_suffix']);

(notice the case for $Title should be $title)

Chaulky’s picture

Re-rolled with case fix from #16

Gaofengzzz’s picture

Status: Needs review » Fixed

Thanks very much @tatewaky for your patch.
After more than two weeks, with no particular objections or further issues on this ticket, I went ahead and got it committed against the 7.x-2.x branch at 8d85432.

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this patch (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on any aspects in the commits or this ticket in general, I would be glad to provide more information or explain in more details.

Special thanks to @Chaulky, @MXT, @aaron.r.carlton, @theunraveler for re-implementing, Re-rolling, testing this patch.

Thanks again to everyone for your help, reviews, feedback and comments on this issue.

Cheers!

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