In D5 I had the following in my hook_menu:
$result = db_query('SELECT format, name FROM {filter_formats}');
while ($filter = db_fetch_array($result)) {
$enabled = db_result(db_query("SELECT COUNT(delta) FROM {filters} WHERE format=%d AND module='glossary'", $filter['format']));
if ($enabled || !variable_get('glossary_hide_menus', false)) {
$items[] = array(
'path' => 'admin/settings/glossary/filter/'. $filter['format'],
'title' => $filter['name'],
'access' => user_access('administer filters'),
'callback' => 'drupal_get_form',
'callback arguments' => array('glossary_filter_form', $filter['format']),
'description' => t('Settings for the !name input format.', array('!name' => $filter['name'])),
'weight' => 2,
'type' => MENU_LOCAL_TASK,
);
}
}
and the form had:
function glossary_filter_form($format = 1) {
In D6, I now have:
$result = db_query('SELECT format, name FROM {filter_formats}');
while ($filter = db_fetch_array($result)) {
$enabled = db_result(db_query("SELECT COUNT(delta) FROM {filters} WHERE format=%d AND module='glossary'", $filter['format']));
if ($enabled || !variable_get('glossary_hide_menus', false)) {
$format = $filter['format'];