Comments

tobiasb’s picture

StatusFileSize
new13.22 KB

add user_access

gábor hojtsy’s picture

Status: Needs review » Needs work

Good catch!

1. $category is still on the D6 API, so not sure why you removed it: http://api.drupal.org/api/function/hook_user/6 Granted, we do not use it, but it is part of the standard signature, so it is common to just include it anyway.

2. if ($op == 'view' && user_access(...)) would have been fine/shorter.

3. I'd put in the #type to the $items array, and then just assign that to the contributions item, so we do not need to iterate that again just to add the #type.

4. I'd love to commit the whitespace changes first, so if you can get that one separately (even if on this patch), then it would be easier for others to view what progress is made here.

gábor hojtsy’s picture

Actually, I've committed an all-whitespace cleanup for the module, so I'm hopeful that you can reroll this patch with only the concrete changes. Please do.

tobiasb’s picture

Status: Needs work » Needs review
StatusFileSize
new2.06 KB

Reroll

gábor hojtsy’s picture

Status: Needs review » Needs work

- Hm, why wouldn't $row->language be set in any cases?
- You seem to add the top level keys to l10n_server_contributions for every row again and again.

As said above, I'd just fill up $items with the FAPI keys and then if (count($items)) { set up the top level l10n_server_contributions item and put $items below that as it is; }.

tobiasb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB
tobiasb’s picture

StatusFileSize
new1.77 KB
gábor hojtsy’s picture

Status: Needs review » Fixed

Thanks, committed!

Status: Fixed » Closed (fixed)

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