You are here

function patterns_tagmodules_find_module in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/ \patterns_tagmodules_find_module()

Tries to find the module responsible for a given action.


array $action Array representing a Patterns action.:

Return value

mixed|bool The name of the module responsible for the action or FALSE, it fails to match the action with a module.

2 calls to patterns_tagmodules_find_module()
patterns_moduletags_get_index in includes/
Builds up an associative array of modules and exposed tags.
patterns_tagmodules_get_index in includes/
Builds an associative array of tags and modules (components).


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


function patterns_tagmodules_find_module($action, $tagmodules = NULL) {
  if (isset($action['module']) && !empty($action['module'])) {
    return $action['module'];
  if (isset($action['tag'])) {
    $tagmodules = is_null($tagmodules) ? patterns_tagmodules_get_index($action) : $tagmodules;
    $tag_name = $action['tag'];
    if (isset($tagmodules[$tag_name]['module'])) {
      return $tagmodules[$tag_name]['module'];
  return FALSE;