Closed (fixed)
Project:
Project
Version:
5.x-1.x-dev
Component:
Releases
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Jul 2007 at 11:34 UTC
Updated:
3 Aug 2007 at 12:01 UTC
Jump to comment: Most recent file
I think that the project_release_download_link() function should be converted to a themeable function. Doing so would make it possible for site administrators to override the function to add additional information to the download link, such as adding Google analytics tracking code to the link.
The attached patch changes project_release_download_link() to theme_project_release_download_link() and changes any calls to the function to use the themeing system.
AC
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | project_release_theme_download_link_1.txt | 3.01 KB | aclight |
| project_release_theme_download_link.txt | 2.42 KB | aclight |
Comments
Comment #1
dwwHrm, not sure I support this. There's already an admin UI to change the link. Why can't you just use that? Why do you need a theme function?
Comment #2
aclight commentedThe admin UI only allows changing the URL. Google analytics, as an example, needs an onclick attribute on the link.
So, for example, my function looks like this:
Comment #3
dwwHrm, I see. Well, making it a theme function is certainly easier than adding a complicated UI for setting link attributes and the like. I'll give this a day or two to sink in and see what I think, but I'll probably commit what you've got here. Maybe the new co-maintainer will have thoughts, too. ;)
As always, thanks for the patch and clear issue title/description...
-Derek
Comment #4
aclight commentedthere is also a call to
project_release_download_link()in project.module (project_page_overview()) that needs to be converted and added to the patch.Comment #5
aclight commentedThis patch fixes the call to
project_release_download_link()described in comment #4.NOTE: If applied AFTER the patch at http://drupal.org/node/105224, this patch won't apply because both change the same line.
It should be trivial to fix by hand, though. Or, possibly CVS is smarter than patch and will be able to apply the entire thing without failing.
AC
Comment #6
dwwSure, seems reasonable. I'll resolve by hand if necessary...
Comment #7
dwwAnd lo, needed to re-roll it (both for that patch, and the code-style commit). Tested, and committed to HEAD. Don't think I'll backport to DRUPAL-4-7--2.
Comment #8
aclight commentedBy the way, if anyone wants to actually use this to track downloads using Google analytics, don't use the code I posted in comment #2. Use this code instead (in the template.php).
The code I posted earlier was missing some crucial parts.
Comment #9
(not verified) commented