function getHookFileUrls($directory) {
    // Get our data.
    $data = $this->getHookInfo();

    foreach ($data as $module => $module_data) {
      $branch = $module_data['branch'];
      foreach ($module_data['hook_files'] as $hook_file => $destination) {
        $url = str_replace(
          array('%file', '%branch'),
          array($hook_file, $branch),
          $module_data['url']
        );
        // Create our own safe filename with module prefix.
        $hook_file_safe_name = "$module.$hook_file";
        $urls[$hook_file_safe_name]['path'] = $directory . '/' . $hook_file_safe_name;
        $urls[$hook_file_safe_name]['url'] = $url;
        $urls[$hook_file_safe_name]['destination'] = $destination;
        if (isset($module_data['hook_destinations'])) {
          $urls[$hook_file_safe_name]['hook_destinations'] = array();
          foreach ($module_data['hook_destinations'] as $destination => $hooks) {
            $urls[$hook_file_safe_name]['hook_destinations'] += array_fill_keys($hooks, $destination);
          }
        }
        if ($module_data['group'] == '#filenames') {
          $urls[$hook_file_safe_name]['group'] = str_replace('.php', '', $hook_file);
        }
        else {
          $urls[$hook_file_safe_name]['group'] = $module_data['group'];
        }
      }
    }

    //print_r($urls);

    return $urls;
  }