You are here

function custom_menu in Spam 5.3

Drupal _menu() hook.

File

filters/custom/custom.module, line 62

Code

function custom_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/spam/filters/custom',
      'title' => t('Custom'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'custom_admin_settings',
      ),
      'description' => t('Configure the custom spam filter module.'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/spam/filters/custom/list',
      'title' => t('List'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'custom_admin_settings',
      ),
      'description' => t('Configure the custom spam filter module.'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/spam/filters/custom/create',
      'title' => t('Create'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'custom_admin_filter',
      ),
      'description' => t('Create a custom spam filter.'),
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    $cid = arg(5);
    $items[] = array(
      'path' => "admin/settings/spam/filters/custom/{$cid}/edit",
      'title' => t('Create'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'custom_admin_filter',
        $cid,
      ),
      'description' => t('Edit a custom spam filter.'),
      'type' => MENU_LOCAL_TASK,
    );
  }
  return $items;
}