Here's a patch that movies the uc_file_user_downloads table creation to a theme_user_downloads function. This allows people who wish to customize the look of their file downloads area to do so by overriding the theme function in their template.php.

Comments

rszrama’s picture

Status: Needs review » Needs work
Issue tags: +theme layer

Definitely a good direction, but one thing I've learned (that we'd been doing wrong) was that you should really be passing any data you need for the theme function as an argument. Themers shouldn't have to make API calls and database queries in their theme functions. So, ideally we'd pass in more than just a $uid. Also, something like setting the page title should be done in the page callback itself instead of in the theme function.

I'm happy to brainstorm about how to pass in the right data to the theme function if you have any suggestions.

By the way, excellent to hang out in DC. Gotta do it again. : )

rszrama’s picture

Issue tags: +dc2009 code sprint
torgospizza’s picture

Thanks Ryan, agreed. After I submitted the patch cha0s looked at it and said basically the same thing. My suggestion is to make it so that the theme function receives an array that contains all the information contained about the user's products -and that way it's up to the theme function to, well, decide how to make it look as rendered html.

It'll take a bit of restructuring but I'm confident we can bang it out.

tr’s picture

Version: 5.x-1.7 » 6.x-2.x-dev

Reviving this, since I had to deal with this same thing recently. I plan to roll a new patch to address this.

tr’s picture

Tagging

longwave’s picture

Component: Code » File downloads

Changing component.

longwave’s picture

Status: Needs work » Closed (duplicate)