You are here

function _xbbcode_get_handlers in Extensible BBCode 6

Same name and namespace in other branches
  1. 5 xbbcode-misc.php \_xbbcode_get_handlers()
1 call to _xbbcode_get_handlers()
xbbcode_settings_handlers_form in ./xbbcode.admin.inc

File

./xbbcode.inc, line 5

Code

function _xbbcode_get_handlers() {

  // This function does not use caching because it is used only in the settings page.
  $all = array();
  foreach (module_implements('xbbcode') as $module) {
    $tags = module_invoke($module, 'xbbcode', 'list');
    if (is_array($tags)) {
      foreach ($tags as $i => $tag) {
        if (!preg_match('/^[a-z0-9]+$/i', $tag)) {
          unset($tags[$i]);
        }
        else {
          $tags[$i] = array(
            'name' => $tag,
            'module' => $module,
          );
        }
      }
      $all = array_merge($all, $tags);
    }
  }
  return $all;
}