Hi, Inspecting pages.inc in l10n_community, I've noticed that in l10n_community_overview_language (which creates the downloads page) the following lines call the hook l10n_community_overview_language for the modules l10n_groups and l10n_community:
$content_output1[]['#markup'] = module_invoke('l10n_groups', 'l10n_community_build_language_page', $languages[$langcode]);
$content_output1[]['#markup'] = module_invoke('l10n_packager', 'l10n_community_build_language_page', $languages[$langcode]);
I was thinking we could replace them with a more generic call so other modules could implement the hook:
$pages = module_invoke_all('l10n_community_build_language_page', $languages[$langcode]);
foreach ($pages as $module_page) {
$content_output[]['#markup'] = $module_page;
}
What do you think? I can provide a patch if needed.
Cheers.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | l10n_server_generic_hook_language_page-1566100-2.patch | 2.34 KB | lucascaro |
| #1 | l10n_server_generic_hook_language_page-1566100-1.patch | 866 bytes | lucascaro |
Comments
Comment #1
lucascaro commentedActually, just to save time in case we decide to do it that way, here's a patch :)
Comment #2
lucascaro commentedaafter talking with SebCorbin we decided that it's better if the hook returns a render array so here's a patch using module_implements that makes it look like:
Comment #3
lucascaro commentedIncidentally, this fixed another problem with rendering for the downloads page, so bumping up the priority.
Comment #4
SebCorbin commentedCommitted!