You are here

function _xbbcode_build_handlers in Extensible BBCode 7

Same name and namespace in other branches
  1. 8 xbbcode.inc \_xbbcode_build_handlers()
  2. 8.2 xbbcode.inc \_xbbcode_build_handlers()

Discover the handlers by module hook invokation.

Return value

An array keyed by tag name. Each element is an array.

  • the 'modules' key contains a list of public module names (keyed by internal name) that provide this tag.
  • the 'info' key contains the data returned by each module's hook.
2 calls to _xbbcode_build_handlers()
xbbcode_rebuild_handlers in ./xbbcode.module
xbbcode_settings_handlers_format in ./xbbcode.admin.inc
Modify handler settings (subform).

File

./xbbcode.inc, line 37
General library of internal functions only called by this module.

Code

function _xbbcode_build_handlers() {
  $module_names = _xbbcode_module_names();
  $handlers = array();
  foreach ($module_names as $module => $name) {
    $tags = module_invoke($module, 'xbbcode_info');
    foreach ($tags as $tag_name => $info) {
      $handlers[$tag_name]['modules'][$module] = $name;
      $handlers[$tag_name]['info'][$module] = $info;
    }
  }
  ksort($handlers);
  return $handlers;
}