You are here

function _patterns_tagmodules_add_module in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/ \_patterns_tagmodules_add_module()

Helper function for <patterns_tagmodules_get_index>.

Call <hook_patterns> on a given module and merge the results in the tagmodules index.


mixed $module A string representing a module (component) name:

array $tagmodules An array containing the tagmodules index:

array $data (optional) An associative array of data, that the: components can use to build dynamic forms names. Defaults NULL.

See also



1 call to _patterns_tagmodules_add_module()
patterns_tagmodules_get_index in includes/
Builds an associative array of tags and modules (components).


includes/, line 80
Functions related to build and retrieve information from the *tagmodules* and *moduletags* indexes.


function _patterns_tagmodules_add_module($module, &$tagmodules, $data = NULL) {
  if (empty($tagmodules)) {
    $tagmodules = array();
  if (empty($module)) {
  $tags = module_invoke($module, 'patterns', $data);
  if (empty($tags)) {

    // should not be the case. It is a component error
    return FALSE;
  _patterns_tagmodules_add_module_to_tags($module, $tags);
  $tagmodules = array_merge($tagmodules, $tags);