"admin", "filter" => "filter", "system" => "system", "user" => "user", "watchdog" => "watchdog"); if ($bootstrap) { $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1"); } else { $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1"); } while ($module = db_fetch_object($result)) { if (file_exists($module->filename)) { /* ** Determine the current throttle status and see if module should be ** loaded based on server load. We have to directly access the ** throttle variables as the throttle.module may not be loaded yet. */ $throttle = ($module->throttle && variable_get("throttle_level", 0) > 4); if (!$throttle) { $list[$module->name] = $module->name; include_once $module->filename; } } } asort($list); } return $list; } // return 1 if module $name exists, 0 otherwise: function module_exist($name) { $list = module_list(); return isset($list[$name]) ? 1 : 0; } // return 1 if module $name implements hook $hook, 0 otherwise: function module_hook($name, $hook) { return function_exists($name ."_". $hook); } ?>