Needs more theming options
| Project: | Session Favorites |
| Version: | 5.x-1.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I used this module on a site recently, to make a "Wish List". Most of the functionality I needed was there, which was great.
However, I wanted the messages and headers and everything to say "Wish List" instead of "Favorites", and I found a few places where the only way to override "Favorites" was to edit the module's PHP code. I think it could use either an admin option or a theming option.
Two main items:
function session_favorites_add_session and session_favorites_remove_node: messages saying "added to favorites" and "already in favorites", etc. I ended up just hard-coding in "wish list" in place of "favorites" in this message, but maybe there could be admin options to set the text of these messages? Or a theme function?
function session_favorites_link: text of the links such as "Remove from favorites". I needed a graphic and/or text saying "Remove from wish list". I implemented this in my version of the module by calling theme('session_favorites_link', 'whatever the text you had was'), and then I overrode that in my theme, with a function that checked to see if the text said "Add" or "Remove" and acted appropriately. Those links appeared in a few other places, such as in theme_session_favorites_list (which I was overriding anyway, but if you were doing this, you might want to replace it there). Also in _session_favorites_js_add, and _session_favorites_js_remove.
Other than those modifications, the module worked great for me! Thanks for making it available to the community.

#1
One other note: if you do make a change like this, it would be useful to add the $html=true option to the call to l() when you make the add/remove from favorites link. This would allow the theme function to pass back an IMG tag to display in the link, instead of plain text.
Also, I can send you a patch of the changes I made, but I'm not sure my solution is the best general one out there. Use my d.o contact form if you'd like the patch.
#2
I third that. String customization is one fairly simple, big piece missing from this module to make it more useful and seamless for any site that needs it.