[documentation] Need CVS + Drupal Issues guidance: How to help fix API documentation formatting

Steven Jones darthsteven at gmail.com
Tue Jun 3 11:38:24 UTC 2008


Hi,

> My understanding is that creating a function called
>
> mymodule_invoke_dosomething()
>
> will cause Drupal (via module_invoke_all() ?) to call functions in other
> modules called othermodule_dosomething()
>
> Is there another step in hook creation that I'm missing?

You need to call module_invoke_all giving the name of the hook that you want
to invoke as the first parameter, and the rest of the parameters of the
hook. It will return a merged array of all the results from those modules
that implement that hook. See:
http://api.drupal.org/api/function/module_invoke_all/6

You *may* want to put the call to module_invoke_all in a wrapper function in
*your* module, which mymodule_invoke_hookname would be a good place, but
there's no hard and fast rule AFAIK.

> I agree - I'm just wondering if we (maybe me) could automate the
> creation of the hook_nodapi page.

It is! a.d.o checks out a file from CVS,
http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/hooks/,
and that's where the http://api.drupal.org/api/function/hook_nodeapi/6 page
comes from.

> - and at the same time look for functions that are implementations of
> the hook so that the hook_nodapi references has links to all the places
> the hook is used.

They'll need to be named modulename_nodeapi so finding implementations is
fairly trivial, just use the search box on a.d.o and type in: "_nodeapi"

Also, we're getting a little off-topic here :-D

On Tue, Jun 3, 2008 at 12:22 PM, Sean Burlington <sean at practicalweb.co.uk>
wrote:
> Steven Jones wrote:
>> I wouldn't say that node_invoke_nodeapi 'defined' the nodeapi hook. It
>> invokes it, because module_invoke_all can't handle references.
>
> My understanding is that creating a function called
>
> mymodule_invoke_dosomething()
>
> will cause Drupal (via module_invoke_all() ?) to call functions in other
> modules called othermodule_dosomething()
>
> Is there another step in hook creation that I'm missing?
>
>
>> But I think that for people looking for how to use the nodeapi hook
>> are much more likely to tap 'hook_nodeapi' into a.d.o. You don't need
>> knowledge of how the hook is invoked to implement it, you just need to
>> know what parameters you get etc.
>>
>
> I agree - I'm just wondering if we (maybe me) could automate the
> creation of the hook_nodapi page.
>
> - and at the same time look for functions that are implementations of
> the hook so that the hook_nodapi references has links to all the places
> the hook is used.
>
> This would be especially useful for my use of the API module on sites I
> work on - where I would be able to look (for example) for all the places
>  the site uses hook_form_alter().
>
>
>
> --
>
> Sean Burlington
>
> www.practicalweb.co.uk
> company number 06427950
>
> --
> Pending work: http://drupal.org/project/issues/documentation/
> List archives: http://lists.drupal.org/pipermail/documentation/
>



-- 
Regards
Steven Jones
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/documentation/attachments/20080603/e6119072/attachment.htm 


More information about the documentation mailing list