Code Snippets

Code sample from a Drupal module

function pathauto_module_implements_alter(&$implementations, $hook) {
  $hooks = pathauto_hook_info();
  if (isset($hooks[$hook])) {
    $modules = array('node', 'taxonomy', 'user', 'forum', 'blog');
    foreach ($modules as $module) {
      if (module_exists($module)) {
        $implementations[$module] = TRUE;
      }
    }
    // Move pathauto.module to get included first since it is responsible for
    // other modules.
   unset($implementations['pathauto']);
   $implementations = array_merge(array('pathauto' => 'pathauto'), $implementations);
  }
}
Resource Tags: