PostNuke Help

Previous
pnModAvailable

Home
up

Next
pnModDBInfoLoad


pnModCallHooks

carry out hook operations for module

Synopsis

bool pnModCallHooks(hookobject, hookaction, hookid, extrainfo);

Description

pnModCallHooks() carries out hook operations for a module

Parameters

hookobject

the object the hook is called for - either 'item' or 'category'

hookaction

the action the hook is called for - one of 'create', 'delete', 'transform', or 'display'

hookid

the id of the object the hook is called for (module-specific)

extrainfo

extra information for the hook, dependent on hookaction

Return Values

This returns the hook output as string. This function returns void if an exception was raised.

Exceptions

This function raises DATABASE_ERROR if an error occurs while querying data. This function throw back exceptions raised by other functions.

Notes

Each hook for the module is called in turn. If the action is 'display' the result is the concatenation of each hook output where the hook area is 'GUI'. Otherwise the result is the extrainfo returned by the last hook that is called.

The list of hook actions is constantly being refined. Check the source code for a current list. TODO: Have an official online hook action registry.

Examples

    // Let any hooks know that we are displaying an item.  As this is a display
    // hook we're passing a URL as the extra info, which is the URL that any
    // hooks will show after they have finished their own work.  It is normal
    // for that URL to bring the user back to this function
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text(pnModCallHooks('item',
                                 'display',
                                 $tid,
                                 pnModURL('Template',
                                          'user',
                                          'display',
                                          array('tid' => $tid))));
    $output->SetInputMode(_PNH_PARSEINPUT);
       

See Also

pnModRegisterHook(), pnModUnregisterHook()


Previous
pnModAvailable

Home
up

Next
pnModDBInfoLoad